From 3d886fe006c5cbfaea04beb424408db79ec233f5 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 15 Sep 2020 16:23:00 -0500 Subject: pmu-firmware: Latest toolchain always treats 'assert' as a macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the structure member from 'assert' to 'resetAssert to avoid a compilation error: | pm_reset.c: In function ‘PmResetDoAssert’: | pm_reset.c:1905:36: error: macro “assert” passed 2 arguments, but takes just 1 | 1905 | reset->ops->assert(reset, action); | | ^ | In file included from .../tmp/work/microblazeel-v11.0-bs-cmp-xilinx-elf/pmu-firmware/v2020.1+gitAUTOINC+e8db5fb118-r0/recipe-sysroot/usr/include/sys/reent.h:503, | from .../tmp/work/microblazeel-v11.0-bs-cmp-xilinx-elf/pmu-firmware/v2020.1+gitAUTOINC+e8db5fb118-r0/recipe-sysroot/usr/include/string.h:11, | from ../misc/zynqmp_pmufw_bsp/psu_pmu_0/include/xil_printf.h:9, | from xpfw_debug.h:57, | from xpfw_default.h:37, | from pm_reset.c:36: | .../tmp/work/microblazeel-v11.0-bs-cmp-xilinx-elf/pmu-firmware/v2020.1+gitAUTOINC+e8db5fb118-r0/recipe-sysroot/usr/include/assert.h:16: note: macro “assert” defined here | 16 | # define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \ | | | Makefile:37: recipe for target ‘pm_reset.o’ failed Signed-off-by: Mark Hatle --- .../pmu-firmware/fix-zynqmp-assert.patch | 68 ++++++++++++++++++++++ .../pmu-firmware/pmu-firmware_2020.2.bb | 3 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware/fix-zynqmp-assert.patch diff --git a/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware/fix-zynqmp-assert.patch b/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware/fix-zynqmp-assert.patch new file mode 100644 index 00000000..87e1b111 --- /dev/null +++ b/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware/fix-zynqmp-assert.patch @@ -0,0 +1,68 @@ +diff --git a/lib/sw_apps/zynqmp_pmufw/src/pm_reset.c b/lib/sw_apps/zynqmp_pmufw/src/pm_reset.c +index 297c6c2ddc..bc295cf013 100644 +--- a/lib/sw_apps/zynqmp_pmufw/src/pm_reset.c ++++ b/lib/sw_apps/zynqmp_pmufw/src/pm_reset.c +@@ -52,7 +52,7 @@ + * @pulse Function performing reset pulse operation + */ + typedef struct PmResetOps { +- void (*const assert)(const PmReset* const rst, const u32 action); ++ void (*const resetAssert)(const PmReset* const rst, const u32 action); + u32 (*const getStatus)(const PmReset* const s); + u32 (*const pulse)(const PmReset* const rst); + } PmResetOps; +@@ -415,37 +415,37 @@ static u32 PmResetPulsePl(const PmReset* const rst) + } + + static const PmResetOps pmResetOpsGeneric = { +- .assert = PmResetAssertGen, ++ .resetAssert = PmResetAssertGen, + .getStatus = PmResetGetStatusGen, + .pulse = PmResetPulseGen, + }; + + static const PmResetOps pmResetOpsGpo = { +- .assert = PmResetAssertGpo, ++ .resetAssert = PmResetAssertGpo, + .getStatus = PmResetGetStatusGpo, + .pulse = PmResetPulseGpo, + }; + + static const PmResetOps pmResetOpsRom = { +- .assert = PmResetAssertRom, ++ .resetAssert = PmResetAssertRom, + .getStatus = PmResetGetStatusRom, + .pulse = PmResetPulseRom, + }; + + static const PmResetOps pmResetOpsNoAssert = { +- .assert = NULL, ++ .resetAssert = NULL, + .getStatus = PmResetGetStatusRom, + .pulse = PmResetPulseRom, + }; + + static const PmResetOps pmResetOpsPl = { +- .assert = PmResetAssertPl, ++ .resetAssert = PmResetAssertPl, + .getStatus = PmResetGetStatusPl, + .pulse = PmResetPulsePl, + }; + + static const PmResetOps pmResetOpsGpioBankIO = { +- .assert = NULL, ++ .resetAssert = NULL, + .getStatus = PmResetGetStatusGpioBankIOs, + .pulse = PmResetPulseGpioBankIOs, + }; +@@ -1901,8 +1901,8 @@ s32 PmResetDoAssert(const PmReset *reset, u32 action) + switch (action) { + case PM_RESET_ACTION_RELEASE: + case PM_RESET_ACTION_ASSERT: +- if (NULL != reset->ops->assert) { +- reset->ops->assert(reset, action); ++ if (NULL != reset->ops->resetAssert) { ++ reset->ops->resetAssert(reset, action); + } else { + status = XST_INVALID_PARAM; + } diff --git a/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware_2020.2.bb b/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware_2020.2.bb index 652241c0..330e0209 100644 --- a/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware_2020.2.bb +++ b/meta-xilinx-standalone/recipes-standalone/pmu-firmware/pmu-firmware_2020.2.bb @@ -6,7 +6,8 @@ LIC_FILES_CHKSUM = "file://../../../../license.txt;md5=39ab6ab638f4d1836ba994ec6 SRCREV = "e8db5fb118229fdc621e0ec7848641a23bf60998" PV = "${XILINX_RELEASE_VERSION}+git${SRCPV}" -SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1" +SRC_URI = "git://github.com/Xilinx/embeddedsw.git;protocol=https;nobranch=1 \ + file://fix-zynqmp-assert.patch;pnum=5" COMPATIBLE_HOST = "microblaze.*-elf" COMPATIBLE_MACHINE = "microblaze-pmu" -- cgit v1.2.3-54-g00ecf