diff options
author | Peter Tribble <peter.tribble@gmail.com> | 2020-02-06 09:28:37 +0000 |
---|---|---|
committer | Peter Tribble <peter.tribble@gmail.com> | 2020-02-24 21:14:37 +0000 |
commit | 2bcbf80ce6c8a2fb827428428c350ebe4f91f7ab (patch) | |
tree | 07d0d46fa48e0985fe67c2c2fd6b4542cf5bc645 /usr/src/lib/libprtdiag | |
parent | 873f5d0769a5334a9dfb27cf8a5174e25ae4418e (diff) | |
download | illumos-gate-2bcbf80ce6c8a2fb827428428c350ebe4f91f7ab.tar.gz |
12289 remove sunfire-specific code from libprtdiag
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libprtdiag')
-rw-r--r-- | usr/src/lib/libprtdiag/Makefile.com | 4 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/common/display_sun4u.c | 6 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/common/display_sun4v.c | 4 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/common/kstat.c | 351 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/common/memory.c | 7 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/inc/libprtdiag.h | 9 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h | 113 | ||||
-rw-r--r-- | usr/src/lib/libprtdiag/inc/reset_info.h | 108 |
8 files changed, 39 insertions, 563 deletions
diff --git a/usr/src/lib/libprtdiag/Makefile.com b/usr/src/lib/libprtdiag/Makefile.com index 6994883b47..406fcfc96f 100644 --- a/usr/src/lib/libprtdiag/Makefile.com +++ b/usr/src/lib/libprtdiag/Makefile.com @@ -21,6 +21,7 @@ # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# Copyright 2020 Peter Tribble. # # @@ -39,8 +40,7 @@ include $(SRC)/Makefile.psm LIBS = $(DYNLIB) $(LINTLIB) IFLAGS = -I ../../inc -I $(USR_PSM_INCL_DIR) IFLAGS += -I $(SRC)/cmd/picl/plugins/inc -IFLAGS += -I $(UTSBASE)/sun4u -IFLAGS += -I $(UTSBASE)/sun4u/sunfire +IFLAGS += -I $(UTSBASE)/sun4u IFLAGS += -I $(UTSBASE)/sun4u/serengeti CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) diff --git a/usr/src/lib/libprtdiag/common/display_sun4u.c b/usr/src/lib/libprtdiag/common/display_sun4u.c index a68246600f..56e2716e38 100644 --- a/usr/src/lib/libprtdiag/common/display_sun4u.c +++ b/usr/src/lib/libprtdiag/common/display_sun4u.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #include <stdio.h> @@ -62,7 +63,6 @@ display(Sys_tree *tree, int exit_code = 0; /* init to all OK */ void *value; /* used for opaque PROM data */ struct mem_total memory_total; /* Total memory in system */ - struct grp_info grps; /* Info on all groups in system */ sys_clk = -1; /* System clock freq. (in MHz) */ @@ -96,7 +96,7 @@ display(Sys_tree *tree, } /* Display the Memory Size */ - display_memorysize(tree, kstats, &grps, &memory_total); + display_memorysize(tree, kstats, &memory_total); /* Display platform specific configuration info */ display_platform_specific_header(); @@ -105,7 +105,7 @@ display(Sys_tree *tree, display_cpu_devices(tree); /* Display the Memory configuration */ - display_memoryconf(tree, &grps); + display_memoryconf(tree); /* Display all the IO cards. */ (void) display_io_devices(tree); diff --git a/usr/src/lib/libprtdiag/common/display_sun4v.c b/usr/src/lib/libprtdiag/common/display_sun4v.c index e4a2408537..9ec03878b5 100644 --- a/usr/src/lib/libprtdiag/common/display_sun4v.c +++ b/usr/src/lib/libprtdiag/common/display_sun4v.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #include <stdio.h> @@ -119,7 +120,6 @@ sun4v_display(Sys_tree *tree, Prom_node *root, int log, { void *value; /* used for opaque PROM data */ struct mem_total memory_total; /* Total memory in system */ - struct grp_info grps; /* Info on all groups in system */ char machine[MAXSTRLEN]; int exit_code = 0; @@ -155,7 +155,7 @@ sun4v_display(Sys_tree *tree, Prom_node *root, int log, } /* Display the Memory Size */ - display_memorysize(tree, NULL, &grps, &memory_total); + display_memorysize(tree, NULL, &memory_total); /* Display the CPU devices */ sun4v_display_cpu_devices(plafh); diff --git a/usr/src/lib/libprtdiag/common/kstat.c b/usr/src/lib/libprtdiag/common/kstat.c index 1c29e96642..5aaf523441 100644 --- a/usr/src/lib/libprtdiag/common/kstat.c +++ b/usr/src/lib/libprtdiag/common/kstat.c @@ -22,10 +22,9 @@ /* * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -54,369 +53,33 @@ /* * This module does the reading and interpreting of sun4u system - * kstats. These kstats are created by the following drivers: - * fhc, environ, sysctrl. Each board in the tree should have - * kstats created for it. There are also system wide kstats that - * are created. + * kstats. It is overlaid by a platform-specific implementation as + * appropriate. */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep) + struct envctrl_kstat_data *ep) { - Board_node *bnode; - kstat_ctl_t *kc; - kstat_t *ksp; - kstat_named_t *knp; - int i; - struct hp_info *hp; - -#ifdef lint - ep = ep; -#endif - if ((kc = kstat_open()) == NULL) { - return; - } - - /* For each board in the system, read the kstats for it. */ - for (bnode = tree->bd_list; bnode != NULL; bnode = bnode->next) { - int board; - - /* - * Kstat instances numbers are set by fhc, ac, simmstat, - * and environ drivers based on their board# property. - */ - board = bnode->board_num; - bdp = &sys_kstat->bd_ksp_list[board]; - - /* Try to find an FHC instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, FHC_KSTAT_NAME); - - /* Atempt to read the FHC kstat */ - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - ksp = NULL; - } - - /* Now read out the data if the kstat read OK */ - if (ksp != NULL) { - /* - * We set the kstats_ok flag to good here. If we - * fail one of the data reads, we set it to bad. - */ - bdp->fhc_kstats_ok = 1; - - /* - * For each data value, If the Kstat named struct - * is found, then get the data out. - */ - knp = kstat_data_lookup(ksp, CSR_KSTAT_NAMED); - if (knp != NULL) { - bdp->fhc_csr = knp->value.ul; - } else { - bdp->fhc_kstats_ok = 0; - } - knp = kstat_data_lookup(ksp, BSR_KSTAT_NAMED); - if (knp != NULL) { - bdp->fhc_bsr = knp->value.ul; - } else { - bdp->fhc_kstats_ok = 0; - } - } - - /* Try to find an AC instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, AC_KSTAT_NAME); - - /* Attempt to read the AC kstat. */ - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - ksp = NULL; - } - - /* If the AC kstat exists, try to read the data from it. */ - if (ksp != NULL) { - /* - * We set the kstats_ok flag to good here. If we - * fail one of the data reads, we set it to bad. - */ - bdp->ac_kstats_ok = 1; - bdp->ac_memstat_ok = 1; - - /* - * For each data value, If the Kstat named struct - * is found, then get the data out. - */ - - knp = kstat_data_lookup(ksp, MEMCTL_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memctl = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, MEMDECODE0_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memdecode[0] = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, MEMDECODE1_KSTAT_NAMED); - if (knp != NULL) { - bdp->ac_memdecode[1] = knp->value.ull; - } else { - bdp->ac_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, BANK_0_KSTAT_NAMED); - if (knp != NULL) { - bdp->mem_stat[0].status = knp->value.c[0]; - bdp->mem_stat[0].condition = knp->value.c[1]; - } else { - bdp->ac_memstat_ok = 0; - } - - knp = kstat_data_lookup(ksp, BANK_1_KSTAT_NAMED); - if (knp != NULL) { - bdp->mem_stat[1].status = knp->value.c[0]; - bdp->mem_stat[1].condition = knp->value.c[1]; - } else { - bdp->ac_memstat_ok = 0; - } - - } - - /* Try to find an simmstat instance for this board number */ - ksp = kstat_lookup(kc, UNIX, board, SIMMSTAT_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - bdp->simmstat_kstats_ok = 0; - } else { - bdp->simmstat_kstats_ok = 1; - (void) memcpy(&bdp->simm_status, ksp->ks_data, - sizeof (bdp->simm_status)); - } - } - - /* Try to find an overtemp kstat instance for this board */ - ksp = kstat_lookup(kc, UNIX, board, OVERTEMP_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - bdp->temp_kstat_ok = 0; - } else { - bdp->temp_kstat_ok = 1; - (void) memcpy(&bdp->tempstat, ksp->ks_data, - sizeof (bdp->tempstat)); - /* XXX - this is for 2.5.1 testing. remove */ - if (sizeof (bdp->tempstat) > ksp->ks_data_size) - bdp->tempstat.trend = TREND_UNKNOWN; - } - } - } - - /* Read the kstats for the system control board */ - ksp = kstat_lookup(kc, UNIX, 0, SYSCTRL_KSTAT_NAME); - - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) == -1)) { - sys_kstat->sys_kstats_ok = 0; - ksp = NULL; - } - - if (ksp != NULL) { - sys_kstat->sys_kstats_ok = 1; - - knp = kstat_data_lookup(ksp, CSR_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysctrl = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, STAT1_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysstat1 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, STAT2_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->sysstat2 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, CLK_FREQ2_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->clk_freq2 = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, FAN_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->fan_status = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, KEY_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->keysw_status = knp->value.c[0]; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, POWER_KSTAT_NAMED); - if (knp != NULL) { - sys_kstat->power_state = - (enum power_state)knp->value.l; - } else { - sys_kstat->sys_kstats_ok = 0; - } - - knp = kstat_data_lookup(ksp, CLK_VER_KSTAT_NAME); - if (knp != NULL) { - sys_kstat->clk_ver = knp->value.c[0]; - } else { - /* - * the clock version register only appears - * on new clock boards - */ - sys_kstat->clk_ver = 0; - } - - } - - /* Read the kstats for the power supply stats */ - ksp = kstat_lookup(kc, UNIX, 0, PSSHAD_KSTAT_NAME); - - if ((ksp != NULL) && (kstat_read(kc, ksp, NULL) != -1)) { - sys_kstat->psstat_kstat_ok = 1; - (void) memcpy(&sys_kstat->ps_shadow[0], ksp->ks_data, - sizeof (sys_kstat->ps_shadow)); - } else { - sys_kstat->psstat_kstat_ok = 0; - } - - /* read the overtemp kstat for the system control board */ - /* Try to find an overtemp kstat instance for this board */ - ksp = kstat_lookup(kc, UNIX, CLOCK_BOARD_INDEX, OVERTEMP_KSTAT_NAME); - - if (ksp != NULL) { - if (kstat_read(kc, ksp, NULL) == -1) { - sys_kstat->temp_kstat_ok = 0; - } else { - sys_kstat->temp_kstat_ok = 1; - (void) memcpy(&sys_kstat->tempstat, ksp->ks_data, - sizeof (sys_kstat->tempstat)); - /* XXX - this is for 2.5.1 testing. remove */ - if (sizeof (sys_kstat->tempstat) > ksp->ks_data_size) - sys_kstat->tempstat.trend = TREND_UNKNOWN; - } - } - - /* Read the reset-info kstat from one of the boards. */ - ksp = kstat_lookup(kc, UNIX, 0, RESETINFO_KSTAT_NAME); - - if (ksp == NULL) { - sys_kstat->reset_kstats_ok = 0; - } else if (kstat_read(kc, ksp, NULL) == -1) { - sys_kstat->reset_kstats_ok = 0; - } else { - sys_kstat->reset_kstats_ok = 1; - (void) memcpy(&sys_kstat->reset_info, ksp->ks_data, - sizeof (sys_kstat->reset_info)); - } - - /* read kstats for hotplugged boards */ - for (i = 0, hp = &sys_kstat->hp_info[0]; i < MAX_BOARDS; i++, hp++) { - ksp = kstat_lookup(kc, UNIX, i, BDLIST_KSTAT_NAME); - - if (ksp == NULL) { - continue; - } - - if (kstat_read(kc, ksp, NULL) == -1) { - hp->kstat_ok = 0; - } else { - hp->kstat_ok = 1; - (void) memcpy(&hp->bd_info, ksp->ks_data, - sizeof (hp->bd_info)); - } - } - - /* read in the kstat for the fault list. */ - ksp = kstat_lookup(kc, UNIX, 0, FT_LIST_KSTAT_NAME); - - if (ksp == NULL) { - sys_kstat->ft_kstat_ok = 0; - } else { - if (kstat_read(kc, ksp, NULL) == -1) { - perror("kstat read"); - sys_kstat->ft_kstat_ok = 0; - return; - } - - sys_kstat->nfaults = ksp->ks_data_size / - sizeof (struct ft_list); - - sys_kstat->ft_array = - (struct ft_list *)malloc(ksp->ks_data_size); - - if (sys_kstat->ft_array == NULL) { - perror("Malloc"); - exit(2); - } - sys_kstat->ft_kstat_ok = 1; - (void) memcpy(sys_kstat->ft_array, ksp->ks_data, - ksp->ks_data_size); - } } /* * This function does the reading and interpreting of sun4u system - * kstats. These kstats are created by the following drivers: - * fhc, environ, sysctrl. Each board in the tree should have - * kstats created for it. There are also system wide kstats that - * are created. + * kstats. */ void read_sun4u_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat) { -#if 0 - Board_node *bnode; - kstat_t *ksp; - kstat_named_t *knp; - struct hp_info *hp; - struct envctrltwo_kstat_data *ecp; -#endif - kstat_ctl_t *kc; + kstat_ctl_t *kc; int i; - struct bd_kstat_data *bdp; struct envctrl_kstat_data *ep; if ((kc = kstat_open()) == NULL) { return; } -#ifdef lint - kc = kc; -#endif /* Initialize the kstats structure */ sys_kstat->sys_kstats_ok = 0; - sys_kstat->temp_kstat_ok = 0; - sys_kstat->reset_kstats_ok = 0; - sys_kstat->ft_kstat_ok = 0; sys_kstat->envctrl_kstat_ok = 0; - for (i = 0; i < MAX_BOARDS; i++) { - bdp = &sys_kstat->bd_ksp_list[i]; - bdp->ac_kstats_ok = 0; - bdp->fhc_kstats_ok = 0; - bdp->simmstat_kstats_ok = 0; - bdp->temp_kstat_ok = 0; - - sys_kstat->hp_info[i].kstat_ok = 0; - } for (i = 0; i < MAX_DEVS; i++) { ep = &sys_kstat->env_data; ep->ps_kstats[i].instance = I2C_NODEV; @@ -424,5 +87,5 @@ read_sun4u_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat) ep->encl_kstats[i].instance = I2C_NODEV; } - read_platform_kstats(tree, sys_kstat, bdp, ep); + read_platform_kstats(tree, sys_kstat, ep); } diff --git a/usr/src/lib/libprtdiag/common/memory.c b/usr/src/lib/libprtdiag/common/memory.c index 1e1aaff425..575f94e956 100644 --- a/usr/src/lib/libprtdiag/common/memory.c +++ b/usr/src/lib/libprtdiag/common/memory.c @@ -22,10 +22,9 @@ /* * Copyright (c) 1999-2001 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -86,7 +85,7 @@ static memory_seg_t *match_seg(uint64_t); /*ARGSUSED0*/ void display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total) + struct mem_total *memory_total) { log_printf(dgettext(TEXT_DOMAIN, "Memory size: "), 0); @@ -110,7 +109,7 @@ display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, /*ARGSUSED0*/ void -display_memoryconf(Sys_tree *tree, struct grp_info *grps) +display_memoryconf(Sys_tree *tree) { /* * This function is intentionally blank diff --git a/usr/src/lib/libprtdiag/inc/libprtdiag.h b/usr/src/lib/libprtdiag/inc/libprtdiag.h index e9361b8e9c..41e6227c18 100644 --- a/usr/src/lib/libprtdiag/inc/libprtdiag.h +++ b/usr/src/lib/libprtdiag/inc/libprtdiag.h @@ -21,13 +21,12 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2020 Peter Tribble. */ #ifndef _SYS_LIBPRTDIAG_H #define _SYS_LIBPRTDIAG_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -132,15 +131,15 @@ void decode_qlc_card_model_prop(Prom_node *card_node, struct io_card *card); */ void read_platform_kstats(Sys_tree *tree, struct system_kstat_data *sys_kstat, - struct bd_kstat_data *bdp, struct envctrl_kstat_data *ep); + struct envctrl_kstat_data *ep); void read_sun4u_kstats(Sys_tree *, struct system_kstat_data *); /* * memory functions */ void display_memorysize(Sys_tree *tree, struct system_kstat_data *kstats, - struct grp_info *grps, struct mem_total *memory_total); -void display_memoryconf(Sys_tree *tree, struct grp_info *grps); + struct mem_total *memory_total); +void display_memoryconf(Sys_tree *tree); /* * prom functions diff --git a/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h b/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h index 7273d62b8d..c4038e4535 100644 --- a/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h +++ b/usr/src/lib/libprtdiag/inc/pdevinfo_sun4u.h @@ -22,68 +22,45 @@ /* * Copyright (c) 1999 by Sun Microsystems, Inc. * All rights reserved. + * Copyright (c) 2020 Peter Tribble. */ #ifndef _PDEVINFO_SUN4U_H #define _PDEVINFO_SUN4U_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/obpdefs.h> -#include <sys/fhc.h> -#include <sys/sysctrl.h> -#include <sys/environ.h> #include <sys/envctrl_gen.h> #include <sys/envctrl_ue250.h> #include <sys/envctrl_ue450.h> -#include <sys/simmstat.h> -#include <sys/ac.h> -#include <sys/sram.h> -#include <reset_info.h> #ifdef __cplusplus extern "C" { #endif -#define UNIX "unix" +/* + * These were formerly defined in sys/ac.h, which was specific to sunfire, + * but usage has leaked into generic code. + */ +#ifndef TRUE +#define TRUE (1) +#endif +#ifndef FALSE +#define FALSE (0) +#endif + +/* + * These were formerly defined as part of the board_type enum in sys/fhc.h, + * which was specific to sunfire, but usage has leaked into generic code. + */ +#define UNKNOWN_BOARD 1 +#define CPU_BOARD 2 /* Define names of nodes to search for */ -#define CPU_NAME "SUNW,UltraSPARC" #define SBUS_NAME "sbus" #define PCI_NAME "pci" #define FFB_NAME "SUNW,ffb" #define AFB_NAME "SUNW,afb" -struct mem_stat_data { - enum ac_bank_status status; /* bank status values */ - enum ac_bank_condition condition; /* bank conditions */ -}; - -struct bd_kstat_data { - u_longlong_t ac_memctl; /* Memctl register contents */ - u_longlong_t ac_memdecode[2]; /* memory decode registers . */ - int ac_kstats_ok; /* successful kstat read occurred */ - uint_t fhc_bsr; /* FHC Board Status Register */ - uint_t fhc_csr; /* FHC Control Status Register */ - int fhc_kstats_ok; /* successful kstat read occurred */ - uchar_t simm_status[SIMM_COUNT]; /* SIMM status */ - int simmstat_kstats_ok; /* successful read occurred */ - struct temp_stats tempstat; - int temp_kstat_ok; - struct mem_stat_data mem_stat[2]; /* raw kstat bank information */ - int ac_memstat_ok; /* successful read of memory status */ -}; - -/* - * Hot plug info structure. If a hotplug kstat is found, the bd_info - * structure from the kstat is filled in the the hp_info structure - * is marked OK. - */ -struct hp_info { - struct bd_info bd_info; - int kstat_ok; -}; - /* Environmental info for Tazmo */ struct envctrl_kstat_data { envctrl_ps_t ps_kstats[MAX_DEVS]; /* kstats for powersupplies */ @@ -106,69 +83,15 @@ struct envctrltwo_kstat_data { }; struct system_kstat_data { - uchar_t sysctrl; /* sysctrl register contents */ - uchar_t sysstat1; /* system status1 register contents. */ - uchar_t sysstat2; /* system status2 register contents. */ - uchar_t ps_shadow[SYS_PS_COUNT]; /* power supply shadow */ - int psstat_kstat_ok; - uchar_t clk_freq2; /* clock frequency register 2 contents */ - uchar_t fan_status; /* shadow fan status */ - uchar_t keysw_status; /* status of the key switch */ - enum power_state power_state; /* redundant power state */ - uchar_t clk_ver; /* clock version register */ int sys_kstats_ok; /* successful kstat read occurred */ - struct temp_stats tempstat; - int temp_kstat_ok; - struct reset_info reset_info; - int reset_kstats_ok; /* kstat read OK */ - struct bd_kstat_data bd_ksp_list[MAX_BOARDS]; - struct hp_info hp_info[MAX_BOARDS]; - struct ft_list *ft_array; /* fault array */ - int nfaults; /* number of faults in fault array */ - int ft_kstat_ok; /* Fault kstats OK */ struct envctrl_kstat_data env_data; /* environment data for Tazmo */ int envctrl_kstat_ok; struct envctrltwo_kstat_data envc_data; /* environ data for Javelin */ int envctrltwo_kstat_ok; }; -/* Description of a single memory group */ -struct grp { - int valid; /* active memory group present */ - u_longlong_t base; /* Phyiscal base of group */ - uint_t size; /* size in bytes */ - uint_t curr_size; /* current size in bytes */ - int board; /* board number */ - enum board_type type; /* board type */ - int group; /* group # on board (0 or 1) */ - int factor; /* interleave factor (0,2,4,8,16) */ - int speed; /* Memory speed (in ns) */ - char groupid; /* Alpha tag for group ID */ - enum ac_bank_status status; /* bank status values */ - enum ac_bank_condition condition; /* bank conditions */ -}; - -#define MAX_GROUPS 32 #define MAXSTRLEN 256 -/* Array of all possible groups in the system. */ -struct grp_info { - struct grp grp[MAX_GROUPS]; -}; - -/* A memory interleave structure */ -struct inter_grp { - u_longlong_t base; /* Physical base of group */ - int valid; - int count; - char groupid; -}; - -/* Array of all possible memory interleave structures */ -struct mem_inter { - struct inter_grp i_grp[MAX_GROUPS]; -}; - /* FFB info structure */ struct ffbinfo { int board; diff --git a/usr/src/lib/libprtdiag/inc/reset_info.h b/usr/src/lib/libprtdiag/inc/reset_info.h deleted file mode 100644 index 8f94813a6f..0000000000 --- a/usr/src/lib/libprtdiag/inc/reset_info.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 - * or http://www.opensolaris.org/os/licensing. - * 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) 1999 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ifndef _RESET_INFO_H -#define _RESET_INFO_H - -#pragma ident "%Z%%M% %I% %E% SMI" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * All of the following data structures and defines come from sun4u server - * POST. If the data in POST changes, then these structures must reflect - * those changes. - */ - -#include <sys/fhc.h> /* To get MAX_BOARDS constant */ - -/* BDA bit assignments */ -#define BOARD_PRESENT (1<<0) -#define BOARD_OK (1<<1) -#define BOARD_TYPE_MSK (7<<2) -#define BOARD_TYPE(x) (((x) & BOARD_TYPE_MSK) >> 2) - -/* Board state mask and defines */ -#define BD_STATE_MASK 0x3 -#define BD_LPM_FZN 0 -#define BD_ONLINE_FAIL 1 -#define BD_NOT_PRESENT 2 -#define BD_ONLINE_NORMAL 3 - -/* define CPU 0 fields */ -#define CPU0_PRESENT (1<<8) -#define CPU0_OK (1<<9) -#define CPU0_FAIL_CODE_MSK (7<<10) - -/* define CPU 1 fields */ -#define CPU1_PRESENT (1<<16) -#define CPU1_OK (1<<17) -#define CPU1_FAIL_CODE_MSK (7<<18) - -/* supported board types */ -#define CPU_TYPE 0 -#define MEM_TYPE 1 /* CPU/MEM board with only memory */ -#define IO_TYPE1 2 -#define IO_TYPE2 3 -#define IO_TYPE3 4 -#define IO_TYPE4 5 /* same as IO TYPE 1 but no HM or PHY chip */ -#define CLOCK_TYPE 7 - -/* for CPU type UPA ports */ -typedef struct { - u_longlong_t afsr; /* Fault status register for CPU */ - u_longlong_t afar; /* Fault address register for CPU */ -} cpu_reset_state; - -/* For the clock board */ -typedef struct { - unsigned long clk_ssr_1; /* reset status for the clock board */ -} clock_reset_state; - -struct board_info { - u_longlong_t board_desc; - cpu_reset_state cpu[2]; /* could be a CPU */ - u_longlong_t ac_error_status; - u_longlong_t dc_shadow_chain; - uint_t fhc_csr; - uint_t fhc_rcsr; -}; - -struct reset_info { - int length; /* size of the structure */ - int version; /* Version of the structure */ - struct board_info bd_reset_info[MAX_BOARDS]; - clock_reset_state clk; /* one clock board */ - unsigned char tod_timestamp[7]; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* _RESET_INFO_H */ |