[LEDE-DEV] [PATCH] imx6: fix pcie scanning on boot

Koen Vandeputte koen.vandeputte at ncentric.com
Thu Jan 4 05:14:37 PST 2018


Some additional info on this:

The issue is caused by the imx6 PCIe Root Complex which is not properly 
configured on boot.
The subordinate should be set to 0xff (maximum bus nr that is reachable 
downstream)

lspci -v:

[ Node 3 | node-3 ] lspci -v
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 
[Normal decode])
     Flags: bus master, fast devsel, latency 0, IRQ 298
     Memory at 01000000 (32-bit, non-prefetchable) [size=1M]
     Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
   ...


The kernel patch mentioned in the patch limits downstream devices to the 
subord of the master, which in this case limits the busnr's to 1.
This stops the scanning process as soon as busnr 1 is used (which is the 
assigned bus in the plx)


After checking the reference manual, I've found a register which can be 
written during imx6 PCIe init to alter this value.
Applying this patch shows this:

lspci -v:

[ Node 3 | node-3 ] lspci -v
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01) (prog-if 00 
[Normal decode])
     Flags: bus master, fast devsel, latency 0, IRQ 298
     Memory at 01000000 (32-bit, non-prefetchable) [size=1M]
     Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
   ...


PCIe bus scanning now shows that all devices are discovered again, and a 
huge amount of warnings & errors have vanished.
I'll send patches to upstream kernel & u-boot to fix the BNR register 
value on reset, and provide a backport to LEDE. (from kernel patch)


Koen



More information about the Lede-dev mailing list