diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2024-07-10 09:16:09 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-07-18 13:51:06 -0600 |
commit | 06518fdf24e5fdf3561eb66c00bd8946cf5b0e58 (patch) | |
tree | bb41aa83832850287869e59df35d44cf419867d7 /scripts | |
parent | 3b7653db7b638c6033ad24f87325a6b4a4895dee (diff) | |
download | u-boot-06518fdf24e5fdf3561eb66c00bd8946cf5b0e58.tar.gz u-boot-06518fdf24e5fdf3561eb66c00bd8946cf5b0e58.tar.bz2 u-boot-06518fdf24e5fdf3561eb66c00bd8946cf5b0e58.zip |
kbuild: Allow DTB overlays to built into .dtbo.S files
[linux commit 941214a512d8, modified for U-Boot by removing the
include of vmlinux.lds.h and replacing STRUCT_ALIGNMENT by 16.]
DTB files can be built into the kernel by converting them to assembly
files then assembling them into object files. We extend this here
for DTB overlays with the .dtso extensions.
We change the start and end delimiting tag prefix to make it clear that
this data came from overlay files.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.lib | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3e68d5aa80..549c361947 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -305,7 +305,7 @@ endif DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) # Generate an assembly file to wrap the output of the device tree compiler -quiet_cmd_dt_S_dtb= DTB $@ +quiet_cmd_dt_S_dtb= DTBS $@ # Modified for U-Boot cmd_dt_S_dtb= \ ( \ @@ -322,6 +322,24 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd,dt_S_dtb) +# Generate an assembly file to wrap the output of the device tree compiler +quiet_cmd_dt_S_dtbo= DTBOS $@ +# Modified for U-Boot +cmd_dt_S_dtbo= \ +{ \ + echo '.section .dtb.init.rodata,"a"'; \ + echo '.balign 16'; \ + echo '.global __dtbo_$(subst -,_,$(*F))_begin'; \ + echo '__dtbo_$(subst -,_,$(*F))_begin:'; \ + echo '.incbin "$<" '; \ + echo '__dtbo_$(subst -,_,$(*F))_end:'; \ + echo '.global __dtbo_$(subst -,_,$(*F))_end'; \ + echo '.balign 16'; \ +} > $@ + +$(obj)/%.dtbo.S: $(obj)/%.dtbo + $(call cmd,dt_S_dtbo) + ifeq ($(CONFIG_OF_LIBFDT_OVERLAY),y) DTC_FLAGS += -@ endif |