Skip to contentSkip to conversation

tools: sunxi-spl-image-builder: support H6/H616 NAND boot

PATCH Superseded Richard Genoud 1 participant 1 message Oct 21, 2025

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: sunxi-spl-image-builder: support H6/H616 NAND boot

The H6/H616 boot ROM doesn't expect a SPL scrambled the same way as older SoCs.
It doesn't use a specific seeds table, it expects a maximized ECC (BCH-80), a specific BBM (FF000301) and doesn't work if empty pages are skipped (it needs its specific BBM, even in the padding).

So, add a -h6 parameter to support H6/616 with:
- more ECC strengths
- specific BBM
- default_scrambler_seeds[] with all values
- no empty pages skip

In Kconfig, select BCH-80 by default for SUNXI_SPL_ECC_STRENGTH to make BROM happy.

And in scripts/Makefile.xpl, use --h6 parameter when building for a SUN50I_GEN_H6 SoC.

Tested on Whatsminer H616 board, booting from NAND.

---
 drivers/mtd/nand/raw/Kconfig    |  1 +
 scripts/Makefile.xpl            |  1 +
 tools/sunxi-spl-image-builder.c | 89 ++++++++++++++++++++++++++-------
 3 files changed, 72 insertions(+), 19 deletions(-)
drivers/mtd/nand/raw/Kconfig +1 -0
index 754b99bf3eb6..5977de76429c 100644
@@ -484,6 +484,7 @@ if NAND_SUNXI
 config NAND_SUNXI_SPL_ECC_STRENGTH
 	int "Allwinner NAND SPL ECC Strength"
 	default 64
+	default 80 if SUN50I_GEN_H6
 
 config NAND_SUNXI_SPL_ECC_SIZE
 	int "Allwinner NAND SPL ECC Step Size"
scripts/Makefile.xpl +1 -0
index 52f014ad3324..aa4ee5cc1ce7 100644
@@ -455,6 +455,7 @@ $(obj)/sunxi-spl.bin: $(obj)/$(SPL_BIN).bin FORCE
 
 quiet_cmd_sunxi_spl_image_builder = SUNXI_SPL_IMAGE_BUILDER $@
 cmd_sunxi_spl_image_builder = $(objtree)/tools/sunxi-spl-image-builder \
+				$(if $(CONFIG_SUN50I_GEN_H6),--h6) \
 				-c $(CONFIG_NAND_SUNXI_SPL_ECC_STRENGTH)/$(CONFIG_NAND_SUNXI_SPL_ECC_SIZE) \
 				-p $(CONFIG_SYS_NAND_PAGE_SIZE) \
 				-o $(CONFIG_SYS_NAND_OOBSIZE) \
tools/sunxi-spl-image-builder.c +70 -19

161 lines not on this page · raw message

base-commit: 2ba64e303b2706e5c42a6bf982326d632342ca66

Signature · 1 line
2.47.3