sysupgrade will not work!
There you need to completely rewrite the commands in the files for updating using Luci or the command line.
@jayanta525, Show the /openwrt-master-kernel-4.19.104/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-sunxi_cortexa7/linux-4.19.104/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts file to make the correct patch-spi-flash for your source.
opi-r1 includes this dts.
1. In
/target/linux/sunxi/image/Makefile you should also write the line PROFILES: = Default
Part of the Makefile
define Device/Default
PROFILES := Default
DEVICE_VARS := SUNXI_DTS SUNXI_DTS_DIR SUNXI_UBOOT
KERNEL_NAME := zImage
KERNEL := kernel-bin | uImage none
IMAGES := sysupgrade.bin
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
SUNXI_DTS_DIR :=
SUNXI_DTS = $$(SUNXI_DTS_DIR)$$(SOC)-$(lastword $(subst _, ,$(1)))
BLOCKSIZE := 64k
IMAGE_SIZE := 15808k
IMAGE/sysupgrade.bin = append-kernel | append-rootfs | pad-rootfs | \
append-metadata | check-size $$$$(IMAGE_SIZE)
endef
Without this, there will be all profiles! And not just the chosen one.
IMAGE_SIZE: = 15808k,
this is 16384k(full 16Mb) - 512k(uboot) - 64k(dtb) = 15808k (firmware)
2. Edit /target/linux/sunxi/config-4.19 as in the spoiler:
Part of the config-4.19
CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_SUPPORT=y
CONFIG_MTD_SPLIT_FIT_FW=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_MTD_OF_PARTS=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEON=y
3. Create the file 212-add-mtd-spi-flash-opi.patch inside /target/linux/sunxi/patches-4.19.
And paste the contents of the spoiler:
212-add-mtd-spi-flashopi-zero.patch
--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -60,6 +70,7 @@
/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
ethernet0 = &emac;
ethernet1 = &xr819;
+ spi0 = &spi0;
};
chosen {
@@ -172,7 +179,7 @@
&spi0 {
/* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
- status = "disabled";
+ status = "okay";
flash@0 {
#address-cells = <1>;
@@ -179,6 +199,28 @@
compatible = "mxicy,mx25l1606e", "winbond,w25q128";
reg = <0>;
spi-max-frequency = <40000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <0x01>;
+ #size-cells = <0x01>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x0 0x80000>;
+ };
+
+ partition@80000 {
+ label = "dtb";
+ reg = <0x80000 0x10000>;
+ };
+
+ partition@90000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x90000 0xf70000>;
+ };
+ };
};
};
uboot use only this one: https://github.com/melsem/openwrt-19.07.2-spi/raw/master/uboot_opi-zero_opi-r1.bin
cd /tmp
mtd -e uboot write uboot_opi-zero_opi-r1.bin uboot
mtd -e dtb write sun8i-h2-plus-orangepi-r1.dtb dtb
mtd -e firmware write openwrt-sunxi-cortexa7-sun8i-h2-plus-orangepi-r1-squashfs-sysupgrade.bin firmware
This is all that needs to be done so that after writing to the sysupgrade.bin spi-flash drive, the firmware is downloaded.
Developer @tr4bl3 (showuser=1177645).
I took a minimal part.
Tested, wrote instructions and uploaded to git. And some additions.