montecarlo.c revision 03831d35f7499c87d51205817c93e9a8d42c4bae
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2000-2001 by Sun Microsystems, Inc.
* All rights reserved.
*
* Netract Platform specific functions.
*
* called when :
* machine_type == MTYPE_MONTECARLO
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* includes */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <stropts.h>
#include <fcntl.h>
#include <kvm.h>
#include <kstat.h>
#include <sys/openpromio.h>
#include <sys/ddi_impldefs.h>
#include <sys/devinfo_impl.h>
#include <sys/systeminfo.h>
#include <libintl.h>
#include <config_admin.h>
#include "pdevinfo.h"
#include "display.h"
#include "pdevinfo_sun4u.h"
#include "display_sun4u.h"
#include "libprtdiag.h"
#include "libdevinfo.h"
/* MC specific header, might just include from MC space */
#include "mct_topology.h"
#include "envctrl_gen.h"
#include "pcf8574_nct.h"
#include "netract_gen.h"
#include "hscimpl.h"
#include "scsbioctl.h"
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
/* globals */
#define MAXNAMESZ 128
#define MAX_NODE_NAME_SZ 32
/* this values equates to Max Tree depth for now */
#define MAXIMUM_DEVS 64
typedef char device_info_t[MAX_NODE_NAME_SZ];
typedef struct {
int req; /* If set, this list_data was requested by user */
} ap_out_t;
typedef struct {
typedef struct {
} slot_data_t;
extern char *progname;
extern int print_flag;
/* These are used to store all force loads of the drivers */
static int oprom_fd;
static int slot_index = 0;
static int idx_minuscpu = 0;
static int num_devs = 0;
static int sd_count = 0;
static int st_instance;
static int gpio_count = 0;
static int slot_table_not_found = 0;
/* default not present */
static int alarm_card_present = 0;
static int cpu_ftm_present = 0;
/*
* We will store all kstat in globals so that
* we can browse thru them later
*/
static int fail_syssoft_prop = 0;
static int fail_drv_prop = 0;
/* scsb driver kstats */
/* pcf8574(gpio) driver kstats */
/* pcf8591(adc-dac) driver kstats */
static char *hotswap_mode = NULL;
static char *slot_auto_config[MC_MAX_SLOTS];
static int slot_table_size;
/*
* use this to ascertain what's the system,
* default is tonga, we can add more for future variations
* 0=tonga, 1=montecarlo
* we need also to figure out what the system version is
* 0 = 1.5, 1 = 1.0, 0.6 etc.
*/
int montecarlo = 0;
int version_p15_and_p20 = 0;
#define MAX_PRTDIAG_INFO_LENGTH 1024
#define MAX_PRTDIAG_FRUS 22
#define BIT_TEST(X, N) ((X) & (1 << (N)))
#define SLOT1_OK_BIT 0
#define SLOT2_OK_BIT 1
#define SLOT3_OK_BIT 2
#define SLOT4_OK_BIT 3
#define SLOT5_OK_BIT 4
#define SLOT6_OK_BIT 5
#define SLOT7_OK_BIT 6
#define SLOT8_OK_BIT 7
#define PDU1_OK_BIT SLOT2_OK_BIT
#define PDU2_OK_BIT SLOT4_OK_BIT
#define FTM_OK_BIT SLOT5_OK_BIT
#define SCB_OK_BIT SLOT6_OK_BIT
#define FAN1_OK_BIT SLOT1_OK_BIT
#define FAN2_OK_BIT SLOT2_OK_BIT
#define DISK1_OK_BIT SLOT4_OK_BIT
#define DISK2_OK_BIT SLOT5_OK_BIT
#define DISK3_OK_BIT SLOT6_OK_BIT
#define PS1_OK_BIT SLOT7_OK_BIT
#define PS2_OK_BIT SLOT8_OK_BIT
#define ENVC_DEBUG_MODE 0x03
#define OPENPROMDEV "/dev/openprom"
#define I2C_PCF8591_NAME "adc-dac"
#define I2C_KSTAT_CPUTEMP "adc_temp"
#define SCSB_DEV "scsb"
#define SDERR "sderr"
#define STERR "sterr"
#define OK "ok"
#define NOK "Not ok"
#define ON "on"
#define OFF "off"
#define BLINK "blink"
#define NA "Not Available"
#define UK "Unknown "
#define YES "Yes"
#define NO "No "
#define LO "low"
#define HI "high"
#define BLANK " "
#define SYSSOFT_PROP "System software"
#define DRV_PROP "Driver"
#define HSC_PROP_NAME "hsc-slot-map"
#define HSC_MODE "hotswap-mode"
#define PCI_ROOT_AP "pci"
#define PROPS "Properties:"
#define BOARDTYPE "Board Type:"
#define DEVS "Devices:"
#define CPCI_IO "CompactPCI IO Slot"
#define AC_CARD "Alarm Card"
#define CPU_FTM "Front Transition Module"
#define SCTRL_PROM_P06 0x00
#define SCTRL_PROM_P10 0x01
#define SCTRL_PROM_P15 0x02
#define SCTRL_PROM_P20 0x03
#define RMM_NUMBER 3
#define MONTECARLO_PLATFORM "SUNW,UltraSPARC-IIi-Netract"
#define MAKAHA_PLATFORM "SUNW,UltraSPARC-IIe-NetraCT-40"
/*
* The follow table is indexed with the enum's defined by mct_slot_occupant_t
* OC_UNKN OC_CPU OC_AC OC_BHS OC_FHS OC_HAHS
* OC_QFE OC_FRCH OC_COMBO OC_PMC OC_ATM
*
* But "scsb" can currently identify only CPU and Alarm Cards by known
* slot numbers.
*/
char *slot_occupants[] = {
"CPU board ",
"Basic HotSwap Board",
"Full HotSwap Board",
"HA Board",
"QFE Board",
"Fresh Choice Board",
"SUN Combo Board",
"PMC Board",
"ATM Board"
};
static char *prtdiag_fru_types[] = {
"I/O ", /* 0 */
"CPU ",
"PSU ",
"HDD ",
"FAN ",
"Alarm Card ",
"SCB ",
"SSB ",
"CFTM ",
"CRTM ",
"PRTM ",
"Midplane " /* 11 */
};
#define SCB_REG_READ 1
#define SCB_REG_WRITE 2
/* Standard Device nodes - hardwired for now */
/* will include fan tray later, cpu voltage not impl */
static char *mc_scsb_node =
static char *ot_scsb_node =
static char *mc_ps_node[] = {
};
static char *ot_ps_node[] = {
};
static char *mc_temp_node =
/*
* these functions will overlay the symbol table of libprtdiag
* at runtime (netract systems only)
* display functions
*/
/* local functions */
/*
* prom function
*/
static void gather_diaginfo(int flag);
static int extract_slot_table_from_obp();
static void mc_dump_node(int id);
#ifdef REDUNDANT_INFO
#endif /* REDUNDANT_INFO */
static void netract_disp_prom_version();
/*
* here we have to do specific kstats to drivers that
* that post kstat here are : scsb, pcf8574(gpio) and pcf8591
*/
static int analyze_nodes(di_node_t, void*);
static void analyze_pcipci_siblings(di_node_t);
static void display_mc_prtdiag_info();
static void prtdiag_devinfo(void);
static void force_load_drivers();
static int dump_prop_list(char *name,
static void explore_slot_occupants();
static void do_scsb_kstat();
static void do_pcf8574_kstat();
static void do_pcf8591_kstat();
static void do_promversion();
static int mc_promopen(int oflag);
static int scsi_disk_status(int disk_number);
static void alarm_card_occupant();
static int check_platform();
int
struct system_kstat_data *kstats,
int syserrlog)
{
int exit_code = 0; /* init to all OK */
void *value; /* used for opaque PROM data */
#ifdef lint
#endif
/*
* Now display the machine's configuration. We do this if we
* are not logging or exit_code is set (machine is broke).
*/
/*
* Display system banner
*/
"System Configuration: Sun Microsystems"
/* display system clock frequency */
"System clock frequency: "
"%d MHz\n"), sys_clk, 0);
}
/* Display the Memory Size */
/* Lets make sure we have all the needed drivers loaded */
/* display Montecarlo/Tonga FRU information */
if (!extract_slot_table_from_obp())
"\r\nslot-table not available\r\n"), 0);
/* figure out if ac is present */
/* platform specific display mod */
} /* if (!logging || exit_code) */
return (exit_code);
} /* display(....) */
static int
{
char si_platform[SYS_NMLN];
/*
*/
return (-1);
}
strlen(MONTECARLO_PLATFORM))) == 0) {
strlen(MAKAHA_PLATFORM))) == 0) {
} else {
return (-1);
}
return (0);
}
void
{
int i;
if (check_platform() == -1) {
return;
}
}
"\nscsb open FAILED!"), 0);
}
/* check the num of PS we have */
"\npowersupply%d open failed"),
i, 0);
}
} /* for */
/* open the cpu temp driver */
if (temp_node) {
"\ncputemp open FAILED!"), 0);
}
}
void
{
int index;
int ret = CFGA_ERROR;
int nlist = 0;
char *prefilt_optp = NULL;
int dyn_exp = 1;
dyn_exp ? CFGA_FLAG_LIST_ALL : 0);
"\ncannot explore configuration"), 0);
return;
}
goto bail;
}
/* create a list of output stat data */
}
"cpci_slot")) != NULL) {
idx_minuscpu++;
}
}
bail:
}
/*
* config_calloc_check - perform allocation, check result and
* set error indicator
*/
void *
{
void *p;
static char alloc_fail[] =
"%s: memory allocation failed (%d*%d bytes)\n";
if (p == NULL) {
}
return (p);
}
void
{
int i;
#ifdef DEBUG_TEMP1
int index;
#endif
if (!(kc = kstat_open())) {
#ifdef DEBUG_TEMP
log_printf("\nkstat_open failed", 0);
#endif
return;
}
#ifdef lint
#endif
/* get kstat on scsb led data */
== NULL) {
#ifdef DEBUG_TEMP
log_printf("\nkstat_lookup for scsb_leddata failed", 0);
#endif
return;
}
#ifdef DEBUG_TEMP
log_printf("\nkstat_read for scsb_leddata failed", 0);
#endif
return;
}
#ifdef DEBUG_LEDS
/* dump the kstat leddata */
printf("\nDumping LED regs: ");
for (i = 0; i < SCSB_LEDDATA_REGISTERS; ++i) {
}
log_printf("\n", 0);
#endif
/* get kstat on scsb states */
== NULL) {
#ifdef DEBUG_TEMP
log_printf("\nkstat_lookup for scsb_state failed", 0);
#endif
return;
}
#ifdef DEBUG_TEMP
log_printf("\nkstat_read for scsb_state failed", 0);
#endif
return;
}
#ifdef DEBUG_TEMP1
/* dump the kstat state */
log_printf("\tSCB is%spresent\n",
log_printf("\tSSB is%spresent\n",
log_printf("\tscsb is%sfrozen\n",
log_printf("\tscsb mode: ", 0);
case ENVC_DEBUG_MODE:
log_printf("DEBUG MODE\n", 0);
break;
case ENVCTRL_DIAG_MODE:
log_printf("DIAGNOSTIC MODE\n", 0);
break;
case ENVCTRL_NORMAL_MODE:
log_printf("NORMAL MODE\n", 0);
break;
}
#endif /* DEBUG_TEMP1 */
== NULL) {
#ifdef DEBUG_TEMP
log_printf("\nkstat_lookup for scsb_topo failed", 0);
#endif
return;
}
#ifdef DEBUG_TEMP
log_printf("\nkstat_read for scsb_topo failed", 0);
#endif
return;
}
/*
* we need to set this so that we can get status info
* for the 2 powersupplies in MC as we need to get
* kstat from both driver instances for environment
*/
/*
* HW version 0.6 and 1.0 had different led maps
* its assumed that HW 2.0 would not change this
* need to modify if it does
*/
version_p15_and_p20 = 1;
}
/* set flag to note that CFTM is present */
cpu_ftm_present = 1;
}
#ifdef DEBUG_TEMP1
/*
* Midplane
*/
log_printf("Midplane type: ", 0);
log_printf("Netra ct800 server\n", 0);
else
log_printf("Netra ct400 server%s\n",
log_printf("Midplane version: %d\n",
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
/*
* Slots
*/
log_printf("Slots present out of maximum %d\n",
continue;
log_printf("\tSlot %d occupant: %s;",
log_printf(" ID 0x%x; VER 0x%x ; ",
log_printf(" Slot health %d\n",
/* pks_topo->mct_slots[i].fru_health */
}
/*
* PDU
*/
log_printf("PDUs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
/* pks_topo->mct_pdu[i].fru_health */
}
/*
* Power Supplies
*/
log_printf("Power Supplies present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* Disks
*/
log_printf("Disks present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* Fans
*/
log_printf("Fans present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* SCBs
*/
log_printf("SCBs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* SSBs
*/
log_printf("SSBs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* Alarms Cards
*/
log_printf("Alarm Cards present out of maximum %d\n",
continue;
log_printf("\ttype %d; unit %d; id 0x%x; VER 0x%x\n",
}
/*
* CFTMs
*/
log_printf("CFTMs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* CRTMs
*/
log_printf("CRTMs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
/*
* PRTMs
*/
log_printf("PRTMs present out of maximum %d\n",
continue;
log_printf("\ttype %d unit %d; id 0x%x; VER 0x%x\n",
}
#endif /* DEBUG_TEMP1 */
} /* do_scsb_kstat(...) */
void
{
int i;
char *kstat_name = NULL;
if (!(kc = kstat_open())) {
#ifdef DEBUG_TEMP
log_printf("\nkstat_open for pcf8574 failed", 0);
#endif
return;
}
#ifdef lint
#endif
/* get kstat on gpio powersupply and fan states */
if (i == 1) {
} else {
}
== NULL) {
#ifdef DEBUG_TEMP
log_printf("\nks lookup for pwrsupply%d failed",
i+1, 0);
#endif
return;
}
#ifdef DEBUG_TEMP
#endif
return;
}
if (i == 1)
else
} /* for */
if (i == 1) {
} else {
}
0, kstat_name)) == NULL) {
#ifdef DEBUG_TEMP
log_printf("\nks lookup for fantray%d failed",
i+1, 0);
#endif
return;
}
#ifdef DEBUG_TEMP
#endif
return;
}
if (i == 1)
else
} /* for */
} /* do_pcf8574_kstat(...) */
void
{
if (!(kc = kstat_open())) {
#ifdef DEBUG_TEMP
log_printf("ks open for pcf8591 failed", 0);
#endif
return;
}
#ifdef lint
#endif
/* get kstat on adc driver's CPU temperature data */
-1, I2C_KSTAT_CPUTEMP))
== NULL) {
#ifdef DEBUG_TEMP
log_printf("ks lookup for adc_temp failed", 0);
#endif
return;
}
#ifdef DEBUG_TEMP
log_printf("ks read for adc_temp failed", 0);
#endif
return;
}
} /* do_pcf8591_kstat(.) */
void
gather_diaginfo(int flag)
{
if (flag) {
/* gather system environmental conditions. */
/* obtain kstat info from gpio & temp. driver */
explore_slot_occupants(); /* fill in some occupant info */
}
} /* display_diaginfo(...) */
void
{
/* Display Prom revision header */
log_printf("---------------------------\n", 0);
} /* netract_disp_prom_version(.) */
/*
* Get and print the PROM version.
*/
void
do_promversion(void)
{
if (mc_promopen(O_RDONLY)) {
"\nCannot open openprom device"), 0);
return;
}
perror("\nOPROMGETVERSION ioctl failed");
return;
}
"\nclose error on %s"), OPENPROMDEV, 0);
return;
}
} /* do_promversion() */
int
mc_promopen(int oflag)
{
for (;;) {
(void) sleep(5);
continue;
}
return (-1);
"\ncannot open %s"), OPENPROMDEV, 0);
return (1);
} else
return (0);
}
}
/*
* This will return -1 for status unknown, 0 for OK, and 1 for failed (scsi
* hard errors)
* swiped from envmon policies
*/
int
{
int i;
int nlist = 0;
char *ap_ids[] = {"c0"};
return (-1);
}
return (-1);
}
for (i = 0; i < nlist; i++) {
/* Tape drive */
if (list_array[i].ap_o_state ==
return (-1);
}
return (-1);
}
break;
/* CD_ROM */
if (list_array[i].ap_o_state ==
return (-1);
}
NULL) {
return (-1);
}
break;
}
}
} else { /* Hard disk */
return (-1);
}
}
"\nks read error for disk%d, drv inst%d"),
return (-1);
}
/*
* if disk_data[].value is >0, we have a problem
*/
return (0);
} else {
return (1);
}
}
void
prtdiag_devinfo(void)
{
/* lets get everything we can from kernel */
if (rootnode == DI_NODE_NIL) {
"\nprtdiag_devinfo: di_init() failed"), 0);
return;
}
}
/*
* gather information about this node, returns appropriate code.
* specific information we seek are driver names, instances
* we will initialize some globals depending on what we find
* from the kernel device tree info and may be private data
* if required
*/
/*ARGSUSED1*/
int
{
char *driver_name;
/* we will initialize our globals here */
if ((di_instance(node) >= 0) &&
(driver_name != NULL) &&
gpio_count++;
sd_count++;
}
}
return (DI_WALK_PRUNECHILD);
else
return (DI_WALK_CONTINUE);
}
/*
* Returns 0 if error , 1 otherwise
*/
int
{
int prop_len, i, k, max_slots_minus_cpu, n;
char *p;
char *temp_s;
int ret_value = 0;
return (0);
while (next != DI_PROP_NIL) {
/*
* get prop length and value:
* private interface--always success
*/
continue;
}
if (prop_len == 0) {
continue;
}
maybe_str = 0;
} else {
/*
* Every character must be a string character or a \0,
* and there must not be two \0's in a row.
*/
for (i = 0; i < prop_len; i++) {
if (prop_data[i] == '\0') {
maybe_str = 0;
break;
}
if ((i > 0) && (prop_data[i] == '\0') &&
maybe_str = 0;
break;
}
}
}
if (maybe_str) {
p = (char *)prop_data;
for (i = 0; i < npossible_strs - 1; i++) {
HSC_PROP_NAME) == 0)) {
temp_s = p;
}
p += strlen(p) + 1;
}
for (k = 0, n = 0; k < prop_len; k++) {
if (temp_s[k] == 0) {
n++;
}
}
if (n % 4) {
"\nbad slot-table(%d)\n"), n);
slot_table_not_found = 0;
return (ret_value);
}
slot_table_size = n / 4;
/*
* NOTE : We save slot table info in order
*/
for (k = 0; k < slot_table_size; k++) {
char *ga;
/*
* Pick off pointer to nexus
* path or PROM handle
*/
temp_s++;
temp_s++;
/*
* Pick off pointer to the
* pci device number
*/
temp_s++;
temp_s++;
/* Pick off physical slot no */
temp_s++;
temp_s++;
/*
* Pick off GA bits which
* we dont use for now.
*/
temp_s++;
temp_s++;
= atoi(phys_slotname);
nexus);
} /* for (k = 0; k < slot_table_size; k++) */
ret_value = 1;
} else /* (strcmp(name, SYSSOFT_PROP) */
slot_table_not_found = 1;
/*
* now we want to save off the info
* we would use later
*/
hotswap_mode = p;
ret_value = 1;
/* save it in order in the right index */
ret_value = 1;
}
} else {
for (i = 0; i < prop_len; ++i) {
#if 0
unsigned char byte;
#endif
}
}
}
return (ret_value);
}
void
{
int i, index;
int tg_cpu_index = 0;
log_printf("===============================", 0);
" FRU Information ================================\n"), 0);
"FRU FRU FRU Green Amber"), 0);
"Type Unit# Present LED LED"), 0);
log_printf("---------- ----- ------- ----- -----", 0);
log_printf(" ----------------------------------\n", 0);
misc_info = "Netra ct800";
else {
misc_info = "Netra ct400";
}
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
default:
}
mc_ok_led = " ";
mc_nok_led = " ";
"%10s %-5d %-7s %-5s %-5s %s\n"),
misc_info, 0);
/* SCB & SSB */
misc_info = "System Controller Board";
if (version_p15_and_p20) {
} else {
/*
* support for 1.0 systems -
* Hack! - should use tables ?
*/
}
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
"%10s %-5d %-7s %-5s %-5s %s\n"),
if (fail_drv_prop == 1)
hotswap_mode, 0);
} /* for */
misc_info = "System Status Panel";
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
"%10s %-5d %-7s %-5s %-5s %s\n"),
} /* for */
/* Slots */
if (montecarlo) {
else
/*
* Another way this could have been done is,
* to read the sub system id
* it is 0x6722 for Alarm Card
* but this id is only valid for the new ACs
* older ACs still have the same susbsystem
* id as most other Sun PCI cards
* We cannot completely rely on this.
* Also,it turns out that Sun OpenBoot does not
* always follow IEEE 1275 std, hence in a few
* systems, the "subsystem-id" published by the
* PROM could not be found
* We know the AC slot# if present on both MC&Tg
* Hence we check on both - now we are sure
* that we have found an AC
*/
(alarm_card_present == 1))
else
board_type = UK;
} else {
else
/*
* Another way this could have been done is,
* to read the sub system id
* it is 0x6722 for Alarm Card
* but this id is only valid for the new ACs
* older ACs still have the same susbsystem
* id as most other Sun PCI cards
* We cannot completely rely on this.
* Also,it turns out that Sun OpenBoot does not
* always follow IEEE 1275 std, hence in a few
* systems, the "subsystem-id" published by the
* PROM could not be found
* We know the AC slot# if present on both MC&Tg
* Hence we check on both - now we are sure
* that we have found an AC
*/
(alarm_card_present == 1))
else
board_type = UK;
}
if (version_p15_and_p20) {
& 0xff), i) ? BLINK :
} else {
/*
* support for 1.0 systems -
* Hack! - should use tables ?
*/
& 0xff), 0) ? BLINK :
(BIT_TEST(
(BIT_TEST(
} else {
/*
* for all other slots offset,
* index are the same
*/
& 0xff), i) ? BLINK :
(BIT_TEST(
}
} /* else if (!version_p15_and_p20) */
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
if (montecarlo) {
/* cpu slot */
"%10s %-5d %-7s %-5s "),
slot_occupants[index], 0);
"%49stemperature(celsius):%d\n"),
pcf8591_ks_temp.value, 0);
#ifdef NEVER
"%49sminimum temperature:%d\n"),
pcf8591_ks_temp.min, 0);
"%49swarning temp. threshold:%d\n"),
"%49sshutdown temp.threshold:%d\n"),
#endif /* NEVER */
(cpu_ftm_present == 1)) {
/* CFTM slot */
/*
* The CFTM can only be present in Slot 2
* for Netract-800, for Netract-400 the FTM
* is not sitted in a Slot. Hence, this is
* another special case and we need to handle
* this differently than other slots
*/
"%10s %-5d %-7s %-5s "),
CPU_FTM, 0);
} else {
if (fail_drv_prop == 1) {
"%10s %-5d %-7s %-5s "),
"%-5s %s\n"),
slot_occupants[index], 0);
"%46s%s\n"), BLANK,
PROPS, 0);
"%49sauto-config=%s\n"),
slot_auto_config[i], 0);
} else {
"%10s %-5d %-7s %-5s "),
slot_occupants[index], 0);
}
}
} else { /* tonga */
/* cpu slot */
"%10s %-5d %-7s %-5s "),
slot_occupants[index], 0);
"%49stemperature(celsius):%d\n"),
pcf8591_ks_temp.value, 0);
#ifdef NEVER
"%49sminimum temperature:%d\n"),
pcf8591_ks_temp.min, 0);
"%49swarning temp. threshold:%d\n"),
"%49sshutdown temp. threshold:%d\n"),
#endif /* NEVER */
} else {
if (fail_drv_prop == 1) {
"%10s %-5d %-7s %-5s "),
"%-5s %s\n"),
slot_occupants[index], 0);
"%49sauto-config=%s\n"),
0);
!= 3)
tg_cpu_index++;
} else {
"%10s %-5d %-7s %-5s "),
slot_occupants[index], 0);
}
}
}
/* we first match the correct slot numbers */
if (slot_table_not_found == 1) {
/* use prom table */
/*
* in all slot info structs
*/
i1++) {
int nd;
"%46s%s%s\n"), BLANK,
BOARDTYPE, board_type, 0);
"%49s%s\n"), BLANK,
PCI_ROOT_AP, 0);
for (nd = 0;
nd++) {
0);
} /* for */
} /* if */
} /* for(i1) */
} /* if */
} else {
/* use solaris lot table */
if (fail_syssoft_prop == 1) {
/*
* num in all slot info structs
*/
int nd;
for (nd = 0;
nd++) {
0);
}
} /* if */
} /* for(i1) */
} /* if */
} /* (fail_syssoft_prop == 1) */
} /* (slot_table_not_found == 1) */
} /* for(s_index) */
} /* for */
mcfru_type = "PDU";
misc_info = "Power Distribution Unit";
if (version_p15_and_p20) {
}
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
if (version_p15_and_p20) {
"%-10s %-5d %-7s %-5s %-5s %s\n"),
} else {
"%-10s %-5d %-7s%18s%s\n"),
}
} /* for */
/* PS */
misc_info = "Power Supply Unit";
if (version_p15_and_p20) {
} else {
/*
* support for 1.0 systems -
* Hack! - should use tables ?
*/
}
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
"%10s %-5d %-7s %-5s %-5s %s\n"),
misc_info, 0);
"%49scondition:%s\n"), BLANK,
"%49stemperature:%s\n"), BLANK,
"%49sps fan:%s\n"), BLANK,
"%49ssupply:%s\n"), BLANK,
} else {
"%49scondition:%s\n"), BLANK,
"%49stemperature:%s\n"), BLANK,
"%49sps fan:%s\n"), BLANK,
"%49ssupply:%s\n"), BLANK,
} /* if */
}
} /* for */
/* Fan tray */
misc_info = "Fan Tray";
if (version_p15_and_p20) {
} else {
/*
* support for 1.0 systems -
* Hack! - should use tables ?
*/
}
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
"%10s %-5d %-7s %-5s %-5s %s\n"),
misc_info, 0);
"%49scondition:%s\n"), BLANK,
"%49sfan speed:%s\n"), BLANK,
} else {
"%49scondition:%s\n"), BLANK,
"%49sfan speed:%s\n"), BLANK,
}
}
} /* for */
/* DISKS */
else
mcfru_type = "RMM ";
case FRU_PRESENT:
break;
case FRU_NOT_PRESENT:
break;
case FRU_NOT_AVAILABLE:
break;
default:
break;
}
if (version_p15_and_p20) {
} else {
/*
* support for 1.0 systems -
* Hack! - should use tables ?
*/
}
/* print everything except condition */
misc_info = "Hard Disk Drive";
"%10s %-5d %-7s %-5s %-5s %s\n"),
} else {
misc_info = "Removable Media Module";
"%10s %5s %-7s %-5s %-5s %s\n"),
}
/* find out fru health from the SCSI drivers */
switch (
case 0:
break;
case 1:
break;
case -1:
break;
default:
break;
}
}
} /* for */
} /* display_mc_prtdiag_info() */
void
{
/* we will find all the dev info for slots first */
/* we are at "pci" node now */
do {
NULL, analyze_nodes) != 0) {
return;
}
/* now we wll gather info on sysctrl */
if (lc_node != DI_NODE_NIL)
} /* analyze_pcipci_siblings(.) */
int
{
char *temp;
/*
* we will figure out whether the parent node is "pci" type
* we will save info only in this case as we only want to
* print out the nodes under AP and not others
*/
/*
* if this is PCI bridge, we know that this is the AP for slots
* hence, we will save off the address(to convert to slot mapping)
* later, and also we will start saving off slot info struct for
* reporting later
* we will save the immediate childs of this bridge only
*/
num_devs = 0;
}
slot_index++;
} else {
!= NULL) {
(void) strcat(
name);
} else {
(void) strcpy(
name);
} /* if ((mc_slots_data.mc_slot_inf */
num_devs++;
= num_devs;
} /* if parent is pci */
} /* if node is pci */
di_prop_sys_next)) {
} else {
}
/*
* (void) dump_prop_list("Hardware",
* l_node, di_prop_hw_next);
*/
/* dump_priv_data(l_node); */
}
}
return (0);
} /* analyze_nodes(..) */
/*
* To get the slot information,
* The OBP defines the 'slot-table' property. But the OS
* can override it with 'hsc-slot-map' property
* through the .conf file.
* Since the formats are different, 2 different property names
* are chosen.
* The OBP property format is
* <phandle>,<pci-devno>,<phys-slotno>,<ga-bits>
* The OS property format is (ga-bits is not used however)
* <busnexus-path>,<pci-devno>,<phys-slotno>,<ga-bits>
* returns 0 on error, 1 otherwise
*/
int
{
if (mc_promopen(O_RDONLY)) {
"\ncannot open openprom device"), 0);
return (0);
}
if (mc_next(0) == 0)
return (0);
"\nclose error on %s"), OPENPROMDEV, 0);
return (0);
}
return (1);
} /* extract_slot_table_from_obp() */
int
{
return (0);
}
return (opp->oprom_node);
} /* mc_next(.) */
void
{
int curnode;
} /* mc_walk(.) */
int
{
perror("\nOPROMCHILD");
exit(0);
}
return (opp->oprom_node);
} /* mc_child(.) */
/*
* Print all properties and values
*/
void
mc_dump_node(int id)
{
int k;
/* get first prop by asking for null string */
for (;;) {
/*
* get next property name
*/
perror("\nOPROMNXTPROP");
return;
}
if (opp->oprom_size == 0)
break;
== (uint_t)-1) {
"\ndata not available"), 0);
return;
} else {
opp->oprom_size /
sizeof (hsc_prom_slot_table_t);
hpstp =
for (k = 0; k < slot_table_size; k++, hpstp++) {
prom_slot_table[k].pslotnum =
prom_slot_table[k].ga =
prom_slot_table[k].pci_devno =
prom_slot_table[k].phandle =
} /* for (k = 0; k < slot_table_size; k++) */
}
}
}
} /* mc_dump_node(.) */
int
{
return (1);
}
return (0);
} /* mc_getpropval(.) */
/*
* This function returns nothing.
*/
void
{
int scsb_fd;
if (check_platform() == -1) {
return;
}
}
if (version_p15_and_p20 == 1)
else
"\n%s open failed"), scsb_node, 0);
return;
}
/* save off the old mode */
return;
/* we put scsb in diag mode to read this specific ioctl */
return;
/* now lets read the config register */
return;
/* restore the original mode */
return;
} /* alarm_card_occupant() */
/*
* This function changes the SCSB mode to the desired one
* 1 on sucess, 0 otherwise
*/
int
{
else
"\nscsb_mode():scsb ioctl() failed"), 0);
return (0);
}
return (1);
} /* scsb_mode(...) */
/*
* 1 on success, 0 otherwise
*/
int
{
/* setup read command before ioctl */
"scsb_ioc_reg_read(): scsb ioctl() failed\n"), 0);
return (0);
}
return (1);
} /* scsb_ioc_reg_read(....) */