aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2016-09-29 23:36:33 +1000
committerNathan Rossi <nathan@nathanrossi.com>2016-10-11 22:36:54 +1000
commit690bd80c093fca1d12b176cd99127513f20c6c43 (patch)
tree0b76b9e1ed5fc96b7591e05f51c542ad3391e67a
parentfd685adf83a998513a3a46ec72abf792c1a194bb (diff)
downloadmeta-xilinx-690bd80c093fca1d12b176cd99127513f20c6c43.tar.gz
meta-xilinx-690bd80c093fca1d12b176cd99127513f20c6c43.tar.bz2
meta-xilinx-690bd80c093fca1d12b176cd99127513f20c6c43.zip
arm-trusted-firmware: Dynamically get entry address
Dynamically get the entry point address for the atf.ub image from the bl31.elf based on the program headers entry point address which matches the expected entry address (aka MEM_BASE). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
-rw-r--r--recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bb13
1 files changed, 10 insertions, 3 deletions
diff --git a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bb b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bb
index f384f5bc..8962429b 100644
--- a/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bb
+++ b/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bb
@@ -43,10 +43,17 @@ do_install() {
:
}
+OUTPUT_DIR = "${S}/build/${PLATFORM}/release"
+
do_deploy() {
install -d ${DEPLOYDIR}
- install -m 0644 ${S}/build/${PLATFORM}/release/bl31/bl31.elf ${DEPLOYDIR}/bl31-${MACHINE}.elf
- install -m 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${MACHINE}.bin
- mkimage -A arm64 -O linux -T kernel -C none -a 0xfffe5000 -e 0xfffe5000 -d ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/atf.ub
+ install -m 0644 ${OUTPUT_DIR}/bl31/bl31.elf ${DEPLOYDIR}/bl31-${MACHINE}.elf
+ install -m 0644 ${OUTPUT_DIR}/bl31.bin ${DEPLOYDIR}/bl31-${MACHINE}.bin
+
+ # Get the entry point address from the elf.
+ BL31_BASE_ADDR=$(${READELF} -h ${OUTPUT_DIR}/bl31/bl31.elf | egrep -m 1 -i "entry point.*?0x" | sed -r 's/.*?(0x.*?)/\1/g')
+ mkimage -A arm64 -O linux -T kernel -C none \
+ -a $BL31_BASE_ADDR -e $BL31_BASE_ADDR \
+ -d ${OUTPUT_DIR}/bl31.bin ${DEPLOYDIR}/atf.ub
}
addtask deploy before do_build after do_compile