PCIe not detecting on rpb?

I recently installed rpb on my hikey960 board and it seems that the pcie is not detected. I used snapshot from https://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/137/rpb/.

I plug in a minipcie wifi card with the pcie adaptor board to the m.2 slot, and lspci shows nothing. What’s strange is that there is no file ‘driver’ under /sys/devices/platform/soc/f4000000.pcie/, and the file ‘driver-override’ reads (null). I think the ‘driver’ file under this directory should read ‘kirin-pcie’ if everything works.

Also, I used ‘dmesg | grep -i pci’ and got the following output:

[ 0.000000] PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000 ( 16 MB)
[ 0.311360] PCI: CLS 0 bytes, default 128
[ 0.427008] ehci-pci: EHCI PCI platform driver
[ 0.427258] ohci-pci: OHCI PCI platform driver
[ 0.889272] tcpci_timer_init : init OK
[ 1.611616] [E/hisi_pd] tcpci_disable_vbus_control: !!!++++++++

Any idea where’s wrong?

Yes, driver probe fails because it does not find the ‘reset-gpio’ resource. Actually this gpio is named ‘reset-gpios’ in the device tree. So we need to align the driver with this name. So for now you can try to fix and rebuild the kernel or use the following DTB (in /boot/) as temporary solution: https://fileserver.linaro.org/owncloud/index.php/s/TQ0aQ4n2UNL2as2

patch submitted: https://patchwork.kernel.org/patch/10320855/

Hi, Loic

Thanks for your analysis. I also met this error. I saw your modification. But in my native kernel4.9 source code.
arch/arm64/boot/dts/hisilicon/hi3660.dtsi
pcie@f4000000 {
compatible = “hisilicon,kirin-pcie”;

reset-gpio = <&gpio11 1 0 >;
}
So I don’t need to modify the drivers/pci/dwc/pcie-kirin.c, right?
But my wifi pcie card still could not be detected.
my log as follows,
console:/ # dmesg |grep -i pci
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 1.779330] PCI: CLS 0 bytes, default 128
[ 1.867824] OF: PCI: host bridge /soc/pcie@f4000000 ranges:
[ 1.867846] OF: PCI: MEM 0xf6000000…0xf7ffffff → 0x00000000
[ 2.868550] Kirin-pcie f4000000.pcie: Link Fail
[ 2.868658] Kirin-pcie f4000000.pcie: PCI host bridge to bus 0000:00
[ 2.868671] pci_bus 0000:00: root bus resource [bus 00-01]
[ 2.868682] pci_bus 0000:00: root bus resource [mem 0xf6000000-0xf7ffffff] (bus address [0x00000000-0x01ffffff])
[ 2.868721] pci 0000:00:00.0: [19e5:3660] type 01 class 0x060400
[ 2.868759] pci 0000:00:00.0: reg 0x10: [mem 0xf6000000-0xf6ffffff]
[ 2.868898] pci 0000:00:00.0: supports D1 D2
[ 2.868907] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
[ 2.869183] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [bus 00-01] (conflicts with (null) [bus 00-01])
[ 2.869235] pci 0000:00:00.0: BAR 0: assigned [mem 0xf6000000-0xf6ffffff]
[ 2.869250] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[ 2.869530] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[ 2.869544] pcie_pme 0000:00:00.0:pcie001: service driver pcie_pme loaded
[ 2.869651] aer 0000:00:00.0:pcie002: service driver aer loaded
[ 2.954578] ehci-pci: EHCI PCI platform driver
[ 2.954859] ohci-pci: OHCI PCI platform driver
[ 3.199242] DRV_IPCIntInit begin.
[ 3.199252] DRV_IPCIntInit line = 220
[ 3.199271] BSP_DRV_IPCIntInit end.
[ 3.231146] tcpci_timer_init : init OK

Yeah, I seem to be facing a similar problem with you. (I used the dtb provided by @Loic instead ) The root bus is detected, but not the mini-pcie card. I get the following output whether or not my card is inserted.

[ 0.000000] PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000 ( 16 MB)
[ 0.309529] PCI: CLS 0 bytes, default 128
[ 0.368044] OF: PCI: host bridge /soc/pcie@f4000000 ranges:
[ 0.368065] OF: PCI: MEM 0xf6000000…0xf7ffffff → 0x00000000
[ 1.372671] kirin-pcie f4000000.pcie: Link Fail
[ 1.372802] kirin-pcie f4000000.pcie: PCI host bridge to bus 0000:00
[ 1.372808] pci_bus 0000:00: root bus resource [bus 00-01]
[ 1.372814] pci_bus 0000:00: root bus resource [mem 0xf6000000-0xf7ffffff] (bus address [0x00000000-0x01ffffff])
[ 1.372845] pci 0000:00:00.0: [19e5:3660] type 01 class 0x060400
[ 1.372892] pci 0000:00:00.0: reg 0x10: [mem 0xf6000000-0xf6ffffff 64bit]
[ 1.372989] pci 0000:00:00.0: supports D1 D2
[ 1.372993] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
[ 1.373236] pci 0000:00:00.0: BAR 0: assigned [mem 0xf6000000-0xf6ffffff 64bit]
[ 1.373253] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 1.373539] pcieport 0000:00:00.0: Signaling PME with IRQ 66
[ 1.373622] pcieport 0000:00:00.0: AER enabled with IRQ 66
[ 1.465616] ehci-pci: EHCI PCI platform driver
[ 1.465886] ohci-pci: OHCI PCI platform driver
[ 1.928138] tcpci_timer_init : init OK
[ 2.645929] [E/hisi_pd] tcpci_disable_vbus_control: !!!++++++++

Strangely, there isn’t the line as shown in @Island_Zhao 's trace.

[ 2.869183] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [bus 00-01] (conflicts with (null) [bus 00-01])

(I think this line at least indicates that it has discovered something.)

Yes the following line seems suspicious as well:

[ 1.372671] kirin-pcie f4000000.pcie: Link Fail

Did you try with an Android image ? do you reproduce the same issue ?

I’ll give it a shot the other day when I have time. I guess I have to use the 4.4 or 4.9 branch kernel this time for the latest 4.14 kernel also has incompability with dts and driver.

I tried with my android image with AOSP kernel from 4.9 branch, and it works. The ‘Link Fail’ line is gone when I insert my card and I can see it from lspci. I didn’t build the driver with the kernel so I don’t know if it will function correctly but at least it is detecting. I also saw the following line but I have no idea if it matters.

[ 1.879027] pci_bus 0000:01: busn_res: can not insert [bus 01-ff] under [bus 00-01] (conflicts with (null) [bus 00-01])

By the way, can I use the AOSP kernel with rpb image (with the config from rpb instead)?

Yes you can, but we should find ideally what is wrong with RPB version, can come from DTB misalignment or from the driver itself.

Thanks a lot. I’ll try further with android and rpb and see.

Did you get any further with this? I’m having the same problem (bridge visible, whatever is connected is not, and a link failure).

Hi jbding,

What is the exact commit you are using on the working 4.9 android kernel? I am trying to get a working PCIe on the hikey960, but am running into the same link fail error you were seeing.

Bas Vermeulen

Does PCIe work on your side with Android OS?

I’m not using android at the moment, but I should be able to check in a couple of days.