From 0edf5e0087952911eec3344e6c1d67408d2dede8 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Sat, 7 Nov 2026 18:12:11 +0000 Subject: [PATCH] openipc: SigmaStar NAND environment back to 256 KiB, as openipc-hisilicon 631d8991cc1 made it 128 KiB in the 256 KiB env partition, so a bad block there would leave room for it. That broke the convention every OpenIPC NAND camera follows: CONFIG_ENV_SIZE 0x40000 in a 0x40000 range at 0xC0000, which the firmware's fw_env.config reads with that size. It is 256 KiB again; ubwrite's size check and partition-bounded write stay. --- CLAUDE.md | 4 ++-- include/configs/openipc-common.h | 5 ++--- openipc/nand_config | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b34caaa6cd8a..de7a4f1db9d6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -157,8 +157,8 @@ IPL_CUST at `0x10000`, the uImage at `0x20000`. The layout and environment of openipc-hisilicon (`include/configs/openipc-common.h`, `openipc/nand_config`): `768k(boot),256k(env),-(ubi)`, the environment at -`0xC0000` (128 KiB in the 256 KiB range, so one bad block there leaves the -other; openipc-hisilicon's is 256 KiB in 256), one UBI device from `0x100000` whose UBIFS +`0xC0000` (256 KiB, range 256 KiB, as openipc-hisilicon's and the +firmware's `fw_env.config`), one UBI device from `0x100000` whose UBIFS `rootfs` volume holds the kernel as `/boot/fitImage` or `/boot/uImage`, and `rootfs_data` on the rest; `root=ubi0:rootfs rootfstype=ubifs ubi.mtd=2,2048`. `common/openipc.c` is the common one (openipc-ingenic's, `OPENIPC_SPI_NAND` diff --git a/include/configs/openipc-common.h b/include/configs/openipc-common.h index 56e4e59951ab..29a6d61192b8 100644 --- a/include/configs/openipc-common.h +++ b/include/configs/openipc-common.h @@ -201,9 +201,8 @@ #define OPENIPC_NAND_MTDPARTS "768k(boot),256k(env),-(ubi)" /* Environment lives in the NAND 'env' partition: CONFIG_ENV_OFFSET 0xc0000, - * CONFIG_ENV_RANGE 0x40000 as on openipc-hisilicon, CONFIG_ENV_SIZE 0x20000 - * so that a bad block in the partition leaves room for it - * (openipc/nand_config). */ + * CONFIG_ENV_SIZE and CONFIG_ENV_RANGE 0x40000 (openipc/nand_config), as + * on openipc-hisilicon. */ #define CONFIG_BOOTARGS OPENIPC_MEMARGS_HEAD "console=ttyS0,115200 panic=20 init=/init root=ubi0:rootfs rootfstype=ubifs ubi.mtd=2,2048 mtdparts=\\${mtdparts}" OPENIPC_MEMARGS_TAIL " \\${extras}" diff --git a/openipc/nand_config b/openipc/nand_config index a1913ff486ae..70ce2f5b1829 100644 --- a/openipc/nand_config +++ b/openipc/nand_config @@ -13,8 +13,7 @@ CONFIG_CMD_NAND_TRIMFFS=y # CONFIG_CMD_NAND_TORTURE is not set CONFIG_ENV_IS_IN_NAND=y CONFIG_ENV_OFFSET=0xc0000 -# 128 KiB in the 256 KiB partition: one bad block there leaves the other -CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_SIZE=0x40000 CONFIG_ENV_RANGE=0x40000 CONFIG_MTD_PARTITIONS=y CONFIG_CMD_MTDPARTS=y