From: Dirk Brandewie <[email protected]> This patch adds support for linking device tree blobs into vmlinux. The device tree blobs are placed in the init.data section.
Signed-off-by: Dirk Brandewie <[email protected]> --- include/asm-generic/vmlinux.lds.h | 12 ++++++++++++ init/Kconfig | 7 +++++++ scripts/Makefile.lib | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 0 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd69d79..a36dab5 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -146,6 +146,17 @@ #define TRACE_SYSCALLS() #endif +#ifdef CONFIG_KERNEL_DTB +#define KERNEL_DTB \ + . = ALIGN(4); \ + VMLINUX_SYMBOL(__dtb_start) = .; \ + *(.dtb) \ + VMLINUX_SYMBOL(__dtb_end) = .; + +#else +#define KERNEL_DTB +#endif + /* .data section */ #define DATA_DATA \ *(.data) \ @@ -772,6 +783,7 @@ CON_INITCALL \ SECURITY_INITCALL \ INIT_RAM_FS \ + KERNEL_DTB \ } #define BSS_SECTION(sbss_align, bss_align, stop_align) \ diff --git a/init/Kconfig b/init/Kconfig index 88c1046..fddfc0f 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1083,6 +1083,13 @@ config PCI_QUIRKS bugs/quirks. Disable this only if your target machine is unaffected by PCI quirks. +config KERNEL_DTB + bool "Support linking a device tree blob into vmlinux" + default n + help + This option provides support for adding a device tree blob(s) + directly to vmlinux + config SLUB_DEBUG default y bool "Enable SLUB debugging support" if EMBEDDED diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 4c72c11..6481f27 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -200,6 +200,20 @@ quiet_cmd_gzip = GZIP $@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ (rm -f $@ ; false) +# DTC +# --------------------------------------------------------------------------- +$(obj)/%.dtb.S: $(obj)/%.dtb + @echo '.section .dtb,"a"' > $@ + @echo '.global __$(*F)_dtb_begin' >> $@ + @echo '__$(*F)_dtb_begin:' >> $@ + @echo '.incbin "$<" ' >> $@ + @echo '.global __$(*F)_dtb_end' >> $@ + @echo '__$(*F)_dtb_end:' >> $@ + +DTC = $(objtree)/scripts/dtc/dtc + +quiet_cmd_dtc = DTC $@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts # Bzip2 # --------------------------------------------------------------------------- -- 1.7.2.3 _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
