How make Rock5B's 22x30mm M.2 PCIe slot work on Linux?

Hi,

I plugged in a 22x30mm M.2 A+E PCIe card in the upper slot on the Rock5B. When I boot Radxa’s latest Debain image (20221031 at https://wiki.radxa.com/Rock5/downloads), when booting, the device is not identified at all.

I’m aware that M.2 slot is backed by a multi-function interface on the RK3588 that can be set to SATA and USB mode too. I thought maybe the slot is set in the wrong mode and that’s why Linux does not find my device.

Can you please confirm if any particular configuration is needed to set the slot to single-lane PCIe v2 mode?

Thanks

@jack @matt911

The M.2 E key is set to PCIe by default. Please send the output of the following command:

dmesg | grep pcie

What model is your PCIe card?

@jack see paste below. It’s a Realtek 2.5gbit Ethernet adapter.

Thanks for confirming that it’s set to PCIe by default.

Do you have any idea what’s wrong?

An expert told me he thinks the ”Missing config reg space” error which is reported for all three PCI interfaces looks strange. The three PCI interfaces are 1. lower M2, 2. upper M2 and 3. the built-in Ethernet.

dmesg | grep pcie

[ 2.122737] reg-fixed-voltage vcc3v3-pcie2x1l0: Looking up vin-supply from device tree
[ 2.122741] vcc3v3_pcie2x1l0: supplied by vcc5v0_sys
[ 2.181029] vcc3v3_pcie2x1l0: 3300 mV, enabled
[ 2.181092] reg-fixed-voltage vcc3v3-pcie2x1l0: vcc3v3_pcie2x1l0 supplying 3300000uV
[ 2.181142] vcc3v3_pcie30: 3300 mV, disabled
[ 2.181183] reg-fixed-voltage vcc3v3-pcie30: Looking up vin-supply from device tree
[ 2.181186] vcc3v3_pcie30: supplied by vcc5v0_sys
[ 2.181218] reg-fixed-voltage vcc3v3-pcie30: vcc3v3_pcie30 supplying 3300000uV
[ 3.175009] rk-pcie fe150000.pcie: invalid prsnt-gpios property in node
[ 3.175018] rk-pcie fe150000.pcie: Looking up vpcie3v3-supply from device tree
[ 3.175108] rk-pcie fe170000.pcie: invalid prsnt-gpios property in node
[ 3.175118] rk-pcie fe170000.pcie: Looking up vpcie3v3-supply from device tree
[ 3.180605] rk-pcie fe170000.pcie: missing legacy IRQ resource
[ 3.180620] rk-pcie fe170000.pcie: IRQ msi not found
[ 3.180625] rk-pcie fe170000.pcie: use outband MSI support
[ 3.180631] rk-pcie fe170000.pcie: Missing config reg space
[ 3.180649] rk-pcie fe170000.pcie: host bridge /pcie@fe170000 ranges:
[ 3.180671] rk-pcie fe170000.pcie: err 0x00f2000000…0x00f20fffff -> 0x00f2000000
[ 3.180686] rk-pcie fe170000.pcie: IO 0x00f2100000…0x00f21fffff -> 0x00f2100000
[ 3.180703] rk-pcie fe170000.pcie: MEM 0x00f2200000…0x00f2ffffff -> 0x00f2200000
[ 3.180718] rk-pcie fe170000.pcie: MEM 0x0980000000…0x09bfffffff -> 0x0980000000
[ 3.180747] rk-pcie fe170000.pcie: Missing config reg space
[ 3.180775] rk-pcie fe170000.pcie: invalid resource
[ 3.191502] rk-pcie fe150000.pcie: missing legacy IRQ resource
[ 3.191517] rk-pcie fe150000.pcie: IRQ msi not found
[ 3.191522] rk-pcie fe150000.pcie: use outband MSI support
[ 3.191527] rk-pcie fe150000.pcie: Missing config reg space
[ 3.191539] rk-pcie fe150000.pcie: host bridge /pcie@fe150000 ranges:
[ 3.191561] rk-pcie fe150000.pcie: err 0x00f0000000…0x00f00fffff -> 0x00f0000000
[ 3.191580] rk-pcie fe150000.pcie: IO 0x00f0100000…0x00f01fffff -> 0x00f0100000
[ 3.191599] rk-pcie fe150000.pcie: MEM 0x00f0200000…0x00f0ffffff -> 0x00f0200000
[ 3.191611] rk-pcie fe150000.pcie: MEM 0x0900000000…0x093fffffff -> 0x0900000000
[ 3.191637] rk-pcie fe150000.pcie: Missing config reg space
[ 3.191666] rk-pcie fe150000.pcie: invalid resource
[ 3.385598] rk-pcie fe170000.pcie: PCIe Linking… LTSSM is 0x3
[ 3.398930] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.424467] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.451137] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.467807] rk-pcie fe170000.pcie: PCIe Link up, LTSSM is 0x130011
[ 3.467975] rk-pcie fe170000.pcie: PCI host bridge to bus 0002:20
[ 3.481136] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.506286] pcieport 0002:20:00.0: PME: Signaling with IRQ 140
[ 3.507779] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.534445] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.561129] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.591148] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.617819] rk-pcie fe150000.pcie: PCIe Linking… LTSSM is 0x0
[ 3.633395] vcc3v3_pcie2x1l2: 3300 mV, enabled
[ 3.633479] reg-fixed-voltage vcc3v3-pcie2x1l2: Looking up vin-supply from device tree
[ 3.633499] vcc3v3_pcie2x1l2: supplied by vcc_3v3_s3
[ 3.633609] reg-fixed-voltage vcc3v3-pcie2x1l2: vcc3v3_pcie2x1l2 supplying 3300000uV
[ 3.782393] rk-pcie fe190000.pcie: invalid prsnt-gpios property in node
[ 3.782408] rk-pcie fe190000.pcie: Looking up vpcie3v3-supply from device tree
[ 3.783030] rk-pcie fe190000.pcie: missing legacy IRQ resource
[ 3.783047] rk-pcie fe190000.pcie: IRQ msi not found
[ 3.783052] rk-pcie fe190000.pcie: use outband MSI support
[ 3.783059] rk-pcie fe190000.pcie: Missing config reg space
[ 3.783073] rk-pcie fe190000.pcie: host bridge /pcie@fe190000 ranges:
[ 3.783104] rk-pcie fe190000.pcie: err 0x00f4000000…0x00f40fffff -> 0x00f4000000
[ 3.783135] rk-pcie fe190000.pcie: IO 0x00f4100000…0x00f41fffff -> 0x00f4100000
[ 3.783161] rk-pcie fe190000.pcie: MEM 0x00f4200000…0x00f4ffffff -> 0x00f4200000
[ 3.783173] rk-pcie fe190000.pcie: MEM 0x0a00000000…0x0a3fffffff -> 0x0a00000000
[ 3.783209] rk-pcie fe190000.pcie: Missing config reg space
[ 3.783244] rk-pcie fe190000.pcie: invalid resource
[ 4.047920] rk-pcie fe190000.pcie: PCIe Link up, LTSSM is 0x130011
[ 4.048154] rk-pcie fe190000.pcie: PCI host bridge to bus 0004:40
[ 4.074605] pcieport 0004:40:00.0: PME: Signaling with IRQ 153
[ 6.097857] rk-pcie fe150000.pcie: PCIe Link Fail
[ 6.097871] rk-pcie fe150000.pcie: failed to initialize host
[ 6.100276] rockchip-pm-domain fd8d8000.power-management:power-controller: Looking up pcie-supply from device tree
[ 6.100312] rockchip-pm-domain fd8d8000.power-management:power-controller: Looking up pcie-supply property in node /power-management@fd8d8000/power-controller failed
[ 34.084762] vcc3v3_pcie30: disabling

I think I may have bought something incompatible. Idk .

I guess I needed the 7265 ?

@Aaron_G could you have the same problem as me, can you paste output of dmesg | grep pcie please?

Also which exact Linux distribution are you using

It doesn’t fit. Embarrassing. Friends told me 7260 so I just bought it. I used to know more about hardware.

@Aaron_G that’s miniPCI. You can buy an M2 to miniPCI adaptor.

1 Like

Thanks. I looked and it is cheaper to just order a different card. I see https://wiki.radxa.com/Rock5/hardware/wifi has the list I was looking for.

Hi @jack @radxa @hipboi / Radxa, to your awareness has this supposed Linux kernel bug been fixed by now?

There is a 1 Feb 2023 release of Debian at Releases · radxa/debos-radxa (github.com) . Perhaps I should just try it to see if it makes any difference.

(Note the Rock5/downloads - Radxa Wiki page still links to October 2022.)

We are going to release a new image for ROCK 5B in May. The download link apply to the known stable one but not the latest.

1 Like

@jack Many thanks for saying. May I as well try with the 1 Feb Rock5B image (Release 20230201-0944 · radxa/debos-radxa · GitHub) or is this indeed the same kernel and kernel configuration as in October so it definitely will have the same issues?

If you are talking about missing *config* reg space it is probably not a bug. See here:

Rockchip’s PCIe host controller is licensed from DesignWare.

debos-radxa is deprecated. If you want to check if the PCIe support will be fixed in the planned May release you can play with this Alpha build: https://github.com/radxa-build/rock-5b/releases/tag/test-build-2

2 Likes

@RadxaYuntian Thanks for responding.

Aha so the whole https://github.com/radxa/debos-radxa/ repo is deprecated, so any Debian distribution should be downloaded from https://github.com/radxa-build/rock-5b/releases/ , is it correct?

Also the meaning of the XFCE and KDE Debian distribution names is clear. The “CLI” distribution, is CLI to mean Command Line Interface as in a text screen mode only distribution without X?

I see. Are you saying the config reg space error message is of no consequence and the issue I had was instead separate that the Linux kernel did not have a driver for my PCIe NIC,

or are you saying the kernel patch you referenced from 2015 will be included at first in the next Debian release you publish next week?

With the previous Debian distribution, would Rock5B’s M.2 slot work for any device at all, e.g. M.2 NVMe SSD:s?

You need the ngw model type if you are in UK I can sell you one for cheap. A8 module.
Or you can wait and get this: https://a.aliexpress.com/_m0W77WC

Yes, and https://github.com/radxa-build/rock-5b/releases/latest will be updated to point to the latest production release.

Yes but it’s also missing some non-X Rockchip packages, for example, video decoding or camera profiles. Those packages are available in our apt repo, so advanced users can install them on top of this minimal image.

The proposed patch suppresses the warning, not fixing the underlying issue you were facing. Your issue was that i225 driver was not included in the kernel.

NVMe should work. We have guide about using NVMe SSD as boot device.

For followup on this thread, I believe the issue was not that PCIe did not work on the Rock5B, but instead, the PCIe worked fine but my etherenet adapter was Intel i225v based, and the issue was actually that the Debian image did not contian the driver for it, which has the name gbc.

While this Ethernet chip is not new, other Linux distributions had the same issue apparently, discussed for instance here https://forums.debian.net/viewtopic.php?t=151101 Still No Driver for Intel i225v 2.5Gbit/s Ethernet card? - Debian User Forums.

One way to see that the PCI indeed works and it’s a driver issue, is run the lspci -v tool. It shows the PCIe device, however there is no “driver” row in the printout, and this means no driver matched the device so it’s left dormant.

@RadxaYuntian I understood it correctly, right?

You also need Kernel modules to have some value in lspci, as driver(s) are provided by the module. So if you have a module blacklisted, you could still see the matching driver listed, but won’t be able to use it as the module is not loaded.

I225-V driver is actually called igc though, and we have this enabled in the latest kernel. You can run grep CONFIG_IGC /boot/config* and you should see CONFIG_IGC=m which means the IGC driver is complied as a module. Can you try running sudo modprobe igc and see if it works?

If above still doesn’t work please send the output of lspci -nnk here.