[1/3] arch: riscv: Add a RISC-V Platform option
diff mbox series

Message ID 20190315230540.4311-1-alistair.francis@wdc.com
State Changes Requested
Headers show
Series
  • [1/3] arch: riscv: Add a RISC-V Platform option
Related show

Commit Message

Alistair Francis March 15, 2019, 11:06 p.m. UTC
Add a RISC-V Platform option. At the moment only QEMU platforms are
supported, but in the future this can be extended to include real
hardware platforms (such as the Unleashed board).

My goal is that this platform will set default config options (such as
the default defconfig for the kernel) based on the platform value.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 arch/Config.in.riscv | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Thomas Petazzoni March 16, 2019, 7:36 a.m. UTC | #1
Hello Alistair,

Thanks for your contribution.

On Fri, 15 Mar 2019 23:06:38 +0000
Alistair Francis <Alistair.Francis@wdc.com> wrote:

> Add a RISC-V Platform option. At the moment only QEMU platforms are
> supported, but in the future this can be extended to include real
> hardware platforms (such as the Unleashed board).
> 
> My goal is that this platform will set default config options (such as
> the default defconfig for the kernel) based on the platform value.
> 
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

We never describe each and every board using Buildroot options. If we
were to do that, we would have gazillion of options for the thousands
of boards that exist.

So, we are not going to accept this patch. What we do however is add a
number of defconfigs for well known platforms, just like:

  configs/qemu_riscv32_virt_defconfig
  configs/qemu_riscv64_virt_defconfig

Best regards,

Thomas
Alistair Francis March 18, 2019, 8:30 p.m. UTC | #2
On Sat, Mar 16, 2019 at 12:36 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Alistair,
>
> Thanks for your contribution.
>
> On Fri, 15 Mar 2019 23:06:38 +0000
> Alistair Francis <Alistair.Francis@wdc.com> wrote:
>
> > Add a RISC-V Platform option. At the moment only QEMU platforms are
> > supported, but in the future this can be extended to include real
> > hardware platforms (such as the Unleashed board).
> >
> > My goal is that this platform will set default config options (such as
> > the default defconfig for the kernel) based on the platform value.
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>
> We never describe each and every board using Buildroot options. If we
> were to do that, we would have gazillion of options for the thousands
> of boards that exist.

Yep, that makes sense.

>
> So, we are not going to accept this patch. What we do however is add a
> number of defconfigs for well known platforms, just like:
>
>   configs/qemu_riscv32_virt_defconfig
>   configs/qemu_riscv64_virt_defconfig

Update in v2.

Alistair

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Patch
diff mbox series

diff --git a/arch/Config.in.riscv b/arch/Config.in.riscv
index 097719e846..c97fa5b703 100644
--- a/arch/Config.in.riscv
+++ b/arch/Config.in.riscv
@@ -108,6 +108,22 @@  config BR2_RISCV_ABI_LP64D
 	depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
 endchoice
 
+choice
+	prompt "Target Platform"
+	default BR2_RISCV_QEMU_VIRT
+	help
+	  The RISC-V Platform to target.
+
+config BR2_RISCV_QEMU_VIRT
+	bool "qemu/virt"
+
+config BR2_RISCV_QEMU_SIFIVE_U
+	bool "qemu/sifive_u"
+
+config BR2_RISCV_UNKNOWN
+	bool "unknown"
+endchoice
+
 config BR2_ARCH
 	default "riscv32" if !BR2_ARCH_IS_64
 	default "riscv64" if BR2_ARCH_IS_64