Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame^] | 1 | SUMMARY = "Firmware for the PMU on the ZynqMP Programmable Silicon" |
| 2 | HOMEPAGE = "https://github.com/Xilinx/embeddedsw" |
| 3 | SECTION = "bsp" |
| 4 | |
| 5 | INHIBIT_DEFAULT_DEPS = "1" |
| 6 | DEPENDS = "virtual/${TARGET_PREFIX}gcc newlib libgloss libgcc" |
| 7 | |
| 8 | # force this recipe to provide a target virtual/pmu-firmware. this is applied |
| 9 | # after any class extender mapping and results in this recipe always providing |
| 10 | # 'virtual/pmu-firmware'. |
| 11 | python append_target_provides () { |
| 12 | d.appendVar("PROVIDES", " virtual/pmu-firmware") |
| 13 | } |
| 14 | addhandler append_target_provides |
| 15 | append_target_provides[eventmask] = "bb.event.RecipeParsed" |
| 16 | |
| 17 | # This source links in a number of components with differing licenses, and some |
| 18 | # licenses are not Open Source compatible. Additionally the pmu-firmware source |
| 19 | # itself is licensed under a modified MIT license which restricts use to Xilinx |
| 20 | # devices only. |
| 21 | LICENSE = "Proprietary" |
| 22 | LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=04841c5ad8409b474da7180de5391926" |
| 23 | |
| 24 | inherit deploy |
| 25 | |
| 26 | XILINX_RELEASE_VERSION = "v2018.1" |
| 27 | SRCREV = "aaa566bc3fa19255de4d434ebfa57ae3a9d261b2" |
| 28 | PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}" |
| 29 | |
| 30 | SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1" |
| 31 | |
| 32 | COMPATIBLE_HOST = "microblaze.*-elf" |
| 33 | COMPATIBLE_MACHINE = "^$" |
| 34 | COMPATIBLE_MACHINE_zynqmp = "zynqmp" |
| 35 | |
| 36 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 37 | |
| 38 | S = "${WORKDIR}/git/lib/sw_apps/zynqmp_pmufw/src" |
| 39 | |
| 40 | # The makefile does not handle parallelization |
| 41 | PARALLEL_MAKE = "" |
| 42 | |
| 43 | do_configure() { |
| 44 | # manually do the copy_bsp step first, so as to be able to fix up use of |
| 45 | # mb-* commands |
| 46 | ${S}/../misc/copy_bsp.sh |
| 47 | } |
| 48 | |
| 49 | COMPILER = "${CC}" |
| 50 | COMPILER_FLAGS = "-O2 -c" |
| 51 | EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects" |
| 52 | ARCHIVER = "${AR}" |
| 53 | |
| 54 | # HACK: fix the dirty bug where xilsecure wants to call this PSVersion |
| 55 | # function, which is not implemented for microblaze. The symbols never make it |
| 56 | # into the final elf as the xilsecure function that uses it is not called in |
| 57 | # pmufw. |
| 58 | EXTRA_COMPILER_FLAGS_append = " -DXGetPSVersion_Info=atexit" |
| 59 | |
| 60 | BSP_DIR ?= "${S}/../misc/zynqmp_pmufw_bsp" |
| 61 | BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_pmu_0/libsrc" |
| 62 | |
| 63 | def bsp_make_vars(d): |
| 64 | s = ["COMPILER", "CC", "COMPILER_FLAGS", "EXTRA_COMPILER_FLAGS", "ARCHIVER", "AR", "AS"] |
| 65 | return " ".join(["\"%s=%s\"" % (v, d.getVar(v)) for v in s]) |
| 66 | |
| 67 | do_compile() { |
| 68 | # the Makefile in ${S}/../misc/Makefile, does not handle CC, AR, AS, etc |
| 69 | # properly. So do its job manually. Preparing the includes first, then libs. |
| 70 | for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do |
| 71 | oe_runmake -C $(dirname $i) -s include ${@bsp_make_vars(d)} |
| 72 | done |
| 73 | for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do |
| 74 | oe_runmake -C $(dirname $i) -s libs ${@bsp_make_vars(d)} |
| 75 | done |
| 76 | |
| 77 | # --build-id=none is required due to linker script not defining a location for it. |
| 78 | oe_runmake CC="${CC}" CC_FLAGS="-MMD -MP -Wl,--build-id=none" |
| 79 | } |
| 80 | |
| 81 | do_install() { |
| 82 | : |
| 83 | } |
| 84 | |
| 85 | PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" |
| 86 | PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" |
| 87 | |
| 88 | do_deploy() { |
| 89 | install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf |
| 90 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf |
| 91 | ln -sf ${BPN}-${MACHINE}.elf ${DEPLOYDIR}/pmu-${MACHINE}.elf |
| 92 | ${OBJCOPY} -O binary ${B}/executable.elf ${B}/executable.bin |
| 93 | install -m 0644 ${B}/executable.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin |
| 94 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin |
| 95 | ln -sf ${BPN}-${MACHINE}.bin ${DEPLOYDIR}/pmu-${MACHINE}.bin |
| 96 | } |
| 97 | addtask deploy before do_build after do_install |
| 98 | |
| 99 | BBCLASSEXTEND = "zynqmp-pmu" |