[PATCH 2/2] arm: renesas: Generate u-boot-elf.shdr for R-Car Gen5 RSIP

Marek Vasut marek.vasut+renesas at mailbox.org
Fri May 8 01:25:36 CEST 2026


Add target to generate u-boot-elf.shdr for R-Car Gen5 Cortex-M33
RSIP core. The resulting .shdr SREC file can be written into the
HF at offset 0.

Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Hai Pham <hai.pham.ud at renesas.com>
Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 Makefile                       |  3 +++
 arch/arm/mach-renesas/Makefile | 17 +++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/Makefile b/Makefile
index 49d9740327e..623e66538ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1578,6 +1578,9 @@ spl/u-boot-spl.srec: spl/u-boot-spl FORCE
 %.scif: %.srec
 	$(Q)$(MAKE) $(build)=arch/arm/mach-renesas $@
 
+%.shdr: %.srec
+	$(Q)$(MAKE) $(build)=arch/arm/mach-renesas $@
+
 OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
 		$(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec) \
 		$(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),$(if $(CONFIG_OF_SEPARATE),-R .bootpg -R .resetvec))
diff --git a/arch/arm/mach-renesas/Makefile b/arch/arm/mach-renesas/Makefile
index e3133668e13..83c576d6007 100644
--- a/arch/arm/mach-renesas/Makefile
+++ b/arch/arm/mach-renesas/Makefile
@@ -46,6 +46,20 @@ quiet_cmd_srec_cat = SRECCAT $@
 			-Output_Block_Size 16 \
 			-generate 0x18402010 0x18402014 $(srec_cat_le_cmd) $(CONFIG_SYS_UBOOT_START) 4 \
 			-generate 0x18402014 0x18402018 $(srec_cat_le_cmd) 0x1ef000 4
+
+quiet_cmd_srec_shdr_cat = SRECCAT $@
+      cmd_srec_shdr_cat = srec_cat -output $@ -M 8 \
+			-Output_Block_Size 16 \
+			-generate 0x18400000 0x18400004 $(srec_cat_le_cmd) 0x00000003 4 \
+			-generate 0x18400004 0x18400008 $(srec_cat_le_cmd) 0x0 4 \
+			-generate 0x18402000 0x18402004 $(srec_cat_le_cmd) 0x6b657963 4 \
+			-generate 0x18402004 0x18402008 $(srec_cat_le_cmd) 0x00010010 4 \
+			-generate 0x18402008 0x1840200c $(srec_cat_le_cmd) 0x0 4 \
+			-generate 0x1840200c 0x18402010 $(srec_cat_le_cmd) 0x34040000 4 \
+			-generate 0x18402010 0x18402014 $(srec_cat_le_cmd) $(CONFIG_SYS_UBOOT_START) 4 \
+			-generate 0x18402014 0x18402018 $(srec_cat_le_cmd) 0x1ef000 4 \
+			-generate 0x18402018 0x1840201c $(srec_cat_le_cmd) 0x0 4 \
+			-generate 0x1840201c 0x18402020 $(srec_cat_le_cmd) 0x0 4
 else
 ifneq ($(CONFIG_RCAR_GEN4),)
 quiet_cmd_srec_cat = SRECCAT $@
@@ -121,6 +135,9 @@ spl/u-boot-spl.scif: spl/u-boot-spl.srec spl/u-boot-spl.bin
 u-boot-elf.scif: u-boot-elf.srec u-boot.bin
 	$(call cmd,srec_cat,$(shell wc -c u-boot-dtb.bin | awk '{printf("0x%08x\n",$$1)}'))
 
+u-boot-elf.shdr: u-boot-elf.srec u-boot.bin
+	$(call cmd,srec_shdr_cat,$(shell wc -c u-boot-dtb.bin | awk '{printf("0x%08x\n",$$1)}'))
+
 # if srec_cat is present build u-boot-spl.scif by default
 has_srec_cat = $(call try-run,srec_cat -VERSion,y,n)
 INPUTS-$(has_srec_cat) += u-boot-spl.scif
-- 
2.53.0



More information about the U-Boot mailing list