diff --git a/board/xmedia/xm72050500/board.c b/board/xmedia/xm72050500/board.c index 79e37182bf21..c82655a027e0 100755 --- a/board/xmedia/xm72050500/board.c +++ b/board/xmedia/xm72050500/board.c @@ -143,11 +143,12 @@ void clear_update_flag(int update_flag) int misc_init_r(void) { + /* before the scan: a split image clears it, so bootm checks its CRC */ + env_set("verify", "n"); openipc_helper(); #ifdef CONFIG_RANDOM_ETHADDR random_init_r(); #endif - env_set("verify", "n"); #ifdef CFG_MMU_HANDLEOK dcache_stop(); diff --git a/board/xmedia/xm720xxx/board.c b/board/xmedia/xm720xxx/board.c index a3c2beb48037..a9c6b08a4061 100755 --- a/board/xmedia/xm720xxx/board.c +++ b/board/xmedia/xm720xxx/board.c @@ -142,11 +142,12 @@ void clear_update_flag(int update_flag) int misc_init_r(void) { + /* before the scan: a split image clears it, so bootm checks its CRC */ + env_set("verify", "n"); openipc_helper(); #ifdef CONFIG_RANDOM_ETHADDR random_init_r(); #endif - env_set("verify", "n"); #ifdef CFG_MMU_HANDLEOK dcache_stop(); diff --git a/common/Kconfig b/common/Kconfig index d5b0eaa49b01..e2d1c9b015f8 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -1070,5 +1070,5 @@ config OPENIPC_NOR_SPLIT of a saved environment are dropped, and bootm checks the uImage CRC. Only for boards whose kernel knows the layout (gk7205v200 family, hi3516cv6xx, hi3519dv500, hi3516cv300/hi3516ev100, the hi3516ev200 - family). + family, the gk7205v500 family). diff --git a/common/openipc.c b/common/openipc.c index d59f5b692753..96370e4515d5 100644 --- a/common/openipc.c +++ b/common/openipc.c @@ -1022,7 +1022,20 @@ int openipc_helper(void) { char msize[16]; sprintf(msize, "%ldM", gd->ram_size / 1024 / 1024); env_set("totalmem", msize); - firmware_recovery(); + + /* Recovery checks what it runs: a board may already have set verify=n + * (so that the split scan below can clear it), and source would then run + * a wrapped script.txt without its data CRC. Drop it for recovery only + * and put it back for the boot. */ + { + const char *v = env_get("verify"); + char *saved = v ? strdup(v) : NULL; + + env_set("verify", NULL); + firmware_recovery(); + env_set("verify", saved); + free(saved); + } altbootcmd_migrate(); /* Persist the default environment on first start (or after a bad env); diff --git a/openipc/xm72050500_config b/openipc/xm72050500_config index ae226538b520..f28bbbb16aba 100644 --- a/openipc/xm72050500_config +++ b/openipc/xm72050500_config @@ -2,3 +2,7 @@ CONFIG_SYS_LOAD_ADDR=0x42000000 CONFIG_MMC=y CONFIG_CMD_MMC=y CONFIG_MMC_SDHCI=y + +# The split NOR layout: the kernel (OpenIPC/linux goke-gk7205v500) +# divides one firmware partition from its own device tree. +CONFIG_OPENIPC_NOR_SPLIT=y diff --git a/openipc/xm720xxx_config b/openipc/xm720xxx_config index b221fc9b8c33..09a42888b29b 100755 --- a/openipc/xm720xxx_config +++ b/openipc/xm720xxx_config @@ -8,3 +8,7 @@ CONFIG_SYS_LOAD_ADDR=0x42000000 CONFIG_MMC=y CONFIG_CMD_MMC=y CONFIG_MMC_SDHCI=y + +# The split NOR layout: the kernel (OpenIPC/linux goke-gk7205v500) +# divides one firmware partition from its own device tree. +CONFIG_OPENIPC_NOR_SPLIT=y