From dd3568a37f3916799cac85ca3e89f9dccbd16c50 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Mon, 24 Feb 2020 10:35:43 -0800 Subject: opensbi: Update to v0.6 (From OE-Core rev: 20e9ca7745fc8f2392c37c5e5e8d5b0a5f72c06c) Signed-off-by: Alistair Francis Signed-off-by: Richard Purdie --- ...0001-Makefile-Don-t-specify-mabi-or-march.patch | 13 +++--- .../files/0001-build-Use-ffreestanding.patch | 28 ------------ meta/recipes-bsp/opensbi/opensbi_0.5.bb | 52 ---------------------- meta/recipes-bsp/opensbi/opensbi_0.6.bb | 48 ++++++++++++++++++++ 4 files changed, 56 insertions(+), 85 deletions(-) delete mode 100644 meta/recipes-bsp/opensbi/files/0001-build-Use-ffreestanding.patch delete mode 100644 meta/recipes-bsp/opensbi/opensbi_0.5.bb create mode 100644 meta/recipes-bsp/opensbi/opensbi_0.6.bb diff --git a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch b/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch index 74d93618b2..d2a8048e87 100644 --- a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch +++ b/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch @@ -1,4 +1,4 @@ -From f5871e1f3650d6c8a032928cb5d8ca00c275c377 Mon Sep 17 00:00:00 2001 +From fe9860fd85e49a75bef545e5d9914070491e8002 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Fri, 15 Feb 2019 14:57:41 -0800 Subject: [PATCH] Makefile: Don't specify mabi or march @@ -7,23 +7,26 @@ To avoid can't link double-float modules with soft-float modules errors when building 32-bit openSBI don't specify mabi or march. -Upstream-Status: Inappropriate [Fixes a 32-bit Yocto flow bug] +Upstream-Status: Inappropriate [Fixes a 32-bit OE flow bug] Signed-off-by: Alistair Francis + --- Makefile | 2 -- 1 file changed, 2 deletions(-) +diff --git a/Makefile b/Makefile +index ccf8ea3..69e5b38 100644 --- a/Makefile +++ b/Makefile -@@ -162,7 +162,6 @@ GENFLAGS += $(firmware-genflags-y) - CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2 +@@ -169,7 +169,6 @@ GENFLAGS += $(firmware-genflags-y) + CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2 CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls CFLAGS += -mno-save-restore -mstrict-align -CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA) CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) CFLAGS += $(GENFLAGS) CFLAGS += $(platform-cflags-y) -@@ -176,7 +175,6 @@ CPPFLAGS += $(firmware-cppflags-y) +@@ -183,7 +182,6 @@ CPPFLAGS += $(firmware-cppflags-y) ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__ ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls ASFLAGS += -mno-save-restore -mstrict-align diff --git a/meta/recipes-bsp/opensbi/files/0001-build-Use-ffreestanding.patch b/meta/recipes-bsp/opensbi/files/0001-build-Use-ffreestanding.patch deleted file mode 100644 index 4899fad6aa..0000000000 --- a/meta/recipes-bsp/opensbi/files/0001-build-Use-ffreestanding.patch +++ /dev/null @@ -1,28 +0,0 @@ -From efa39afecedf75a1f3154c39507bdde2810bc140 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 6 Jan 2020 18:21:02 -0800 -Subject: [PATCH] build: Use -ffreestanding - -this is a stand-alone/baremetal application, therefore demanding --ffreestanding would help it compile with hosted toolchains e.g. ( linux -toolchains ), it also ensures that it won't be using platform -optimizations like inlining mem* str* functions which gcc might decide -especially with wrapper string functions in opensbi code - -Upstream-Status: Accepted [https://github.com/riscv/opensbi/commit/049ad0b3877352527ab470eba33bc767e9b54961] -Signed-off-by: Khem Raj ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/Makefile -+++ b/Makefile -@@ -159,7 +159,7 @@ GENFLAGS += $(libsbiutils-genflags-y) - GENFLAGS += $(platform-genflags-y) - GENFLAGS += $(firmware-genflags-y) - --CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2 -+CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2 - CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls - CFLAGS += -mno-save-restore -mstrict-align - CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL) diff --git a/meta/recipes-bsp/opensbi/opensbi_0.5.bb b/meta/recipes-bsp/opensbi/opensbi_0.5.bb deleted file mode 100644 index 71d64fa324..0000000000 --- a/meta/recipes-bsp/opensbi/opensbi_0.5.bb +++ /dev/null @@ -1,52 +0,0 @@ -SUMMARY = "RISC-V Open Source Supervisor Binary Interface (OpenSBI)" -DESCRIPTION = "OpenSBI aims to provide an open-source and extensible implementation of the RISC-V SBI specification for a platform specific firmware (M-mode) and a general purpose OS, hypervisor or bootloader (S-mode or HS-mode). OpenSBI implementation can be easily extended by RISC-V platform or System-on-Chip vendors to fit a particular hadware configuration." -LICENSE = "BSD-2-Clause" -LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5" - -require opensbi-payloads.inc - -inherit autotools-brokensep deploy - -SRCREV = "be92da280d87c38a2e0adc5d3f43bab7b5468f09" -SRC_URI = "git://github.com/riscv/opensbi.git \ - file://0001-Makefile-Don-t-specify-mabi-or-march.patch \ - file://0001-build-Use-ffreestanding.patch \ - " - -S = "${WORKDIR}/git" - -SRC_URI[md5sum] = "621f38d8205ef5fb185e4055025e73df" -SRC_URI[sha256sum] = "07f18b73abf3b85aabe5bead19a923716c100d30eb58033459f39c3a224be300" - -EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D}" -# If RISCV_SBI_PAYLOAD is set then include it as a payload -EXTRA_OEMAKE_append = " ${@riscv_get_extra_oemake_image(d)}" - -# Required if specifying a custom payload -do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" - -do_install_append() { - # In the future these might be required as a dependency for other packages. - # At the moment just delete them to avoid warnings - rm -r ${D}/include - rm -r ${D}/platform/${RISCV_SBI_PLAT}/lib - rm -r ${D}/platform/${RISCV_SBI_PLAT}/firmware/payloads - rm -r ${D}/lib -} - -do_deploy () { - install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/ - install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/ - install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/ -} - -addtask deploy before do_build after do_install - -FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_jump.*" -FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_payload.*" -FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" - -COMPATIBLE_HOST = "(riscv64|riscv32).*" -INHIBIT_PACKAGE_STRIP = "1" - -SECURITY_CFLAGS = "" diff --git a/meta/recipes-bsp/opensbi/opensbi_0.6.bb b/meta/recipes-bsp/opensbi/opensbi_0.6.bb new file mode 100644 index 0000000000..56f2d4b915 --- /dev/null +++ b/meta/recipes-bsp/opensbi/opensbi_0.6.bb @@ -0,0 +1,48 @@ +SUMMARY = "RISC-V Open Source Supervisor Binary Interface (OpenSBI)" +DESCRIPTION = "OpenSBI aims to provide an open-source and extensible implementation of the RISC-V SBI specification for a platform specific firmware (M-mode) and a general purpose OS, hypervisor or bootloader (S-mode or HS-mode). OpenSBI implementation can be easily extended by RISC-V platform or System-on-Chip vendors to fit a particular hadware configuration." +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5" + +require opensbi-payloads.inc + +inherit autotools-brokensep deploy + +SRCREV = "ac5e821d50be631f26274765a59bc1b444ffd862" +SRC_URI = "git://github.com/riscv/opensbi.git \ + file://0001-Makefile-Don-t-specify-mabi-or-march.patch \ + " + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D}" +# If RISCV_SBI_PAYLOAD is set then include it as a payload +EXTRA_OEMAKE_append = " ${@riscv_get_extra_oemake_image(d)}" + +# Required if specifying a custom payload +do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" + +do_install_append() { + # In the future these might be required as a dependency for other packages. + # At the moment just delete them to avoid warnings + rm -r ${D}/include + rm -r ${D}/platform/${RISCV_SBI_PLAT}/lib + rm -r ${D}/platform/${RISCV_SBI_PLAT}/firmware/payloads + rm -r ${D}/lib +} + +do_deploy () { + install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/ + install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/ + install -m 755 ${D}/platform/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/ +} + +addtask deploy before do_build after do_install + +FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_jump.*" +FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_payload.*" +FILES_${PN} += "/platform/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" + +COMPATIBLE_HOST = "(riscv64|riscv32).*" +INHIBIT_PACKAGE_STRIP = "1" + +SECURITY_CFLAGS = "" -- cgit v1.2.3-54-g00ecf