NanoPi R76S-RK3576 a new OpenWrt device

SoC Model: Rockchip RK3576
CPU Cores: 4x Cortex-A72 + 4x Cortex-A53
Frequency: Cortex-A72 up to 2.2 GHz, Cortex-A53 up to 2.0 GHz
GPU ARM Mali-G52 MC3, supports OpenGL ES 1.1, 2.0, 3.2, Vulkan 1.2, and OpenCL 2.0
VPU 8K@30fps H.265/VP9 video decoder, 4K@60fps video encoder
NPU 6 TOPS*@INT8 supports INT4, INT8, INT16, FP16, BF16, TF32 mixed operation
RAM LPDDR4X(2GB/4GB) / LPDDR5(16GB)
Storage Flash: 32GB eMMC
MicroSD Slot: support UHS-I
Connectivity 2 x PCIe 2.5G Ethernet, RTL8125BG chip
Supports M.2 SDIO Wi-Fi/BT module
Video Output Standard HDMI Type-A output port
• Supports HDMI 1.4 and HDMI 2.0 operations
• Supports up to 10 bits Deep Color modes
• Supports up to 1080p@120Hz and 4096x2304@60Hz
• Supports 3D video formats
USB USB 3.0: 3.2 Gen 1 Type-A ports
USB-C: 5V Power input Only
Pin header 8-Pin GPIO connector
Debug UART: 3-pin 2.54mm header, 3V level, 1500000bps
LED SYS LED (Red)
LED1 (Green)
LED2 (Green)
Button MASK Button for eMMC update
User Button
Power Button
Others RTC Battery: 2 Pin 1.27/1.25mm RTC battery input connector for low power RTC IC HYM8563TS
Working Temperature: 0℃ to 70℃
Power Supply USB-C, 5V Power input

PCB 8-Layer
Weight 37.5g(without Case) / 145.5g(with Case)
Dimension 58x58x1.6mm (without Case) / 62.5x62.5x29mm (with Case)

FriendlyElec NanoPi R76S OpenWrt support
OpenWrt snapshots fireware

2 Likes

Nice catch! Thanks for sharing.
Unrelated: I am wondering about the use of an NPU for a home router. Are there any AI-based tools (e.g. for intrusion detection) that could make use of that hardware? If so, anything supported by OpenWRT?

No, NPU isn't new on RockChip device, for example the popular RK3588 which has released much earlier but apparently still no way to work on OpenWrt's kernel

1 Like

Nothing you may do on OpenWrt will make any use of a NPU (neural processing unit (like on rockchip), not network processing unit!) at all. A neural processing unit serves no purpose or benefit for routing/ firewalling related tasks.

That shouldn't detract from the raw performance of the plain CPU cores of the RK3576 SOC, but the NPU is dead weight for OpenWrt (doesn't hurt, won't help).

1 Like

Someone is working on it, but its too Chinese for me to make any sense of it:

https://github.com/sbwml/r4s_build_script
https://init2.cooluc.com/build.sh

edit:

Too bad, I always thought it could be helpful with traffic analysis or qos

Awesome, I cant wait to go into [Tinker-Mode] :wink:

Found another one, very Chinese again, but it has a build recipe for R76S. Currently trying to build it, not much luck with -j$(nproc) so we are building with a snails pace make V=s -j1

edit:

Finally got it to compile using Debian 10, 8gb ram, 25gb of disk space and multicore . This fork is still called LEDE for some reason. Not much to tell except there is no display output and its has some extra apps: NAS, Internet Access Schedule Control, Dynamic DNS, KMS server an a couple others.

Is it possible to install the image directly without an SD card using the eMMC Tool?

I think it is, the image does not care if its run from emmc or sdcard. However since the rk3576 is under active development ymmv. So my advice: run any software from sdcard until a stable version is available. Unbricking is not hard, but annoying.

1 Like

Contacted Tianling Shen from the link posted by @xiaobo regarding the R76S WIP log. Got a link:

Until today, firmware images wouldn't boot from the SD card.
I'm not sure if the necessary changes have been merged into the main branch and builds, but it's worth checking.

Be careful — it seems the CPU is overclocked in this fork.
I didn't see any mention of overclocking in the README, so I've opened an issue on GitHub.

Of course, nobody is forced to use this fork, but such information should be clearly disclosed, as everyone should be able to make an informed decision and understand the potential consequences.

Fork:

[root@OpenWrt ~]# lscpu
Architecture:                aarch64
  CPU op-mode(s):            32-bit, 64-bit
  Byte Order:                Little Endian
CPU(s):                      8
  On-line CPU(s) list:       0-7
Vendor ID:                   ARM
  Model name:                Cortex-A53
    Model:                   4
    Thread(s) per core:      1
    Core(s) per socket:      4
    Socket(s):               1
    Stepping:                r0p4
    CPU(s) scaling MHz:      54%
    CPU max MHz:             2208.0000
    CPU min MHz:             408.0000
    BogoMIPS:                48.00
    Flags:                   fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
  Model name:                Cortex-A72
    Model:                   0
    Thread(s) per core:      1
    Core(s) per socket:      4
    Socket(s):               1
    Stepping:                r1p0
    CPU(s) scaling MHz:      70%
    CPU max MHz:             2304.0000
    CPU min MHz:             408.0000
    BogoMIPS:                48.00
    Flags:                   fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid


[root@OpenWrt ~]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000
[root@OpenWrt ~]# cat /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
0 1 2 3
[root@OpenWrt ~]# cat /sys/devices/system/cpu/cpu4/cpufreq/affected_cpus
4 5 6 7
[root@OpenWrt ~]# cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000 2304000

FriendlyWrt:

root@FriendlyWrt:~# lscpu
Architecture:             aarch64
  CPU op-mode(s):         32-bit, 64-bit
  Byte Order:             Little Endian
CPU(s):                   8
  On-line CPU(s) list:    0-7
Vendor ID:                ARM
  Model name:             Cortex-A53
    Model:                4
    Thread(s) per core:   1
    Core(s) per socket:   4
    Socket(s):            1
    Stepping:             r0p4
    CPU(s) scaling MHz:   30%
    CPU max MHz:          2016.0000
    CPU min MHz:          408.0000
    BogoMIPS:             2000.00
    Flags:                fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
  Model name:             Cortex-A72
    Model:                0
    Thread(s) per core:   1
    Core(s) per socket:   4
    Socket(s):            1
    Stepping:             r1p0
    CPU(s) scaling MHz:   18%
    CPU max MHz:          2208.0000
    CPU min MHz:          408.0000
    BogoMIPS:             2000.00
    Flags:                fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

root@FriendlyWrt:~# cat /sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
0 1 2 3
root@FriendlyWrt:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000

root@FriendlyWrt:~# cat /sys/devices/system/cpu/cpu4/cpufreq/affected_cpus
4 5 6 7
root@FriendlyWrt:~# cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000

You learn something new every day...

The fork author's response:

FriendlyWrt uses the Rockchip BSP kernel and ATF, while I am using the mainline kernel and mainline ATF. 2.2GHz + 2.3GHz is already the default frequency.
opp-2208000000 https://github.com/torvalds/linux/blob/v6.17/arch/arm64/boot/dts/rockchip/rk3576.dtsi#L273
opp-2304000000 https://github.com/torvalds/linux/blob/v6.17/arch/arm64/boot/dts/rockchip/rk3576.dtsi#L345
So there’s no such thing as overclocking.

linux/arch/arm64/boot/dts/rockchip/rk3576.dtsi

opp-2208000000 {
	opp-hz = /bits/ 64 <2208000000>;
	opp-microvolt = <950000 950000 950000>;
	clock-latency-ns = <40000>;
	};
	
opp-2304000000 {
	opp-hz = /bits/ 64 <2304000000>;
	opp-microvolt = <950000 950000 950000>;
	clock-latency-ns = <40000>;
	};

My knowledge isn't sufficient to draw any conclusions...
I have more questions than answers. (Logic suggests that if the manufacturer specifies a certain frequency, it should operate at that frequency—but nothing gets into the Linux kernel without a reason.)

However, according to the Datasheet:

3.2 Recommended Operating Conditions

Parameters Symbol Min Typ Max Unit
Voltage for CPU BigCore CPU_BIG_DVDD 0.675 0.75 1.0 V
Voltage for CPU LitCore and CCI CPU_LIT_DVDD 0.675 0.75 1.0 V
Max A72 CPU frequency 2.2 GHz
Max A53 CPU frequency 2.0 GHz

I don't know whether CPU_BIG_DVDD and CPU_LIT_DVDD (for CCI) correspond to opp-microvolt values...

My only wish now is to find and check the actual opp-microvolt values defined in the FriendlyWrt kernel.

Edit:
Limiting the maximum CPU core frequency is quite simple:
Luci -> System -> Startup -> Local Startup

echo 2016000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 2208000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq

exit 0

Edit:

opp-2208000000 {
	opp-supported-hw = <0xf1 0xffff>;
	opp-hz = /bits/ 64 <2208000000>;
	opp-microvolt = <950000 950000 950000>;
	
opp-2016000000 {
	opp-supported-hw = <0xf1 0xffff>;
	opp-hz = /bits/ 64 <2016000000>;
	opp-microvolt = <950000 950000 950000>;

The opp-microvolt values are the same; only the frequencies are lower.
The copyright notice reads "Copyright (c) 2023 Rockchip Electronics Co., Ltd.", which implies that for the RK3576, the maximum frequencies are A72 at 2.3 GHz and A53 at 2.2 GHz, although Rockchip recommends 2.2 GHz / 2.0 GHz respectively.
It's unclear whether these higher frequencies will cause additional heating—only real-world testing will show.
Therefore, if stability isn't an issue, there's no need to lower the frequencies.

we can strip the recipe from it to build our own. i tired but fail building every time, and im no programmer so my knowledge is very limited.

maybe discuss in this thread what we need to add and or backport to make it compile at least.

Good afternoon.

I'm not a programmer either.

It's not entirely clear which image you're trying to build.

If you're referring to the fork https://github.com/sbwml/builder and you're encountering any issues while using it, just ask the author directly.

The minimal image is not published on GitHub(https://github.com/sbwml/builder); it is available here:
https://r76s.cooluc.com/

FriendlyElec NanoPi R76S support

1 Like

snapshot available

There is an issue with the interrupt controller — it is not possible to assign interrupt handling to other CPU cores(interrupts are stuck on CPU core #0 (A53).
I received a response from frendlyelec technical support:

Currently, it has been found that this is a limitation of the interrupt controller, and we temporarily have no solution. We need to see if Rockchip will release any patches in the future.
We found that adjusting the RK3576 memory to performance mode or increasing the minimum frequency can make the 2.5G network card performance more stable.
echo performance > /sys/class/devfreq/dmc/governor
echo 1068000000 > /sys/class/devfreq/dmc/min_freq

Hi, I’ll receive NanoPi R76S tomorrow. I hear that the performance is not optimal as by default all the important things run on one of the slowest cores, while the remaining cores are not used. Is there any patch/workaround to increase performance?