summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/opensbi
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/opensbi')
-rw-r--r--meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch36
-rw-r--r--meta/recipes-bsp/opensbi/opensbi-payloads.inc27
-rw-r--r--meta/recipes-bsp/opensbi/opensbi_1.7.bb (renamed from meta/recipes-bsp/opensbi/opensbi_0.9.bb)35
3 files changed, 42 insertions, 56 deletions
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
deleted file mode 100644
index d2a8048e87..0000000000
--- a/meta/recipes-bsp/opensbi/files/0001-Makefile-Don-t-specify-mabi-or-march.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From fe9860fd85e49a75bef545e5d9914070491e8002 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Fri, 15 Feb 2019 14:57:41 -0800
4Subject: [PATCH] Makefile: Don't specify mabi or march
5
6To avoid
7 can't link double-float modules with soft-float modules
8errors when building 32-bit openSBI don't specify mabi or march.
9
10Upstream-Status: Inappropriate [Fixes a 32-bit OE flow bug]
11Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
12
13---
14 Makefile | 2 --
15 1 file changed, 2 deletions(-)
16
17diff --git a/Makefile b/Makefile
18index ccf8ea3..69e5b38 100644
19--- a/Makefile
20+++ b/Makefile
21@@ -169,7 +169,6 @@ GENFLAGS += $(firmware-genflags-y)
22 CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2
23 CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
24 CFLAGS += -mno-save-restore -mstrict-align
25-CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
26 CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL)
27 CFLAGS += $(GENFLAGS)
28 CFLAGS += $(platform-cflags-y)
29@@ -183,7 +182,6 @@ CPPFLAGS += $(firmware-cppflags-y)
30 ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__
31 ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
32 ASFLAGS += -mno-save-restore -mstrict-align
33-ASFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
34 ASFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL)
35 ASFLAGS += $(GENFLAGS)
36 ASFLAGS += $(platform-asflags-y)
diff --git a/meta/recipes-bsp/opensbi/opensbi-payloads.inc b/meta/recipes-bsp/opensbi/opensbi-payloads.inc
index 2e32943245..a55679632e 100644
--- a/meta/recipes-bsp/opensbi/opensbi-payloads.inc
+++ b/meta/recipes-bsp/opensbi/opensbi-payloads.inc
@@ -1,21 +1,38 @@
1def riscv_get_extra_oemake_image(d): 1def riscv_get_extra_oemake_image(d):
2 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') 2 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD')
3 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
4
5 if sbi_payload is None: 3 if sbi_payload is None:
6 return "" 4 return ""
7 5
6 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
7
8 return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload 8 return "FW_PAYLOAD_PATH=" + deploy_dir + "/" + sbi_payload
9 9
10def riscv_get_do_compile_depends(d): 10def riscv_get_extra_oemake_fdt(d):
11 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') 11 if d.getVar('RISCV_SBI_PAYLOAD') is None:
12 return ""
13 sbi_fdt = d.getVar('RISCV_SBI_FDT')
14 deploy_dir = d.getVar('DEPLOY_DIR_IMAGE')
12 15
13 if sbi_payload is None: 16 if sbi_fdt is None:
17 return ""
18
19 return "FW_FDT_PATH=" + deploy_dir + "/" + sbi_fdt
20
21def riscv_get_do_compile_depends(d):
22 sbi_payload = d.getVar('RISCV_SBI_PAYLOAD') or ""
23 if sbi_payload == "":
14 return "" 24 return ""
15 25
26 sbi_fdt = d.getVar('RISCV_SBI_FDT') or ""
27
28 if sbi_fdt != "" and 'u-boot.bin' in sbi_payload:
29 return "virtual/kernel:do_deploy virtual/bootloader:do_deploy"
30
16 if 'linux' in sbi_payload or 'Image' in sbi_payload: 31 if 'linux' in sbi_payload or 'Image' in sbi_payload:
17 return "virtual/kernel:do_deploy" 32 return "virtual/kernel:do_deploy"
18 if 'u-boot.bin' in sbi_payload: 33 if 'u-boot.bin' in sbi_payload:
19 return "virtual/bootloader:do_deploy" 34 return "virtual/bootloader:do_deploy"
35 if sbi_fdt != "":
36 return "virtual/kernel:do_deploy"
20 37
21 return "" 38 return ""
diff --git a/meta/recipes-bsp/opensbi/opensbi_0.9.bb b/meta/recipes-bsp/opensbi/opensbi_1.7.bb
index cb1c3f2ebf..a460062e93 100644
--- a/meta/recipes-bsp/opensbi/opensbi_0.9.bb
+++ b/meta/recipes-bsp/opensbi/opensbi_1.7.bb
@@ -6,23 +6,31 @@ LIC_FILES_CHKSUM = "file://COPYING.BSD;md5=42dd9555eb177f35150cf9aa240b61e5"
6 6
7require opensbi-payloads.inc 7require opensbi-payloads.inc
8 8
9inherit autotools-brokensep deploy 9inherit deploy
10 10
11SRCREV = "234ed8e427f4d92903123199f6590d144e0d9351" 11SRCREV = "a32a91069119e7a5aa31e6bc51d5e00860be3d80"
12SRC_URI = "git://github.com/riscv/opensbi.git;branch=master \ 12SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https"
13 file://0001-Makefile-Don-t-specify-mabi-or-march.patch \
14 "
15 13
16S = "${WORKDIR}/git" 14TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"
17 15
18EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D}" 16TARGET_CC_ARCH += "${LDFLAGS}"
17
18RISCV_SBI_FW_TEXT_START ??= "0x80000000"
19EXTRA_OEMAKE += "REPRODUCIBLE=y CROSS_COMPILE=${HOST_PREFIX} ELFFLAGS="${LDFLAGS}" PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_TEXT_START=${RISCV_SBI_FW_TEXT_START}"
20EXTRA_OEMAKE:append:toolchain-clang = " LLVM=y"
19# If RISCV_SBI_PAYLOAD is set then include it as a payload 21# If RISCV_SBI_PAYLOAD is set then include it as a payload
20EXTRA_OEMAKE_append = " ${@riscv_get_extra_oemake_image(d)}" 22EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}"
23EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_fdt(d)}"
21 24
22# Required if specifying a custom payload 25# Required if specifying a custom payload
23do_compile[depends] += "${@riscv_get_do_compile_depends(d)}" 26do_compile[depends] += "${@riscv_get_do_compile_depends(d)}"
24 27
25do_install_append() { 28do_compile() {
29 oe_runmake
30}
31
32do_install() {
33 oe_runmake DESTDIR=${D} install
26 # In the future these might be required as a dependency for other packages. 34 # In the future these might be required as a dependency for other packages.
27 # At the moment just delete them to avoid warnings 35 # At the moment just delete them to avoid warnings
28 rm -r ${D}/include 36 rm -r ${D}/include
@@ -38,11 +46,8 @@ do_deploy () {
38 46
39addtask deploy before do_build after do_install 47addtask deploy before do_build after do_install
40 48
41FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*" 49FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.*"
42FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*" 50FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.*"
43FILES_${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*" 51FILES:${PN} += "/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.*"
44 52
45COMPATIBLE_HOST = "(riscv64|riscv32).*" 53COMPATIBLE_HOST = "(riscv64|riscv32).*"
46INHIBIT_PACKAGE_STRIP = "1"
47
48SECURITY_CFLAGS = ""