From 35c7f98770eebffc93145f10fce88b2b656e91d2 Mon Sep 17 00:00:00 2001 From: Thomas Perrot Date: Tue, 1 Jul 2025 16:42:50 +0200 Subject: opensbi: bump to 1.7 This release has: - New parameter in top-level Makefile for reproducible builds - Added MIPS P8700 platform support - Allow arbitrary path in LLVM parameter of top-level Makefile - Improved SBI v3.0 extensions to match frozen specification - Emulate AMO instructions when Zaamo is not available - Stop the harts waiting for HSM start from supervisor software - Improved generic platform overrides to use common fdt_driver helpers - Improved SBI MPXY framework to use per-domain data - Added support for control transfer records (CTR) ISA extension - Use LR and SC when Zaamo ISA extension is not available - Added PXA UART support - Added support for double-trap ISA extensions - Optimized hartid and scratch lookup - Added unit tests for bitwise operations - Added unit tests for SBI ecall functionality - Constify various FDT driver definitions - Added MPXY RPMI mailbox driver for System MSI service group - Improved RPMI drivers to match frozen specifications - Initialize miscellaneous early drivers in one pass - Use fdt_driver helpers for irqchip driver framework - Allow adding SSE events dynamically at boot-time - Simple singly linked list implementation Overall, this release adds more ISA extensions and does many device driver improvements. (From OE-Core rev: 4278b9dde47957393fee46dfcc6620c3838cc73d) Signed-off-by: Thomas Perrot Signed-off-by: Antonin Godard Signed-off-by: Richard Purdie --- ...Add-flag-for-reprodubility-compiler-flags.patch | 49 ------------------- meta/recipes-bsp/opensbi/opensbi_1.6.bb | 55 ---------------------- meta/recipes-bsp/opensbi/opensbi_1.7.bb | 53 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 104 deletions(-) delete mode 100644 meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch delete mode 100644 meta/recipes-bsp/opensbi/opensbi_1.6.bb create mode 100644 meta/recipes-bsp/opensbi/opensbi_1.7.bb diff --git a/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch b/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch deleted file mode 100644 index e650476f50..0000000000 --- a/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch +++ /dev/null @@ -1,49 +0,0 @@ -From f4c440219f42d74bd3d6688132ea876f3f51e601 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 14 May 2025 19:50:24 -0700 -Subject: [PATCH] Makefile: Add flag for reprodubility compiler flags - -Provides mechanism to remove absolute paths from binaries using --ffile-prefix-map - -It will help distros (e.g. yocto based ones ) which want to ship -the .elf files but need to scrub absolute paths in objects - -Upstream-Status: Submitted [https://lists.infradead.org/pipermail/opensbi/2025-May/008458.html] -Signed-off-by: Khem Raj ---- - Makefile | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/Makefile b/Makefile -index e90836c7..22d4ecff 100644 ---- a/Makefile -+++ b/Makefile -@@ -174,6 +174,11 @@ else - USE_LD_FLAG = -fuse-ld=bfd - endif - -+REPRODUCIBLE ?= n -+ifeq ($(REPRODUCIBLE),y) -+REPRODUCIBLE_FLAGS += -ffile-prefix-map=$(src_dir)= -+endif -+ - # Check whether the linker supports creating PIEs - OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) - -@@ -362,6 +367,7 @@ GENFLAGS += $(firmware-genflags-y) - - CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -ffunction-sections -fdata-sections - CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls -+CFLAGS += $(REPRODUCIBLE_FLAGS) - # Optionally supported flags - ifeq ($(CC_SUPPORT_VECTOR),y) - CFLAGS += -DOPENSBI_CC_SUPPORT_VECTOR -@@ -387,6 +393,7 @@ CPPFLAGS += $(firmware-cppflags-y) - ASFLAGS = -g -Wall -nostdlib - ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls - ASFLAGS += -fPIE -+ASFLAGS += $(REPRODUCIBLE_FLAGS) - # Optionally supported flags - ifeq ($(CC_SUPPORT_SAVE_RESTORE),y) - ASFLAGS += -mno-save-restore diff --git a/meta/recipes-bsp/opensbi/opensbi_1.6.bb b/meta/recipes-bsp/opensbi/opensbi_1.6.bb deleted file mode 100644 index 308ac43ac8..0000000000 --- a/meta/recipes-bsp/opensbi/opensbi_1.6.bb +++ /dev/null @@ -1,55 +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." -HOMEPAGE = "https://github.com/riscv/opensbi" -LICENSE = "BSD-2-Clause" -LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5" - -require opensbi-payloads.inc - -inherit deploy - -SRCREV = "bd613dd92113f683052acfb23d9dc8ba60029e0a" -SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https \ - file://0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch \ -" - -TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/" - -TARGET_CC_ARCH += "${LDFLAGS}" - -RISCV_SBI_FW_TEXT_START ??= "0x80000000" -EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}" -EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y" -# If RISCV_SBI_PAYLOAD is set then include it as a payload -EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}" -EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}" - -# Required if specifying a custom payload -do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" - -do_compile() { - oe_runmake -} - -do_install() { - oe_runmake DESTDIR=${D} install - # 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}/lib* - rm -r ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/payloads -} - -do_deploy () { - install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/ - install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/ - install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/ -} - -addtask deploy before do_build after do_install - -FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*" -FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*" -FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" - -COMPATIBLE_HOST = "(riscv64|riscv32).*" diff --git a/meta/recipes-bsp/opensbi/opensbi_1.7.bb b/meta/recipes-bsp/opensbi/opensbi_1.7.bb new file mode 100644 index 0000000000..a460062e93 --- /dev/null +++ b/meta/recipes-bsp/opensbi/opensbi_1.7.bb @@ -0,0 +1,53 @@ +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." +HOMEPAGE = "https://github.com/riscv/opensbi" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5" + +require opensbi-payloads.inc + +inherit deploy + +SRCREV = "a32a91069119e7a5aa31e6bc51d5e00860be3d80" +SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https" + +TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/" + +TARGET_CC_ARCH += "${LDFLAGS}" + +RISCV_SBI_FW_TEXT_START ??= "0x80000000" +EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}" +EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y" +# If RISCV_SBI_PAYLOAD is set then include it as a payload +EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}" +EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}" + +# Required if specifying a custom payload +do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake DESTDIR=${D} install + # 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}/lib* + rm -r ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/payloads +} + +do_deploy () { + install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/ + install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/ + install -m 755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/ +} + +addtask deploy before do_build after do_install + +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*" +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*" +FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" + +COMPATIBLE_HOST = "(riscv64|riscv32).*" -- cgit v1.2.3-54-g00ecf