📄 pci_defs.h
字号:
*/#define CFG1_ADDR_REGISTER_MASK 0x000000fc#define CFG1_ADDR_FUNCTION_MASK 0x00000700#define CFG1_ADDR_DEVICE_MASK 0x0000f800#define CFG1_ADDR_BUS_MASK 0x00ff0000#define CFG1_REGISTER_SHIFT 2#define CFG1_FUNCTION_SHIFT 8#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 */#define PCI_CFG_CLASS_PRE20 0x00#define PCI_CFG_CLASS_STORAGE 0x01#define PCI_CFG_CLASS_NETWORK 0x02#define PCI_CFG_CLASS_DISPLAY 0x03#define PCI_CFG_CLASS_MMEDIA 0x04#define PCI_CFG_CLASS_MEMORY 0x05#define PCI_CFG_CLASS_BRIDGE 0x06#define PCI_CFG_CLASS_COMM 0x07#define PCI_CFG_CLASS_BASE 0x08#define PCI_CFG_CLASS_INPUT 0x09#define PCI_CFG_CLASS_DOCK 0x0A#define PCI_CFG_CLASS_PROC 0x0B#define PCI_CFG_CLASS_SERIALBUS 0x0C#define PCI_CFG_CLASS_OTHER 0xFF/* * Important Subclasses */#define PCI_CFG_SUBCLASS_BRIDGE_HOST 0x00#define PCI_CFG_SUBCLASS_BRIDGE_ISA 0x01#define PCI_CFG_SUBCLASS_BRIDGE_EISA 0x02#define PCI_CFG_SUBCLASS_BRIDGE_MC 0x03#define PCI_CFG_SUBCLASS_BRIDGE_PCI 0x04#define PCI_CFG_SUBCLASS_BRIDGE_PCMCIA 0x05#define PCI_CFG_SUBCLASS_BRIDGE_NUBUS 0x06#define PCI_CFG_SUBCLASS_BRIDGE_CARDBUS 0x07#define PCI_CFG_SUBCLASS_BRIDGE_OTHER 0x80#ifndef __ASSEMBLY__#ifdef LITTLE_ENDIAN/* * PCI config space definition */typedef volatile struct pci_cfg_s { uint16_t vendor_id; uint16_t dev_id; uint16_t cmd; uint16_t status; uchar_t rev; uchar_t prog_if; uchar_t sub_class; uchar_t class; uchar_t line_size; uchar_t lt; uchar_t hdr_type; uchar_t bist; uint32_t bar[6]; uint32_t cardbus; uint16_t subsys_vendor_id; uint16_t subsys_dev_id; uint32_t exp_rom; uint32_t res[2]; uchar_t int_line; uchar_t int_pin; uchar_t min_gnt; uchar_t max_lat;} pci_cfg_t;/* * PCI Type 1 config space definition for PCI to PCI Bridges (PPBs) */typedef volatile struct pci_cfg1_s { uint16_t vendor_id; uint16_t dev_id; uint16_t cmd; uint16_t status; uchar_t rev; uchar_t prog_if; uchar_t sub_class; uchar_t class; uchar_t line_size; uchar_t lt; uchar_t hdr_type; uchar_t bist; uint32_t bar[2]; uchar_t pri_bus_num; uchar_t snd_bus_num; uchar_t sub_bus_num; uchar_t slt; uchar_t io_base; uchar_t io_limit; uint16_t snd_status; uint16_t mem_base; uint16_t mem_limit; uint16_t pmem_base; uint16_t pmem_limit; uint32_t pmem_base_upper; uint32_t pmem_limit_upper; uint16_t io_base_upper; uint16_t io_limit_upper; uint32_t res; uint32_t exp_rom; uchar_t int_line; uchar_t int_pin; uint16_t ppb_control;} pci_cfg1_t;/* * PCI-X Capability */typedef volatile struct cap_pcix_cmd_reg_s { uint16_t data_parity_enable: 1, enable_relaxed_order: 1, max_mem_read_cnt: 2, max_split: 3, reserved1: 9;} cap_pcix_cmd_reg_t;typedef volatile struct cap_pcix_stat_reg_s { uint32_t func_num: 3, dev_num: 5, bus_num: 8, bit64_device: 1, mhz133_capable: 1, split_complt_discard: 1, unexpect_split_complt: 1, device_complex: 1, max_mem_read_cnt: 2, max_out_split: 3, max_cum_read: 3, split_complt_err: 1, reserved1: 2;} cap_pcix_stat_reg_t;typedef volatile struct cap_pcix_type0_s { uchar_t pcix_cap_id; uchar_t pcix_cap_nxt; cap_pcix_cmd_reg_t pcix_type0_command; cap_pcix_stat_reg_t pcix_type0_status;} cap_pcix_type0_t;#else/* * PCI config space definition */typedef volatile struct pci_cfg_s { uint16_t dev_id; uint16_t vendor_id; uint16_t status; uint16_t cmd; uchar_t class; uchar_t sub_class; uchar_t prog_if; uchar_t rev; uchar_t bist; uchar_t hdr_type; uchar_t lt; uchar_t line_size; uint32_t bar[6]; uint32_t cardbus; uint16_t subsys_dev_id; uint16_t subsys_vendor_id; uint32_t exp_rom; uint32_t res[2]; uchar_t max_lat; uchar_t min_gnt; uchar_t int_pin; uchar_t int_line;} pci_cfg_t;/* * PCI Type 1 config space definition for PCI to PCI Bridges (PPBs) */typedef volatile struct pci_cfg1_s { uint16_t dev_id; uint16_t vendor_id; uint16_t status; uint16_t cmd; uchar_t class; uchar_t sub_class; uchar_t prog_if; uchar_t rev; uchar_t bist; uchar_t hdr_type; uchar_t lt; uchar_t line_size; uint32_t bar[2]; uchar_t slt; uchar_t sub_bus_num; uchar_t snd_bus_num; uchar_t pri_bus_num; uint16_t snd_status; uchar_t io_limit; uchar_t io_base; uint16_t mem_limit; uint16_t mem_base; uint16_t pmem_limit; uint16_t pmem_base; uint32_t pmem_limit_upper; uint32_t pmem_base_upper; uint16_t io_limit_upper; uint16_t io_base_upper; uint32_t res; uint32_t exp_rom; uint16_t ppb_control; uchar_t int_pin; uchar_t int_line;} pci_cfg1_t;/* * PCI-X Capability */typedef volatile struct cap_pcix_cmd_reg_s { uint16_t reserved1: 9, max_split: 3, max_mem_read_cnt: 2, enable_relaxed_order: 1, data_parity_enable: 1;} cap_pcix_cmd_reg_t;typedef volatile struct cap_pcix_stat_reg_s { uint32_t reserved1: 2, split_complt_err: 1, max_cum_read: 3, max_out_split: 3, max_mem_read_cnt: 2, device_complex: 1, unexpect_split_complt: 1, split_complt_discard: 1, mhz133_capable: 1, bit64_device: 1, bus_num: 8, dev_num: 5, func_num: 3;} cap_pcix_stat_reg_t;typedef volatile struct cap_pcix_type0_s { cap_pcix_cmd_reg_t pcix_type0_command; uchar_t pcix_cap_nxt; uchar_t pcix_cap_id; cap_pcix_stat_reg_t pcix_type0_status;} cap_pcix_type0_t;#endif#endif /* __ASSEMBLY__ */#endif /* _ASM_SN_PCI_PCI_DEFS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -