FriendlyARM NanoPi R4S

Manjaro Linux 5.16.2-4
No major changes were done to nanopi,dtsi nor r4s.dts upstream so it should be the same in 5.15 and 5.16

I cannot find this message in the upstream pcie-rockchip-host driver in kernel 5.15 and 5.16 so i think there are additional patches. A matching one is in armbian. But this patch adds a delay that is not configured in the dts so it is not the patch we need.

Yes I found a patch here

while there is no changes to rk3399-nanopi-r4s.dts
We do have dts patched for rockpro64

Please try this image: Index of /~arne_f/highly-experimental/aarch64/nanopi-r4s

The reboot should work now and i have increased the training timeout from 500 to 1000ms

I hope this will find the second nic now.

Thanks but still the same.

I have tried some patches yet but it make it even worse. Now also the working board will not detect the pcie root.

if i unload and reload the driver it works. but this is no solution.
rmmod pcie-rockchip-host
modprobe pcie-rockchip-host

1 Like

Someone just shared with me images of R4S from official website.

They seem to use 2 pcie chips.

RTL8211H and RTL8111H

I think I have the later one. Wil try to zoom in to my device chip to find out.


Can you guys also check which chip is used on your boards?

Hi @spikerguy

Mine is 8111H:

Greetings.

1 Like

Mine is the same with same manufacturing date.
2103

I think Arne must be having RTL8211H version.

I just tried FriendlyArm’s Official FriendlyARM WRT 5.15 image and guess what the pcie lan didn’t work there also.

So I think there is some patch which is part of 5.16 or outside which is making it work on Manjaro ARM.

root@ipfire rockchip]# rmmod pcie-rockchip-host
[root@ipfire rockchip]# modprobe pcie-rockchip-host
[root@ipfire rockchip]# 
[root@ipfire rockchip]# 
[root@ipfire rockchip]# dmesg
[  297.719772] rockchip-pcie f8000000.pcie: host bridge /pcie@f8000000 ranges:
[  297.719827] rockchip-pcie f8000000.pcie:      MEM 0x00fa000000..0x00fbdfffff -> 0x00fa000000
[  297.719851] rockchip-pcie f8000000.pcie:       IO 0x00fbe00000..0x00fbefffff -> 0x00fbe00000
[  297.720618] rockchip-pcie f8000000.pcie: no vpcie12v regulator found
[  297.742828] rockchip-pcie f8000000.pcie: PCI host bridge to bus 0000:00
[  297.742844] pci_bus 0000:00: root bus resource [bus 00-1f]
[  297.742859] pci_bus 0000:00: root bus resource [mem 0xfa000000-0xfbdfffff]
[  297.742874] pci_bus 0000:00: root bus resource [io  0x0000-0xfffff] (bus address [0xfbe00000-0xfbefffff])
[  297.742931] pci 0000:00:00.0: [1d87:0100] type 01 class 0x060400
[  297.743057] pci 0000:00:00.0: supports D1
[  297.743068] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[  297.748230] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[  297.748523] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
[  297.748599] pci 0000:01:00.0: reg 0x10: initial BAR value 0x00000000 invalid
[  297.748610] pci 0000:01:00.0: reg 0x10: [io  size 0x0100]
[  297.748696] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
[  297.748755] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit]
[  297.748813] pci 0000:01:00.0: Upstream bridge's Max Payload Size set to 128 (was 256, max 256)
[  297.748836] pci 0000:01:00.0: Max Payload Size set to 128 (was 128, max 128)
[  297.749199] pci 0000:01:00.0: supports D1 D2
[  297.749209] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[  297.757086] pci_bus 0000:01: busn_res: [bus 01-1f] end is updated to 01
[  297.757127] pci 0000:00:00.0: BAR 8: assigned [mem 0xfa000000-0xfa0fffff]
[  297.757146] pci 0000:01:00.0: BAR 4: assigned [mem 0xfa000000-0xfa003fff 64bit]
[  297.757198] pci 0000:01:00.0: BAR 2: assigned [mem 0xfa004000-0xfa004fff 64bit]
[  297.757270] pci 0000:01:00.0: BAR 0: no space for [io  size 0x0100]
[  297.757283] pci 0000:01:00.0: BAR 0: failed to assign [io  size 0x0100]
[  297.757296] pci 0000:00:00.0: PCI bridge to [bus 01]
[  297.757309] pci 0000:00:00.0:   bridge window [mem 0xfa000000-0xfa0fffff]
[  297.757521] pcieport 0000:00:00.0: enabling device (0000 -> 0002)
[  297.757875] pcieport 0000:00:00.0: PME: Signaling with IRQ 86
[  297.758528] pcieport 0000:00:00.0: AER: enabled with IRQ 86
[  297.810311] r8169 0000:01:00.0: enabling device (0000 -> 0002)
[  297.817640] r8169 0000:01:00.0: can't read MAC address, setting random one
[  297.828566] r8169 0000:01:00.0 eth1: RTL8168h/8111h, 76:31:50:de:e1:39, XID 541, IRQ 87
[  297.828593] r8169 0000:01:00.0 eth1: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[root@ipfire rockchip]# 

I used Manjaro’s dtb just to test and it didn’t work on it until I rmmod and modprobe it manually.
Which means the pcie-rockchip driver needs something to make it initialize on boot.

Nope. It is also a RTL8111H and has the 2103 marking on the silkscreen.
Im my guess RTL8211H is a typo because none RTL8211x has an integrated mac, they are only transcievers and i have not found a RTL8211H datasheet.

I think it has to do with power regulation because i run in the same issues with a different power supply.
And there is a work around somewhere. Maybe adding a enable and disable of the pcie in u-boot or similar. (I have read comments that the friendlyarm u-boot will always work. I will check armbian and openwrt for patches here…

1 Like

I have added a retry to the driver. On my board it is now works always, even if the first traing has failed.
Please try with the latest nightly but keep in mind that this is work in progress. There are some other bugs in the nightly that are not fixed yet.

1 Like

Sorry been busy.
Will test tomorrow

Thanks.

Tried this image from nightly
ipfire-2.27.2gb-ext4.aarch64-full-core163.img.xz
no luck with pcie lan. :frowning:

I will try with latest uboot, the above image doesnt seem to have r4s uboot in rootfs.

For R4S you need the next branch.

https://nightly.ipfire.org/next/latest/aarch64/

1 Like

Thanks.

This one can see both NIC. What patch was needed ?
Great job. Now do you plan to have R4S image with R4S uboot flashed ?

I have not found an existing patch that works. I have added a retry to the driver:
https://git.ipfire.org/?p=people/arne_f/kernel.git;a=commit;h=f18fc74bfd0179149c095801a7bba6aa015ccec4

1 Like

Hi @arne_f.

I have tried the last one that you have passed and it works correctly for me, like the previous one.

Greetings.

1 Like

I just realized that these router devices will always need uart to complete the initial setup which not every user will have.

Can there be a way to have dhcp on one port and static ip on another?

And set default login.

1 Like