blob: a0d2d2b9dac5f115e5beee89b46115b200db249c [file] [log] [blame]
Andrew Geissler84ad7c52020-06-27 00:00:16 -05001inherit esw deploy
2
3COMPATIBLE_MACHINE = ".*-zynqmp"
4
5ESW_COMPONENT_SRC = "/lib/sw_apps/zynqmp_fsbl/src"
6
7DEPENDS += "xilstandalone xiltimer xilffs xilsecure xilpm device-tree"
8
9PSU_INIT = "${RECIPE_SYSROOT}/${includedir}/devicetree/psu_init*"
10
11do_configure_prepend() {
12 # Copy psu_init* files to fsbl source code
13 cp ${PSU_INIT} ${S}/${ESW_COMPONENT_SRC}
14}
15
16do_install() {
17 install -d ${D}/${base_libdir}/firmware
18 # Note that we have to make the ELF executable for it to be stripped
19 install -m 0755 ${B}/zynqmp_fsbl* ${D}/${base_libdir}/firmware
20}
21
22ZYNQMP_FSBL_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
23ZYNQMP_FSBL_BASE_NAME[vardepsexclude] = "DATETIME"
24
25do_deploy() {
26
27 # We need to deploy the stripped elf, hence why not doing it from ${D}
28 install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/zynqmp_fsbl.elf ${DEPLOYDIR}/${ZYNQMP_FSBL_BASE_NAME}.elf
29 ln -sf ${ZYNQMP_FSBL_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
30 ${OBJCOPY} -O binary ${WORKDIR}/package/${base_libdir}/firmware/zynqmp_fsbl.elf ${WORKDIR}/package/${base_libdir}/firmware/zynqmp_fsbl.bin
31 install -m 0644 ${WORKDIR}/package/${base_libdir}/firmware/zynqmp_fsbl.bin ${DEPLOYDIR}/${ZYNQMP_FSBL_BASE_NAME}.bin
32 ln -sf ${ZYNQMP_FSBL_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
33}
34
35addtask deploy before do_build after do_package
36
37CFLAGS_append_aarch64 = " -DARMA53_64"
38CFLAGS_append_armrm = " -DARMR5"
39
40FILES_${PN} = "${base_libdir}/firmware/zynqmp_fsbl*"