diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2017-05-30 21:02:04 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2017-06-03 16:55:31 +1000 |
commit | 9f106fd35c100d2b28ba2f6ea893702f85e0ffa3 (patch) | |
tree | 35b3b652a2af2b0308319f6697fffb81d1d58c09 | |
parent | 0071b9673743ee93ede97ce132bd898b0da13a0a (diff) | |
download | meta-xilinx-9f106fd35c100d2b28ba2f6ea893702f85e0ffa3.tar.gz |
pmu-firmware: Create a recipe for the PMU firmware for PMU on ZynqMP
Create a recipe for the PMU firmware for the ZynqMP PMU. This firmware
is provided by the embeddedsw repo, and specifically uses the
'zynqmp_pmufw' application of the repo.
This build requires a MicroBlaze compiler with newlib, libgloss and
libgcc.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Tested-by: Koteswararao Nayudu <kotin@xilinx.com>
-rw-r--r-- | recipes-bsp/pmu-firmware/pmu-firmware_2017.1.bb | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes-bsp/pmu-firmware/pmu-firmware_2017.1.bb b/recipes-bsp/pmu-firmware/pmu-firmware_2017.1.bb new file mode 100644 index 00000000..68916ad0 --- /dev/null +++ b/recipes-bsp/pmu-firmware/pmu-firmware_2017.1.bb | |||
@@ -0,0 +1,85 @@ | |||
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 | # This source links in a number of components with differing licenses, and some | ||
9 | # licenses are not Open Source compatible. Additionally the pmu-firmware source | ||
10 | # itself is licensed under a modified MIT license which restricts use to Xilinx | ||
11 | # devices only. | ||
12 | LICENSE = "Proprietary" | ||
13 | LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=8c0025a6b0e91b4ab8e4ba9f6d2fb65c" | ||
14 | |||
15 | inherit deploy | ||
16 | |||
17 | XILINX_RELEASE_VERSION = "v2017.1" | ||
18 | SRCREV = "3813f14966bd69e7e1d59943d2a58c64efafa17b" | ||
19 | PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}" | ||
20 | |||
21 | SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1" | ||
22 | |||
23 | COMPATIBLE_HOST = "microblaze.*-elf" | ||
24 | COMPATIBLE_MACHINE = "^$" | ||
25 | COMPATIBLE_MACHINE_zynqmp = "zynqmp" | ||
26 | |||
27 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
28 | |||
29 | S = "${WORKDIR}/git/lib/sw_apps/zynqmp_pmufw/src" | ||
30 | |||
31 | # The makefile does not handle parallelization | ||
32 | PARALLEL_MAKE = "" | ||
33 | |||
34 | do_configure() { | ||
35 | # manually do the copy_bsp step first, so as to be able to fix up use of | ||
36 | # mb-* commands | ||
37 | ${S}/../misc/copy_bsp.sh | ||
38 | } | ||
39 | |||
40 | COMPILER = "${CC}" | ||
41 | COMPILER_FLAGS = "-O2 -c" | ||
42 | EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects" | ||
43 | ARCHIVER = "${AR}" | ||
44 | |||
45 | # HACK: fix the dirty bug where xilsecure wants to call this PSVersion | ||
46 | # function, which is not implemented for microblaze. The symbols never make it | ||
47 | # into the final elf as the xilsecure function that uses it is not called in | ||
48 | # pmufw. | ||
49 | EXTRA_COMPILER_FLAGS_append = " -DXGetPSVersion_Info=atexit" | ||
50 | |||
51 | BSP_DIR ?= "${S}/../misc/zynqmp_pmufw_bsp" | ||
52 | BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_pmu_0/libsrc" | ||
53 | |||
54 | def bsp_make_vars(d): | ||
55 | s = ["COMPILER", "CC", "COMPILER_FLAGS", "EXTRA_COMPILER_FLAGS", "ARCHIVER", "AR", "AS"] | ||
56 | return " ".join(["\"%s=%s\"" % (v, d.getVar(v)) for v in s]) | ||
57 | |||
58 | do_compile() { | ||
59 | # the Makefile in ${S}/../misc/Makefile, does not handle CC, AR, AS, etc | ||
60 | # properly. So do its job manually. Preparing the includes first, then libs. | ||
61 | for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do | ||
62 | oe_runmake -C $(dirname $i) -s include ${@bsp_make_vars(d)} | ||
63 | done | ||
64 | for i in $(ls ${BSP_TARGETS_DIR}/*/src/Makefile); do | ||
65 | oe_runmake -C $(dirname $i) -s libs ${@bsp_make_vars(d)} | ||
66 | done | ||
67 | |||
68 | # --build-id=none is required due to linker script not defining a location for it. | ||
69 | oe_runmake CC="${CC}" CC_FLAGS="-MMD -MP -Wl,--build-id=none" | ||
70 | } | ||
71 | |||
72 | do_install() { | ||
73 | : | ||
74 | } | ||
75 | |||
76 | PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" | ||
77 | PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME" | ||
78 | |||
79 | do_deploy() { | ||
80 | install -Dm 0644 ${B}/executable.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf | ||
81 | ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf | ||
82 | ln -sf ${BPN}-${MACHINE}.elf ${DEPLOYDIR}/pmu-${MACHINE}.elf | ||
83 | } | ||
84 | addtask deploy before do_build after do_install | ||
85 | |||