Skip to contentSkip to conversation

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

PATCH In review Richard Genoud 3 participants 4 messages Oct 28, 2025 – Jan 19

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 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 --soc=h6 option 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 --soc=h6 option 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 | 92 ++++++++++++++++++++++++++-------
 3 files changed, 75 insertions(+), 19 deletions(-)

Changes from v2:
- add a --soc=h6 option as suggested by Michael

Changes from v1:
- move up "default 80 if SUN50I_GEN_H6" (sorry for the noise)

drivers/mtd/nand/raw/Kconfig +1 -0
index 9c8a32bb0a89..b5fc4f5f8c34 100644
@@ -475,6 +475,7 @@ if NAND_SUNXI
 
 config NAND_SUNXI_SPL_ECC_STRENGTH
 	int "Allwinner NAND SPL ECC Strength"
+	default 80 if SUN50I_GEN_H6
 	default 64
 
 config NAND_SUNXI_SPL_ECC_SIZE
scripts/Makefile.xpl +1 -0
index 3e940bf562d5..98d139724c54 100644
@@ -454,6 +454,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),--soc=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 +73 -19

170 lines not on this page · raw message

base-commit: e50b1e8715011def8aff1588081a2649a2c6cd47

Signature · 1 line
2.47.3
maintainer Reviewed-by on v3 1/1
#1 lore raw

Hi Richard,

Quoted 18 lines · Richard Genoud

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 --soc=h6 option 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 --soc=h6 option when building for a SUN50I_GEN_H6 SoC.

Quoted 6 lines

Tested on Whatsminer H616 board, booting from NAND.

---

Thanks,
Miquèl

#2 lore raw

Hi Michael,
Le 28/10/2025 à 10:40, Miquel Raynal a écrit :

Quoted 29 lines

Hi Richard,

Quoted 18 lines · Richard Genoud

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 --soc=h6 option 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 --soc=h6 option when building for a SUN50I_GEN_H6 SoC.

Quoted 6 lines

Tested on Whatsminer H616 board, booting from NAND.

---

Quoted 4 lines

Thanks,
Miquèl

Sorry, I didn't remembered until now, but it seems this patch also got forgotten.

Regards,
Richard

#3 lore raw

Hi

I will drop my request now, and prepare a new one and including this one

Michael

Quoted 43 lines · Richard GENOUD

Hi Michael,

Quoted 29 lines · Miquel Raynal

Hi Richard,

Quoted 18 lines · Richard Genoud

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 --soc=h6 option 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 --soc=h6 option when building for a SUN50I_GEN_H6 SoC.

Quoted 6 lines

Tested on Whatsminer H616 board, booting from NAND.

---

Quoted 4 lines

Thanks,
Miquèl

Sorry, I didn't remembered until now, but it seems this patch also got forgotten.

Regards,
Richard

Signature · 11 lines
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
[email protected]
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
[email protected]
www.amarulasolutions.com