initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-ia64 / sn / klconfig.h
blob781b0e00303a8b7613186c81cdeeab08abb23ba8
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Derived from IRIX <sys/SN/klconfig.h>.
8 * Copyright (C) 1992-1997,1999,2001-2003 Silicon Graphics, Inc. All Rights Reserved.
9 * Copyright (C) 1999 by Ralf Baechle
11 #ifndef _ASM_IA64_SN_KLCONFIG_H
12 #define _ASM_IA64_SN_KLCONFIG_H
15 * The KLCONFIG structures store info about the various BOARDs found
16 * during Hardware Discovery. In addition, it stores info about the
17 * components found on the BOARDs.
21 * WARNING:
22 * Certain assembly language routines (notably xxxxx.s) in the IP27PROM
23 * will depend on the format of the data structures in this file. In
24 * most cases, rearranging the fields can seriously break things.
25 * Adding fields in the beginning or middle can also break things.
26 * Add fields if necessary, to the end of a struct in such a way
27 * that offsets of existing fields do not change.
30 #include <linux/types.h>
31 #include <asm/sn/types.h>
32 #include <asm/sn/slotnum.h>
33 #include <asm/sn/router.h>
34 #include <asm/sn/sgi.h>
35 #include <asm/sn/addrs.h>
36 #include <asm/sn/vector.h>
37 #include <asm/sn/xtalk/xbow.h>
38 #include <asm/sn/xtalk/xtalk.h>
39 #include <asm/sn/kldir.h>
40 #include <asm/sn/sn_fru.h>
41 #include <asm/sn/sn2/shub_md.h>
42 #include <asm/sn/geo.h>
44 #define KLCFGINFO_MAGIC 0xbeedbabe
46 typedef s32 klconf_off_t;
48 #define MAX_MODULE_ID 255
49 #define SIZE_PAD 4096 /* 4k padding for structures */
50 /*
51 * 1 NODE brick, 3 Router bricks (1 local, 1 meta, 1 repeater),
52 * 6 XIO Widgets, 1 Xbow, 1 gfx
54 #define MAX_SLOTS_PER_NODE (1 + 3 + 6 + 1 + 1)
56 /* XXX if each node is guranteed to have some memory */
58 #define MAX_PCI_DEVS 8
60 /* lboard_t->brd_flags fields */
61 /* All bits in this field are currently used. Try the pad fields if
62 you need more flag bits */
64 #define ENABLE_BOARD 0x01
65 #define FAILED_BOARD 0x02
66 #define DUPLICATE_BOARD 0x04 /* Boards like midplanes/routers which
67 are discovered twice. Use one of them */
68 #define VISITED_BOARD 0x08 /* Used for compact hub numbering. */
69 #define LOCAL_MASTER_IO6 0x10 /* master io6 for that node */
70 #define KLTYPE_IOBRICK_XBOW (KLCLASS_MIDPLANE | 0x2)
72 /* klinfo->flags fields */
74 #define KLINFO_ENABLE 0x01 /* This component is enabled */
75 #define KLINFO_FAILED 0x02 /* This component failed */
76 #define KLINFO_DEVICE 0x04 /* This component is a device */
77 #define KLINFO_VISITED 0x08 /* This component has been visited */
78 #define KLINFO_CONTROLLER 0x10 /* This component is a device controller */
79 #define KLINFO_INSTALL 0x20 /* Install a driver */
80 #define KLINFO_HEADLESS 0x40 /* Headless (or hubless) component */
82 /* Structures to manage various data storage areas */
83 /* The numbers must be contiguous since the array index i
84 is used in the code to allocate various areas.
87 #define BOARD_STRUCT 0
88 #define COMPONENT_STRUCT 1
89 #define ERRINFO_STRUCT 2
90 #define KLMALLOC_TYPE_MAX (ERRINFO_STRUCT + 1)
91 #define DEVICE_STRUCT 3
94 typedef struct console_s {
95 unsigned long uart_base;
96 unsigned long config_base;
97 unsigned long memory_base;
98 short baud;
99 short flag;
100 int type;
101 nasid_t nasid;
102 char wid;
103 char npci;
104 nic_t baseio_nic;
105 } console_t;
107 typedef struct klc_malloc_hdr {
108 klconf_off_t km_base;
109 klconf_off_t km_limit;
110 klconf_off_t km_current;
111 } klc_malloc_hdr_t;
113 /* Functions/macros needed to use this structure */
115 typedef struct kl_config_hdr {
116 u64 ch_magic; /* set this to KLCFGINFO_MAGIC */
117 u32 ch_version; /* structure version number */
118 klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */
119 klconf_off_t ch_cons_off; /* offset of ch_cons */
120 klconf_off_t ch_board_info; /* the link list of boards */
121 console_t ch_cons_info; /* address info of the console */
122 klc_malloc_hdr_t ch_malloc_hdr[KLMALLOC_TYPE_MAX];
123 confidence_t ch_sw_belief; /* confidence that software is bad*/
124 confidence_t ch_sn0net_belief; /* confidence that sn0net is bad */
125 } kl_config_hdr_t;
128 #define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
130 #define NODE_OFFSET_TO_LBOARD(nasid,off) (lboard_t*)(NODE_CAC_BASE(nasid) + (off))
132 #define KL_CONFIG_INFO(_nasid) root_lboard[nasid_to_cnodeid(_nasid)]
134 /* --- New Macros for the changed kl_config_hdr_t structure --- */
136 #define PTR_CH_CONS_INFO(_k) ((console_t *)\
137 ((unsigned long)_k + (_k->ch_cons_off)))
139 #define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
141 /* ------------------------------------------------------------- */
143 #define KL_CONFIG_DUPLICATE_BOARD(_brd) ((_brd)->brd_flags & DUPLICATE_BOARD)
145 #define XBOW_PORT_TYPE_HUB(_xbowp, _link) \
146 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_HUB)
147 #define XBOW_PORT_TYPE_IO(_xbowp, _link) \
148 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_IO)
150 #define XBOW_PORT_IS_ENABLED(_xbowp, _link) \
151 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_ENABLE)
152 #define XBOW_PORT_NASID(_xbowp, _link) \
153 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_nasid)
155 #define XBOW_PORT_IO 0x1
156 #define XBOW_PORT_HUB 0x2
157 #define XBOW_PORT_ENABLE 0x4
160 * The KLCONFIG area is organized as a LINKED LIST of BOARDs. A BOARD
161 * can be either 'LOCAL' or 'REMOTE'. LOCAL means it is attached to
162 * the LOCAL/current NODE. REMOTE means it is attached to a different
163 * node.(TBD - Need a way to treat ROUTER boards.)
165 * There are 2 different structures to represent these boards -
166 * lboard - Local board, rboard - remote board. These 2 structures
167 * can be arbitrarily mixed in the LINKED LIST of BOARDs. (Refer
168 * Figure below). The first byte of the rboard or lboard structure
169 * is used to find out its type - no unions are used.
170 * If it is a lboard, then the config info of this board will be found
171 * on the local node. (LOCAL NODE BASE + offset value gives pointer to
172 * the structure.
173 * If it is a rboard, the local structure contains the node number
174 * and the offset of the beginning of the LINKED LIST on the remote node.
175 * The details of the hardware on a remote node can be built locally,
176 * if required, by reading the LINKED LIST on the remote node and
177 * ignoring all the rboards on that node.
179 * The local node uses the REMOTE NODE NUMBER + OFFSET to point to the
180 * First board info on the remote node. The remote node list is
181 * traversed as the local list, using the REMOTE BASE ADDRESS and not
182 * the local base address and ignoring all rboard values.
185 KLCONFIG
187 +------------+ +------------+ +------------+ +------------+
188 | lboard | +-->| lboard | +-->| rboard | +-->| lboard |
189 +------------+ | +------------+ | +------------+ | +------------+
190 | board info | | | board info | | |errinfo,bptr| | | board info |
191 +------------+ | +------------+ | +------------+ | +------------+
192 | offset |--+ | offset |--+ | offset |--+ |offset=NULL |
193 +------------+ +------------+ +------------+ +------------+
196 +------------+
197 | board info |
198 +------------+ +--------------------------------+
199 | compt 1 |------>| type, rev, diaginfo, size ... | (CPU)
200 +------------+ +--------------------------------+
201 | compt 2 |--+
202 +------------+ | +--------------------------------+
203 | ... | +--->| type, rev, diaginfo, size ... | (MEM_BANK)
204 +------------+ +--------------------------------+
205 | errinfo |--+
206 +------------+ | +--------------------------------+
207 +--->|r/l brd errinfo,compt err flags |
208 +--------------------------------+
211 * Each BOARD consists of COMPONENTs and the BOARD structure has
212 * pointers (offsets) to its COMPONENT structure.
213 * The COMPONENT structure has version info, size and speed info, revision,
214 * error info and the NIC info. This structure can accommodate any
215 * BOARD with arbitrary COMPONENT composition.
217 * The ERRORINFO part of each BOARD has error information
218 * that describes errors about the BOARD itself. It also has flags to
219 * indicate the COMPONENT(s) on the board that have errors. The error
220 * information specific to the COMPONENT is present in the respective
221 * COMPONENT structure.
223 * The ERRORINFO structure is also treated like a COMPONENT, ie. the
224 * BOARD has pointers(offset) to the ERRORINFO structure. The rboard
225 * structure also has a pointer to the ERRORINFO structure. This is
226 * the place to store ERRORINFO about a REMOTE NODE, if the HUB on
227 * that NODE is not working or if the REMOTE MEMORY is BAD. In cases where
228 * only the CPU of the REMOTE NODE is disabled, the ERRORINFO pointer can
229 * be a NODE NUMBER, REMOTE OFFSET combination, pointing to error info
230 * which is present on the REMOTE NODE.(TBD)
231 * REMOTE ERRINFO can be stored on any of the nearest nodes
232 * or on all the nearest nodes.(TBD)
233 * Like BOARD structures, REMOTE ERRINFO structures can be built locally
234 * using the rboard errinfo pointer.
236 * In order to get useful information from this Data organization, a set of
237 * interface routines are provided (TBD). The important thing to remember while
238 * manipulating the structures, is that, the NODE number information should
239 * be used. If the NODE is non-zero (remote) then each offset should
240 * be added to the REMOTE BASE ADDR else it should be added to the LOCAL BASE ADDR.
241 * This includes offsets for BOARDS, COMPONENTS and ERRORINFO.
243 * Note that these structures do not provide much info about connectivity.
244 * That info will be part of HWGRAPH, which is an extension of the cfg_t
245 * data structure. (ref IP27prom/cfg.h) It has to be extended to include
246 * the IO part of the Network(TBD).
248 * The data structures below define the above concepts.
252 * BOARD classes
255 #define KLCLASS_MASK 0xf0
256 #define KLCLASS_NONE 0x00
257 #define KLCLASS_NODE 0x10 /* CPU, Memory and HUB board */
258 #define KLCLASS_CPU KLCLASS_NODE
259 #define KLCLASS_IO 0x20 /* BaseIO, 4 ch SCSI, ethernet, FDDI
260 and the non-graphics widget boards */
261 #define KLCLASS_ROUTER 0x30 /* Router board */
262 #define KLCLASS_MIDPLANE 0x40 /* We need to treat this as a board
263 so that we can record error info */
264 #define KLCLASS_GFX 0x50 /* graphics boards */
266 #define KLCLASS_PSEUDO_GFX 0x60 /* HDTV type cards that use a gfx
267 * hw ifc to xtalk and are not gfx
268 * class for sw purposes */
270 #define KLCLASS_IOBRICK 0x70 /* IP35 iobrick */
272 #define KLCLASS_MAX 8 /* Bump this if a new CLASS is added */
273 #define KLTYPE_MAX 11 /* Bump this if a new CLASS is added */
275 #define KLCLASS_UNKNOWN 0xf0
277 #define KLCLASS(_x) ((_x) & KLCLASS_MASK)
280 * board types
283 #define KLTYPE_MASK 0x0f
284 #define KLTYPE_NONE 0x00
285 #define KLTYPE_EMPTY 0x00
287 #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0)
288 #define KLTYPE_SNIA (KLCLASS_CPU | 0x1)
290 #define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1)
291 #define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
292 #define KLTYPE_REPEATER_ROUTER (KLCLASS_ROUTER | 0x4)
294 #define KLTYPE_IOBRICK (KLCLASS_IOBRICK | 0x0)
295 #define KLTYPE_NBRICK (KLCLASS_IOBRICK | 0x4)
296 #define KLTYPE_PXBRICK (KLCLASS_IOBRICK | 0x6)
297 #define KLTYPE_IXBRICK (KLCLASS_IOBRICK | 0x7)
298 #define KLTYPE_CGBRICK (KLCLASS_IOBRICK | 0x8)
299 #define KLTYPE_OPUSBRICK (KLCLASS_IOBRICK | 0x9)
302 /* The value of type should be more than 8 so that hinv prints
303 * out the board name from the NIC string. For values less than
304 * 8 the name of the board needs to be hard coded in a few places.
305 * When bringup started nic names had not standardized and so we
306 * had to hard code. (For people interested in history.)
308 #define KLTYPE_UNKNOWN (KLCLASS_UNKNOWN | 0xf)
310 #define KLTYPE(_x) ((_x) & KLTYPE_MASK)
313 * board structures
316 #define MAX_COMPTS_PER_BRD 24
318 typedef struct lboard_s {
319 klconf_off_t brd_next_any; /* Next BOARD */
320 unsigned char struct_type; /* type of structure, local or remote */
321 unsigned char brd_type; /* type+class */
322 unsigned char brd_sversion; /* version of this structure */
323 unsigned char brd_brevision; /* board revision */
324 unsigned char brd_promver; /* board prom version, if any */
325 unsigned char brd_flags; /* Enabled, Disabled etc */
326 unsigned char brd_slot; /* slot number */
327 unsigned short brd_debugsw; /* Debug switches */
328 geoid_t brd_geoid; /* geo id */
329 partid_t brd_partition; /* Partition number */
330 unsigned short brd_diagval; /* diagnostic value */
331 unsigned short brd_diagparm; /* diagnostic parameter */
332 unsigned char brd_inventory; /* inventory history */
333 unsigned char brd_numcompts; /* Number of components */
334 nic_t brd_nic; /* Number in CAN */
335 nasid_t brd_nasid; /* passed parameter */
336 klconf_off_t brd_compts[MAX_COMPTS_PER_BRD]; /* pointers to COMPONENTS */
337 klconf_off_t brd_errinfo; /* Board's error information */
338 struct lboard_s *brd_parent; /* Logical parent for this brd */
339 char pad0[4];
340 confidence_t brd_confidence; /* confidence that the board is bad */
341 nasid_t brd_owner; /* who owns this board */
342 unsigned char brd_nic_flags; /* To handle 8 more NICs */
343 char pad1[24]; /* future expansion */
344 char brd_name[32];
345 nasid_t brd_next_same_host; /* host of next brd w/same nasid */
346 klconf_off_t brd_next_same; /* Next BOARD with same nasid */
347 } lboard_t;
350 * Make sure we pass back the calias space address for local boards.
351 * klconfig board traversal and error structure extraction defines.
354 #define BOARD_SLOT(_brd) ((_brd)->brd_slot)
356 #define KLCF_CLASS(_brd) KLCLASS((_brd)->brd_type)
357 #define KLCF_TYPE(_brd) KLTYPE((_brd)->brd_type)
358 #define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
359 #define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
361 #define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off))
362 #define KLCF_NEXT(_brd) \
363 ((_brd)->brd_next_same ? \
364 (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL)
365 #define KLCF_NEXT_ANY(_brd) \
366 ((_brd)->brd_next_any ? \
367 (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL)
368 #define KLCF_COMP(_brd, _ndx) \
369 ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \
370 (NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)])))
372 #define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
373 #define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
378 * Generic info structure. This stores common info about a
379 * component.
382 typedef struct klinfo_s { /* Generic info */
383 unsigned char struct_type; /* type of this structure */
384 unsigned char struct_version; /* version of this structure */
385 unsigned char flags; /* Enabled, disabled etc */
386 unsigned char revision; /* component revision */
387 unsigned short diagval; /* result of diagnostics */
388 unsigned short diagparm; /* diagnostic parameter */
389 unsigned char inventory; /* previous inventory status */
390 unsigned short partid; /* widget part number */
391 nic_t nic; /* MUst be aligned properly */
392 unsigned char physid; /* physical id of component */
393 unsigned int virtid; /* virtual id as seen by system */
394 unsigned char widid; /* Widget id - if applicable */
395 nasid_t nasid; /* node number - from parent */
396 char pad1; /* pad out structure. */
397 char pad2; /* pad out structure. */
398 void *data;
399 klconf_off_t errinfo; /* component specific errors */
400 unsigned short pad3; /* pci fields have moved over to */
401 unsigned short pad4; /* klbri_t */
402 } klinfo_t ;
404 #define KLCONFIG_INFO_ENABLED(_i) ((_i)->flags & KLINFO_ENABLE)
406 * Component structures.
407 * Following are the currently identified components:
408 * CPU, HUB, MEM_BANK,
409 * XBOW(consists of 16 WIDGETs, each of which can be HUB or GRAPHICS or BRIDGE)
410 * BRIDGE, IOC3, SuperIO, SCSI, FDDI
411 * ROUTER
412 * GRAPHICS
414 #define KLSTRUCT_UNKNOWN 0
415 #define KLSTRUCT_CPU 1
416 #define KLSTRUCT_HUB 2
417 #define KLSTRUCT_MEMBNK 3
418 #define KLSTRUCT_XBOW 4
419 #define KLSTRUCT_BRI 5
420 #define KLSTRUCT_ROU 9
421 #define KLSTRUCT_GFX 10
422 #define KLSTRUCT_SCSI 11
423 #define KLSTRUCT_DISK 14
424 #define KLSTRUCT_CDROM 16
426 #define KLSTRUCT_FIBERCHANNEL 25
427 #define KLSTRUCT_MOD_SERIAL_NUM 26
428 #define KLSTRUCT_QLFIBRE 32
429 #define KLSTRUCT_1394 33
430 #define KLSTRUCT_USB 34
431 #define KLSTRUCT_USBKBD 35
432 #define KLSTRUCT_USBMS 36
433 #define KLSTRUCT_SCSI_CTLR 37
434 #define KLSTRUCT_PEBRICK 38
435 #define KLSTRUCT_GIGE 39
436 #define KLSTRUCT_IDE 40
437 #define KLSTRUCT_IOC4 41
438 #define KLSTRUCT_IOC4UART 42
439 #define KLSTRUCT_IOC4_TTY 43
440 #define KLSTRUCT_IOC4PCKM 44
441 #define KLSTRUCT_IOC4MS 45
442 #define KLSTRUCT_IOC4_ATA 46
443 #define KLSTRUCT_PCIGFX 47
447 * The port info in ip27_cfg area translates to a lboart_t in the
448 * KLCONFIG area. But since KLCONFIG does not use pointers, lboart_t
449 * is stored in terms of a nasid and a offset from start of KLCONFIG
450 * area on that nasid.
452 typedef struct klport_s {
453 nasid_t port_nasid;
454 unsigned char port_flag;
455 klconf_off_t port_offset;
456 short port_num;
457 } klport_t;
459 typedef struct klcpu_s { /* CPU */
460 klinfo_t cpu_info;
461 unsigned short cpu_prid; /* Processor PRID value */
462 unsigned short cpu_fpirr; /* FPU IRR value */
463 unsigned short cpu_speed; /* Speed in MHZ */
464 unsigned short cpu_scachesz; /* secondary cache size in MB */
465 unsigned short cpu_scachespeed;/* secondary cache speed in MHz */
466 unsigned long pad;
467 } klcpu_t ;
469 #define CPU_STRUCT_VERSION 2
471 typedef struct klhub_s { /* HUB */
472 klinfo_t hub_info;
473 unsigned int hub_flags; /* PCFG_HUB_xxx flags */
474 #define MAX_NI_PORTS 2
475 klport_t hub_port[MAX_NI_PORTS + 1];/* hub is connected to this */
476 nic_t hub_box_nic; /* nic of containing box */
477 klconf_off_t hub_mfg_nic; /* MFG NIC string */
478 u64 hub_speed; /* Speed of hub in HZ */
479 moduleid_t hub_io_module; /* attached io module */
480 unsigned long pad;
481 } klhub_t ;
483 typedef struct klhub_uart_s { /* HUB */
484 klinfo_t hubuart_info;
485 unsigned int hubuart_flags; /* PCFG_HUB_xxx flags */
486 nic_t hubuart_box_nic; /* nic of containing box */
487 unsigned long pad;
488 } klhub_uart_t ;
490 #define MEMORY_STRUCT_VERSION 2
492 typedef struct klmembnk_s { /* MEMORY BANK */
493 klinfo_t membnk_info;
494 short membnk_memsz; /* Total memory in megabytes */
495 short membnk_dimm_select; /* bank to physical addr mapping*/
496 short membnk_bnksz[MD_MEM_BANKS]; /* Memory bank sizes */
497 short membnk_attr;
498 unsigned long pad;
499 } klmembnk_t ;
501 #define MAX_SERIAL_NUM_SIZE 10
503 typedef struct klmod_serial_num_s {
504 klinfo_t snum_info;
505 union {
506 char snum_str[MAX_SERIAL_NUM_SIZE];
507 unsigned long long snum_int;
508 } snum;
509 unsigned long pad;
510 } klmod_serial_num_t;
512 /* Macros needed to access serial number structure in lboard_t.
513 Hard coded values are necessary since we cannot treat
514 serial number struct as a component without losing compatibility
515 between prom versions. */
517 #define GET_SNUM_COMP(_l) ((klmod_serial_num_t *)\
518 KLCF_COMP(_l, _l->brd_numcompts))
520 #define MAX_XBOW_LINKS 16
522 typedef struct klxbow_s { /* XBOW */
523 klinfo_t xbow_info ;
524 klport_t xbow_port_info[MAX_XBOW_LINKS] ; /* Module number */
525 int xbow_master_hub_link;
526 /* type of brd connected+component struct ptr+flags */
527 unsigned long pad;
528 } klxbow_t ;
530 #define MAX_PCI_SLOTS 8
532 typedef struct klpci_device_s {
533 s32 pci_device_id; /* 32 bits of vendor/device ID. */
534 s32 pci_device_pad; /* 32 bits of padding. */
535 } klpci_device_t;
537 #define BRIDGE_STRUCT_VERSION 2
539 typedef struct klbri_s { /* BRIDGE */
540 klinfo_t bri_info ;
541 unsigned char bri_eprominfo ; /* IO6prom connected to bridge */
542 unsigned char bri_bustype ; /* PCI/VME BUS bridge/GIO */
543 u64 *pci_specific ; /* PCI Board config info */
544 klpci_device_t bri_devices[MAX_PCI_DEVS] ; /* PCI IDs */
545 klconf_off_t bri_mfg_nic ;
546 unsigned long pad;
547 } klbri_t ;
549 #define ROUTER_VECTOR_VERS 2
551 /* XXX - Don't we need the number of ports here?!? */
552 typedef struct klrou_s { /* ROUTER */
553 klinfo_t rou_info ;
554 unsigned int rou_flags ; /* PCFG_ROUTER_xxx flags */
555 nic_t rou_box_nic ; /* nic of the containing module */
556 klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */
557 klconf_off_t rou_mfg_nic ; /* MFG NIC string */
558 u64 rou_vector; /* vector from master node */
559 unsigned long pad;
560 } klrou_t ;
563 * Graphics Controller/Device
565 * (IP27/IO6) Prom versions 6.13 (and 6.5.1 kernels) and earlier
566 * used a couple different structures to store graphics information.
567 * For compatibility reasons, the newer data structure preserves some
568 * of the layout so that fields that are used in the old versions remain
569 * in the same place (with the same info). Determination of what version
570 * of this structure we have is done by checking the cookie field.
572 #define KLGFX_COOKIE 0x0c0de000
574 typedef struct klgfx_s { /* GRAPHICS Device */
575 klinfo_t gfx_info;
576 klconf_off_t old_gndevs; /* for compatibility with older proms */
577 klconf_off_t old_gdoff0; /* for compatibility with older proms */
578 unsigned int cookie; /* for compatibility with older proms */
579 unsigned int moduleslot;
580 struct klgfx_s *gfx_next_pipe;
581 u64 *gfx_specific;
582 klconf_off_t pad0; /* for compatibility with older proms */
583 klconf_off_t gfx_mfg_nic;
584 unsigned long pad;
585 } klgfx_t;
587 #define MAX_SCSI_DEVS 16
590 * NOTE: THis is the max sized kl* structure and is used in klmalloc.c
591 * to allocate space of type COMPONENT. Make sure that if the size of
592 * any other component struct becomes more than this, then redefine
593 * that as the size to be klmalloced.
596 typedef struct klscsi_s { /* SCSI Bus */
597 klinfo_t scsi_info ;
598 u64 *scsi_specific ;
599 unsigned char scsi_numdevs ;
600 klconf_off_t scsi_devinfo[MAX_SCSI_DEVS] ;
601 unsigned long pad;
602 } klscsi_t ;
604 typedef struct klscctl_s { /* SCSI Controller */
605 klinfo_t scsi_info ;
606 unsigned int type;
607 unsigned int scsi_buscnt; /* # busses this cntlr */
608 void *scsi_bus[2]; /* Pointer to 2 klscsi_t's */
609 unsigned long pad;
610 } klscctl_t ;
612 typedef struct klscdev_s { /* SCSI device */
613 klinfo_t scdev_info ;
614 struct scsidisk_data *scdev_cfg ; /* driver fills up this */
615 unsigned long pad;
616 } klscdev_t ;
618 typedef struct klttydev_s { /* TTY device */
619 klinfo_t ttydev_info ;
620 struct terminal_data *ttydev_cfg ; /* driver fills up this */
621 unsigned long pad;
622 } klttydev_t ;
624 typedef struct klpcigfx_s { /* PCI GFX */
625 klinfo_t gfx_info ;
626 } klpcigfx_t ;
628 typedef struct klkbddev_s { /* KBD device */
629 klinfo_t kbddev_info ;
630 struct keyboard_data *kbddev_cfg ; /* driver fills up this */
631 unsigned long pad;
632 } klkbddev_t ;
634 typedef struct klmsdev_s { /* mouse device */
635 klinfo_t msdev_info ;
636 void *msdev_cfg ;
637 unsigned long pad;
638 } klmsdev_t ;
641 * USB info
644 typedef struct klusb_s {
645 klinfo_t usb_info; /* controller info */
646 void *usb_bus; /* handle to usb_bus_t */
647 uint64_t usb_controller; /* ptr to controller info */
648 unsigned long pad;
649 } klusb_t ;
651 typedef union klcomp_s {
652 klcpu_t kc_cpu;
653 klhub_t kc_hub;
654 klmembnk_t kc_mem;
655 klxbow_t kc_xbow;
656 klbri_t kc_bri;
657 klrou_t kc_rou;
658 klgfx_t kc_gfx;
659 klscsi_t kc_scsi;
660 klscctl_t kc_scsi_ctl;
661 klscdev_t kc_scsi_dev;
662 klmod_serial_num_t kc_snum ;
663 klusb_t kc_usb;
664 } klcomp_t;
666 typedef union kldev_s { /* for device structure allocation */
667 klscdev_t kc_scsi_dev ;
668 klttydev_t kc_tty_dev ;
669 klkbddev_t kc_kbd_dev ;
670 } kldev_t ;
672 /* external declarations of Linux kernel functions. */
674 extern lboard_t *root_lboard[];
675 extern lboard_t *find_lboard_any(lboard_t *start, unsigned char type);
676 extern lboard_t *find_lboard_nasid(lboard_t *start, nasid_t, unsigned char type);
677 extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);
678 extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);
679 extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
682 extern lboard_t *find_gfxpipe(int pipenum);
683 extern lboard_t *find_lboard_class_any(lboard_t *start, unsigned char brd_class);
684 extern lboard_t *find_lboard_class_nasid(lboard_t *start, nasid_t, unsigned char brd_class);
685 extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
686 extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
687 extern lboard_t *find_lboard_modslot(lboard_t *start, geoid_t geoid);
688 extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
689 extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
690 extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
691 extern int update_klcfg_cpuinfo(nasid_t, int);
692 extern void board_to_path(lboard_t *brd, char *path);
693 extern void nic_name_convert(char *old_name, char *new_name);
694 extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
695 extern lboard_t *brd_from_key(uint64_t key);
696 extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
697 char *);
698 extern int board_serial_number_get(lboard_t *,char *);
699 extern nasid_t get_actual_nasid(lboard_t *brd) ;
700 extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
702 #endif /* _ASM_IA64_SN_KLCONFIG_H */