Go to the documentation of this file.
11 #ifndef _ASM_SN_KLCONFIG_H
12 #define _ASM_SN_KLCONFIG_H
30 #include <linux/types.h>
31 #include <asm/sn/types.h>
33 #if defined(CONFIG_SGI_IP27)
38 #define MAX_ROUTER_PORTS (6)
43 #elif defined(CONFIG_SGI_IP35)
45 #include <asm/sn/sn1/addrs.h>
46 #include <sys/sn/router.h>
47 #include <sys/graph.h>
48 #include <asm/xtalk/xbow.h>
52 #if defined(CONFIG_SGI_IP27) || defined(CONFIG_SGI_IP35)
56 #if defined(CONFIG_SGI_IP35)
59 #include <asm/sn/vector.h>
66 #define KLCFGINFO_MAGIC 0xbeedbabe
73 #define MAX_MODULE_ID 255
79 #define MAX_SLOTS_PER_NODE (1 + 2 + 6 + 2)
83 #define MAX_PCI_DEVS 8
89 #define ENABLE_BOARD 0x01
90 #define FAILED_BOARD 0x02
91 #define DUPLICATE_BOARD 0x04
93 #define VISITED_BOARD 0x08
94 #define LOCAL_MASTER_IO6 0x10
95 #define GLOBAL_MASTER_IO6 0x20
96 #define THIRD_NIC_PRESENT 0x40
97 #define SECOND_NIC_PRESENT 0x80
101 #define KLINFO_ENABLE 0x01
102 #define KLINFO_FAILED 0x02
103 #define KLINFO_DEVICE 0x04
104 #define KLINFO_VISITED 0x08
105 #define KLINFO_CONTROLLER 0x10
106 #define KLINFO_INSTALL 0x20
107 #define KLINFO_HEADLESS 0x40
108 #define IS_CONSOLE_IOC3(i) ((((klinfo_t *)i)->flags) & KLINFO_INSTALL)
110 #define GB2 0x80000000
112 #define MAX_RSV_PTRS 32
119 #define BOARD_STRUCT 0
120 #define COMPONENT_STRUCT 1
121 #define ERRINFO_STRUCT 2
122 #define KLMALLOC_TYPE_MAX (ERRINFO_STRUCT + 1)
123 #define DEVICE_STRUCT 3
160 #define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
161 #define KL_CONFIG_INFO_OFFSET(_nasid) \
162 (KL_CONFIG_HDR(_nasid)->ch_board_info)
163 #define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \
164 (KL_CONFIG_HDR(_nasid)->ch_board_info = (_off))
166 #define KL_CONFIG_INFO(_nasid) \
167 (lboard_t *)((KL_CONFIG_HDR(_nasid)->ch_board_info) ? \
168 NODE_OFFSET_TO_K1((_nasid), KL_CONFIG_HDR(_nasid)->ch_board_info) : \
170 #define KL_CONFIG_MAGIC(_nasid) (KL_CONFIG_HDR(_nasid)->ch_magic)
172 #define KL_CONFIG_CHECK_MAGIC(_nasid) \
173 (KL_CONFIG_HDR(_nasid)->ch_magic == KLCFGINFO_MAGIC)
175 #define KL_CONFIG_HDR_INIT_MAGIC(_nasid) \
176 (KL_CONFIG_HDR(_nasid)->ch_magic = KLCFGINFO_MAGIC)
180 #define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
181 ((unsigned long)_k + (_k->ch_malloc_hdr_off)))
183 #define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
185 #define PTR_CH_CONS_INFO(_k) ((console_t *)\
186 ((unsigned long)_k + (_k->ch_cons_off)))
188 #define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
192 #define KL_CONFIG_INFO_START(_nasid) \
193 (klconf_off_t)(KLCONFIG_OFFSET(_nasid) + sizeof(kl_config_hdr_t))
195 #define KL_CONFIG_BOARD_NASID(_brd) ((_brd)->brd_nasid)
196 #define KL_CONFIG_BOARD_SET_NEXT(_brd, _off) ((_brd)->brd_next = (_off))
198 #define KL_CONFIG_DUPLICATE_BOARD(_brd) ((_brd)->brd_flags & DUPLICATE_BOARD)
200 #define XBOW_PORT_TYPE_HUB(_xbowp, _link) \
201 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_HUB)
202 #define XBOW_PORT_TYPE_IO(_xbowp, _link) \
203 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_IO)
205 #define XBOW_PORT_IS_ENABLED(_xbowp, _link) \
206 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_flag & XBOW_PORT_ENABLE)
207 #define XBOW_PORT_NASID(_xbowp, _link) \
208 ((_xbowp)->xbow_port_info[(_link) - BASE_XBOW_PORT].port_nasid)
210 #define XBOW_PORT_IO 0x1
211 #define XBOW_PORT_HUB 0x2
212 #define XBOW_PORT_ENABLE 0x4
214 #define SN0_PORT_FENCE_SHFT 0
215 #define SN0_PORT_FENCE_MASK (1 << SN0_PORT_FENCE_SHFT)
312 #define KL_CPU_R4000 0x1
313 #define KL_CPU_TFP 0x2
314 #define KL_CPU_R10000 0x3
315 #define KL_CPU_NONE (-1)
321 #define KLCLASS_MASK 0xf0
322 #define KLCLASS_NONE 0x00
323 #define KLCLASS_NODE 0x10
324 #define KLCLASS_CPU KLCLASS_NODE
325 #define KLCLASS_IO 0x20
327 #define KLCLASS_ROUTER 0x30
328 #define KLCLASS_MIDPLANE 0x40
330 #define KLCLASS_GFX 0x50
332 #define KLCLASS_PSEUDO_GFX 0x60
336 #define KLCLASS_MAX 7
337 #define KLTYPE_MAX 10
339 #define KLCLASS_UNKNOWN 0xf0
341 #define KLCLASS(_x) ((_x) & KLCLASS_MASK)
347 #define KLTYPE_MASK 0x0f
348 #define KLTYPE_NONE 0x00
349 #define KLTYPE_EMPTY 0x00
351 #define KLTYPE_WEIRDCPU (KLCLASS_CPU | 0x0)
352 #define KLTYPE_IP27 (KLCLASS_CPU | 0x1)
354 #define KLTYPE_WEIRDIO (KLCLASS_IO | 0x0)
355 #define KLTYPE_BASEIO (KLCLASS_IO | 0x1)
356 #define KLTYPE_IO6 KLTYPE_BASEIO
357 #define KLTYPE_4CHSCSI (KLCLASS_IO | 0x2)
358 #define KLTYPE_MSCSI KLTYPE_4CHSCSI
359 #define KLTYPE_ETHERNET (KLCLASS_IO | 0x3)
360 #define KLTYPE_MENET KLTYPE_ETHERNET
361 #define KLTYPE_FDDI (KLCLASS_IO | 0x4)
362 #define KLTYPE_UNUSED (KLCLASS_IO | 0x5)
363 #define KLTYPE_HAROLD (KLCLASS_IO | 0x6)
364 #define KLTYPE_PCI KLTYPE_HAROLD
365 #define KLTYPE_VME (KLCLASS_IO | 0x7)
366 #define KLTYPE_MIO (KLCLASS_IO | 0x8)
367 #define KLTYPE_FC (KLCLASS_IO | 0x9)
368 #define KLTYPE_LINC (KLCLASS_IO | 0xA)
369 #define KLTYPE_TPU (KLCLASS_IO | 0xB)
370 #define KLTYPE_GSN_A (KLCLASS_IO | 0xC)
371 #define KLTYPE_GSN_B (KLCLASS_IO | 0xD)
373 #define KLTYPE_GFX (KLCLASS_GFX | 0x0)
374 #define KLTYPE_GFX_KONA (KLCLASS_GFX | 0x1)
375 #define KLTYPE_GFX_MGRA (KLCLASS_GFX | 0x3)
377 #define KLTYPE_WEIRDROUTER (KLCLASS_ROUTER | 0x0)
378 #define KLTYPE_ROUTER (KLCLASS_ROUTER | 0x1)
379 #define KLTYPE_ROUTER2 KLTYPE_ROUTER
380 #define KLTYPE_NULL_ROUTER (KLCLASS_ROUTER | 0x2)
381 #define KLTYPE_META_ROUTER (KLCLASS_ROUTER | 0x3)
383 #define KLTYPE_WEIRDMIDPLANE (KLCLASS_MIDPLANE | 0x0)
384 #define KLTYPE_MIDPLANE8 (KLCLASS_MIDPLANE | 0x1)
385 #define KLTYPE_MIDPLANE KLTYPE_MIDPLANE8
386 #define KLTYPE_PBRICK_XBOW (KLCLASS_MIDPLANE | 0x2)
388 #define KLTYPE_IOBRICK (KLCLASS_IOBRICK | 0x0)
389 #define KLTYPE_IBRICK (KLCLASS_IOBRICK | 0x1)
390 #define KLTYPE_PBRICK (KLCLASS_IOBRICK | 0x2)
391 #define KLTYPE_XBRICK (KLCLASS_IOBRICK | 0x3)
393 #define KLTYPE_PBRICK_BRIDGE KLTYPE_PBRICK
401 #define KLTYPE_XTHD (KLCLASS_PSEUDO_GFX | 0x9)
403 #define KLTYPE_UNKNOWN (KLCLASS_UNKNOWN | 0xf)
405 #define KLTYPE(_x) ((_x) & KLTYPE_MASK)
406 #define IS_MIO_PRESENT(l) ((l->brd_type == KLTYPE_BASEIO) && \
407 (l->brd_flags & SECOND_NIC_PRESENT))
408 #define IS_MIO_IOC3(l, n) (IS_MIO_PRESENT(l) && (n > 2))
414 #define MAX_COMPTS_PER_BRD 24
416 #define LOCAL_BOARD 1
417 #define REMOTE_BOARD 2
419 #define LBOARD_STRUCT_VERSION 2
455 #define BOARD_SLOT(_brd) ((_brd)->brd_slot)
457 #define KLCF_CLASS(_brd) KLCLASS((_brd)->brd_type)
458 #define KLCF_TYPE(_brd) KLTYPE((_brd)->brd_type)
459 #define KLCF_REMOTE(_brd) (((_brd)->struct_type & LOCAL_BOARD) ? 0 : 1)
460 #define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
461 #define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
463 #define KLCF_NEXT(_brd) \
464 ((_brd)->brd_next ? \
465 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\
467 #define KLCF_COMP(_brd, _ndx) \
468 (klinfo_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), \
469 (_brd)->brd_compts[(_ndx)]))
471 #define KLCF_COMP_ERROR(_brd, _comp) \
472 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo))
474 #define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
475 #define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid)
505 #define KLCONFIG_INFO_ENABLED(_i) ((_i)->flags & KLINFO_ENABLE)
515 #define KLSTRUCT_UNKNOWN 0
516 #define KLSTRUCT_CPU 1
517 #define KLSTRUCT_HUB 2
518 #define KLSTRUCT_MEMBNK 3
519 #define KLSTRUCT_XBOW 4
520 #define KLSTRUCT_BRI 5
521 #define KLSTRUCT_IOC3 6
522 #define KLSTRUCT_PCI 7
523 #define KLSTRUCT_VME 8
524 #define KLSTRUCT_ROU 9
525 #define KLSTRUCT_GFX 10
526 #define KLSTRUCT_SCSI 11
527 #define KLSTRUCT_FDDI 12
528 #define KLSTRUCT_MIO 13
529 #define KLSTRUCT_DISK 14
530 #define KLSTRUCT_TAPE 15
531 #define KLSTRUCT_CDROM 16
532 #define KLSTRUCT_HUB_UART 17
533 #define KLSTRUCT_IOC3ENET 18
534 #define KLSTRUCT_IOC3UART 19
535 #define KLSTRUCT_UNUSED 20
536 #define KLSTRUCT_IOC3PCKM 21
537 #define KLSTRUCT_RAD 22
538 #define KLSTRUCT_HUB_TTY 23
539 #define KLSTRUCT_IOC3_TTY 24
544 #define KLSTRUCT_FIBERCHANNEL 25
545 #define KLSTRUCT_MOD_SERIAL_NUM 26
546 #define KLSTRUCT_IOC3MS 27
547 #define KLSTRUCT_TPU 28
548 #define KLSTRUCT_GSN_A 29
549 #define KLSTRUCT_GSN_B 30
550 #define KLSTRUCT_XTHD 31
556 #define IP27_CPU0_INDEX 0
557 #define IP27_CPU1_INDEX 1
558 #define IP27_HUB_INDEX 2
559 #define IP27_MEM_INDEX 3
561 #define BASEIO_BRIDGE_INDEX 0
562 #define BASEIO_IOC3_INDEX 1
563 #define BASEIO_SCSI1_INDEX 2
564 #define BASEIO_SCSI2_INDEX 3
566 #define MIDPLANE_XBOW_INDEX 0
567 #define ROUTER_COMPONENT_INDEX 0
569 #define CH4SCSI_BRIDGE_INDEX 0
603 #define CPU_STRUCT_VERSION 2
620 #define MEMORY_STRUCT_VERSION 2
630 #define KLCONFIG_MEMBNK_SIZE(_info, _bank) \
631 ((_info)->membnk_bnksz[(_bank)])
634 #define MEMBNK_PREMIUM 1
635 #define KLCONFIG_MEMBNK_PREMIUM(_info, _bank) \
636 ((_info)->membnk_attr & (MEMBNK_PREMIUM << (_bank)))
638 #define MAX_SERIAL_NUM_SIZE 10
653 #define GET_SNUM_COMP(_l) ((klmod_serial_num_t *)\
654 KLCF_COMP(_l, _l->brd_numcompts))
656 #define MAX_XBOW_LINKS 16
665 #define MAX_PCI_SLOTS 8
672 #define BRIDGE_STRUCT_VERSION 2
683 #define MAX_IOC3_TTY 2
696 #define MAX_VME_SLOTS 8
710 #define ROUTER_VECTOR_VERS 2
732 #define KLGFX_COOKIE 0x0c0de000
761 #define MAX_SCSI_DEVS 16
802 #define MAX_FDDI_DEVS 10
869 #define BRI_PER_XBOW 6
870 #define PCI_PER_BRI 8
871 #define DEV_PER_PCI 16
876 #define VDS_NOGFX 0x8000
877 #define VDS_NOMP 0x100
878 #define VDS_MANUMODE 0x80
879 #define VDS_NOARB 0x40
880 #define VDS_PODMODE 0x20
881 #define VDS_NO_DIAGS 0x10
882 #define VDS_DEFAULTS 0x08
883 #define VDS_NOMEMCLEAR 0x04
884 #define VDS_2ND_IO4 0x02
885 #define VDS_DEBUG_PROM 0x01