Jump to content

Recommended Posts

Posted

Hello dear Armbian Community,

 

I've been trying to get a custom M.2 PCIe Adapter Board, based on the ASMedia ASM1182e PCIe Packet Switch, to work for a couple of days on my NanoPi M4V2. After solving a few other issues, where it didn't even finish pci link training, it's finally being sort-of-recognized by the SBC (Atleast PCI ID [1b21:1182] is being read). But now, whenever the Adapter is plugged into the SBC, it doesn't boot and aborts with a kernel panic. I've read about this issue already in other forums and it seems to be a common problem with the PCIe Implementation on the RK3399. Usually, one just implements a delay between pci link training and scanning to avoid this error.

 

Here are the kernel messages during failed boot, captured with UART:

  Reveal hidden contents

 

There are patches available for building yourself, however after comparing them to the source code of the Kernel I'm using (5.15.25-rockchip64) and looking at the modules, it seems that the patch is already applied, "modinfo -p pcie_rockchip_host" returns a kernel parameter integer (see code snippet below). I just downloaded the Armbian_22.02.1_Nanopim4v2_focal_current_5.15.25_xfce_desktop image, put it on the eMMC-Module and booted. I also activated the pcie-gen2 overlay. 

 

Here's how it looks like when booting normally:

nanopim4v2:~:% modinfo -p pcie_rockchip_host
name:           pcie_rockchip_host
bus_scan_delay: (int)
nanopim4v2:~:% cat /sys/module/pcie_rockchip_host/parameters/bus_scan_delay
-1
nanopim4v2:~:% dmesg | grep pcie
[    2.468434] rockchip-pcie f8000000.pcie: host bridge /pcie@f8000000 ranges:
[    2.468505] rockchip-pcie f8000000.pcie:      MEM 0x00fa000000..0x00fbdfffff -> 0x00fa000000
[    2.469442] rockchip-pcie f8000000.pcie:       IO 0x00fbe00000..0x00fbefffff -> 0x00fbe00000
[    2.475187] rockchip-pcie f8000000.pcie: no bus scan delay, default to 0 ms
[    2.475896] rockchip-pcie f8000000.pcie: no vpcie12v regulator found
[    2.476524] rockchip-pcie f8000000.pcie: no vpcie3v3 regulator found
[    2.977826] rockchip-pcie f8000000.pcie: PCIe link training gen1 timeout!
[    2.978491] rockchip-pcie: probe of f8000000.pcie failed with error -110
nanopim4v2:~:% uname -r
5.15.25-rockchip64

 

Now I've tried to change the PCIe Bus Scan Delay to 1000ms with several different methods, but with no success. Dmesg always shows "no bus scan delay, default to 0 ms" and "cat /sys/module/pcie_rockchip_host/parameters/bus_scan_delay" always returns -1 after reboot.

Methods I've tried:

- Modify /boot/armbianEnv.txt (add extraargs=bus-scan-delay-ms=1000) (does show up in /proc/cmdline)

- Modify /etc/sysctl.conf (add pcie_rockchip_host.bus_scan_delay=1000) and call "sudo deb-systemd-invoke restart procps.service" afterwards ("sudo sysctl -p" doesn't find parameter)

- Create a dedicated .conf file under /etc/sysctl.d/ with same line as above

- sudo modprobe pcie_rockchip_host bus_scan_delay=1000

- echo -n 1000 > /sys/module/pcie_rockchip_host/parameters/bus_scan_delay (no permission, not even as root, probably not supposed to be written to)

- Modify /etc/modules and/or /etc/init/module-init-tools.conf (add either only module name "pcie_rockchip_host" or "pcie_rockchip_host bus_scan_delay=1000") + sudo update-initramfs -u

- Create new .conf file under /etc/modprobe.d/ with new line "options pcie_rockchip_host bus_scan_delay=1000" (plus also module name in /etc/init/module-init-tools.conf)

 

I was hoping that maybe I can change the PCIe Bus Scan Delay without having to build my own kernel, is there a proper way to change this kernel parameter on a pre-built image?

I am still a newbie when it comes to linux so there might be a misunderstanding on my side, please correct me if I'm wrong.

If there is more information required, I'll gladly post it here.

 

Thank you in advance for any help

 

with kind regards,

Florian

 

 

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines