dts: combine dtb in u-boot ELF

u-boot and dtb are seperate images. This patch combines them as
single ELF image.

Change-Id: Ib3c72c26844ffd4fd8489d0595c243a15434802e
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
This commit is contained in:
Manoharan Vijaya Raghavan 2016-05-30 13:12:45 +05:30
parent 53afc70d8f
commit 2fb1c57774
5 changed files with 37 additions and 2 deletions

View file

@ -630,6 +630,7 @@ HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makef
libs-y += lib/
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
libs-$(CONFIG_OF_EMBED) += dts/
libs-$(CONFIG_OF_COMBINE) += dts/
libs-y += fs/
libs-y += net/
libs-y += disk/

View file

@ -144,6 +144,13 @@ SECTIONS
KEEP(*(.__bss_end));
}
#ifdef CONFIG_OF_COMBINE
. = ALIGN(4);
. = CONFIG_DTB_LOAD_ADDR;
.dtb : {
KEEP(*(.dtb.combine*));
}
#endif
.dynsym _image_binary_end : { *(.dynsym) }
.dynbss : { *(.dynbss) }
.dynstr : { *(.dynstr*) }

View file

@ -37,12 +37,16 @@ arch-dtbs:
.SECONDARY: $(obj)/dt.dtb.S
.SECONDARY: $(obj)/dt_comb.dtb.S
obj-$(CONFIG_OF_EMBED) := dt.dtb.o
obj-$(CONFIG_OF_COMBINE) := dt_comb.dtb.o
dtbs: $(obj)/dt.dtb
@:
clean-files := dt.dtb.S
clean-files := dt.dtb.S dt_comb.dtb.S
# Let clean descend into dts directories
subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts

View file

@ -79,11 +79,16 @@
sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_SYS_SDRAM_BASE 0x40000000
#define CONFIG_SYS_TEXT_BASE 0x4f600000
#define CONFIG_SYS_TEXT_BASE 0x4AD00000
#define CONFIG_SYS_SDRAM_SIZE 0x10000000
#define CONFIG_MAX_RAM_BANK_SIZE CONFIG_SYS_SDRAM_SIZE
#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + (64 << 20))
#define CONFIG_OF_COMBINE 1
#define CONFIG_DTB_LOAD_ADDR 0x4AE00000
#define CONFIG_EXTRA_ENV_SETTINGS "fdtcontroladdr=0x4AE00000\0"
/*
* SPI Flash Configs
*/

View file

@ -283,6 +283,24 @@ cmd_dt_S_dtb= \
$(obj)/%.dtb.S: $(obj)/%.dtb
$(call cmd,dt_S_dtb)
# DTB_COMB
# ---------------------------------------------------------------------------
# Generate an assembly file to wrap the output of the device tree compiler
quiet_cmd_dt_comb_S_dtb= DTB_COMB $@
# Modified for U-Boot Combined ELF
cmd_dt_comb_S_dtb= \
( \
echo '.section .dtb.combine,"a"'; \
echo '.balign 16'; \
echo '.incbin "$<" '; \
echo '.balign 16'; \
) > $@
$(obj)/%_comb.dtb.S: $(obj)/%.dtb
$(call cmd,dt_comb_S_dtb)
quiet_cmd_dtc = DTC $@
# Modified for U-Boot
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \