]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: renesas: Generate u-boot-elf.shdr for R-Car Gen5 RSIP
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 7 May 2026 23:25:36 +0000 (01:25 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 21 May 2026 19:48:05 +0000 (21:48 +0200)
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@mailbox.org>
Makefile
arch/arm/mach-renesas/Makefile

index 552328f9f2c2f0aa111a0f9d646b101ac874bfc6..7e87b4f65f282547da40e8934f343d99eb5fff1e 100644 (file)
--- 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))
index e3133668e13f8ddccb80ac59ff73b9e0748fda93..83c576d600732e5a997edd46e7c0b94d30c8c1c1 100644 (file)
@@ -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