mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 15:14:27 +00:00
hv: implement PCI bus scan function
- It starts from scaning bus 0 and scan other buses only if it is referred as a Secondary Bus by a PCI-to-PCI bridge. - Skip to next device if function 0 is not implemented. - Don't enumerate function 1-7 if a device is not a multi-function device. Tracked-On: #1568 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -142,6 +142,8 @@ enum pci_bar_type {
|
||||
PCIBAR_MEM64,
|
||||
};
|
||||
|
||||
typedef void (*pci_enumeration_cb)(uint16_t pbdf, void *data);
|
||||
|
||||
static inline uint32_t pci_bar_offset(uint32_t idx)
|
||||
{
|
||||
return PCIR_BARS + (idx << 2U);
|
||||
@@ -160,4 +162,6 @@ static inline bool pci_bar_access(uint32_t offset)
|
||||
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes);
|
||||
void pci_pdev_write_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
|
||||
void pci_scan_bus(pci_enumeration_cb cb, void *data);
|
||||
|
||||
#endif /* PCI_H_ */
|
||||
|
||||
Reference in New Issue
Block a user