summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-04-27 22:23:01 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-03 14:00:15 +0200
commit7d7cddb45acf915a7cb761b85c7a291d874195f5 (patch)
tree073cfcc0b3ccf5b7a9566b5daaf9e97343e54a6d
parent569042e154b7d211aea82c884607ee568bcd4d3d (diff)
downloadbarebox-7d7cddb45acf915a7cb761b85c7a291d874195f5.tar.gz
barebox-7d7cddb45acf915a7cb761b85c7a291d874195f5.tar.xz
RISC-V: support multi-image for all machines
We already got rid of arch/riscv/mach-virt. Now do the same for arch/riscv/mach-erizo. This will enable us to build images for all RISC-V boards at once. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/riscv/Kconfig31
-rw-r--r--arch/riscv/Kconfig.socs24
-rw-r--r--arch/riscv/Makefile2
-rw-r--r--arch/riscv/configs/erizo_generic_defconfig1
-rw-r--r--arch/riscv/configs/virt32_defconfig2
-rw-r--r--arch/riscv/configs/virt64_defconfig2
-rw-r--r--arch/riscv/mach-erizo/Kconfig11
7 files changed, 30 insertions, 43 deletions
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c0583f3153..a4aa799acf 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -19,31 +19,6 @@ config ARCH_TEXT_BASE
hex
default 0x0
-menu "Machine selection"
-
-choice
- prompt "System type"
- default MACH_ERIZO
-
-config MACH_ERIZO
- bool "erizo family"
- select ARCH_RV32I
- select HAS_DEBUG_LL
- select HAS_NMON
- select USE_COMPRESSED_DTB
- select RISCV_M_MODE
- select RISCV_TIMER
-
-config MACH_VIRT
- bool "virt family"
- select BOARD_RISCV_GENERIC_DT
- select CLINT_TIMER
- help
- Generates an image tht can be be booted by QEMU. The image is called
- barebox-dt-2nd.img
-
-endchoice
-
choice
prompt "Base ISA"
default ARCH_RV32I
@@ -63,6 +38,8 @@ config ARCH_RV64I
endchoice
+source "arch/riscv/Kconfig.socs"
+
config CPU_SUPPORTS_32BIT_KERNEL
bool
@@ -82,8 +59,6 @@ config 64BIT
select ARCH_DMA_ADDR_T_64BIT
select PHYS_ADDR_T_64BIT
-source "arch/riscv/mach-erizo/Kconfig"
-
config BOARD_RISCV_GENERIC_DT
select BOARD_GENERIC_DT
bool "Build generic RISC-V device tree 2nd stage image"
@@ -93,8 +68,6 @@ config BOARD_RISCV_GENERIC_DT
in a1 like the Kernel does, so it could be used anywhere where a Kernel
image could be used. The image will be called images/barebox-dt-2nd.img
-endmenu
-
menu "RISC-V specific settings"
config RISCV_OPTIMZED_STRING_FUNCTIONS
diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
new file mode 100644
index 0000000000..b0e38d8f2c
--- /dev/null
+++ b/arch/riscv/Kconfig.socs
@@ -0,0 +1,24 @@
+menu "SoC selection"
+
+config SOC_ERIZO
+ bool "Erizo SoC"
+ select ARCH_RV32I
+ select HAS_DEBUG_LL
+ select HAS_NMON
+ select USE_COMPRESSED_DTB
+ select RISCV_M_MODE
+ select RISCV_TIMER
+
+config BOARD_ERIZO_GENERIC
+ depends on SOC_ERIZO
+ def_bool y
+
+config SOC_VIRT
+ bool "QEMU Virt Machine"
+ select BOARD_RISCV_GENERIC_DT
+ select CLINT_TIMER
+ help
+ Generates an image tht can be be booted by QEMU. The image is called
+ barebox-dt-2nd.img
+
+endmenu
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 1a41d15477..09a94d69b2 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -19,7 +19,7 @@ LDFLAGS_pbl += $(riscv-ldflags-y)
cflags-y += $(riscv-cflags-y)
LDFLAGS_barebox += -nostdlib
-machine-$(CONFIG_MACH_ERIZO) := erizo
+machine-$(CONFIG_SOC_ERIZO) := erizo
LDFLAGS_barebox += $(riscv-ldflags-y)
diff --git a/arch/riscv/configs/erizo_generic_defconfig b/arch/riscv/configs/erizo_generic_defconfig
index 839b652ab5..247a179130 100644
--- a/arch/riscv/configs/erizo_generic_defconfig
+++ b/arch/riscv/configs/erizo_generic_defconfig
@@ -1,3 +1,4 @@
+CONFIG_SOC_ERIZO=y
# CONFIG_GLOBALVAR is not set
CONFIG_STACK_SIZE=0x20000
CONFIG_MALLOC_SIZE=0x100000
diff --git a/arch/riscv/configs/virt32_defconfig b/arch/riscv/configs/virt32_defconfig
index 83e3ca1bad..218fee57b7 100644
--- a/arch/riscv/configs/virt32_defconfig
+++ b/arch/riscv/configs/virt32_defconfig
@@ -1,4 +1,4 @@
-CONFIG_MACH_VIRT=y
+CONFIG_SOC_VIRT=y
CONFIG_RISCV_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_STACK_SIZE=0x20000
CONFIG_MALLOC_SIZE=0x0
diff --git a/arch/riscv/configs/virt64_defconfig b/arch/riscv/configs/virt64_defconfig
index 17ce16637d..04a4f1e2f4 100644
--- a/arch/riscv/configs/virt64_defconfig
+++ b/arch/riscv/configs/virt64_defconfig
@@ -1,4 +1,4 @@
-CONFIG_MACH_VIRT=y
+CONFIG_SOC_VIRT=y
CONFIG_ARCH_RV64I=y
CONFIG_RISCV_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_STACK_SIZE=0x20000
diff --git a/arch/riscv/mach-erizo/Kconfig b/arch/riscv/mach-erizo/Kconfig
deleted file mode 100644
index 2400b4437b..0000000000
--- a/arch/riscv/mach-erizo/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-if MACH_ERIZO
-
-choice
- prompt "Board type"
-
-config BOARD_ERIZO_GENERIC
- bool "erizo generic board"
-
-endchoice
-
-endif