OrangePi R2S is a great new RISC-V OpenWrt device

I am simply disabling devices in the power domain and suspect that communication issues between the power control i2c and the power management chip are causing the load to increase. The side effect is that the operating system cannot automatically complete the reboot, and can only disconnect and then turn on the power to complete the reboot.

Thanks for the information, but I don't think that's the best approach: the 2.0 load average is only showing "apparent load" since those two kernel threads are not actually consuming any CPU time.
I think it's better to have a wrong but harmless load average figure than mess up the reboot functionality (and who knows what else).
I am trying to investigate the cause within the source code, it's probably a misbehaving driver.


Edit:
I believe to have fixed it by simply replacing wait_for_completion_timeout with its interruptible variant in function __process_theread of drivers/remoteproc/x1-rproc.c.
After rebuilding and flashing I have ~0 load average at idle, vq0/vq1 are in SW state.

Hi everybody,
I have uploaded my source tree, you can find it here.

It starts from orangepi-xunlong/openwrt branch openwrt-24.10 (the one with RV2/R2S support), merges with upstream OpenWRT up to v24.10.5 (kernel v6.6.119) while adjusting and slimming down vendor patches (removes most patched-in drivers) and fixing the load average issue.

The opir2s_defconfig I use is very barebones, so I don't think it's useful to publish a prebuilt image here as any additional package would still need to be built from source anyway.

I will have a look at porting the patches to OpenWRT v25.12 (kernel v6.12) when it's released, but I can't guarantee anything.

I hope somebody finds this useful, at least until we can run mainline Linux on this board!

Hello LaXiS96,

I imagine that with the basic configuration this error wouldn't occur (I haven't tested it), but with a more complete configuration I got this error and I'm sharing it in case it's helpful: (I don't think it's an unsolvable error)

make[5]: Entering directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119'
CC drivers/gpu/drm/ky/ky_planes.o
drivers/gpu/drm/ky/ky_planes.c: In function 'ky_drm_plane_create_color_properties':
drivers/gpu/drm/ky/ky_planes.c:592:16: error: ISO C90 forbids variable length array 'enum_list' [-Werror=vla]
592 | struct drm_prop_enum_list enum_list[max_t(int, DRM_COLOR_ENCODING_MAX,
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[11]: *** [scripts/Makefile.build:243: drivers/gpu/drm/ky/ky_planes.o] Error 1
make[10]: *** [scripts/Makefile.build:480: drivers/gpu/drm/ky] Error 2
make[9]: *** [scripts/Makefile.build:480: drivers/gpu/drm] Error 2
make[8]: *** [scripts/Makefile.build:480: drivers/gpu] Error 2
make[7]: *** [scripts/Makefile.build:480: drivers] Error 2
make[6]: *** [/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119/Makefile:1924: .] Error 2
make[5]: *** [Makefile:234: __sub-make] Error 2
make[5]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119'
make[4]: *** [Makefile:43: /home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119/.modules] Error 2
make[4]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/target/linux/ky'
make[3]: *** [Makefile:12: compile] Error 2
make[3]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/target/linux'
time: target/linux/compile#1.27#0.59#1.81
ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:32: target/linux/compile] Error 1
make[2]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s'
make[1]: *** [target/Makefile:25: /home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/staging_dir/target-riscv64_riscv64_musl/stamp/.target_compile] Error 2
make[1]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s'
make: *** [/home/asubuntu/OW/OPRV2-LaXiS96/openwrt-orangepi-r2s/include/toplevel.mk:233: world] Error 2

That error can be ignored by setting these in make menuconfig or adding them to your defconfig:

CONFIG_DEVEL=y
CONFIG_KERNEL_CFLAGS="-Wno-vla"

They are already included in opir2s_defconfig but not in opirv2_defconfig (I haven't really tested the RV2 build since I only have the R2S).

Confirmed, that was the only thing I'd omitted from your initial config, and adding it compiles it. But I'll start with your config to generate a new, more complete one and see how far it goes. I'll test it carefully.

Thanks

Hello LaXiS96,
With my config, which came from compiling the image generated with the repository of johnkarazou, I managed to compile simply by adding to the config:

CONFIG_DEVEL=y
CONFIG_KERNEL_CFLAGS="-Wno-vla"
But check your repository's config because without adding anything, if you do the usual:
git clone ``https://github.com/LaXiS96/openwrt-orangepi-r2s.git
cd openwrt-orangepi-r2s
./scripts/feeds update -a
./scripts/feeds install -a
in menuconfig, select ky, rv2
the result is:
drivers/gpu/drm/ky/ky_planes.c: In function 'ky_drm_plane_create_color_properties':
drivers/gpu/drm/ky/ky_planes.c:592:16: error: ISO C90 forbids variable length array 'enum_list' [-Werror=vla]
592 | struct drm_prop_enum_list enum_list[max_t(int, DRM_COLOR_ENCODING_MAX,
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[11]: *** [scripts/Makefile.build:243: drivers/gpu/drm/ky/ky_planes.o] Error 1
make[10]: *** [scripts/Makefile.build:480: drivers/gpu/drm/ky] Error 2
make[9]: *** [scripts/Makefile.build:480: drivers/gpu/drm] Error 2
make[8]: *** [scripts/Makefile.build:480: drivers/gpu] Error 2
make[7]: *** [scripts/Makefile.build:480: drivers] Error 2
make[6]: *** [/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119/Makefile:1924: .] Error 2
make[5]: *** [Makefile:234: __sub-make] Error 2
make[5]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119'
make[4]: *** [Makefile:43: /home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/linux-6.6.119/.modules] Error 2
make[4]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/target/linux/ky'
make[3]: *** [Makefile:12: compile] Error 2
make[3]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/target/linux'
time: target/linux/compile#829.38#103.21#938.09
ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:32: target/linux/compile] Error 1
make[2]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s'
make[1]: *** [target/Makefile:25: /home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/staging_dir/target-riscv64_riscv64_musl/stamp/.target_compile] Error 2
make[1]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s'
make: *** [/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/include/toplevel.mk:233: world] Error 2

and if you add the following to the config:
CONFIG_DEVEL=y
CONFIG_KERNEL_CFLAGS="-Wno-vla"
the result is:
error: ext4_allocate_best_fit_partial: failed to allocate 2949 blocks, out of space?
make[5]: *** [Makefile:66: /home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/build_dir/target-riscv64_riscv64_musl/linux-ky_riscv64/tmp/openwrt-ky-riscv64-x1_orangepi-rv2-squashfs-sysupgrade.img.gz] Error 1
make[5]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/target/linux/ky/image'
make[4]: *** [Makefile:42: install] Error 2
make[4]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/target/linux/ky'
make[3]: *** [Makefile:12: install] Error 2
make[3]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/target/linux'
time: target/linux/install#13.53#4.47#14.05
ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:32: target/linux/install] Error 1
make[2]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s'
make[1]: *** [target/Makefile:26: /home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/staging_dir/target-riscv64_riscv64_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s'
make: *** [/home/asubuntu/OW/OPRV2-LaXiS96-cfg-original/openwrt-orangepi-r2s/include/toplevel.mk:233: world] Error 2

Hello! I need a photo from the R2S board, can you send one to me? Does not need to be good, 1024 pixels width is fine, but with permission to publish on github / Armbian.com website.

Background: I just completed a pull request to Armbian.com for the Orange Pi RV2, see [1]. Kernel 6.6 and 6.19. While working on that board, I added files for the R2S sister board (e.g. add *.dts and r8125 eth). The pull request robo now want photos for publishing on the Armbian website and I hesitate to reproduce material grabbed from the web. I can throw away the R2V stuff b/c I do not need it - or add that photo.

Also (while optional and if one person here is interested) I just generated an R2S image, that can be downloaded[2] and installed. I am interested in feedback (runs or runs not, all Eth working?).

Ah - and while I am here: the Orange Pi RV2 (as you probably know) has two M.2 slots (m-key). I have an adapter for e/a-key, making the board a tri band router. Here is a photo (taken from the respective Armbian forum thread[3]).

LG && TIA // Sven-Ola

[1] https://github.com/armbian/build/pull/9299
[2] https://privat-in.de/ (navigate to downloads)
[3] https://forum.armbian.com/topic/56846-orange-pi-rv2/

Thanks to Github member https://github.com/peterwillcn I got a decent photo from the R2S, posted as attachment to the respective Armbian PR (the one mentioned above). Many thanks Peter!

Hello, i own OrangePi R2S.

Is there anything i can do to help with bringup of official support for this board?

if possible, return it.

add ky/riscv64 to the kernel, seems it's still missing.

As it happens my PR here supports the R2S and RV2. Both devices are not yet tested, so feedback is very much welcome:

Support seems to be getting there. Many thanks to all that have been contributing: notably dhewg, sven-ola, peterwillcn, 21hertz and all the other active contributors over the past months.

The reason of this slowdown is an error in /etc/hotplug.d/net/40-net-smp-affinity After the line

echo 1 > /sys/class/wlan_power_ctrl/wlan_power/wlan_power

there is no ;;.

To fix it:

  cp /etc/hotplug.d/net/40-net-smp-affinity /root/40-net-smp-affinity.bak

  awk '
    { print }
    /echo 1 > \/sys\/class\/wlan_power_ctrl\/wlan_power\/wlan_power/ {
      print "\t;;"
    }
  ' /root/40-net-smp-affinity.bak > /etc/hotplug.d/net/40-net-smp-affinity

  chmod +x /etc/hotplug.d/net/40-net-smp-affinity
  sh -n /etc/hotplug.d/net/40-net-smp-affinity

To apply the fix without reboot:

  for q in /sys/class/net/eth2/queues/rx-*/rps_cpus /sys/class/net/eth3/queues/rx-*/rps_cpus; do
    [ -e "$q" ] || continue
    echo ff > "$q"
    echo 4096 > "${q%/rps_cpus}/rps_flow_cnt"
  done