Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame^] | 1 | DESCRIPTION = "ARM Trusted Firmware" |
| 2 | |
| 3 | LICENSE = "BSD" |
| 4 | LIC_FILES_CHKSUM = "file://license.rst;md5=33065335ea03d977d0569f270b39603e" |
| 5 | |
| 6 | PROVIDES = "virtual/arm-trusted-firmware" |
| 7 | |
| 8 | inherit deploy |
| 9 | |
| 10 | DEPENDS += "u-boot-mkimage-native" |
| 11 | |
| 12 | S = "${WORKDIR}/git" |
| 13 | B = "${WORKDIR}/build" |
| 14 | |
| 15 | XILINX_RELEASE_VERSION ?= "" |
| 16 | ATF_VERSION ?= "1.4" |
| 17 | ATF_VERSION_EXTENSION ?= "-xilinx-${XILINX_RELEASE_VERSION}" |
| 18 | PV = "${ATF_VERSION}${ATF_VERSION_EXTENSION}+git${SRCPV}" |
| 19 | |
| 20 | BRANCH ?= "" |
| 21 | REPO ?= "git://github.com/Xilinx/arm-trusted-firmware.git;protocol=https" |
| 22 | BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}" |
| 23 | SRC_URI = "${REPO};${BRANCHARG}" |
| 24 | |
| 25 | ATF_BASE_NAME ?= "${PN}-${PKGE}-${PKGV}-${PKGR}-${DATETIME}" |
| 26 | ATF_BASE_NAME[vardepsexclude] = "DATETIME" |
| 27 | |
| 28 | COMPATIBLE_MACHINE = "zynqmp" |
| 29 | PLATFORM_zynqmp = "zynqmp" |
| 30 | |
| 31 | # requires CROSS_COMPILE set by hand as there is no configure script |
| 32 | export CROSS_COMPILE="${TARGET_PREFIX}" |
| 33 | |
| 34 | # Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application |
| 35 | CFLAGS[unexport] = "1" |
| 36 | LDFLAGS[unexport] = "1" |
| 37 | AS[unexport] = "1" |
| 38 | LD[unexport] = "1" |
| 39 | |
| 40 | do_configure() { |
| 41 | : |
| 42 | } |
| 43 | |
| 44 | do_compile() { |
| 45 | oe_runmake -C ${S} BUILD_BASE=${B} PLAT=${PLATFORM} RESET_TO_BL31=1 bl31 |
| 46 | } |
| 47 | |
| 48 | do_install() { |
| 49 | : |
| 50 | } |
| 51 | |
| 52 | OUTPUT_DIR = "${B}/${PLATFORM}/release" |
| 53 | |
| 54 | do_deploy() { |
| 55 | install -d ${DEPLOYDIR} |
| 56 | install -m 0644 ${OUTPUT_DIR}/bl31/bl31.elf ${DEPLOYDIR}/${ATF_BASE_NAME}.elf |
| 57 | ln -sf ${ATF_BASE_NAME}.elf ${DEPLOYDIR}/${PN}.elf |
| 58 | install -m 0644 ${OUTPUT_DIR}/bl31.bin ${DEPLOYDIR}/${ATF_BASE_NAME}.bin |
| 59 | ln -sf ${ATF_BASE_NAME}.bin ${DEPLOYDIR}/${PN}.bin |
| 60 | |
| 61 | # Get the entry point address from the elf. |
| 62 | BL31_BASE_ADDR=$(${READELF} -h ${OUTPUT_DIR}/bl31/bl31.elf | egrep -m 1 -i "entry point.*?0x" | sed -r 's/.*?(0x.*?)/\1/g') |
| 63 | mkimage -A arm64 -O arm-trusted-firmware -T kernel -C none \ |
| 64 | -a $BL31_BASE_ADDR -e $BL31_BASE_ADDR \ |
| 65 | -d ${OUTPUT_DIR}/bl31.bin ${DEPLOYDIR}/${ATF_BASE_NAME}.ub |
| 66 | ln -sf ${ATF_BASE_NAME}.ub ${DEPLOYDIR}/${PN}.ub |
| 67 | ln -sf ${ATF_BASE_NAME}.ub ${DEPLOYDIR}/atf-uboot.ub |
| 68 | } |
| 69 | addtask deploy before do_build after do_compile |