summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2017-05-30 21:02:04 +1000
committerNathan Rossi <nathan@nathanrossi.com>2017-06-03 16:55:31 +1000
commit9f106fd35c100d2b28ba2f6ea893702f85e0ffa3 (patch)
tree35b3b652a2af2b0308319f6697fffb81d1d58c09
parent0071b9673743ee93ede97ce132bd898b0da13a0a (diff)
downloadmeta-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.bb85
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 @@
1SUMMARY = "Firmware for the PMU on the ZynqMP Programmable Silicon"
2HOMEPAGE = "https://github.com/Xilinx/embeddedsw"
3SECTION = "bsp"
4
5INHIBIT_DEFAULT_DEPS = "1"
6DEPENDS = "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.
12LICENSE = "Proprietary"
13LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=8c0025a6b0e91b4ab8e4ba9f6d2fb65c"
14
15inherit deploy
16
17XILINX_RELEASE_VERSION = "v2017.1"
18SRCREV = "3813f14966bd69e7e1d59943d2a58c64efafa17b"
19PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}"
20
21SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1"
22
23COMPATIBLE_HOST = "microblaze.*-elf"
24COMPATIBLE_MACHINE = "^$"
25COMPATIBLE_MACHINE_zynqmp = "zynqmp"
26
27PACKAGE_ARCH = "${MACHINE_ARCH}"
28
29S = "${WORKDIR}/git/lib/sw_apps/zynqmp_pmufw/src"
30
31# The makefile does not handle parallelization
32PARALLEL_MAKE = ""
33
34do_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
40COMPILER = "${CC}"
41COMPILER_FLAGS = "-O2 -c"
42EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects"
43ARCHIVER = "${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.
49EXTRA_COMPILER_FLAGS_append = " -DXGetPSVersion_Info=atexit"
50
51BSP_DIR ?= "${S}/../misc/zynqmp_pmufw_bsp"
52BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_pmu_0/libsrc"
53
54def 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
58do_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
72do_install() {
73 :
74}
75
76PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
77PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME"
78
79do_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}
84addtask deploy before do_build after do_install
85