[PATCH] arm64: versal-net: Enable remaking ELF from bin

U-Boot is composing u-boot.bin from u-boot-nodtb.bin with appended dts/dt.dtb. It means U-Boot doesn't have DTB inside. When REMAKE_ELF is enabled make will also create u-boot.elf which is recreated from u-boot.bin. Below is build output for mini configuration how ELF is recreated.
cat arch/arm/dts/versal-net-mini.dtb > dts/dt.dtb cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin cp dts/dt.dtb u-boot.dtb cp u-boot-dtb.bin u-boot.bin aarch64-linux-gnu-objcopy -I binary -B aarch64 -O elf64-littleaarch64 u-boot.bin u-boot-elf.o aarch64-linux-gnu-ld.bfd u-boot-elf.o -o u-boot.elf -EL -T u-boot-elf.lds --defsym="_start"=0xBBF00000 -Ttext=0xBBF00000
It is useful to have u-boot.elf present because Xilinx XSDB debugger can load ELF file and user doesn't need to specify loading address for u-boot.bin.
Signed-off-by: Michal Simek michal.simek@amd.com ---
configs/xilinx_versal_net_mini_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/xilinx_versal_net_mini_defconfig b/configs/xilinx_versal_net_mini_defconfig index 5bad1791964f..0ff5268bc342 100644 --- a/configs/xilinx_versal_net_mini_defconfig +++ b/configs/xilinx_versal_net_mini_defconfig @@ -20,6 +20,7 @@ CONFIG_SYS_MEMTEST_END=0x00001000 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xBBF10000 # CONFIG_EXPERT is not set +CONFIG_REMAKE_ELF=y # CONFIG_LEGACY_IMAGE_FORMAT is not set # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set # CONFIG_AUTOBOOT is not set

On 1/19/23 10:46, Michal Simek wrote:
U-Boot is composing u-boot.bin from u-boot-nodtb.bin with appended dts/dt.dtb. It means U-Boot doesn't have DTB inside. When REMAKE_ELF is enabled make will also create u-boot.elf which is recreated from u-boot.bin. Below is build output for mini configuration how ELF is recreated.
cat arch/arm/dts/versal-net-mini.dtb > dts/dt.dtb cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin cp dts/dt.dtb u-boot.dtb cp u-boot-dtb.bin u-boot.bin aarch64-linux-gnu-objcopy -I binary -B aarch64 -O elf64-littleaarch64 u-boot.bin u-boot-elf.o aarch64-linux-gnu-ld.bfd u-boot-elf.o -o u-boot.elf -EL -T u-boot-elf.lds --defsym="_start"=0xBBF00000 -Ttext=0xBBF00000
It is useful to have u-boot.elf present because Xilinx XSDB debugger can load ELF file and user doesn't need to specify loading address for u-boot.bin.
Signed-off-by: Michal Simek michal.simek@amd.com
configs/xilinx_versal_net_mini_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/xilinx_versal_net_mini_defconfig b/configs/xilinx_versal_net_mini_defconfig index 5bad1791964f..0ff5268bc342 100644 --- a/configs/xilinx_versal_net_mini_defconfig +++ b/configs/xilinx_versal_net_mini_defconfig @@ -20,6 +20,7 @@ CONFIG_SYS_MEMTEST_END=0x00001000 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xBBF10000 # CONFIG_EXPERT is not set +CONFIG_REMAKE_ELF=y # CONFIG_LEGACY_IMAGE_FORMAT is not set # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set # CONFIG_AUTOBOOT is not set
Applied. M
participants (1)
-
Michal Simek