diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2021-03-12 13:38:25 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-14 16:33:59 +0000 |
commit | 7aaa97c9040d4c87ea4de09eed73a68ff24d53dc (patch) | |
tree | 8308a9184ee6a23c00861f2837e0d67f78f5ead5 | |
parent | b19c8f0af0d7c1a4c5919350ceae7a7ec5d15963 (diff) | |
download | poky-7aaa97c9040d4c87ea4de09eed73a68ff24d53dc.tar.gz |
u-boot: Add support for building for qemuriscv32
(From OE-Core rev: a9666fbfe2dcb43fe9e8fd78e357eaacd99ca75e)
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/conf/machine/qemuriscv32.conf | 7 | ||||
-rw-r--r-- | meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch | 42 | ||||
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot_2021.01.bb | 2 |
3 files changed, 47 insertions, 4 deletions
diff --git a/meta/conf/machine/qemuriscv32.conf b/meta/conf/machine/qemuriscv32.conf index 1413775ad6..d3858dc051 100644 --- a/meta/conf/machine/qemuriscv32.conf +++ b/meta/conf/machine/qemuriscv32.conf | |||
@@ -11,7 +11,6 @@ PREFERRED_VERSION_openocd = "riscv" | |||
11 | 11 | ||
12 | XVISOR_PLAT = "riscv/virt32" | 12 | XVISOR_PLAT = "riscv/virt32" |
13 | 13 | ||
14 | # u-boot doesn't compile, error: "can't link hard-float modules with soft-float modules" | 14 | EXTRA_IMAGEDEPENDS += "u-boot" |
15 | # EXTRA_IMAGEDEPENDS += "u-boot" | 15 | UBOOT_MACHINE = "qemu-riscv32_smode_defconfig" |
16 | # UBOOT_MACHINE = "qemu-riscv32_smode_defconfig" | 16 | UBOOT_ELF = "u-boot" |
17 | # UBOOT_ELF = "u-boot" | ||
diff --git a/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch b/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch new file mode 100644 index 0000000000..0ed3de4914 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/0001-riscv32-Use-double-float-ABI-for-rv32.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 66dfe0fa886f6289add06d1af8642ce2b5302852 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 9 Feb 2021 16:40:12 -0800 | ||
4 | Subject: [PATCH] riscv32: Use double-float ABI for rv32 | ||
5 | |||
6 | So it can use libgcc built with OE toolchain | ||
7 | Fixes | ||
8 | error: "can't link hard-float modules with soft-float modules" | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | Upstream-Status: Inappropriate [embedded specific] | ||
12 | --- | ||
13 | arch/riscv/Makefile | 6 ++++-- | ||
14 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile | ||
17 | index 0b80eb8d86..7324946f48 100644 | ||
18 | --- a/arch/riscv/Makefile | ||
19 | +++ b/arch/riscv/Makefile | ||
20 | @@ -9,7 +9,9 @@ ifeq ($(CONFIG_ARCH_RV64I),y) | ||
21 | endif | ||
22 | ifeq ($(CONFIG_ARCH_RV32I),y) | ||
23 | ARCH_BASE = rv32im | ||
24 | - ABI = ilp32 | ||
25 | + ABI = ilp32d | ||
26 | + ARCH_D = d | ||
27 | + ARCH_F = f | ||
28 | endif | ||
29 | ifeq ($(CONFIG_RISCV_ISA_A),y) | ||
30 | ARCH_A = a | ||
31 | @@ -24,7 +26,7 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y) | ||
32 | CMODEL = medany | ||
33 | endif | ||
34 | |||
35 | -ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \ | ||
36 | +ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C) -mabi=$(ABI) \ | ||
37 | -mcmodel=$(CMODEL) | ||
38 | |||
39 | PLATFORM_CPPFLAGS += $(ARCH_FLAGS) | ||
40 | -- | ||
41 | 2.30.0 | ||
42 | |||
diff --git a/meta/recipes-bsp/u-boot/u-boot_2021.01.bb b/meta/recipes-bsp/u-boot/u-boot_2021.01.bb index 2eef1e900e..bbbc99bf8d 100644 --- a/meta/recipes-bsp/u-boot/u-boot_2021.01.bb +++ b/meta/recipes-bsp/u-boot/u-boot_2021.01.bb | |||
@@ -1,4 +1,6 @@ | |||
1 | require u-boot-common.inc | 1 | require u-boot-common.inc |
2 | require u-boot.inc | 2 | require u-boot.inc |
3 | 3 | ||
4 | SRC_URI_append = " file://0001-riscv32-Use-double-float-ABI-for-rv32.patch" | ||
5 | |||
4 | DEPENDS += "bc-native dtc-native python3-setuptools-native" | 6 | DEPENDS += "bc-native dtc-native python3-setuptools-native" |