pub unsafe extern "C" fn PF_PCIE_enumeration(
apb_addr: u64,
pcie_ctrl_num: u8,
ecam_addr: u64,
) -> *mut pf_pcie_ebuff_tExpand description
The PF_PCIE_enumeration() function enumerates all the components in a PCIe system, including endpoints, bridges, and switches connected to the system.
@param apb_addr Specifies the base address in the processor’s memory map for the registers of the PCI Express hardware instance being initialized.
@param pcie_ctrl_num Specifies the PCIe controller number 0 or 1.
@param ecam_addr Specifies the ECAM address of PCIe system. The address is calculated based on the bus number, device number, function number, and the PCIe AXI4 slave base address from the processor’s memory map. The bus, device, and function number should be 0 so the enumeration starts with bus number 0 and ends with bus number 8.
@return The PF_PCIE_enumeration() function returns a pointer to the PCIe enumerate buffer structure for all the devices and bridges connected to the PCIe system.
@code uint64_t apb_addr = 0x60000000
uint64_t ecam_addr = 0x70000000; uint8_t slv_table_no = 0; uint8_t tlp = PF_PCIE_TLP_MEM;
pf_pcie_slave_atr_cfg_t s_cfg; pf_pcie_ebuff_t * p_pcie_enum_data;
s_cfg.state = PF_PCIE_ATR_TABLE_ENABLE; s_cfg.size = PF_PCIE_SIZE_256MB; s_cfg.src_addr = 0x70000000; s_cfg.src_addr_msb = 0; s_cfg.trns_addr = 0x70000000; s_cfg.trns_addr_msb = 0;
PF_PCIE_slave_atr_table_init(apb_addr, PF_PCIE_CTRL_1, &s_cfg, slv_table_no, tlp);
p_pcie_enumer_data = PF_PCIE_enumeration(apb_addr, PF_PCIE_CTRL_1, ecam_addr);
if(p_pcie_enum_data->no_of_devices_attached != 0) {
} @endcode