From c4dbf0b05606e3d7d1b855c51053f1c9b39be62f Mon Sep 17 00:00:00 2001 From: QiaoChong Date: Thu, 14 Feb 2019 17:22:35 +0800 Subject: [PATCH] pci: add pci_get_busno to get next busno will be used to support board such as 2k. Change-Id: Ia2b6e8e1c224dc44a8c142e28b404d367f5836bc Signed-off-by: QiaoChong --- sys/dev/pci/pciconf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/pci/pciconf.c b/sys/dev/pci/pciconf.c index 81bf21f9..088cf99d 100644 --- a/sys/dev/pci/pciconf.c +++ b/sys/dev/pci/pciconf.c @@ -408,6 +408,11 @@ static inline int fls(int x) } return r; } + +__attribute__((weak)) int pci_get_busno(struct pci_device *pd, int bus) +{ + return bus + 1; +} /* * Scan each PCI device on the system and record its configuration @@ -540,7 +545,12 @@ _pci_query_dev_func (struct pci_device *dev, pcitag_t tag, int initialise) isbridge = 1; pd->bridge.pribus_num = bus; +#if 1 + _pci_nbus = pci_get_busno(pd, _pci_nbus); + pd->bridge.secbus_num = _pci_nbus; +#else pd->bridge.secbus_num = ++_pci_nbus; +#endif /* Set it temperary to same as secondary bus number */ pd->bridge.subbus_num = pd->bridge.secbus_num;