blob: 330e020957d27ef9cfdef200a3b4bb8dca40133e [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001inherit deploy
2
3LICENSE = "Proprietary"
Andrew Geissler84ad7c52020-06-27 00:00:16 -05004LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=39ab6ab638f4d1836ba994ec6852de94"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005
Andrew Geissler84ad7c52020-06-27 00:00:16 -05006SRCREV = "e8db5fb118229fdc621e0ec7848641a23bf60998"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08007PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}"
8
Andrew Geissler10fa1492020-12-11 16:25:29 -06009SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1 \
10 file://fix-zynqmp-assert.patch;pnum=5"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080011
12COMPATIBLE_HOST = "microblaze.*-elf"
Andrew Geissler84ad7c52020-06-27 00:00:16 -050013COMPATIBLE_MACHINE = "microblaze-pmu"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080014
15S = "${WORKDIR}/git/lib/sw_apps/zynqmp_pmufw/src"
16
17# The makefile does not handle parallelization
18PARALLEL_MAKE = ""
19
20do_configure() {
21 # manually do the copy_bsp step first, so as to be able to fix up use of
22 # mb-* commands
23 ${S}/../misc/copy_bsp.sh
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024}
25
26COMPILER = "${CC}"
27COMPILER_FLAGS = "-O2 -c"
28EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects"
29ARCHIVER = "${AR}"
30
31BSP_DIR ?= "${S}/../misc/zynqmp_pmufw_bsp"
32BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_pmu_0/libsrc"
33
34def bsp_make_vars(d):
35 s = ["COMPILER", "CC", "COMPILER_FLAGS", "EXTRA_COMPILER_FLAGS", "ARCHIVER", "AR", "AS"]
36 return " ".join(["\"%s=%s\"" % (v, d.getVar(v)) for v in s])
37
38do_compile() {
39 # the Makefile in ${S}/../misc/Makefile, does not handle CC, AR, AS, etc
40 # properly. So do its job manually. Preparing the includes first, then libs.
41 for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do
42 oe_runmake -C $(dirname $i) -s include ${@bsp_make_vars(d)}
43 done
44 for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do
45 oe_runmake -C $(dirname $i) -s libs ${@bsp_make_vars(d)}
46 done
47
48 # --build-id=none is required due to linker script not defining a location for it.
49 # Again, recipe-systoot include is necessary
50 oe_runmake CC="${CC}" CC_FLAGS="-MMD -MP -Wl,--build-id=none -I${STAGING_DIR_TARGET}/usr/include"
51}
52
53do_install() {
54 :
55}
56
Andrew Geisslera9ff2b32020-10-16 10:11:54 -050057PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058
59do_deploy() {
60 install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf
61 ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
62 ${OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin
63 install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin
64 ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
65}
66
67addtask deploy before do_build after do_install