Re: [PATCH v2] riscv: add rv32 and rv64 randconfig build targets

From: Palmer Dabbelt
Date: Mon Oct 04 2021 - 20:57:42 EST


On Sat, 11 Sep 2021 20:45:38 PDT (-0700), rdunlap@xxxxxxxxxxxxx wrote:
Add the ability to do randconfig build targets for both
rv32 and rv64.

Based on a similar patch by Michael Ellerman for PowerPC.

Usage:
make ARCH=riscv rv32_randconfig
or
make ARCH=riscv rv64_randconfig

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx>
Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx>
Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx>
Cc: linux-riscv@xxxxxxxxxxxxxxxxxxx
---
v2: add missing S-o-b

arch/riscv/Makefile | 10 ++++++++++
arch/riscv/configs/32-bit.config | 2 ++
arch/riscv/configs/64-bit.config | 2 ++
3 files changed, 14 insertions(+)

--- linux-next-20210910.orig/arch/riscv/Makefile
+++ linux-next-20210910/arch/riscv/Makefile
@@ -141,3 +141,13 @@ install zinstall:

archclean:
$(Q)$(MAKE) $(clean)=$(boot)
+
+PHONY += rv32_randconfig
+rv32_randconfig:
+ $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/riscv/configs/32-bit.config \
+ -f $(srctree)/Makefile randconfig
+
+PHONY += rv64_randconfig
+rv64_randconfig:
+ $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/riscv/configs/64-bit.config \
+ -f $(srctree)/Makefile randconfig
--- /dev/null
+++ linux-next-20210910/arch/riscv/configs/32-bit.config
@@ -0,0 +1,2 @@
+CONFIG_ARCH_RV32I=y
+CONFIG_32BIT=y
--- /dev/null
+++ linux-next-20210910/arch/riscv/configs/64-bit.config
@@ -0,0 +1,2 @@
+CONFIG_ARCH_RV64I=y
+CONFIG_64BIT=y

Thanks, this is on for-next.