From: Pat Gefre Mostly code pruning - a couple of adds due to the clean up --- 25-akpm/arch/ia64/sn/io/sn2/klconflib.c | 1 25-akpm/arch/ia64/sn/io/sn2/ml_iograph.c | 65 ---- 25-akpm/arch/ia64/sn/io/sn2/shub_intr.c | 2 25-akpm/arch/ia64/sn/kernel/setup.c | 36 ++ 25-akpm/include/asm-ia64/sn/ioerror_handling.h | 42 --- 25-akpm/include/asm-ia64/sn/klconfig.h | 290 +--------------------- 25-akpm/include/asm-ia64/sn/pci/pci_defs.h | 10 25-akpm/include/asm-ia64/sn/sn2/shub.h | 1 25-akpm/include/asm-ia64/sn/sn2/sn_private.h | 1 25-akpm/include/asm-ia64/sn/xtalk/xbow_info.h | 48 --- 25-akpm/include/asm-ia64/sn/xtalk/xtalk_private.h | 6 11 files changed, 63 insertions(+), 439 deletions(-) diff -puN arch/ia64/sn/io/sn2/klconflib.c~sn26 arch/ia64/sn/io/sn2/klconflib.c --- 25/arch/ia64/sn/io/sn2/klconflib.c~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/arch/ia64/sn/io/sn2/klconflib.c Thu Jan 8 15:18:59 2004 @@ -30,6 +30,7 @@ #define DBG(x...) #endif /* DEBUG_KLGRAPH */ +lboard_t *root_lboard[MAX_COMPACT_NODES]; u64 klgraph_addr[MAX_COMPACT_NODES]; static int hasmetarouter; diff -puN arch/ia64/sn/io/sn2/ml_iograph.c~sn26 arch/ia64/sn/io/sn2/ml_iograph.c --- 25/arch/ia64/sn/io/sn2/ml_iograph.c~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/arch/ia64/sn/io/sn2/ml_iograph.c Thu Jan 8 15:18:59 2004 @@ -490,70 +490,6 @@ io_init_xswitch_widgets(vertex_hdl_t xsw } /* - * For each PCI bridge connected to the xswitch, add a link from the - * board's klconfig info to the bridge's hwgraph vertex. This lets - * the FRU analyzer find the bridge without traversing the hardware - * graph and risking hangs. - */ -static void -io_link_xswitch_widgets(vertex_hdl_t xswitchv, cnodeid_t cnodeid) -{ - xwidgetnum_t widgetnum; - char pathname[128]; - vertex_hdl_t vhdl; - nasid_t nasid, peer_nasid; - lboard_t *board; - - - - /* And its connected hub's nasids */ - nasid = COMPACT_TO_NASID_NODEID(cnodeid); - peer_nasid = NODEPDA(cnodeid)->xbow_peer; - - /* - * Look for paths matching "/pci" under xswitchv. - * For every widget, init. its lboard's hwgraph link. If the - * board has a PCI bridge, point the link to it. - */ - for (widgetnum = HUB_WIDGET_ID_MIN; widgetnum <= HUB_WIDGET_ID_MAX; - widgetnum++) { - sprintf(pathname, "%d", widgetnum); - if (hwgraph_traverse(xswitchv, pathname, &vhdl) != - GRAPH_SUCCESS) - continue; - - board = find_lboard_module((lboard_t *)KL_CONFIG_INFO(nasid), - NODEPDA(cnodeid)->geoid); - if (board == NULL && peer_nasid != INVALID_NASID) { - /* - * Try to find the board on our peer - */ - board = find_lboard_module( - (lboard_t *)KL_CONFIG_INFO(peer_nasid), - NODEPDA(cnodeid)->geoid); - } - if (board == NULL) { - printk(KERN_WARNING "Could not find PROM info for vertex 0x%p, " - "FRU analyzer may fail", - (void *)vhdl); - return; - } - - /* Check both buses */ - sprintf(pathname, "%d/"EDGE_LBL_PCIX_0, widgetnum); - if (hwgraph_traverse(xswitchv, pathname, &vhdl) == GRAPH_SUCCESS) - board->brd_graph_link = vhdl; - else { - sprintf(pathname, "%d/"EDGE_LBL_PCIX_1, widgetnum); - if (hwgraph_traverse(xswitchv, pathname, &vhdl) == GRAPH_SUCCESS) - board->brd_graph_link = vhdl; - else - board->brd_graph_link = GRAPH_VERTEX_NONE; - } - } -} - -/* * Initialize all I/O on the specified node. */ static void @@ -724,7 +660,6 @@ io_init_node(cnodeid_t cnodeid) /* Now both nodes can safely inititialize widgets */ io_init_xswitch_widgets(switchv, cnodeid); - io_link_xswitch_widgets(switchv, cnodeid); DBG("\nio_init_node: DONE INITIALIZED ALL I/O FOR CNODEID %d\n\n", cnodeid); } diff -puN arch/ia64/sn/io/sn2/shub_intr.c~sn26 arch/ia64/sn/io/sn2/shub_intr.c --- 25/arch/ia64/sn/io/sn2/shub_intr.c~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/arch/ia64/sn/io/sn2/shub_intr.c Thu Jan 8 15:18:59 2004 @@ -61,7 +61,6 @@ do_hub_intr_alloc(vertex_hdl_t dev, iopaddr_t xtalk_addr; struct xtalk_intr_s *xtalk_info; xwidget_info_t xwidget_info; - ilvl_t intr_swlevel = 0; cpu = intr_heuristic(dev, -1, &vector); if (cpu == CPU_NONE) { @@ -94,7 +93,6 @@ do_hub_intr_alloc(vertex_hdl_t dev, xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info); } - intr_hdl->i_swlevel = intr_swlevel; intr_hdl->i_cpuid = cpu; intr_hdl->i_bit = vector; intr_hdl->i_flags |= HUB_INTR_IS_ALLOCED; diff -puN arch/ia64/sn/kernel/setup.c~sn26 arch/ia64/sn/kernel/setup.c --- 25/arch/ia64/sn/kernel/setup.c~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/arch/ia64/sn/kernel/setup.c Thu Jan 8 15:18:59 2004 @@ -69,6 +69,8 @@ u64 sn_partition_serial_number; short physical_node_map[MAX_PHYSNODE_ID]; +int numionodes; + /* * This is the address of the RRegs in the HSpace of the global * master. It is used by a hack in serial.c (serial_[in|out], @@ -302,6 +304,7 @@ void sn_init_pdas(char **cmdline_p) { cnodeid_t cnode; + void scan_for_ionodes(void); /* * Make sure that the PDA fits entirely in the same page as the @@ -314,6 +317,9 @@ sn_init_pdas(char **cmdline_p) for (cnode=0; cnodecnodeid_to_nasid_table[cnode] = pxm_to_nasid(nid_to_pxm_map[cnode]); + numionodes = numnodes; + scan_for_ionodes(); + /* * Allocate & initalize the nodepda for each node. */ @@ -418,3 +424,33 @@ sn_cpu_init(void) bte_init_cpu(); } + +/* + * Scan klconfig for ionodes. Add the nasids to the + * physical_node_map and the pda and increment numionodes. + */ + +void +scan_for_ionodes(void) { + int nasid = 0; + lboard_t *brd; + + /* Setup ionodes with memory */ + for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid +=2) { + u64 klgraph_header; + cnodeid_t cnodeid; + + if (physical_node_map[nasid] == -1) + continue; + + klgraph_header = cnodeid = -1; + klgraph_header = ia64_sn_get_klconfig_addr(nasid); + if (klgraph_header <= 0) + BUG(); /* All nodes must have klconfig tables! */ + cnodeid = nasid_to_cnodeid(nasid); + root_lboard[cnodeid] = (lboard_t *) + NODE_OFFSET_TO_LBOARD( (nasid), + ((kl_config_hdr_t *)(klgraph_header))-> + ch_board_info); + } +} diff -puN include/asm-ia64/sn/ioerror_handling.h~sn26 include/asm-ia64/sn/ioerror_handling.h --- 25/include/asm-ia64/sn/ioerror_handling.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/ioerror_handling.h Thu Jan 8 15:18:59 2004 @@ -203,12 +203,6 @@ enum error_priority_e { typedef uint64_t error_priority_t; -/* Error state interfaces */ -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) -extern error_return_code_t error_state_set(vertex_hdl_t,error_state_t); -extern error_state_t error_state_get(vertex_hdl_t); -#endif - /* Error action interfaces */ extern error_return_code_t error_action_set(vertex_hdl_t, @@ -231,42 +225,6 @@ hwgraph_info_get_LBL(v, INFO_LBL_ERROR_S #define v_error_skip_env_clear(v) \ hwgraph_info_remove_LBL(v, INFO_LBL_ERROR_SKIP_ENV, 0) -/* REFERENCED */ -#if defined(CONFIG_SGI_IO_ERROR_HANDLING) - -inline static int -error_skip_point_mark(vertex_hdl_t v) -{ - label_t *error_env = NULL; - int code = 0; - - /* Check if we have a valid hwgraph vertex */ -#ifdef LATER - if (!dev_is_vertex(v)) - return(code); -#endif - - /* There is no error jump buffer for this device vertex. Allocate - * one. - */ - if (v_error_skip_env_get(v, error_env) != GRAPH_SUCCESS) { - error_env = kmalloc(sizeof(label_t), GFP_KERNEL); - /* Unable to allocate memory for jum buffer. This should - * be a very rare occurrence. - */ - if (!error_env) - return(-1); - memset(error_env, 0, sizeof(label_t)); - /* Store the jump buffer information on the vertex.*/ - if (v_error_skip_env_set(v, error_env, 0) != GRAPH_SUCCESS) - return(-2); - } - ASSERT(v_error_skip_env_get(v, error_env) == GRAPH_SUCCESS); - code = setjmp(*error_env); - return(code); -} -#endif /* CONFIG_SGI_IO_ERROR_HANDLING */ - typedef uint64_t counter_t; extern counter_t error_retry_count_get(vertex_hdl_t); diff -puN include/asm-ia64/sn/klconfig.h~sn26 include/asm-ia64/sn/klconfig.h --- 25/include/asm-ia64/sn/klconfig.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/klconfig.h Thu Jan 8 15:18:59 2004 @@ -78,11 +78,6 @@ typedef s32 klconf_off_t; #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 @@ -131,41 +126,13 @@ typedef struct kl_config_hdr { #define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid))) -#define KL_CONFIG_INFO_OFFSET(_nasid) \ - (KL_CONFIG_HDR(_nasid)->ch_board_info) -#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \ - (KL_CONFIG_HDR(_nasid)->ch_board_info = (_off)) - -#ifndef __ia64 -#define KL_CONFIG_INFO(_nasid) \ - (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ? \ - NODE_OFFSET_TO_K0((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \ - 0) -#else -#define NODE_OFFSET_TO_LBOARD(nasid,off) (lboard_t*)(NODE_CAC_BASE(nasid) + (off)) - -#define KL_CONFIG_INFO(_nasid) \ - (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ? \ - NODE_OFFSET_TO_LBOARD((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \ - NULL) -#endif /* __ia64 */ - -#define KL_CONFIG_MAGIC(_nasid) (KL_CONFIG_HDR(_nasid)->ch_magic) - -#define KL_CONFIG_CHECK_MAGIC(_nasid) \ - (KL_CONFIG_HDR(_nasid)->ch_magic == KLCFGINFO_MAGIC) +#define NODE_OFFSET_TO_LBOARD(nasid,off) (lboard_t*)(NODE_CAC_BASE(nasid) + (off)) -#define KL_CONFIG_HDR_INIT_MAGIC(_nasid) \ - (KL_CONFIG_HDR(_nasid)->ch_magic = KLCFGINFO_MAGIC) +#define KL_CONFIG_INFO(_nasid) root_lboard[nasid_to_cnodeid(_nasid)] /* --- New Macros for the changed kl_config_hdr_t structure --- */ -#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\ - ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off))) - -#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n)) - #define PTR_CH_CONS_INFO(_k) ((console_t *)\ ((__psunsigned_t)_k + (_k->ch_cons_off))) @@ -173,12 +140,6 @@ typedef struct kl_config_hdr { /* ------------------------------------------------------------- */ -#define KL_CONFIG_INFO_START(_nasid) \ - (klconf_off_t)(KLCONFIG_OFFSET(_nasid) + sizeof(kl_config_hdr_t)) - -#define KL_CONFIG_BOARD_NASID(_brd) ((_brd)->brd_nasid) -#define KL_CONFIG_BOARD_SET_NEXT(_brd, _off) ((_brd)->brd_next = (_off)) - #define KL_CONFIG_DUPLICATE_BOARD(_brd) ((_brd)->brd_flags & DUPLICATE_BOARD) #define XBOW_PORT_TYPE_HUB(_xbowp, _link) \ @@ -195,9 +156,6 @@ typedef struct kl_config_hdr { #define XBOW_PORT_HUB 0x2 #define XBOW_PORT_ENABLE 0x4 -#define SN0_PORT_FENCE_SHFT 0 -#define SN0_PORT_FENCE_MASK (1 << SN0_PORT_FENCE_SHFT) - /* * 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 @@ -291,15 +249,7 @@ typedef struct kl_config_hdr { */ /* - * 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 + * BOARD classes */ #define KLCLASS_MASK 0xf0 @@ -337,14 +287,6 @@ typedef struct kl_config_hdr { #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0) #define KLTYPE_SNIA (KLCLASS_CPU | 0x1) -#define KLTYPE_WEIRDIO (KLCLASS_IOBRICK | 0x0) -#define KLTYPE_BASEIO (KLCLASS_IO | 0x1) /* IOC3, SuperIO, Bridge, SCSI */ -#define KLTYPE_ETHERNET (KLCLASS_IO | 0x3) -#define KLTYPE_FDDI (KLCLASS_IO | 0x4) -#define KLTYPE_FC (KLCLASS_IO | 0x9) -#define KLTYPE_GSN_A (KLCLASS_IO | 0xC) /* Main GSN board */ -#define KLTYPE_GSN_B (KLCLASS_IO | 0xD) /* Auxiliary GSN board */ - #define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1) #define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3) #define KLTYPE_REPEATER_ROUTER (KLCLASS_ROUTER | 0x4) @@ -357,16 +299,12 @@ typedef struct kl_config_hdr { #define KLTYPE_OPUSBRICK (KLCLASS_IOBRICK | 0x9) -#define KLTYPE_PBRICK_BRIDGE KLTYPE_PBRICK - /* 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 KLTYPE_UNKNOWN (KLCLASS_UNKNOWN | 0xf) #define KLTYPE(_x) ((_x) & KLTYPE_MASK) @@ -377,13 +315,8 @@ typedef struct kl_config_hdr { #define MAX_COMPTS_PER_BRD 24 -#define LOCAL_BOARD 1 -#define REMOTE_BOARD 2 - -#define LBOARD_STRUCT_VERSION 2 - typedef struct lboard_s { - klconf_off_t brd_next; /* Next BOARD */ + klconf_off_t brd_next_any; /* Next BOARD */ unsigned char struct_type; /* type of structure, local or remote */ unsigned char brd_type; /* type+class */ unsigned char brd_sversion; /* version of this structure */ @@ -403,15 +336,16 @@ typedef struct lboard_s { klconf_off_t brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */ klconf_off_t brd_errinfo; /* Board's error information */ struct lboard_s *brd_parent; /* Logical parent for this brd */ - vertex_hdl_t brd_graph_link; /* vertex hdl to connect extern compts */ + char pad0[4]; confidence_t brd_confidence; /* confidence that the board is bad */ nasid_t brd_owner; /* who owns this board */ unsigned char brd_nic_flags; /* To handle 8 more NICs */ - char pad[32]; /* future expansion */ + char pad1[24]; /* future expansion */ char brd_name[32]; + nasid_t brd_next_same_host; /* host of next brd w/same nasid */ + klconf_off_t brd_next_same; /* Next BOARD with same nasid */ } lboard_t; - /* * Make sure we pass back the calias space address for local boards. * klconfig board traversal and error structure extraction defines. @@ -421,33 +355,20 @@ typedef struct lboard_s { #define KLCF_CLASS(_brd) KLCLASS((_brd)->brd_type) #define KLCF_TYPE(_brd) KLTYPE((_brd)->brd_type) -#define KLCF_REMOTE(_brd) (((_brd)->struct_type & LOCAL_BOARD) ? 0 : 1) #define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) #define KLCF_MODULE_ID(_brd) ((_brd)->brd_module) -#ifndef __ia64 -#define KLCF_NEXT(_brd) ((_brd)->brd_next ? (lboard_t *)((_brd)->brd_next): NULL) -#define KLCF_COMP(_brd, _ndx) \ - (klinfo_t *)(NODE_OFFSET_TO_K0(NASID_GET(_brd), \ - (_brd)->brd_compts[(_ndx)])) -#define KLCF_COMP_ERROR(_brd, _comp) \ - (NODE_OFFSET_TO_K0(NASID_GET(_brd), (_comp)->errinfo)) - -#else - #define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off)) #define KLCF_NEXT(_brd) \ - ((_brd)->brd_next ? \ - (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next)): NULL) + ((_brd)->brd_next_same ? \ + (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL) +#define KLCF_NEXT_ANY(_brd) \ + ((_brd)->brd_next_any ? \ + (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL) #define KLCF_COMP(_brd, _ndx) \ ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \ (NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)]))) -#define KLCF_COMP_ERROR(_brd, _comp) \ - (NODE_OFFSET_TO_K0(NASID_GET(_brd), (_comp)->errinfo)) - -#endif /* __ia64 */ - #define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) #define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */ @@ -496,36 +417,14 @@ typedef struct klinfo_s { #define KLSTRUCT_MEMBNK 3 #define KLSTRUCT_XBOW 4 #define KLSTRUCT_BRI 5 -#define KLSTRUCT_IOC3 6 -#define KLSTRUCT_PCI 7 -#define KLSTRUCT_VME 8 #define KLSTRUCT_ROU 9 #define KLSTRUCT_GFX 10 #define KLSTRUCT_SCSI 11 -#define KLSTRUCT_FDDI 12 -#define KLSTRUCT_MIO 13 #define KLSTRUCT_DISK 14 -#define KLSTRUCT_TAPE 15 #define KLSTRUCT_CDROM 16 -#define KLSTRUCT_HUB_UART 17 -#define KLSTRUCT_IOC3ENET 18 -#define KLSTRUCT_IOC3UART 19 -#define KLSTRUCT_UNUSED 20 /* XXX UNUSED */ -#define KLSTRUCT_IOC3PCKM 21 -#define KLSTRUCT_RAD 22 -#define KLSTRUCT_HUB_TTY 23 -#define KLSTRUCT_IOC3_TTY 24 - -/* Early Access IO proms are compatible - only with KLSTRUCT values upto 24. */ #define KLSTRUCT_FIBERCHANNEL 25 #define KLSTRUCT_MOD_SERIAL_NUM 26 -#define KLSTRUCT_IOC3MS 27 -#define KLSTRUCT_TPU 28 -#define KLSTRUCT_GSN_A 29 -#define KLSTRUCT_GSN_B 30 -#define KLSTRUCT_XTHD 31 #define KLSTRUCT_QLFIBRE 32 #define KLSTRUCT_1394 33 #define KLSTRUCT_USB 34 @@ -535,36 +434,14 @@ typedef struct klinfo_s { #define KLSTRUCT_PEBRICK 38 #define KLSTRUCT_GIGE 39 #define KLSTRUCT_IDE 40 +#define KLSTRUCT_IOC4 41 +#define KLSTRUCT_IOC4UART 42 +#define KLSTRUCT_IOC4_TTY 43 +#define KLSTRUCT_IOC4PCKM 44 +#define KLSTRUCT_IOC4MS 45 +#define KLSTRUCT_IOC4_ATA 46 +#define KLSTRUCT_PCIGFX 47 -/* - * These are the indices of various components within a lboard structure. - */ - -#define IP27_CPU0_INDEX 0 -#define IP27_CPU1_INDEX 1 -#define IP27_HUB_INDEX 2 -#define IP27_MEM_INDEX 3 - -#define BASEIO_BRIDGE_INDEX 0 -#define BASEIO_IOC3_INDEX 1 -#define BASEIO_SCSI1_INDEX 2 -#define BASEIO_SCSI2_INDEX 3 - -#define MIDPLANE_XBOW_INDEX 0 -#define ROUTER_COMPONENT_INDEX 0 - -#define CH4SCSI_BRIDGE_INDEX 0 - -/* Info holders for various hardware components */ - -typedef u64 *pci_t; -typedef u64 *vmeb_t; -typedef u64 *vmed_t; -typedef u64 *fddi_t; -typedef u64 *scsi_t; -typedef u64 *mio_t; -typedef u64 *graphics_t; -typedef u64 *router_t; /* * The port info in ip27_cfg area translates to a lboart_t in the @@ -621,14 +498,6 @@ typedef struct klmembnk_s { /* MEMORY unsigned long pad; } klmembnk_t ; -#define KLCONFIG_MEMBNK_SIZE(_info, _bank) \ - ((_info)->membnk_bnksz[(_bank)]) - - -#define MEMBNK_PREMIUM 1 -#define KLCONFIG_MEMBNK_PREMIUM(_info, _bank) \ - ((_info)->membnk_attr & (MEMBNK_PREMIUM << (_bank))) - #define MAX_SERIAL_NUM_SIZE 10 typedef struct klmod_serial_num_s { @@ -671,42 +540,12 @@ typedef struct klbri_s { klinfo_t bri_info ; unsigned char bri_eprominfo ; /* IO6prom connected to bridge */ unsigned char bri_bustype ; /* PCI/VME BUS bridge/GIO */ - pci_t pci_specific ; /* PCI Board config info */ + u64 *pci_specific ; /* PCI Board config info */ klpci_device_t bri_devices[MAX_PCI_DEVS] ; /* PCI IDs */ klconf_off_t bri_mfg_nic ; unsigned long pad; } klbri_t ; -#define MAX_IOC3_TTY 2 - -typedef struct klioc3_s { /* IOC3 */ - klinfo_t ioc3_info ; - unsigned char ioc3_ssram ; /* Info about ssram */ - unsigned char ioc3_nvram ; /* Info about nvram */ - klinfo_t ioc3_superio ; /* Info about superio */ - klconf_off_t ioc3_tty_off ; - klinfo_t ioc3_enet ; - klconf_off_t ioc3_enet_off ; - klconf_off_t ioc3_kbd_off ; - unsigned long pad; -} klioc3_t ; - -#define MAX_VME_SLOTS 8 - -typedef struct klvmeb_s { /* VME BRIDGE - PCI CTLR */ - klinfo_t vmeb_info ; - vmeb_t vmeb_specific ; - klconf_off_t vmeb_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */ - unsigned long pad; -} klvmeb_t ; - -typedef struct klvmed_s { /* VME DEVICE - VME BOARD */ - klinfo_t vmed_info ; - vmed_t vmed_specific ; - klconf_off_t vmed_brdinfo[MAX_VME_SLOTS] ; /* VME Board config info */ - unsigned long pad; -} klvmed_t ; - #define ROUTER_VECTOR_VERS 2 /* XXX - Don't we need the number of ports here?!? */ @@ -745,23 +584,6 @@ typedef struct klgfx_s { /* GRAPHICS De unsigned long pad; } klgfx_t; -typedef struct klxthd_s { - klinfo_t xthd_info ; - klconf_off_t xthd_mfg_nic ; /* MFG NIC string */ - unsigned long pad; -} klxthd_t ; - -typedef struct kltpu_s { /* TPU board */ - klinfo_t tpu_info ; - klconf_off_t tpu_mfg_nic ; /* MFG NIC string */ - unsigned long pad; -} kltpu_t ; - -typedef struct klgsn_s { /* GSN board */ - klinfo_t gsn_info ; - klconf_off_t gsn_mfg_nic ; /* MFG NIC string */ -} klgsn_t ; - #define MAX_SCSI_DEVS 16 /* @@ -799,11 +621,9 @@ typedef struct klttydev_s { unsigned long pad; } klttydev_t ; -typedef struct klenetdev_s { /* ENET device */ - klinfo_t enetdev_info ; - struct net_data *enetdev_cfg ; /* driver fills up this */ - unsigned long pad; -} klenetdev_t ; +typedef struct klpcigfx_s { /* PCI GFX */ + klinfo_t gfx_info ; +} klpcigfx_t ; typedef struct klkbddev_s { /* KBD device */ klinfo_t kbddev_info ; @@ -817,21 +637,6 @@ typedef struct klmsdev_s { unsigned long pad; } klmsdev_t ; -#define MAX_FDDI_DEVS 10 /* XXX Is this true */ - -typedef struct klfddi_s { /* FDDI */ - klinfo_t fddi_info ; - fddi_t fddi_specific ; - klconf_off_t fddi_devinfo[MAX_FDDI_DEVS] ; - unsigned long pad; -} klfddi_t ; - -typedef struct klmio_s { /* MIO */ - klinfo_t mio_info ; - mio_t mio_specific ; - unsigned long pad; -} klmio_t ; - /* * USB info */ @@ -864,54 +669,9 @@ typedef union kldev_s { /* for devi klkbddev_t kc_kbd_dev ; } kldev_t ; -/* Data structure interface routines. TBD */ - -/* 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 sepatate 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. - */ - -typedef union { - lboard_t *lbinfo ; -} biptr_t ; - - -#define BRI_PER_XBOW 6 -#define PCI_PER_BRI 8 -#define DEV_PER_PCI 16 - - -/* Virtual dipswitch values (starting from switch "7"): */ - -#define VDS_NOGFX 0x8000 /* Don't enable gfx and autoboot */ -#define VDS_NOMP 0x100 /* Don't start slave processors */ -#define VDS_MANUMODE 0x80 /* Manufacturing mode */ -#define VDS_NOARB 0x40 /* No bootmaster arbitration */ -#define VDS_PODMODE 0x20 /* Go straight to POD mode */ -#define VDS_NO_DIAGS 0x10 /* Don't run any diags after BM arb */ -#define VDS_DEFAULTS 0x08 /* Use default environment values */ -#define VDS_NOMEMCLEAR 0x04 /* Don't run mem cfg code */ -#define VDS_2ND_IO4 0x02 /* Boot from the second IO4 */ -#define VDS_DEBUG_PROM 0x01 /* Print PROM debugging messages */ - /* external declarations of Linux kernel functions. */ +extern lboard_t *root_lboard[]; extern lboard_t *find_lboard(lboard_t *start, unsigned char type); extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type); extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type); diff -puN include/asm-ia64/sn/pci/pci_defs.h~sn26 include/asm-ia64/sn/pci/pci_defs.h --- 25/include/asm-ia64/sn/pci/pci_defs.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/pci/pci_defs.h Thu Jan 8 15:18:59 2004 @@ -275,16 +275,6 @@ extern void pci_write(void * address, in #define CFG1_DEVICE_SHIFT 11 #define CFG1_BUS_SHIFT 16 -#ifdef CONFIG_SGI_IP32 - /* Definitions related to IP32 PCI Bridge policy - * XXX- should probaly be moved to a mace-specific header - */ -#define PCI_CONFIG_BITS 0xfe0085ff -#define PCI_CONTROL_MRMRA_ENABLE 0x00000800 -#define PCI_FIRST_IO_ADDR 0x1000 -#define PCI_IO_MAP_INCR 0x1000 -#endif /* CONFIG_SGI_IP32 */ - /* * Class codes */ diff -puN include/asm-ia64/sn/sn2/shub.h~sn26 include/asm-ia64/sn/sn2/shub.h --- 25/include/asm-ia64/sn/sn2/shub.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/sn2/shub.h Thu Jan 8 15:18:59 2004 @@ -1,5 +1,4 @@ /* - * * 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. diff -puN include/asm-ia64/sn/sn2/sn_private.h~sn26 include/asm-ia64/sn/sn2/sn_private.h --- 25/include/asm-ia64/sn/sn2/sn_private.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/sn2/sn_private.h Thu Jan 8 15:18:59 2004 @@ -153,7 +153,6 @@ struct hub_dmamap_s { */ struct hub_intr_s { struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */ - ilvl_t i_swlevel; /* software level for blocking intr */ cpuid_t i_cpuid; /* which cpu */ int i_bit; /* which bit */ int i_flags; diff -puN include/asm-ia64/sn/xtalk/xbow_info.h~sn26 include/asm-ia64/sn/xtalk/xbow_info.h --- 25/include/asm-ia64/sn/xtalk/xbow_info.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/xtalk/xbow_info.h Thu Jan 8 15:18:59 2004 @@ -11,24 +11,6 @@ #include #define XBOW_PERF_MODES 0x03 -#define XBOW_PERF_COUNTERS 0x02 - -#define XBOW_MONITOR_NONE 0x00 -#define XBOW_MONITOR_SRC_LINK 0x01 -#define XBOW_MONITOR_DEST_LINK 0x02 -#define XBOW_MONITOR_INP_PKT 0x03 -#define XBOW_MONITOR_MULTIPLEX 0x04 - -#define XBOW_LINK_MULTIPLEX 0x20 - -#define XBOW_PERF_TIMEOUT 4 -#define XBOW_STATS_TIMEOUT HZ - -typedef struct xbow_perf_link { - uint64_t xlp_cumulative[XBOW_PERF_MODES]; - unsigned char xlp_link_alive; -} xbow_perf_link_t; - typedef struct xbow_link_status { uint64_t rx_err_count; @@ -36,32 +18,4 @@ typedef struct xbow_link_status { } xbow_link_status_t; - -typedef struct xbow_perf { - uint32_t xp_current; - unsigned char xp_link; - unsigned char xp_mode; - unsigned char xp_curlink; - unsigned char xp_curmode; - volatile uint32_t *xp_perf_reg; -} xbow_perf_t; - -extern void xbow_update_perf_counters(vertex_hdl_t); -extern xbow_perf_link_t *xbow_get_perf_counters(vertex_hdl_t); -extern int xbow_enable_perf_counter(vertex_hdl_t, int, int, int); - -#define XBOWIOC_PERF_ENABLE 1 -#define XBOWIOC_PERF_DISABLE 2 -#define XBOWIOC_PERF_GET 3 -#define XBOWIOC_LLP_ERROR_ENABLE 4 -#define XBOWIOC_LLP_ERROR_DISABLE 5 -#define XBOWIOC_LLP_ERROR_GET 6 - - -struct xbow_perfarg_t { - int link; - int mode; - int counter; -}; - -#endif /* _ASM_SN_XTALK_XBOW_INFO_H */ +#endif /* _ASM_IA64_SN_XTALK_XBOW_INFO_H */ diff -puN include/asm-ia64/sn/xtalk/xtalk_private.h~sn26 include/asm-ia64/sn/xtalk/xtalk_private.h --- 25/include/asm-ia64/sn/xtalk/xtalk_private.h~sn26 Thu Jan 8 15:18:59 2004 +++ 25-akpm/include/asm-ia64/sn/xtalk/xtalk_private.h Thu Jan 8 15:18:59 2004 @@ -51,12 +51,6 @@ struct xtalk_intr_s { /* * Xtalk interrupt handler structure access functions */ -#define xtalk_intr_arg(xt) ((xt)->xi_sfarg) - -#define xwidget_hwid_is_sn0_xswitch(_hwid) \ - (((_hwid)->part_num == XBOW_WIDGET_PART_NUM ) && \ - ((_hwid)->mfg_num == XBOW_WIDGET_MFGR_NUM )) - #define xwidget_hwid_is_sn1_xswitch(_hwid) \ (((_hwid)->part_num == XXBOW_WIDGET_PART_NUM || \ (_hwid)->part_num == PXBOW_WIDGET_PART_NUM) && \ _