drivers: pcie: late initialization of pcie when PCIe controller is used
For architectures that rely on a PCIe controller (for example, ARM64),
scanning the PCI space will only succeed after the controller has
initialized. Therefore, in the presence of PCIe controller, the PCIe
initialization is bumped to the next system init level.
In the past, drivers like ivshmem would do a late scan of the PCI space
in case the early scan failed; however, the cited commit removed this
feature and ivshmem fails for ARM64. This commit fix this by making the
early scan succeed.
Fixes: a96016d747
("drivers: ivshmem: Remove unnecessary BDF lookup ...")
Signed-off-by: Rodrigo Cataldo <rodrigo.cataldo@huawei.com>
Co-authored-by: Henri Xavier <datacomos@huawei.com>
This commit is contained in:
parent
0efb0f55b3
commit
bcb3961567
1 changed files with 12 additions and 1 deletions
|
@ -529,4 +529,15 @@ static int pcie_init(const struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SYS_INIT(pcie_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||
|
||||
/*
|
||||
* If a pcie controller is employed, pcie_scan() depends on it for working.
|
||||
* Thus, pcie must be bumped to the next level
|
||||
*/
|
||||
#ifdef CONFIG_PCIE_CONTROLLER
|
||||
#define PCIE_SYS_INIT_LEVEL PRE_KERNEL_2
|
||||
#else
|
||||
#define PCIE_SYS_INIT_LEVEL PRE_KERNEL_1
|
||||
#endif
|
||||
|
||||
SYS_INIT(pcie_init, PCIE_SYS_INIT_LEVEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue