📄 klconfig.h
字号:
#define CPU_STRUCT_VERSION 2
typedef struct klhub_s { /* HUB */
klinfo_t hub_info;
uint 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 ;
typedef struct klhub_uart_s { /* HUB */
klinfo_t hubuart_info;
uint hubuart_flags; /* PCFG_HUB_xxx flags */
nic_t hubuart_box_nic; /* nic of containing box */
} klhub_uart_t ;
#define MEMORY_STRUCT_VERSION 2
typedef struct 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 ;
#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 {
klinfo_t snum_info;
union {
char snum_str[MAX_SERIAL_NUM_SIZE];
unsigned long long snum_int;
} snum;
} klmod_serial_num_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. */
#define GET_SNUM_COMP(_l) ((klmod_serial_num_t *)\
KLCF_COMP(_l, _l->brd_numcompts))
#define MAX_XBOW_LINKS 16
typedef struct klxbow_s { /* XBOW */
klinfo_t xbow_info ;
klport_t xbow_port_info[MAX_XBOW_LINKS] ; /* Module number */
int xbow_master_hub_link;
/* type of brd connected+component struct ptr+flags */
} klxbow_t ;
#define MAX_PCI_SLOTS 8
typedef struct klpci_device_s {
s32 pci_device_id; /* 32 bits of vendor/device ID. */
s32 pci_device_pad; /* 32 bits of padding. */
} klpci_device_t;
#define BRIDGE_STRUCT_VERSION 2
typedef struct klbri_s { /* BRIDGE */
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 */
klpci_device_t bri_devices[MAX_PCI_DEVS] ; /* PCI IDs */
klconf_off_t bri_mfg_nic ;
} 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 ;
} 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 */
} 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 */
} klvmed_t ;
#define ROUTER_VECTOR_VERS 2
/* XXX - Don't we need the number of ports here?!? */
typedef struct klrou_s { /* ROUTER */
klinfo_t rou_info ;
uint 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
typedef struct 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 */
uint cookie; /* for compatibility with older proms */
uint 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;
typedef struct klxthd_s {
klinfo_t xthd_info ;
klconf_off_t xthd_mfg_nic ; /* MFG NIC string */
} klxthd_t ;
typedef struct kltpu_s { /* TPU board */
klinfo_t tpu_info ;
klconf_off_t tpu_mfg_nic ; /* MFG NIC string */
} 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
/*
* 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.
*/
typedef struct klscsi_s { /* SCSI Controller */
klinfo_t scsi_info ;
scsi_t scsi_specific ;
unsigned char scsi_numdevs ;
klconf_off_t scsi_devinfo[MAX_SCSI_DEVS] ;
} klscsi_t ;
typedef struct klscdev_s { /* SCSI device */
klinfo_t scdev_info ;
struct scsidisk_data *scdev_cfg ; /* driver fills up this */
} klscdev_t ;
typedef struct klttydev_s { /* TTY device */
klinfo_t ttydev_info ;
struct terminal_data *ttydev_cfg ; /* driver fills up this */
} klttydev_t ;
typedef struct klenetdev_s { /* ENET device */
klinfo_t enetdev_info ;
struct net_data *enetdev_cfg ; /* driver fills up this */
} klenetdev_t ;
typedef struct klkbddev_s { /* KBD device */
klinfo_t kbddev_info ;
struct keyboard_data *kbddev_cfg ; /* driver fills up this */
} klkbddev_t ;
typedef struct klmsdev_s { /* mouse device */
klinfo_t msdev_info ;
void *msdev_cfg ;
} 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] ;
} klfddi_t ;
typedef struct klmio_s { /* MIO */
klinfo_t mio_info ;
mio_t mio_specific ;
} klmio_t ;
typedef union klcomp_s {
klcpu_t kc_cpu;
klhub_t kc_hub;
klmembnk_t kc_mem;
klxbow_t kc_xbow;
klbri_t kc_bri;
klioc3_t kc_ioc3;
klvmeb_t kc_vmeb;
klvmed_t kc_vmed;
klrou_t kc_rou;
klgfx_t kc_gfx;
klscsi_t kc_scsi;
klscdev_t kc_scsi_dev;
klfddi_t kc_fddi;
klmio_t kc_mio;
klmod_serial_num_t kc_snum ;
} klcomp_t;
typedef union kldev_s { /* for device structure allocation */
klscdev_t kc_scsi_dev ;
klttydev_t kc_tty_dev ;
klenetdev_t kc_enet_dev ;
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 *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);
extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
#if defined(CONFIG_SGI_IO)
extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
extern lboard_t *find_gfxpipe(int pipenum);
extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
unsigned char brd_class);
extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
extern klcpu_t *get_cpuinfo(cpuid_t cpu);
extern int update_klcfg_cpuinfo(nasid_t, int);
extern void board_to_path(lboard_t *brd, char *path);
extern moduleid_t get_module_id(nasid_t nasid);
extern void nic_name_convert(char *old_name, char *new_name);
extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
extern lboard_t *brd_from_key(ulong_t key);
extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
char *);
extern int board_serial_number_get(lboard_t *,char *);
extern int is_master_baseio(nasid_t,moduleid_t,slotid_t);
extern nasid_t get_actual_nasid(lboard_t *brd) ;
extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
#else /* CONFIG_SGI_IO */
extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
#endif /* CONFIG_SGI_IO */
#endif /* _ASM_SN_KLCONFIG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -