From e38409661983cfebc694dae686b543f73bb23411 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Wed, 21 Oct 2026 13:31:11 +0300 Subject: [PATCH] hi3516ev200, hi3518ev300, hi3516dv200: the split NOR image, as on gk7205v200 Their lite images sit within a few KiB of the fixed slots (rootfs 5084K, 5112K and 4808K of 5120K). The split layout lets kernel and rootfs share one budget. Lite and ultimate use general/scripts/post-image-split.sh with BR2_OPENIPC_NOR_FIXED_PACKAGE=y: the fixed-slot package as before, plus -split. The kernel configs turn on MTD_SPLIT_FIRMWARE (named "firmware"), MTD_SPLIT_UIMAGE_FW, MTD_SPLIT_SQUASHFS_ROOT and MTD_ROOTFS_ROOT_DEV (OpenIPC/linux#131; their U-Boot scans for it since OpenIPC/u-boot#48). Makefile: the split branch closed only after the UBI and initramfs packaging, so a NOR+NAND build (ultimate, BR2_TARGET_ROOTFS_UBI) shipping firmware.bin lost its NAND package. Those now run whichever NOR layout the build ships. No split board had a UBI rootfs before. hi3516ev300 is left as it is: its uImage is 2009K with the split options, over the 1983K a fixed-slot package beside a split one may use (a uImage ending in the slot's last block reads as split). It needs a smaller kernel, or to ship -split only, first. neo, dev and glibc are unchanged. Built locally with the kernel branch: - hi3516ev200_lite: uImage 1785K/1983K, squashfs 5084K/5120K, firmware.bin 6912K/7616K; -lite.tgz and -lite-split.tgz. - hi3516ev200_ultimate: firmware.bin 9024K/15808K, rootfs.ubi 16256K/24576K; nand-ultimate (fitImage, rootfs.ubifs, rootfs.ubi, as on latest), nor-ultimate and nor-ultimate-split. - hi3518ev300_lite: uImage 1877K, squashfs 5112K, firmware.bin 7040K. Tested in qemu-hisilicon (hi3516ev200, hi3518ev300; 8 and 16 MB): - the split firmware.bin under the new U-Boot: "Found RootFS at 0x00210000", root-less command line, "hi_sfc: split NOR layout, device tree partitions", root on 31:4; /init's overlay marker on rootfs_data kept across a reset; - the same under the published u-boot-hi3516ev200-nor.bin: its fixed mtdparts and root=/dev/mtdblock3 ignored, the same split; - the fixed-slot package (8 MB lite, 16 MB ultimate at 0x350000) under both: the command line's partitions, root on 31:3. Not run on hardware. --- Makefile | 4 +++- .../board/hi3516ev200/hi3516dv200.generic.config | 5 +++++ .../board/hi3516ev200/hi3516ev200.generic.config | 5 +++++ .../board/hi3516ev200/hi3518ev300.generic.config | 5 +++++ br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig | 2 ++ br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig | 2 ++ br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig | 2 ++ br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig | 2 ++ br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig | 2 ++ 9 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 65f83d1692..3ddb6b6df0 100644 --- a/Makefile +++ b/Makefile @@ -199,6 +199,9 @@ else @$(call PREPARE_REPACK,uImage,2048,rootfs.squashfs,8192,nor) endif endif +endif +# A NOR+NAND build (ultimate with BR2_TARGET_ROOTFS_UBI) packages its NAND +# image whichever NOR layout it ships. ifeq ($(BR2_TARGET_ROOTFS_UBI),y) ifneq ($(filter $(BR2_OPENIPC_SOC_VENDOR),"rockchip" "sigmastar"),) @$(call PREPARE_REPACK,,,rootfs.ubi,16384,nand) @@ -232,7 +235,6 @@ ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) @$(call PREPARE_REPACK,uImage,16384,,,initramfs) endif endif -endif size-report: @TARGET_DIR=$(TARGET)/target \ diff --git a/br-ext-chip-hisilicon/board/hi3516ev200/hi3516dv200.generic.config b/br-ext-chip-hisilicon/board/hi3516ev200/hi3516dv200.generic.config index 59a3dfc173..05622e1495 100644 --- a/br-ext-chip-hisilicon/board/hi3516ev200/hi3516dv200.generic.config +++ b/br-ext-chip-hisilicon/board/hi3516ev200/hi3516dv200.generic.config @@ -777,6 +777,11 @@ CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_AFS_PARTS is not set CONFIG_MTD_OF_PARTS=y +CONFIG_MTD_ROOTFS_ROOT_DEV=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y # CONFIG_MTD_AR7_PARTS is not set # diff --git a/br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config b/br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config index a91f15019b..74e2c560f4 100644 --- a/br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config +++ b/br-ext-chip-hisilicon/board/hi3516ev200/hi3516ev200.generic.config @@ -890,6 +890,11 @@ CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_AFS_PARTS is not set CONFIG_MTD_OF_PARTS=y +CONFIG_MTD_ROOTFS_ROOT_DEV=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y # CONFIG_MTD_AR7_PARTS is not set # diff --git a/br-ext-chip-hisilicon/board/hi3516ev200/hi3518ev300.generic.config b/br-ext-chip-hisilicon/board/hi3516ev200/hi3518ev300.generic.config index 8534433dca..1cb9288867 100644 --- a/br-ext-chip-hisilicon/board/hi3516ev200/hi3518ev300.generic.config +++ b/br-ext-chip-hisilicon/board/hi3516ev200/hi3518ev300.generic.config @@ -901,6 +901,11 @@ CONFIG_MTD=y CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_AFS_PARTS is not set CONFIG_MTD_OF_PARTS=y +CONFIG_MTD_ROOTFS_ROOT_DEV=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y # CONFIG_MTD_AR7_PARTS is not set # diff --git a/br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig b/br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig index 4f11d4283f..ba6655413a 100644 --- a/br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig +++ b/br-ext-chip-hisilicon/configs/hi3516dv200_lite_defconfig @@ -62,3 +62,5 @@ BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +BR2_OPENIPC_NOR_FIXED_PACKAGE=y diff --git a/br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig b/br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig index 833e40eda8..72c9f8bc12 100644 --- a/br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig +++ b/br-ext-chip-hisilicon/configs/hi3516ev200_lite_defconfig @@ -63,3 +63,5 @@ BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +BR2_OPENIPC_NOR_FIXED_PACKAGE=y diff --git a/br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig b/br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig index 7f73934de6..3bff0937cb 100644 --- a/br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig +++ b/br-ext-chip-hisilicon/configs/hi3516ev200_ultimate_defconfig @@ -81,3 +81,5 @@ BR2_PACKAGE_UACME_OPENIPC=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y BR2_PACKAGE_ZEROTIER_ONE=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +BR2_OPENIPC_NOR_FIXED_PACKAGE=y diff --git a/br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig b/br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig index 4d2358bad9..6e384e82cb 100644 --- a/br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig +++ b/br-ext-chip-hisilicon/configs/hi3518ev300_lite_defconfig @@ -66,3 +66,5 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_YAML_CLI=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +BR2_OPENIPC_NOR_FIXED_PACKAGE=y diff --git a/br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig b/br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig index 395b1e1fb2..a26084d230 100644 --- a/br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig +++ b/br-ext-chip-hisilicon/configs/hi3518ev300_ultimate_defconfig @@ -81,3 +81,5 @@ BR2_PACKAGE_UACME_OPENIPC=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y BR2_PACKAGE_ZEROTIER_ONE=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +BR2_OPENIPC_NOR_FIXED_PACKAGE=y