Skip to contentSkip to conversation

Makefile: pass KEYDIR when set to sunxi-spl.bin mkimage

PATCH In review Richard Genoud 2 participants 2 messages Oct 21, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Makefile: pass KEYDIR when set to sunxi-spl.bin mkimage

From: James Hilliard <[email protected]>

Provide private keys to build sunxi-spl.bin

Currently we pass this for u-boot-spl.kwb targets, however when building sunxi-spl.bin in the TOC0 format, we may also need to specify a KEYDIR.
As such we should also pass this when set to mkimage for the sunxi-spl.bin target.

Tested on Whatsminer H616 board.

---
 scripts/Makefile.xpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Changes from v1:
- remove superfluous From: (sorry for the noise)

scripts/Makefile.xpl +2 -1
index 3e940bf562d5..52f014ad3324 100644
@@ -442,7 +442,8 @@ MKIMAGEFLAGS_sunxi-spl.bin = \
 	-A $(ARCH) \
 	-T $(CONFIG_SPL_IMAGE_TYPE) \
 	-a $(CONFIG_SPL_TEXT_BASE) \
-	-n $(CONFIG_DEFAULT_DEVICE_TREE)
+	-n $(CONFIG_DEFAULT_DEVICE_TREE) \
+	$(if $(KEYDIR),-k $(KEYDIR))
 
 OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
 

base-commit: 2ba64e303b2706e5c42a6bf982326d632342ca66

Signature · 1 line
2.47.3
#1 lore raw

On Tue, 21 Oct 2025 09:59:34 +0200
Richard Genoud <[email protected]> wrote:

Hi Richard,

Quoted 10 lines

From: James Hilliard <[email protected]>

Provide private keys to build sunxi-spl.bin

Currently we pass this for u-boot-spl.kwb targets, however when building sunxi-spl.bin in the TOC0 format, we may also need to specify a KEYDIR.
As such we should also pass this when set to mkimage for the sunxi-spl.bin target.

Quoted 4 lines

Tested on Whatsminer H616 board.

I have queued James' original patch just yesterday evening:
https://lore.kernel.org/u-boot/[email protected]/T/#t

Cheers,
Andre

Quoted 23 lines
---
 scripts/Makefile.xpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Changes from v1:
- remove superfluous From: (sorry for the noise)

scripts/Makefile.xpl +2 -1
index 3e940bf562d5..52f014ad3324 100644
@@ -442,7 +442,8 @@ MKIMAGEFLAGS_sunxi-spl.bin = \
 	-A $(ARCH) \
 	-T $(CONFIG_SPL_IMAGE_TYPE) \
 	-a $(CONFIG_SPL_TEXT_BASE) \
-	-n $(CONFIG_DEFAULT_DEVICE_TREE)
+	-n $(CONFIG_DEFAULT_DEVICE_TREE) \
+	$(if $(KEYDIR),-k $(KEYDIR))
 
 OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
 

base-commit: 2ba64e303b2706e5c42a6bf982326d632342ca66