mirror of
https://github.com/frank-w/u-boot.git
synced 2026-01-22 16:53:37 +08:00
spl: dm: Make it possible for the SPL to pick its own DTB from a FIT
u-boot can be embedded within a FIT image with multiple DTBs. It then selects at run-time which one is best suited for the platform. Use the same principle here for the SPL: put the DTBs in a FIT image, compress it (LZO, GZIP, or no compression) and append it at the end of the SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> [trini: Move default y of SPL_MULTI_DTB_FIT_DYN_ALLOC to it being the default choice if SYS_MALLOC_F, drop spl.h include from lib/fdtdec.c it's unused.] Signed-off-by Tom Rini <trini@konsulko.com>
This commit is contained in:
committed by
Tom Rini
parent
035d64025c
commit
2f57c95100
@@ -209,10 +209,21 @@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@
|
||||
quiet_cmd_copy = COPY $@
|
||||
cmd_copy = cp $< $@
|
||||
|
||||
ifneq ($(CONFIG_SPL_MULTI_DTB_FIT),y)
|
||||
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).dtb
|
||||
else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_LZO),y)
|
||||
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.lzo
|
||||
else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_GZIP),y)
|
||||
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.gz
|
||||
else
|
||||
FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_$(SPL_TPL_)OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
|
||||
$(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
|
||||
$(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
|
||||
$(obj)/$(SPL_BIN).dtb FORCE
|
||||
$(FINAL_DTB_CONTAINER) FORCE
|
||||
$(call if_changed,cat)
|
||||
|
||||
$(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
|
||||
@@ -383,6 +394,28 @@ checkdtoc: tools
|
||||
PHONY += FORCE
|
||||
FORCE:
|
||||
|
||||
PHONY += dtbs
|
||||
dtbs:
|
||||
$(Q)$(MAKE) $(build)=dts dtbs
|
||||
|
||||
# Declare the contents of the .PHONY variable as phony. We keep that
|
||||
# information in a variable so we can use it in if_changed and friends.
|
||||
.PHONY: $(PHONY)
|
||||
|
||||
SHRUNK_ARCH_DTB = $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST)))
|
||||
.SECONDEXPANSION:
|
||||
$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@)
|
||||
$(call if_changed,fdtgrep)
|
||||
|
||||
MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
|
||||
-n "Multi DTB fit image for $(SPL_BIN)" -E \
|
||||
$(patsubst %,-b %,$(SHRUNK_ARCH_DTB))
|
||||
|
||||
$(obj)/$(SPL_BIN).multidtb.fit: /dev/null $(SHRUNK_ARCH_DTB) FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
$(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit
|
||||
@gzip -kf9 $< > $@
|
||||
|
||||
$(obj)/$(SPL_BIN).multidtb.fit.lzo: $(obj)/$(SPL_BIN).multidtb.fit
|
||||
@lzop -f9 $< > $@
|
||||
|
||||
Reference in New Issue
Block a user