arm: RTIC kernel integration to generate MP DTS

With new Boot Image header v2 the boot image header generation
decoupled from the kernel. RTIC DTS requires kernel build
environment (because of OBJDUMP, OBJCPY, and other dependencies).
The RTIC DTS will be compiled to DTB later either by
arch/arm64/boot/Makefile (for Boot Image Header v1) or by
kernel_definitions.mk (for Boot Image Header v2).

Change-Id: I299e62fa2105eb3a59df7ec9577aa2fcf193cfed
Signed-off-by: Amareswar Reddy Valasa <avalasa@codeaurora.org>
This commit is contained in:
Amareswar Reddy Valasa 2019-09-10 12:36:57 +05:30 committed by Gerrit - the friendly Code Review server
parent 5af1d28861
commit cacbbae73e
2 changed files with 15 additions and 3 deletions

View File

@ -29,14 +29,15 @@ endif
DTB_OBJS := $(shell find $(obj)/dts/ -name \*.dtb)
# Add RTIC DTB to the DTB list if RTIC MPGen is enabled
# Note, we keep this for compatibility with
# BUILD_ARM64_APPENDED_DTB_IMAGE targets.
# The rtic_mp.dts would be generated with the vmlinux if
# MPGen enabled (RTIC_MPGEN defined).
ifdef RTIC_MPGEN
DTB_OBJS += rtic_mp.dtb
endif
rtic_mp.dtb: vmlinux FORCE
$(RTIC_MPGEN) --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \
--binpath="" --vmlinux="vmlinux" --config=${KCONFIG_CONFIG} \
--cc="${CC} ${KBUILD_AFLAGS}" --dts=rtic_mp.dts && \
$(DTC) -O dtb -o rtic_mp.dtb -b 0 $(DTC_FLAGS) rtic_mp.dts
$(obj)/Image: vmlinux FORCE

View File

@ -455,5 +455,16 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
fi
fi
# Starting Android Q, the DTB's are part of dtb.img and not part
# of the kernel image. RTIC DTS relies on the kernel environment
# and could not build outside of the kernel. Generate RTIC DTS after
# successful kernel build if MPGen is enabled. The DTB will be
# generated with dtb.img in kernel_definitions.mk.
if [ ! -z ${RTIC_MPGEN+x} ]; then
${RTIC_MPGEN} --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \
--binpath="" --vmlinux="vmlinux" --config=${KCONFIG_CONFIG} \
--cc="${CC} ${KBUILD_AFLAGS}" --dts=rtic_mp.dts
fi
# We made a new kernel - delete old version file
rm -f .old_version