Re: [PATCH 10/13] m68k: implement an embedded devicetree for nonmmu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

On Tue, 18 Feb 2025 at 13:54, Greg Ungerer <gerg@xxxxxxxxxxxxxx> wrote:
If there is no capability for the boot loader to specify a devicetree
blob then this option allows for it to be embedded within the linux
kernel binary itself. This change specifically adds this embedding
support for the m68knommu targets.

Signed-off-by: Greg Ungerer <gerg@xxxxxxxxxxxxxx>

Thanks for your patch!

--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -144,3 +144,14 @@ config SERIAL_CONSOLE
 endmenu

 endif
+
+config EMBEDDED_DTB

BUILTIN_DTB

+       bool "Embedded devicetree ELF section"

select GENERIC_BUILTIN_DTB

+       help
+         If there is no capability for the boot loader to specify a
+         devicetree (DTB) then this option allows for it to be embedbed
+         within the linux binary itself. Typically you can do this with
+         something like this:
+
+               objcopy --update-section .embedded_dtb=<filename>.dtb vmlinux
+

--- a/arch/m68k/kernel/vmlinux-nommu.lds
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -70,6 +70,15 @@ SECTIONS {
        INIT_TEXT_SECTION(PAGE_SIZE)
        INIT_DATA_SECTION(16)
        PERCPU_SECTION(16)
+
+#ifdef CONFIG_EMBEDDED_DTB
+       STRUCT_ALIGN();
+       .embedded_dtb : {
+               embedded_dtb = .;
+               *(.embedded_dtb)
+               KEEP(*(.embedded_dtb))
+       }
+#endif
        .m68k_fixup : {
                __start_fixup = .;
                *(.m68k_fixup)

Please use the existing DTB support in include/asm-generic/vmlinux.lds.h.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds




[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux