/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Derived from IRIX <sys/SN/klconfig.h>. * * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. * Copyright (C) 1999, 2000 by Ralf Baechle
*/ #ifndef _ASM_SN_KLCONFIG_H #define _ASM_SN_KLCONFIG_H
/* * The KLCONFIG structures store info about the various BOARDs found * during Hardware Discovery. In addition, it stores info about the * components found on the BOARDs.
*/
/* * WARNING: * Certain assembly language routines (notably xxxxx.s) in the IP27PROM * will depend on the format of the data structures in this file. In * most cases, rearranging the fields can seriously break things. * Adding fields in the beginning or middle can also break things. * Add fields if necessary, to the end of a struct in such a way * that offsets of existing fields do not change.
*/
#ifdefined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP35) #include <asm/sn/agent.h> #include <asm/fw/arc/types.h> #include <asm/fw/arc/hinv.h> #ifdefined(CONFIG_SGI_IP35) // The hack file has to be before vector and after sn0_fru.... #include <asm/hack.h> #include <asm/sn/vector.h> #include <asm/xtalk/xtalk.h> #endif/* CONFIG_SGI_IP35 */ #endif/* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
typedef u64 nic_t;
#define KLCFGINFO_MAGIC 0xbeedbabe
typedef s32 klconf_off_t;
/* * Some IMPORTANT OFFSETS. These are the offsets on all NODES.
*/ #define MAX_MODULE_ID 255 #define SIZE_PAD 4096 /* 4k padding for structures */ /* * 1 NODE brd, 2 Router brd (1 8p, 1 meta), 6 Widgets, * 2 Midplanes assuming no pci card cages
*/ #define MAX_SLOTS_PER_NODE (1 + 2 + 6 + 2)
/* XXX if each node is guaranteed to have some memory */
#define MAX_PCI_DEVS 8
/* lboard_t->brd_flags fields */ /* All bits in this field are currently used. Try the pad fields if
you need more flag bits */
#define ENABLE_BOARD 0x01 #define FAILED_BOARD 0x02 #define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which
are discovered twice. Use one of them */ #define VISITED_BOARD 0x08 /* Used for compact hub numbering. */ #define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */ #define GLOBAL_MASTER_IO6 0x20 #define THIRD_NIC_PRESENT 0x40 /* for future use */ #define SECOND_NIC_PRESENT 0x80 /* addons like MIO are present */
/* klinfo->flags fields */
#define KLINFO_ENABLE 0x01 /* This component is enabled */ #define KLINFO_FAILED 0x02 /* This component failed */ #define KLINFO_DEVICE 0x04 /* This component is a device */ #define KLINFO_VISITED 0x08 /* This component has been visited */ #define KLINFO_CONTROLLER 0x10 /* This component is a device controller */ #define KLINFO_INSTALL 0x20 /* Install a driver */ #define KLINFO_HEADLESS 0x40 /* Headless (or hubless) component */ #define IS_CONSOLE_IOC3(i) ((((klinfo_t *)i)->flags) & KLINFO_INSTALL)
#define GB2 0x80000000
#define MAX_RSV_PTRS 32
/* Structures to manage various data storage areas */ /* The numbers must be contiguous since the array index i is used in the code to allocate various areas.
*/
/* Functions/macros needed to use this structure */
typedefstruct kl_config_hdr {
u64 ch_magic; /* set this to KLCFGINFO_MAGIC */
u32 ch_version; /* structure version number */
klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */
klconf_off_t ch_cons_off; /* offset of ch_cons */
klconf_off_t ch_board_info; /* the link list of boards */
console_t ch_cons_info; /* address info of the console */
klc_malloc_hdr_t ch_malloc_hdr[KLMALLOC_TYPE_MAX];
confidence_t ch_sw_belief; /* confidence that software is bad*/
confidence_t ch_sn0net_belief; /* confidence that sn0net is bad */
} kl_config_hdr_t;
/* * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to * the LOCAL/current NODE. REMOTE means it is attached to a different * node.(TBD - Need a way to treat ROUTER boards.) * * There are 2 different structures to represent these boards - * lboard - Local board, rboard - remote board. These 2 structures * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer * Figure below). The first byte of the rboard or lboard structure * is used to find out its type - no unions are used. * If it is a lboard, then the config info of this board will be found * on the local node. (LOCAL NODE BASE + offset value gives pointer to * the structure. * If it is a rboard, the local structure contains the node number * and the offset of the beginning of the LINKED LIST on the remote node. * The details of the hardware on a remote node can be built locally, * if required, by reading the LINKED LIST on the remote node and * ignoring all the rboards on that node. * * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the * First board info on the remote node. The remote node list is * traversed as the local list, using the REMOTE BASE ADDRESS and not * the local base address and ignoring all rboard values. * * KLCONFIG
* * Each BOARD consists of COMPONENTs and the BOARD structure has * pointers (offsets) to its COMPONENT structure. * The COMPONENT structure has version info, size and speed info, revision, * error info and the NIC info. This structure can accommodate any * BOARD with arbitrary COMPONENT composition. * * The ERRORINFO part of each BOARD has error information * that describes errors about the BOARD itself. It also has flags to * indicate the COMPONENT(s) on the board that have errors. The error * information specific to the COMPONENT is present in the respective * COMPONENT structure. * * The ERRORINFO structure is also treated like a COMPONENT, ie. the * BOARD has pointers(offset) to the ERRORINFO structure. The rboard * structure also has a pointer to the ERRORINFO structure. This is * the place to store ERRORINFO about a REMOTE NODE, if the HUB on * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info * which is present on the REMOTE NODE.(TBD) * REMOTE ERRINFO can be stored on any of the nearest nodes * or on all the nearest nodes.(TBD) * Like BOARD structures, REMOTE ERRINFO structures can be built locally * using the rboard errinfo pointer. * * In order to get useful information from this Data organization, a set of * interface routines are provided (TBD). The important thing to remember while * manipulating the structures, is that, the NODE number information should * be used. If the NODE is non-zero (remote) then each offset should * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR. * This includes offsets for BOARDS, COMPONENTS and ERRORINFO. * * Note that these structures do not provide much info about connectivity. * That info will be part of HWGRAPH, which is an extension of the cfg_t * data structure. (ref IP27prom/cfg.h) It has to be extended to include * the IO part of the Network(TBD). * * The data structures below define the above concepts.
*/
/* * Values for CPU types
*/ #define KL_CPU_R4000 0x1 /* Standard R4000 */ #define KL_CPU_TFP 0x2 /* TFP processor */ #define KL_CPU_R10000 0x3 /* R10000 (T5) */ #define KL_CPU_NONE (-1) /* no cpu present in slot */
/* * IP27 BOARD classes
*/
#define KLCLASS_MASK 0xf0 #define KLCLASS_NONE 0x00 #define KLCLASS_NODE 0x10 /* CPU, Memory and HUB board */ #define KLCLASS_CPU KLCLASS_NODE #define KLCLASS_IO 0x20 /* BaseIO, 4 ch SCSI, ethernet, FDDI
and the non-graphics widget boards */ #define KLCLASS_ROUTER 0x30 /* Router board */ #define KLCLASS_MIDPLANE 0x40 /* We need to treat this as a board
so that we can record error info */ #define KLCLASS_GFX 0x50 /* graphics boards */
#define KLCLASS_PSEUDO_GFX 0x60 /* HDTV type cards that use a gfx * hw ifc to xtalk and are not gfx
* class for sw purposes */
#define KLCLASS_MAX 7 /* Bump this if a new CLASS is added */ #define KLTYPE_MAX 10 /* Bump this if a new CLASS is added */
/* The value of type should be more than 8 so that hinv prints * out the board name from the NIC string. For values less than * 8 the name of the board needs to be hard coded in a few places. * When bringup started nic names had not standardized and so we * had to hard code. (For people interested in history.)
*/ #define KLTYPE_XTHD (KLCLASS_PSEUDO_GFX | 0x9)
#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) #define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
/* * Generic info structure. This stores common info about a * component.
*/
typedefstruct klinfo_s { /* Generic info */ unsignedchar struct_type; /* type of this structure */ unsignedchar struct_version; /* version of this structure */ unsignedchar flags; /* Enabled, disabled etc */ unsignedchar revision; /* component revision */ unsignedshort diagval; /* result of diagnostics */ unsignedshort diagparm; /* diagnostic parameter */ unsignedchar inventory; /* previous inventory status */
nic_t nic; /* MUst be aligned properly */ unsignedchar physid; /* physical id of component */ unsignedint virtid; /* virtual id as seen by system */ unsignedchar widid; /* Widget id - if applicable */
nasid_t nasid; /* node number - from parent */ char pad1; /* pad out structure. */ char pad2; /* pad out structure. */
COMPONENT *arcs_compt; /* ptr to the arcs struct for ease*/
klconf_off_t errinfo; /* component specific errors */ unsignedshort pad3; /* pci fields have moved over to */ unsignedshort pad4; /* klbri_t */
} klinfo_t ;
/* * The port info in ip27_cfg area translates to a lboart_t in the * KLCONFIG area. But since KLCONFIG does not use pointers, lboart_t * is stored in terms of a nasid and a offset from start of KLCONFIG * area on that nasid.
*/ typedefstruct klport_s {
nasid_t port_nasid; unsignedchar port_flag;
klconf_off_t port_offset;
} klport_t;
typedefstruct klcpu_s { /* CPU */
klinfo_t cpu_info; unsignedshort cpu_prid; /* Processor PRID value */ unsignedshort cpu_fpirr; /* FPU IRR value */ unsignedshort cpu_speed; /* Speed in MHZ */ unsignedshort cpu_scachesz; /* secondary cache size in MB */ unsignedshort cpu_scachespeed;/* secondary cache speed in MHz */
} klcpu_t ;
#define CPU_STRUCT_VERSION 2
typedefstruct klhub_s { /* HUB */
klinfo_t hub_info; unsignedint hub_flags; /* PCFG_HUB_xxx flags */
klport_t hub_port; /* hub is connected to this */
nic_t hub_box_nic; /* nic of containing box */
klconf_off_t hub_mfg_nic; /* MFG NIC string */
u64 hub_speed; /* Speed of hub in HZ */
} klhub_t ;
typedefstruct klmembnk_s { /* MEMORY BANK */
klinfo_t membnk_info; short membnk_memsz; /* Total memory in megabytes */ short membnk_dimm_select; /* bank to physical addr mapping*/ short membnk_bnksz[MD_MEM_BANKS]; /* Memory bank sizes */ short membnk_attr;
} klmembnk_t ;
/* Macros needed to access serial number structure in lboard_t. Hard coded values are necessary since we cannot treat serial number struct as a component without losing compatibility
between prom versions. */
/* XXX - Don't we need the number of ports here?!? */ typedefstruct klrou_s { /* ROUTER */
klinfo_t rou_info ; unsignedint rou_flags ; /* PCFG_ROUTER_xxx flags */
nic_t rou_box_nic ; /* nic of the containing module */
klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
klconf_off_t rou_mfg_nic ; /* MFG NIC string */
u64 rou_vector; /* vector from master node */
} klrou_t ;
/* * Graphics Controller/Device * * (IP27/IO6) Prom versions 6.13 (and 6.5.1 kernels) and earlier * used a couple different structures to store graphics information. * For compatibility reasons, the newer data structure preserves some * of the layout so that fields that are used in the old versions remain * in the same place (with the same info). Determination of what version * of this structure we have is done by checking the cookie field.
*/ #define KLGFX_COOKIE 0x0c0de000
typedefstruct klgfx_s { /* GRAPHICS Device */
klinfo_t gfx_info;
klconf_off_t old_gndevs; /* for compatibility with older proms */
klconf_off_t old_gdoff0; /* for compatibility with older proms */ unsignedint cookie; /* for compatibility with older proms */ unsignedint moduleslot; struct klgfx_s *gfx_next_pipe;
graphics_t gfx_specific;
klconf_off_t pad0; /* for compatibility with older proms */
klconf_off_t gfx_mfg_nic;
} klgfx_t;
/* * NOTE: THis is the max sized kl* structure and is used in klmalloc.c * to allocate space of type COMPONENT. Make sure that if the size of * any other component struct becomes more than this, then redefine * that as the size to be klmalloced.
*/
/* Include launch info in this file itself? TBD */
/* * TBD - Can the ARCS and device driver related info also be included in the * KLCONFIG area. On the IO4PROM, prom device driver info is part of cfgnode_t * structure, viz private to the IO4prom.
*/
/* * TBD - Allocation issues. * * Do we need to Mark off separate heaps for lboard_t, rboard_t, component, * errinfo and allocate from them, or have a single heap and allocate all * structures from it. Debug is easier in the former method since we can * dump all similar structs in one command, but there will be lots of holes, * in memory and max limits are needed for number of structures. * Another way to make it organized, is to have a union of all components * and allocate a aligned chunk of memory greater than the biggest * component.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.