NanoPi R4S rk3399 4G is a great new OpenWrt device

Adding support for the R4S to OpenWrt is going to be easy:

Thanks for the link. The 1GB RAM model is considerably more expensive than the R2S (US$45 vs US$22). I was guessing it would've been around the $40 mark.
I'm curious about how hot the R4S will run but it looks like another sleek metal case from Friendlyelec.
@mj82 I'll be up for testing in mid-Jan

Nice, i would like to see some SQM and openvpn benchmarks, if you dont mind doing them :slight_smile:

@xiaobo can you try this image in your R4S, I need to know if at least it boot .

Thanks @xiaobo , I have to wait 3 to 4 weeks for the R4S to arrives and do more tests, I added the NanoPi R4S to my sources, maybe you can make some progress .

1 Like

The kernel isn't actually hanged. Serial console output is changed, and hence there is no more output.

mmc bootscript needs some adjustments.

@mj82

In line 3, here: https://github.com/openwrt/openwrt/blob/33c27ccf4aef677d28246d30e815050ead68b434/target/linux/rockchip/image/mmc.bootscript#L3

change: console=ttyS2,1500000 console=tty1 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait

to: console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait

tty1 is the console at display output. Changing it to only ttyS2 should be fine.

1 Like

@xiaobo I updated the R4S dts adding the r8169 aliases for eth1, maybe is detected now.

@jayanta525 thanks for your suggestion, I added a boot script for the R4S

I don't think using r8169 driver on NanoPi R4S is a good idea, as you may know it performs really bad.

So I suggest using vendor driver from Realtek and it works well (at least for current):

The correct mainline driver for this hardware is indeed r8169, if that has problems with this specific hardware revision, those need to be fixed - the vendor module has no future in mainline nor OpenWrt. There is no systemic reason why the mainline r8169 module wouldn't work, I'm successfully using it with very good performance results on several different (r8168 based-) devices (x86_64).

See the following link:


However, it fails to boot on 1G RAM (DDR3 800 MHz) version, could you take a look?

Hey guys. I use a 4GB device and it works fine. The LED is not working properly.
Original DTS:

&leds {
	led@2 {
		gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
		label = "lan_led";
	};

	led@3 {
		gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
		label = "wan_led";
	};
};

&leds_gpio {
	rockchip,pins =
		<0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
		<1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>,
		<1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
};

But......... patch error - -

How do you add support? I don’t know how to add it into Linux menuconfig so I can compile for it.

Download and apply the patch from my repo:

wget https://patch-diff.githubusercontent.com/raw/mj22226/openwrt/pull/2.patch
git am 2.patch
1 Like

I'm getting some error's. Are you positive that your patch works?

error: patch failed: package/boot/uboot-rockchip/Makefile:38
error: package/boot/uboot-rockchip/Makefile: patch does not apply
Patch failed at 0001 uboot-rockchip: add support for NanoPi R4S
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Try from a fresh clone, ignore the warning.

git clone https://github.com/openwrt/openwrt.git
cd openwrt
openwrt$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
openwrt$ git diff
openwrt$ wget https://patch-diff.githubusercontent.com/raw/mj22226/openwrt/pull/2.patch
--2020-12-15 05:31:15--  https://patch-diff.githubusercontent.com/raw/mj22226/openwrt/pull/2.patch
Resolving patch-diff.githubusercontent.com (patch-diff.githubusercontent.com)... 140.82.112.4
Connecting to patch-diff.githubusercontent.com (patch-diff.githubusercontent.com)|140.82.112.4|:443... connected.
HTTP request sent, awaiting response... 200 OK
Cookie coming from patch-diff.githubusercontent.com attempted to set domain to github.com
Length: unspecified [text/plain]
Saving to: ‘2.patch’

2.patch                              [ <=>                                                              ]  26.94K  --.-KB/s    in 0.05s   

2020-12-15 05:31:15 (492 KB/s) - ‘2.patch’ saved [27589]

openwrt$ git am 2.patch
Applying: uboot-rockchip: add support for NanoPi R4S
.git/rebase-apply/patch:61: space before tab in indent.
        rk3399-nanopi-m4.dtb \
.git/rebase-apply/patch:62: space before tab in indent.
        rk3399-nanopi-m4-2gb.dtb \
.git/rebase-apply/patch:63: space before tab in indent.
        rk3399-nanopi-neo4.dtb \
.git/rebase-apply/patch:65: space before tab in indent.
        rk3399-orangepi.dtb \
.git/rebase-apply/patch:66: space before tab in indent.
        rk3399-pinebook-pro.dtb \
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.
Applying: rockchip: add support for NanoPi R4S
Applying: rockchip: add NanoPi R4S DTS
Applying: rockchip: add bootscript for NanoPi R4S
Applying: uboot-rockchip: add NanoPi R4S 1Gb DDR3
.git/rebase-apply/patch:61: space before tab in indent.
        rk3399-nanopi-m4-2gb.dtb \
.git/rebase-apply/patch:62: space before tab in indent.
        rk3399-nanopi-neo4.dtb \
.git/rebase-apply/patch:63: space before tab in indent.
        rk3399-nanopi-r4s.dtb \
.git/rebase-apply/patch:65: space before tab in indent.
        rk3399-orangepi.dtb \
.git/rebase-apply/patch:66: space before tab in indent.
        rk3399-pinebook-pro.dtb \
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
Applying: rockchip: add NanoPi R4S 1Gb DDR3
Applying: rockchip: fix LEDs states for NanoPi R4S
Applying: rockchip: update base-files
openwrt$ git log
1 Like

Ahh ok I'm running it through Lede instead of OpenWRT which I think is causing problems.

Could anyone tell me that how to make u-boot compatible with both DDR3 and LPDDR4 memory?
I can only make a dirty workaround for current.

See below:

Possibly this may work, I just need someone to confirm it.