[Qemu-devel] [RFC PATCH v2 13/37] hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards

Yang Zhong posted 37 patches 6 years, 9 months ago
There is a newer version of this series
[Qemu-devel] [RFC PATCH v2 13/37] hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards
Posted by Yang Zhong 6 years, 9 months ago
Add the new configs to default-configs/riscv*-sofmmu.mak.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
---
 default-configs/riscv32-softmmu.mak |  6 ++++++
 default-configs/riscv64-softmmu.mak |  6 ++++++
 hw/riscv/Makefile.objs              | 22 +++++++++++-----------
 3 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/default-configs/riscv32-softmmu.mak b/default-configs/riscv32-softmmu.mak
index dbc9398284..af841839d1 100644
--- a/default-configs/riscv32-softmmu.mak
+++ b/default-configs/riscv32-softmmu.mak
@@ -11,3 +11,9 @@ CONFIG_PCI_GENERIC=y
 
 CONFIG_VGA=y
 CONFIG_VGA_PCI=y
+
+CONFIG_HTIF=y
+CONFIG_HART=y
+CONFIG_SIFIVE=y
+CONFIG_SPIKE=y
+CONFIG_RISCV_VIRTIO=y
diff --git a/default-configs/riscv64-softmmu.mak b/default-configs/riscv64-softmmu.mak
index dbc9398284..af841839d1 100644
--- a/default-configs/riscv64-softmmu.mak
+++ b/default-configs/riscv64-softmmu.mak
@@ -11,3 +11,9 @@ CONFIG_PCI_GENERIC=y
 
 CONFIG_VGA=y
 CONFIG_VGA_PCI=y
+
+CONFIG_HTIF=y
+CONFIG_HART=y
+CONFIG_SIFIVE=y
+CONFIG_SPIKE=y
+CONFIG_RISCV_VIRTIO=y
diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs
index 1dde01d39d..dde1b01f90 100644
--- a/hw/riscv/Makefile.objs
+++ b/hw/riscv/Makefile.objs
@@ -1,11 +1,11 @@
-obj-y += riscv_htif.o
-obj-y += riscv_hart.o
-obj-y += sifive_e.o
-obj-y += sifive_clint.o
-obj-y += sifive_prci.o
-obj-y += sifive_plic.o
-obj-y += sifive_test.o
-obj-y += sifive_u.o
-obj-y += sifive_uart.o
-obj-y += spike.o
-obj-y += virt.o
+obj-$(CONFIG_HTIF) += riscv_htif.o
+obj-$(CONFIG_HART) += riscv_hart.o
+obj-$(CONFIG_SIFIVE) += sifive_e.o
+obj-$(CONFIG_SIFIVE) += sifive_clint.o
+obj-$(CONFIG_SIFIVE) += sifive_prci.o
+obj-$(CONFIG_SIFIVE) += sifive_plic.o
+obj-$(CONFIG_SIFIVE) += sifive_test.o
+obj-$(CONFIG_SIFIVE) += sifive_u.o
+obj-$(CONFIG_SIFIVE) += sifive_uart.o
+obj-$(CONFIG_SPIKE) += spike.o
+obj-$(CONFIG_RISCV_VIRTIO) += virt.o
-- 
2.17.1


Re: [Qemu-devel] [RFC PATCH v2 13/37] hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards
Posted by Thomas Huth 6 years, 9 months ago
On 2019-01-15 15:10, Yang Zhong wrote:
> Add the new configs to default-configs/riscv*-sofmmu.mak.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> ---
>  default-configs/riscv32-softmmu.mak |  6 ++++++
>  default-configs/riscv64-softmmu.mak |  6 ++++++
>  hw/riscv/Makefile.objs              | 22 +++++++++++-----------
>  3 files changed, 23 insertions(+), 11 deletions(-)
> 
> diff --git a/default-configs/riscv32-softmmu.mak b/default-configs/riscv32-softmmu.mak
> index dbc9398284..af841839d1 100644
> --- a/default-configs/riscv32-softmmu.mak
> +++ b/default-configs/riscv32-softmmu.mak
> @@ -11,3 +11,9 @@ CONFIG_PCI_GENERIC=y
>  
>  CONFIG_VGA=y
>  CONFIG_VGA_PCI=y
> +
> +CONFIG_HTIF=y
> +CONFIG_HART=y
> +CONFIG_SIFIVE=y
> +CONFIG_SPIKE=y
> +CONFIG_RISCV_VIRTIO=y
> diff --git a/default-configs/riscv64-softmmu.mak b/default-configs/riscv64-softmmu.mak
> index dbc9398284..af841839d1 100644
> --- a/default-configs/riscv64-softmmu.mak
> +++ b/default-configs/riscv64-softmmu.mak
> @@ -11,3 +11,9 @@ CONFIG_PCI_GENERIC=y
>  
>  CONFIG_VGA=y
>  CONFIG_VGA_PCI=y
> +
> +CONFIG_HTIF=y
> +CONFIG_HART=y
> +CONFIG_SIFIVE=y
> +CONFIG_SPIKE=y
> +CONFIG_RISCV_VIRTIO=y
> diff --git a/hw/riscv/Makefile.objs b/hw/riscv/Makefile.objs
> index 1dde01d39d..dde1b01f90 100644
> --- a/hw/riscv/Makefile.objs
> +++ b/hw/riscv/Makefile.objs
> @@ -1,11 +1,11 @@
> -obj-y += riscv_htif.o
> -obj-y += riscv_hart.o
> -obj-y += sifive_e.o
> -obj-y += sifive_clint.o
> -obj-y += sifive_prci.o
> -obj-y += sifive_plic.o
> -obj-y += sifive_test.o
> -obj-y += sifive_u.o
> -obj-y += sifive_uart.o
> -obj-y += spike.o
> -obj-y += virt.o
> +obj-$(CONFIG_HTIF) += riscv_htif.o

riscv_htif.o seems to belong to the spike machine, so I think you don't
need a separate config switch for that and could simply use CONFIG_SPIKE
here.

> +obj-$(CONFIG_HART) += riscv_hart.o
> +obj-$(CONFIG_SIFIVE) += sifive_e.o
> +obj-$(CONFIG_SIFIVE) += sifive_clint.o
> +obj-$(CONFIG_SIFIVE) += sifive_prci.o
> +obj-$(CONFIG_SIFIVE) += sifive_plic.o
> +obj-$(CONFIG_SIFIVE) += sifive_test.o
> +obj-$(CONFIG_SIFIVE) += sifive_u.o

Looking at the output of "qemu-system-riscv64 -M help", sifive_e and
sifive_u are two separate machines. So should we use two different
config switches here?

> +obj-$(CONFIG_SIFIVE) += sifive_uart.o
> +obj-$(CONFIG_SPIKE) += spike.o
> +obj-$(CONFIG_RISCV_VIRTIO) += virt.o

The machine is only called "virt", so I'd suggest to call the config
switch CONFIG_RISCV_VIRT only.

 Thomas

Re: [Qemu-devel] [RFC PATCH v2 13/37] hw/riscv/Makefile.objs: Create CONFIG_* for riscv boards
Posted by Yang Zhong 6 years, 9 months ago
On Wed, Jan 16, 2019 at 10:46:45AM +0100, Thomas Huth wrote:
> > +obj-$(CONFIG_HTIF) += riscv_htif.o
> 
> riscv_htif.o seems to belong to the spike machine, so I think you don't
> need a separate config switch for that and could simply use CONFIG_SPIKE
> here.
> 
> > +obj-$(CONFIG_HART) += riscv_hart.o
> > +obj-$(CONFIG_SIFIVE) += sifive_e.o
> > +obj-$(CONFIG_SIFIVE) += sifive_clint.o
> > +obj-$(CONFIG_SIFIVE) += sifive_prci.o
> > +obj-$(CONFIG_SIFIVE) += sifive_plic.o
> > +obj-$(CONFIG_SIFIVE) += sifive_test.o
> > +obj-$(CONFIG_SIFIVE) += sifive_u.o
> 
> Looking at the output of "qemu-system-riscv64 -M help", sifive_e and
> sifive_u are two separate machines. So should we use two different
> config switches here?
> 
> > +obj-$(CONFIG_SIFIVE) += sifive_uart.o
> > +obj-$(CONFIG_SPIKE) += spike.o
> > +obj-$(CONFIG_RISCV_VIRTIO) += virt.o
> 
> The machine is only called "virt", so I'd suggest to call the config
> switch CONFIG_RISCV_VIRT only.
> 
>  Thomas

   Hello Thomas,

   Thanks, i did below changes

   +obj-$(CONFIG_SPIKE) += riscv_htif.o
   +obj-$(CONFIG_HART) += riscv_hart.o
   +obj-$(CONFIG_SIFIVE_E) += sifive_e.o
   +obj-$(CONFIG_SIFIVE) += sifive_clint.o
   +obj-$(CONFIG_SIFIVE) += sifive_prci.o
   +obj-$(CONFIG_SIFIVE) += sifive_plic.o
   +obj-$(CONFIG_SIFIVE) += sifive_test.o
   +obj-$(CONFIG_SIFIVE_U) += sifive_u.o
   +obj-$(CONFIG_SIFIVE) += sifive_uart.o
   +obj-$(CONFIG_SPIKE) += spike.o
   +obj-$(CONFIG_RISCV_VIRT) += virt.o

   Regards,

   Yang