Is there any dev working on the NanoPi R2S

Booting from the SPI isn't that tough.

  1. Add spi node in DTS
  2. Modify uboot
  3. Add kernel configs
  4. Modify openwrt makefile to generate squashfs images.
  5. mtd write images with an operating system.

I will look into supporting nanopi r2s with SPI flash.


SPI boot should work as long as u-boot and kernel (+ device tree) has support for it. While the u-boot that Armbian used can successfully detect my W25Q256 chip (only the lower half is usable due to the lack of 4-byte addressing support), I haven't tried actually reading/writing to the flash in u-boot yet.

SD card is very convenient, SPI flash chip need to welding is not necessary to use.

it is entirely possible to boot from the SPI. I had an R1S. I would post my 1,189 line boot log from the serial console, but nobody wants to see that. Yes it has U-Boot + .scr file you can edit/replace.

SDCard = $9 for an EVO 64GB last time I bought one. The easiest boot media.

eMMC pluggable socket = higher performance and reliability than SDCard, but R1S/R1S doesnt have a nice friendly upright socket. Prices range from $29 to $99 for 64GB 5.1 eMMC. Get yourself an M4V2 and stop wasting time.

SPI = the most frustrating, illogical, poorly documented PLEASE-BRICK-ME option. I dont care if its $1 or $99, I hates it. Quick, are you fdt or dtb? You're gonna *#$#(% up at some point.

How much did it improve temps? My 2 NanoPi were sent yesterday, so i'm gonna have to wait a month to test things

The temperature 30-50 degrees Celsius


Please have a look at this topic where I am sharing initial (very promising) test results of OpenWRT on the R2S -- thanks @jayanta525




Is this based on the irq optimize script @jayanta525 added or some other tweaking you have done?

Try this script

Do you have your modifications in a repo where we can take a look?

I see you noted CONFIG_IRQBALANCE. It’s interesting because I had tried irqbalance as well but found it didn’t separate eth0 and eth1 to different cores.

What kind of load were you putting on your NanoPi during the screen capture?

Only recorded here, CONFIG_IRQBALANCE is not implemented yet

Hi, I am trying to boot openwrt from orangepi r1 plus spi but don't know how to start
like editing dts modifying uboot etc. Could you help me please?

i tried some things to bring mtd nor flash support

  1. i compiled this repo to run openwrt on my sd card
    then mtd not exist in default shown below.
root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
  1. i started to add SPI node to rockchip.dtb found in my sd card's mmcblk0p1 partition

i converted dtb to dts and add SPI support changes shown below (if it is true, please check)
right side original one, left side modified one to support SPI

/dts-v1/;							/dts-v1/;

/ {								/ {
	compatible = "xunlong,orangepi-r1plus\0rockchip,rk332		compatible = "xunlong,orangepi-r1plus\0rockchip,rk332
	interrupt-parent = <0x01>;					interrupt-parent = <0x01>;
	#address-cells = <0x02>;					#address-cells = <0x02>;
	#size-cells = <0x02>;						#size-cells = <0x02>;
	model = "Orange Pi R1 PLUS";					model = "Orange Pi R1 PLUS";

	aliases {							aliases {
		serial0 = "/serial@ff110000";					serial0 = "/serial@ff110000";
		serial1 = "/serial@ff120000";					serial1 = "/serial@ff120000";
		serial2 = "/serial@ff130000";					serial2 = "/serial@ff130000";
		i2c0 = "/i2c@ff150000";						i2c0 = "/i2c@ff150000";
		i2c1 = "/i2c@ff160000";						i2c1 = "/i2c@ff160000";
		i2c2 = "/i2c@ff170000";						i2c2 = "/i2c@ff170000";
		i2c3 = "/i2c@ff180000";						i2c3 = "/i2c@ff180000";
		**spi0-0 = "/soc/spi@ff190000";		      <**
**		spi0-1 = "/soc/spi@ff190000";		      <**
**		spi0-2 = "/soc/spi@ff190000";		      <**
		ethernet0 = "/ethernet@ff540000";				ethernet0 = "/ethernet@ff540000";
		ethernet1 = "/ethernet@ff550000";				ethernet1 = "/ethernet@ff550000";
		led-boot = "/leds/led-1";					led-boot = "/leds/led-1";
		led-failsafe = "/leds/led-1";					led-failsafe = "/leds/led-1";
		led-running = "/leds/led-1";					led-running = "/leds/led-1";
		led-upgrade = "/leds/led-1";					led-upgrade = "/leds/led-1";
	};								};
	spi@ff190000 {							spi@ff190000 {
		compatible = "rockchip,rk3328-spi\0rockchip,r			compatible = "rockchip,rk3328-spi\0rockchip,r
		reg = <0x00 0xff190000 0x00 0x1000>;				reg = <0x00 0xff190000 0x00 0x1000>;
		interrupts = <0x00 0x31 0x04>;					interrupts = <0x00 0x31 0x04>;
		#address-cells = <0x01>;					#address-cells = <0x01>;
		#size-cells = <0x00>;						#size-cells = <0x00>;
		clocks = <0x02 0x20 0x02 0xd1>;					clocks = <0x02 0x20 0x02 0xd1>;
		clock-names = "spiclk\0apb_pclk";				clock-names = "spiclk\0apb_pclk";
		dmas = <0x0b 0x08 0x0b 0x09>;					dmas = <0x0b 0x08 0x0b 0x09>;
		dma-names = "tx\0rx";						dma-names = "tx\0rx";
		pinctrl-names = "default";					pinctrl-names = "default";
		pinctrl-0 = <0x2a 0x2b 0x2c 0x2d>;				pinctrl-0 = <0x2a 0x2b 0x2c 0x2d>;
		status = "okay";			      |			status = "disabled";
		**flash@0 {				      <**
**				#address-cells = <0x01>;      <**
**				#size-cells = <0x01>;	      <**
**				compatible = "mxicy,mx25l1280 <**
**				reg = <0x00>;		      <**
**				spi-max-frequency = <0x2625a0 <**
**							      <**
**				partitions {		      <**
**					compatible = "fixed-p <**
**					#address-cells = <0x0 <**
**					#size-cells = <0x01>; <**
**							      <**
**					partition@0 {	      <**
**						label = "uboo <**
**						reg = <0x00 0 <**
**					};		      <**
**							      <**
**					partition@80000 {     <**
**						label = "dtb" <**
**						reg = <0x8000 <**
**					};		      <**
**							      <**
**					partition@90000 {     <**
**						compatible =  <**
**						label = "firm <**
**						reg = <0x9000 <**
**					};		      <**
**				};			      <**
**			};				      <**
	};								};

Here is the result it seems works!

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "uboot"
mtd1: 00010000 00010000 "dtb"
mtd2: 00f70000 00010000 "firmware"

root@OpenWrt:/# cat /dev/mtd2 >> alfa.bin
root@OpenWrt:/# du -sh alfa.bin 
15.5M   alfa.bin

converting dtb to dts

dtc -I dtb -O dts -f rockchip.dtb -o rockchip.dts
dtc -I dts -O dtb -f rockchip.dts -o rockchip.dtb

So i will try to modify uboot any help would be appreciated..

Please refer to this thread: Xunlong Orange Pi R1 Boot from Flash

You'll find the appropriate modifications in the discussions.

As for RK3328 SoC, I will order a 16M SPI flash and test it out in a while, and will post back here.

1 Like

In addition to uboot modification, some openwrt makefile modifications is required along with kernel_config.

Please start fresh with a fork of openwrt upstream.

first of all, SPI partitions in uboot must be added via a patch file, and then in linux dts.

1 Like


Thanks for your interest,
i have edited makefile like shown below and compiled openwrt it gives me 5.9M sysupgrade image

### Devices ###
define Device/Default
  PROFILES := Default
  KERNEL := kernel-bin | lzma
  IMAGES := sysupgrade.bin
  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1)))
  IMAGE_SIZE := 16286k
  IMAGE/sysupgrade.bin = append-kernel | append-rootfs | pad-rootfs | \
  	append-metadata | check-size $$$$(IMAGE_SIZE)

include $(SUBTARGET).mk

$(eval $(call BuildImage))

4.) i have cloned this uboot repo >
and added spi booting options to nanopi-r2s-rk3328_defconfig shown below and compiled uboot


result images are :u-boot.bin u-boot.cfg u-boot.cfg.configs u-boot.dtb u-boot-dtb.bin u-boot-dtb.img u-boot.img u-boot.itb u-boot.its

which image should i flash to SPI flash and i don't know below partitioning is true i moved this flash parts from opir1 . Can you help me this point?

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "uboot"
mtd1: 00010000 00010000 "dtb"
mtd2: 00f70000 00010000 "firmware"

here is modified files by me

1 Like

@alfa I would suggest opening up a new thread for the discussion.

Please post the same in the new created thread.
We will continue the discussion over there.


Hi, we can continue with this thread

1 Like

I have the NanoPi R2S board with me. I will solder a 4MB flash and test out the configurations first.

Meanwhile please wait for input from different users, might be helpful for troubleshooting later.

EDIT: Just found out I only have an 2MB flash. OpenWrt won't fit in here.
Please follow up on the original thread.

1 Like