ARM: convert build of appended dtb zImage to list of dtbs
Allow CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES to specify a space separated list of dtbs to append to the zImage, and name the resulting file zImage-dtb Change-Id: Ied5d0bafbd1d01fc1f109c15c4283de7029903c9 Signed-off-by: Colin Cross <ccross@android.com>
This commit is contained in:
parent
d7a9d61873
commit
17d0350f21
6 changed files with 41 additions and 9 deletions
|
@ -1857,16 +1857,16 @@ config BUILD_ARM_APPENDED_DTB_IMAGE
|
||||||
bool "Build a concatenated zImage/dtb by default"
|
bool "Build a concatenated zImage/dtb by default"
|
||||||
depends on OF
|
depends on OF
|
||||||
help
|
help
|
||||||
Enabling this option will cause a concatenated zImage and DTB to
|
Enabling this option will cause a concatenated zImage and list of
|
||||||
be built by default (instead of a standalone zImage.) The image
|
DTBs to be built by default (instead of a standalone zImage.)
|
||||||
will built in arch/arm/boot/zImage-dtb.<dtb name>
|
The image will built in arch/arm/boot/zImage-dtb
|
||||||
|
|
||||||
config BUILD_ARM_APPENDED_DTB_IMAGE_NAME
|
config BUILD_ARM_APPENDED_DTB_IMAGE_NAMES
|
||||||
string "Default dtb name"
|
string "Default dtb names"
|
||||||
depends on BUILD_ARM_APPENDED_DTB_IMAGE
|
depends on BUILD_ARM_APPENDED_DTB_IMAGE
|
||||||
help
|
help
|
||||||
name of the dtb to append when building a concatenated
|
Space separated list of names of dtbs to append when
|
||||||
zImage/dtb.
|
building a concatenated zImage-dtb.
|
||||||
|
|
||||||
# Compressed boot loader in ROM. Yes, we really want to ask about
|
# Compressed boot loader in ROM. Yes, we really want to ask about
|
||||||
# TEXT and BSS so we preserve their values in the config files.
|
# TEXT and BSS so we preserve their values in the config files.
|
||||||
|
|
|
@ -297,7 +297,7 @@ libs-y := arch/arm/lib/ $(libs-y)
|
||||||
ifeq ($(CONFIG_XIP_KERNEL),y)
|
ifeq ($(CONFIG_XIP_KERNEL),y)
|
||||||
KBUILD_IMAGE := xipImage
|
KBUILD_IMAGE := xipImage
|
||||||
else ifeq ($(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE),y)
|
else ifeq ($(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE),y)
|
||||||
KBUILD_IMAGE := zImage-dtb.$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAME)
|
KBUILD_IMAGE := zImage-dtb
|
||||||
else
|
else
|
||||||
KBUILD_IMAGE := zImage
|
KBUILD_IMAGE := zImage
|
||||||
endif
|
endif
|
||||||
|
@ -348,6 +348,9 @@ ifeq ($(CONFIG_VDSO),y)
|
||||||
$(Q)$(MAKE) $(build)=arch/arm/vdso $@
|
$(Q)$(MAKE) $(build)=arch/arm/vdso $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
zImage-dtb: vmlinux scripts dtbs
|
||||||
|
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
|
||||||
|
|
||||||
# We use MRPROPER_FILES and CLEAN_FILES now
|
# We use MRPROPER_FILES and CLEAN_FILES now
|
||||||
archclean:
|
archclean:
|
||||||
$(Q)$(MAKE) $(clean)=$(boot)
|
$(Q)$(MAKE) $(clean)=$(boot)
|
||||||
|
|
1
arch/arm/boot/.gitignore
vendored
1
arch/arm/boot/.gitignore
vendored
|
@ -4,3 +4,4 @@ xipImage
|
||||||
bootpImage
|
bootpImage
|
||||||
uImage
|
uImage
|
||||||
*.dtb
|
*.dtb
|
||||||
|
zImage-dtb
|
|
@ -28,6 +28,14 @@ export ZRELADDR INITRD_PHYS PARAMS_PHYS
|
||||||
|
|
||||||
targets := Image zImage xipImage bootpImage uImage
|
targets := Image zImage xipImage bootpImage uImage
|
||||||
|
|
||||||
|
DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
|
||||||
|
ifneq ($(DTB_NAMES),)
|
||||||
|
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
|
||||||
|
else
|
||||||
|
DTB_LIST := $(dtb-y)
|
||||||
|
endif
|
||||||
|
DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST))
|
||||||
|
|
||||||
ifeq ($(CONFIG_XIP_KERNEL),y)
|
ifeq ($(CONFIG_XIP_KERNEL),y)
|
||||||
|
|
||||||
$(obj)/xipImage: vmlinux FORCE
|
$(obj)/xipImage: vmlinux FORCE
|
||||||
|
@ -56,6 +64,10 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
|
||||||
$(call if_changed,objcopy)
|
$(call if_changed,objcopy)
|
||||||
@$(kecho) ' Kernel: $@ is ready'
|
@$(kecho) ' Kernel: $@ is ready'
|
||||||
|
|
||||||
|
$(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE
|
||||||
|
$(call if_changed,cat)
|
||||||
|
@echo ' Kernel: $@ is ready'
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(LOADADDR),)
|
ifneq ($(LOADADDR),)
|
||||||
|
|
|
@ -782,5 +782,15 @@ endif
|
||||||
dtstree := $(srctree)/$(src)
|
dtstree := $(srctree)/$(src)
|
||||||
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
|
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
|
||||||
|
|
||||||
always := $(dtb-y)
|
DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
|
||||||
|
ifneq ($(DTB_NAMES),)
|
||||||
|
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
|
||||||
|
else
|
||||||
|
DTB_LIST := $(dtb-y)
|
||||||
|
endif
|
||||||
|
|
||||||
|
targets += dtbs dtbs_install
|
||||||
|
targets += $(DTB_LIST)
|
||||||
|
|
||||||
|
always := $(DTB_LIST)
|
||||||
clean-files := *.dtb
|
clean-files := *.dtb
|
||||||
|
|
|
@ -294,6 +294,12 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
|
||||||
|
|
||||||
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
||||||
|
|
||||||
|
# cat
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Concatentate multiple files together
|
||||||
|
quiet_cmd_cat = CAT $@
|
||||||
|
cmd_cat = (cat $(filter-out FORCE,$^) > $@) || (rm -f $@; false)
|
||||||
|
|
||||||
# Bzip2
|
# Bzip2
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue