[U-Boot-Users] u-boot 1.0.0+ PCI Bridge enumeration problem

Greetings fellow u-boot'ers:
I've done a port to the ibm ppc440 gx (patch is in Wolfgang's queue for those that are interested).
I am having a problem with PCI 'plug-n-play', specifically with bridge setup.
My topology is the following (from linux):
bash-2.05# lspci -t -[00]-+-01.0-[01-03]--+-00.0-[02]--+-02.0 | | -04.0 | -01.0-[03]----03.0 -02.0
Where 01.0, 00.0[02], and 01.0[03] are intel 21154 p2p bridges in Bus/dev/func speak: 0/1/0, 1/0/0, and 1/1/0.
If I turn on CONFIG_PCI_PNP (in u-boot), the pci enumeration never stops. I turned on DEBUG'ing in pci.c and pci_auto.c and added some debug prints to try to see what is going on, but I cannot figure out why it is seeing more than just the 3 21154 bridges.
Any help would greatly be appreciated.
OUTPUT:
U-Boot 1.0.1 (Jan 19 2004 - 15:17:24)
IBM PowerPC 440 GX Rev. B Board: XES XPedite1000 440GX VCO: 1333 MHz CPU: 666 MHz PLB: 166 MHz OPB: 83 MHz EPB: 27 MHz I2C: ready DRAM: 512 MB FLASH: 512 kB PCI: Bus Dev VenId DevId Class Int PCI Autoconfig: Memory region: [80000000-8fffffff] PCI Autoconfig: I/O region: [0-ffff] PCI Scan: Found Bus 0, Device 1, Function 0 PCI Autoconfig: BAR 0, I/O, size=0x4, address=0x0 PCI Autoconfig: Found P2P bridge, device 0/1 PCI Autoconfig: setting device 0/1 PBUS: 0 SBUS: 1 SUBBUS: ff PCI Autoconfig: Scanning down P2P bridge, busno: 1 PCI Scan: Found Bus 1, Device 1, Function 0 PCI Autoconfig: BAR 0, I/O, size=0x4, address=0x1000 PCI Autoconfig: Found P2P bridge, device 1/1 PCI Autoconfig: setting device 1/1 PBUS: 1 SBUS: 2 SUBBUS: ff PCI Autoconfig: Scanning down P2P bridge, busno: 2 PCI Scan: Found Bus 2, Device 1, Function 0 PCI Autoconfig: BAR 0, I/O, size=0x4, address=0x2000 PCI Autoconfig: Found P2P bridge, device 2/1 PCI Autoconfig: setting device 2/1 PBUS: 2 SBUS: 3 SUBBUS: ff PCI Autoconfig: Scanning down P2P bridge, busno: 3 PCI Scan: Found Bus 3, Device 1, Function 0 PCI Autoconfig: BAR 0, I/O, size=0x4, address=0x3000 PCI Autoconfig: Found P2P bridge, device 3/1 PCI Autoconfig: setting device 3/1 PBUS: 3 SBUS: 4 SUBBUS: ff PCI Autoconfig: Scanning down P2P bridge, busno: 4 [SNIP, goes on forever...]
-travis sawyer

On Mon, 2004-01-19 at 17:06, Travis Sawyer wrote: <SNIP>
I am having a problem with PCI 'plug-n-play', specifically with bridge setup.
<SNIP>
If I turn on CONFIG_PCI_PNP (in u-boot), the pci enumeration never stops. I turned on DEBUG'ing in pci.c and pci_auto.c and added some debug prints to try to see what is going on, but I cannot figure out why it is seeing more than just the 3 21154 bridges.
Any help would greatly be appreciated.
<SNIP> Looking through the archives, I bet its funny to see how many people reply to their own posts...so I'll add another.
I'm not sure how this worked for (or if it even works for) any of the ppc4xx ports with built in pci.
In pci_indirect.c:
#else #define INDIRECT_PCI_OP(rw, size, type, op, mask) \ static int \ indirect_##rw##_config_##size(struct pci_controller *hose, \ pci_dev_t dev, int offset, type val) \ { \ out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000000); \ cfg_##rw(val, hose->cfg_data + (offset & mask), type, op); \ return 0; \ } #endif
In order to get config access across sub-bridges one must do config type 1 reads/writes.
Not knowing if this would break other ports, I've added a #elif defined(CONFIG_440_GX) section that adds the following lines:
if(PCI_BUS(dev) > 0) \ out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000001); \ else out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000000); \
I'll send a patch when Wolfgang has submitted the 440GX port to CVS.
I hope this helps someone having the same difficulties in the meantime...
-travis sawyer

Travis,
On Mon, 2004-01-19 at 17:06, Travis Sawyer wrote:
<SNIP> > I am having a problem with PCI 'plug-n-play', specifically with bridge > setup. <SNIP> > If I turn on CONFIG_PCI_PNP (in u-boot), the pci enumeration never > stops. I turned on DEBUG'ing in pci.c and pci_auto.c and added some > debug prints to try to see what is going on, but I cannot figure out why > it is seeing more than just the 3 21154 bridges. > > Any help would greatly be appreciated. <SNIP>
<SNIP>
In order to get config access across sub-bridges one must do config type 1 reads/writes.
Not knowing if this would break other ports, I've added a #elif defined(CONFIG_440_GX) section that adds the following lines:
I don't know if it is related but I have a similar problem with pci enum on Cogent CSB272 board (with IBM PPC405GP) I am working. This board has two PCI slots. If any of these slots have a PCI card the bus enum does not stop after the identified PCI device and I get repeated listings (32 in all) of the same device except that Dev is different for each one. i.e.
=> pci Scanning PCI devices on bus 0 BusDevFun VendorId DeviceId Device Class Sub-Class _____________________________________________________________ 00.00.00 0x1014 0x0156 Bridge device 0x00 00.01.00 0x5333 0x8901 Display controller 0x00 00.02.00 0x5333 0x8901 Display controller 0x00 00.03.00 0x5333 0x8901 Display controller 0x00 ... 00.1d.00 0x5333 0x8901 Display controller 0x00 00.1e.00 0x5333 0x8901 Display controller 0x00 00.1f.00 0x5333 0x8901 Display controller 0x00
Right now PCI functionality is not needed here. So, I was deferring investigation of this later. On another post it was said it might be related to IDSEL but as far as I understand IDSEL issue is for when I am trying to use both PCI slots.
In short, it is possible that your fix might be needed beyond 440GX...
Regards, Tolunay
participants (2)
-
listmember@orkun.us
-
Travis Sawyer