<div>Hi,</div><div>as you've suggested, I've added a printout inside fsl_pcie_check_link() which is called twice and returns 0 both times.</div><div>Here follows the PCI-related part of dmesg with some extra printouts enabled.</div>
<div><br></div><div>thank you,</div><div>Davide</div><div><br></div><div>...</div><div>Adding PCI host bridge /pcie@ffe09000</div><div>*** [/pcie@ffe09000] fsl_pcie_check_link() val=0x16 => return 0</div><div>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div>
<div>Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->255</div><div> ->Hose at 0xc05a2000, cfg_addr=0xff7fd000,cfg_data=0xff7fd004</div><div>PCI host bridge /pcie@ffe09000  ranges:</div><div>
 MEM 0x00000000a0000000..0x00000000afffffff -> 0x00000000a0000000 </div><div>  IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000</div><div>PCI memory map start 0x00000000ffe09000, size 0x0000000000001000</div>
<div>PCI MEM resource start 0x00000000a0000000, size 0x0000000010000000.</div><div>PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy base 0x00000000ffc10000.</div><div>/pcie@ffe09000: PCICSRBAR @ 0xfff00000</div>
<div><br></div><div>Adding PCI host bridge /pcie@ffe0a000</div><div>*** [/pcie@ffe0a000] fsl_pcie_check_link() val=0x16 => return 0</div><div>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div>Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: 0->255</div>
<div> ->Hose at 0xc05a20e0, cfg_addr=0xff7eb000,cfg_data=0xff7eb004</div><div>PCI host bridge /pcie@ffe0a000  ranges:</div><div> MEM 0x00000000b0000000..0x00000000bfffffff -> 0x00000000b0000000 </div><div>  IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000</div>
<div>PCI memory map start 0x00000000ffe0a000, size 0x0000000000001000</div><div>PCI MEM resource start 0x00000000b0000000, size 0x0000000010000000.</div><div>PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy base 0x00000000ffc00000.</div>
<div>/pcie@ffe0a000: PCICSRBAR @ 0xfff00000</div><div><br></div><div>...</div><div><br></div><div>PCI: Probing PCI hardware</div><div>PCI: Scanning PHB /pcie@ffe09000</div><div>PCI: PHB IO resource    = 00000000ff7ed000-00000000ff7fcfff [100]</div>
<div>PCI: PHB MEM resource 0 = 00000000a0000000-00000000afffffff [200]</div><div>PCI: PHB MEM offset     = 0000000000000000</div><div>PCI: PHB IO  offset     = ff7ed000</div><div>    probe mode: 0</div><div>pci_bus 0000:00: scanning bus</div>
<div>pci 0000:00:00.0: found [1957:0100] class 000b20 header type 01</div><div>pci 0000:00:00.0: ignoring class b20 (doesn't match header type 01)</div><div>pci 0000:00:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54</div>
<div>pci 0000:00:00.0: calling pcibios_fixup_resources+0x0/0x19c</div><div>pci 0000:00:00.0: calling quirk_fsl_pcie_header+0x0/0x50</div><div>pci 0000:00:00.0: calling quirk_resource_alignment+0x0/0x1a8</div><div>pci 0000:00:00.0: supports D1 D2</div>
<div>pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold</div><div>pci 0000:00:00.0: PME# disabled</div><div>pci_bus 0000:00: fixups for bus</div><div>PCI: Fixup bus devices 0 (PHB)</div><div>pci_busdev_to_OF_node(0,0x0)</div>
<div> parent is /pcie@ffe09000</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div><div> result is /pcie@ffe09000/pcie@0</div><div>PCI: Try to map irq for 0000:00:00.0...</div><div>pci_busdev_to_OF_node(0,0x0)</div>
<div> parent is /pcie@ffe09000</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div><div> result is /pcie@ffe09000/pcie@0</div><div>pci 0000:00:00.0: scanning [bus 01-01] behind bridge, pass 0</div><div>
pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1</div><div>pci_bus 0000:01: scanning bus</div><div>pci 0000:01:00.0: found [1b65:abba] class 000280 header type 00</div><div>pci 0000:01:00.0: reg 10: [mem 0xa0000000-0xa00003ff]</div>
<div>pci 0000:01:00.0: reg 14: [mem 0xa0010000-0xa001ffff]</div><div>pci 0000:01:00.0: calling pcibios_fixup_resources+0x0/0x19c</div><div>PCI:0000:01:00.0 Resource 0 00000000a0000000-00000000a00003ff [40200] fixup...</div>
<div>PCI:0000:01:00.0            00000000a0000000-00000000a00003ff</div><div>PCI:0000:01:00.0 Resource 1 00000000a0010000-00000000a001ffff [40200] fixup...</div><div>PCI:0000:01:00.0            00000000a0010000-00000000a001ffff</div>
<div>pci 0000:01:00.0: calling quirk_resource_alignment+0x0/0x1a8</div><div>pci_bus 0000:01: fixups for bus</div><div>pci 0000:00:00.0: PCI bridge to [bus 01-ff]</div><div>pci 0000:00:00.0:   bridge window [io  0x0000-0x0000] (disabled)</div>
<div>pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xa00fffff]</div><div>pci 0000:00:00.0:   bridge window [mem 0x10000000-0x000fffff pref] (disabled)</div><div>PCI:0000:00:00.0 Bus rsrc 1 00000000a0000000-00000000a00fffff [200] fixup...</div>
<div>PCI:0000:00:00.0            00000000a0000000-00000000a00fffff</div><div>PCI: Fixup bus devices 1 (0000:00:00.0)</div><div>pci_busdev_to_OF_node(1,0x0)</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div>
<div> parent is /pcie@ffe09000/pcie@0</div><div> result is <NULL></div><div>PCI: Try to map irq for 0000:01:00.0...</div><div>pci_busdev_to_OF_node(1,0x0)</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div>
<div> parent is /pcie@ffe09000/pcie@0</div><div> result is <NULL></div><div>pci_busdev_to_OF_node(0,0x0)</div><div> parent is /pcie@ffe09000</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div>
<div> result is /pcie@ffe09000/pcie@0</div><div> Got one, spec 1 cells (0x00000001 0xffffffff...) on /soc@ffe00000/pic@40000</div><div>  alloc irq_desc for 16 on node 0</div><div>  alloc kstat_irqs on node 0</div><div>irq: irq 1 on host /soc@ffe00000/pic@40000 mapped to virtual irq 16</div>
<div> Mapped to linux irq 16</div><div>pci_bus 0000:01: bus scan returning with max=01</div><div>pci_bus 0000:00: bus scan returning with max=01</div><div>PCI: Scanning PHB /pcie@ffe0a000</div><div>PCI: PHB IO resource    = 00000000ff7db000-00000000ff7eafff [100]</div>
<div>PCI: PHB MEM resource 0 = 00000000b0000000-00000000bfffffff [200]</div><div>PCI: PHB MEM offset     = 0000000000000000</div><div>PCI: PHB IO  offset     = ff7db000</div><div>    probe mode: 0</div><div>pci_bus 0001:02: scanning bus</div>
<div>pci 0001:02:00.0: found [1957:0100] class 000b20 header type 01</div><div>pci 0001:02:00.0: ignoring class b20 (doesn't match header type 01)</div><div>pci 0001:02:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54</div>
<div>pci 0001:02:00.0: calling pcibios_fixup_resources+0x0/0x19c</div><div>pci 0001:02:00.0: calling quirk_fsl_pcie_header+0x0/0x50</div><div>pci 0001:02:00.0: calling quirk_resource_alignment+0x0/0x1a8</div><div>pci 0001:02:00.0: supports D1 D2</div>
<div>pci 0001:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold</div><div>pci 0001:02:00.0: PME# disabled</div><div>pci_bus 0001:02: fixups for bus</div><div>PCI: Fixup bus devices 2 (PHB)</div><div>pci_busdev_to_OF_node(2,0x0)</div>
<div> parent is /pcie@ffe0a000</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div><div> result is /pcie@ffe0a000/pcie@0</div><div>PCI: Try to map irq for 0001:02:00.0...</div><div>pci_busdev_to_OF_node(2,0x0)</div>
<div> parent is /pcie@ffe0a000</div><div>*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0</div><div> result is /pcie@ffe0a000/pcie@0</div><div>pci 0001:02:00.0: scanning [bus 01-01] behind bridge, pass 0</div><div>
pci 0001:02:00.0: bus configuration invalid, reconfiguring</div><div>pci 0001:02:00.0: scanning [bus 00-00] behind bridge, pass 1</div><div>pci_bus 0001:03: scanning bus</div><div>pci_bus 0001:03: fixups for bus</div><div>
pci 0001:02:00.0: PCI bridge to [bus 03-ff]</div><div>pci 0001:02:00.0:   bridge window [io  0x0000-0x0000] (disabled)</div><div>pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xb00fffff]</div><div>pci 0001:02:00.0:   bridge window [mem 0x10000000-0x000fffff pref] (disabled)</div>
<div>PCI:0001:02:00.0 Bus rsrc 1 00000000b0000000-00000000b00fffff [200] fixup...</div><div>PCI:0001:02:00.0            00000000b0000000-00000000b00fffff</div><div>PCI: Fixup bus devices 3 (0001:02:00.0)</div><div>pci_bus 0001:03: bus scan returning with max=03</div>
<div>pci_bus 0001:02: bus scan returning with max=03</div><div>PCI->OF bus map (pci_bus_count=4):</div><div>0 -> 0</div><div>2 -> 0</div><div>PCI: Allocating bus resources for 0000:00...</div><div>PCI: PHB (bus 0) bridge rsrc 0: 00000000ff7ed000-00000000ff7fcfff [0x100], parent c04cd81c (PCI IO)</div>
<div>PCI: PHB (bus 0) bridge rsrc 1: 00000000a0000000-00000000afffffff [0x200], parent c04cd800 (PCI mem)</div><div>PCI: Allocating bus resources for 0000:01...</div><div>PCI: 0000:00:00.0 (bus 1) bridge rsrc 0: 00000000ff7ed000-00000000ff7fcfff [0x100], parent c05a204c (/pcie@ffe09000)</div>
<div>PCI: 0000:00:00.0 (bus 1) bridge rsrc 1: 00000000a0000000-00000000afffffff [0x200], parent c05a2068 (/pcie@ffe09000)</div><div>PCI: Allocating bus resources for 0001:02...</div><div>PCI: PHB (bus 2) bridge rsrc 0: 00000000ff7db000-00000000ff7eafff [0x100], parent c04cd81c (PCI IO)</div>
<div>PCI: PHB (bus 2) bridge rsrc 1: 00000000b0000000-00000000bfffffff [0x200], parent c04cd800 (PCI mem)</div><div>PCI: Allocating bus resources for 0001:03...</div><div>PCI: 0001:02:00.0 (bus 3) bridge rsrc 0: 00000000ff7db000-00000000ff7eafff [0x100], parent c05a212c (/pcie@ffe0a000)</div>
<div>PCI: 0001:02:00.0 (bus 3) bridge rsrc 1: 00000000b0000000-00000000bfffffff [0x200], parent c05a2148 (/pcie@ffe0a000)</div><div>PCI: Allocating 0000:01:00.0: Resource 0: 00000000a0000000..00000000a00003ff [40200]</div>
<div>PCI: Allocating 0000:01:00.0: Resource 1: 00000000a0010000..00000000a001ffff [40200]</div><div>Reserving legacy ranges for domain 0000</div><div>Candidate legacy IO: [io  0xff7ed000-0xff7edfff]</div><div>PCI 0000:00 Cannot reserve Legacy IO [io  0xff7ed000-0xff7edfff]</div>
<div>hose mem offset: 0000000000000000</div><div>hose mem res: [mem 0xa0000000-0xafffffff]</div><div>Reserving legacy ranges for domain 0001</div><div>Candidate legacy IO: [io  0xff7db000-0xff7dbfff]</div><div>PCI 0001:02 Cannot reserve Legacy IO [io  0xff7db000-0xff7dbfff]</div>
<div>hose mem offset: 0000000000000000</div><div>hose mem res: [mem 0xb0000000-0xbfffffff]</div><div>PCI: Assigning unassigned resources...</div><div>pci 0000:00:00.0: PCI bridge to [bus 01-01]</div><div>pci 0000:00:00.0:   bridge window [io  0xff7ed000-0xff7fcfff]</div>
<div>pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xafffffff]</div><div>pci 0000:00:00.0:   bridge window [mem pref disabled]</div><div>pci 0000:00:00.0: enabling device (0106 -> 0107)</div><div>pci 0001:02:00.0: PCI bridge to [bus 03-03]</div>
<div>pci 0001:02:00.0:   bridge window [io  0xff7db000-0xff7eafff]</div><div>pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xbfffffff]</div><div>pci 0001:02:00.0:   bridge window [mem pref disabled]</div><div>pci 0001:02:00.0: enabling device (0106 -> 0107)</div>
<div>pci_bus 0000:00: resource 0 [io  0xff7ed000-0xff7fcfff]</div><div>pci_bus 0000:00: resource 1 [mem 0xa0000000-0xafffffff]</div><div>pci_bus 0000:01: resource 0 [io  0xff7ed000-0xff7fcfff]</div><div>pci_bus 0000:01: resource 1 [mem 0xa0000000-0xafffffff]</div>
<div>pci_bus 0001:02: resource 0 [io  0xff7db000-0xff7eafff]</div><div>pci_bus 0001:02: resource 1 [mem 0xb0000000-0xbfffffff]</div><div>pci_bus 0001:03: resource 0 [io  0xff7db000-0xff7eafff]</div><div>pci_bus 0001:03: resource 1 [mem 0xb0000000-0xbfffffff]</div>
<div>bio: create slab <bio-0> at 0</div><div>vgaarb: loaded</div><div>SCSI subsystem initialized</div><div>libata version 3.00 loaded.</div><div>Freescale Elo / Elo Plus DMA driver</div><div>Switching to clocksource timebase</div>
<div>NET: Registered protocol family 2</div><div><br></div><div>pci 0000:00:00.0: calling quirk_cardbus_legacy+0x0/0x50</div><div>pci 0000:00:00.0: calling quirk_usb_early_handoff+0x0/0x6ac</div><div>pci 0000:01:00.0: calling quirk_cardbus_legacy+0x0/0x50</div>
<div>pci 0000:01:00.0: calling quirk_usb_early_handoff+0x0/0x6ac</div><div>pci 0001:02:00.0: calling quirk_cardbus_legacy+0x0/0x50</div><div>pci 0001:02:00.0: calling quirk_usb_early_handoff+0x0/0x6ac</div><div><br></div>
<br><div class="gmail_quote">2012/9/26 Kumar Gala <span dir="ltr"><<a href="mailto:galak@kernel.crashing.org" target="_blank">galak@kernel.crashing.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
> 2012/9/24 Davide Viti <<a href="mailto:zinosat@tiscali.it">zinosat@tiscali.it</a>><br>
> Hi,<br>
> does the output I've included show anything wrong or should I post something else to help identifying the cause of the problem?<br>
><br>
> thank you in advance,<br>
> Davide<br>
><br>
> 2012/9/21 Davide Viti <<a href="mailto:zinosat@tiscali.it">zinosat@tiscali.it</a>><br>
> I mean there are two controllers and both of them have a device "subtended" (both 0x1b65:0xabba).<br>
> u-boot can see both devices, linux detects only the device attached to the first controller.<br>
><br>
> Here's the output of lspci and /proc/iomem :<br>
><br>
> root@(none):/# lspci -v<br>
><br>
> 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)<br>
><br>
>         Flags: bus master, fast devsel, latency 0<br>
><br>
>         Memory at <ignored> (32-bit, non-prefetchable)<br>
><br>
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0<br>
><br>
>         I/O behind bridge: 00000000-00000fff<br>
><br>
>         Memory behind bridge: a0000000-afffffff<br>
><br>
>         Capabilities: [44] Power Management version 2<br>
><br>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00<br>
><br>
>         Capabilities: [100] Advanced Error Reporting<br>
><br>
><br>
> 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)<br>
><br>
>         Flags: bus master, fast devsel, latency 0, IRQ 16<br>
><br>
>         Memory at a0000000 (32-bit, non-prefetchable) [size=1K]<br>
><br>
>         Memory at a0010000 (32-bit, non-prefetchable) [size=64K]<br>
><br>
>         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+<br>
><br>
>         Capabilities: [78] Power Management version 3<br>
><br>
>         Capabilities: [80] Express Endpoint, MSI 00<br>
><br>
>         Capabilities: [100] Virtual Channel <?><br>
><br>
>         Capabilities: [800] Advanced Error Reporting<br>
><br>
><br>
> 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)<br>
><br>
>         Flags: bus master, fast devsel, latency 0<br>
><br>
>         Memory at <ignored> (32-bit, non-prefetchable)<br>
><br>
>         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0<br>
><br>
>         I/O behind bridge: 00000000-00000fff<br>
><br>
>         Memory behind bridge: b0000000-bfffffff<br>
><br>
>         Capabilities: [44] Power Management version 2<br>
><br>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00<br>
><br>
>         Capabilities: [100] Advanced Error Reporting<br>
<br>
</div></div>Its possible that in linux the 2nd controller does not believe it has link status.  Can you see if there is a function like fsl_pcie_check_link() in your kernel.  If so maybe add a printk debug message there and see what gets return.<br>

<br>
Also helpful to post a full boot log.<br>
<div><div class="h5"><br>
><br>
><br>
><br>
><br>
> root@(none):/# cat /proc/iomem<br>
><br>
> a0000000-afffffff : /pcie@ffe09000<br>
><br>
>   a0000000-afffffff : PCI Bus 0000:01<br>
><br>
>     a0000000-a00003ff : 0000:01:00.0<br>
><br>
>     a0010000-a001ffff : 0000:01:00.0<br>
><br>
> b0000000-bfffffff : /pcie@ffe0a000<br>
><br>
>   b0000000-bfffffff : PCI Bus 0001:03<br>
><br>
> ef000000-efffffff : ef000000.nor<br>
><br>
> ffe04500-ffe04507 : serial<br>
><br>
> ffe04600-ffe04607 : serial<br>
><br>
><br>
><br>
> thanx for your help,<br>
><br>
> Davide<br>
><br>
><br>
><br>
><br>
> I mean that the kernel detects the first controller and the device attached to it, plus the second controller: the device on the second controller is not detected (same device as the one detected on the first controller)<br>

><br>
> 2012/9/21 Kumar Gala <<a href="mailto:galak@kernel.crashing.org">galak@kernel.crashing.org</a>><br>
><br>
> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:<br>
><br>
> > Hi,<br>
> > I'm working on a custom board based on P1020 with two (identical) PCI devices attached;<br>
> > The work is derived from another board with a single instance of that device.<br>
> > The system is based on u-boot-2009.11 and Linux 2.6.34.6<br>
> ><br>
> > The "pci" command on u-boot, shows me both the PCI controllers and<br>
> > the attached devices:<br>
> ><br>
> > Scanning PCI devices on bus 0<br>
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class<br>
> > _____________________________________________________________<br>
> > 00.00.00   0x1957     0x0100     Processor               0x20<br>
> ><br>
> > Scanning PCI devices on bus 1<br>
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class<br>
> > _____________________________________________________________<br>
> > 01.00.00   0x1b65     0xabba     Network controller      0x80<br>
> ><br>
> > Scanning PCI devices on bus 2<br>
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class<br>
> > _____________________________________________________________<br>
> > 02.00.00   0x1957     0x0100     Processor               0x20<br>
> ><br>
> > Scanning PCI devices on bus 3<br>
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class<br>
> > _____________________________________________________________<br>
> > 03.00.00   0x1b65     0xabba     Network controller      0x80<br>
> ><br>
> > The kernel detects only the first instance of the device.<br>
><br>
> What do you mean by first instance of the device ?<br>
><br>
> > Didn't get very far while looking at dts file and kernel logs, so I'm<br>
> > asking for some help on narrowing down the problem.<br>
> ><br>
> > I'm wondering if I can assume that the problem is restricted to<br>
> > kernel/dts and avoid concentrating on uboot.<br>
> > I can provide any log (didn't want to post tons of details on the first<br>
> > message)<br>
><br>
> Probably a dts issue.<br>
><br>
> What does lspci in linux say?<br>
><br>
> - k<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Linuxppc-dev mailing list<br>
> <a href="mailto:Linuxppc-dev@lists.ozlabs.org">Linuxppc-dev@lists.ozlabs.org</a><br>
> <a href="https://lists.ozlabs.org/listinfo/linuxppc-dev" target="_blank">https://lists.ozlabs.org/listinfo/linuxppc-dev</a><br>
<br>
</blockquote></div><br>