diff mbox series

[1/2] platform: goldfish: Allow goldfish virtual platform drivers for RISCV

Message ID 20190925042912.119553-2-anup.patel@wdc.com (mailing list archive)
State New, archived
Headers show
Series Enable Goldfish RTC for RISC-V | expand

Commit Message

Anup Patel Sept. 25, 2019, 4:30 a.m. UTC
We will be using some of the Goldfish virtual platform devices (such
as RTC) on QEMU RISC-V virt machine so this patch enables goldfish
kconfig option for RISC-V architecture.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
 drivers/platform/goldfish/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman Sept. 25, 2019, 4:43 a.m. UTC | #1
On Wed, Sep 25, 2019 at 04:30:03AM +0000, Anup Patel wrote:
> We will be using some of the Goldfish virtual platform devices (such
> as RTC) on QEMU RISC-V virt machine so this patch enables goldfish
> kconfig option for RISC-V architecture.
> 
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> ---
>  drivers/platform/goldfish/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig
> index 77b35df3a801..0ba825030ffe 100644
> --- a/drivers/platform/goldfish/Kconfig
> +++ b/drivers/platform/goldfish/Kconfig
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  menuconfig GOLDFISH
>  	bool "Platform support for Goldfish virtual devices"
> -	depends on X86_32 || X86_64 || ARM || ARM64 || MIPS
> +	depends on X86_32 || X86_64 || ARM || ARM64 || MIPS || RISCV

Why does this depend on any of these?  Can't we just have:

>  	depends on HAS_IOMEM

And that's it?

thanks,

greg k-h
Anup Patel Sept. 25, 2019, 5 a.m. UTC | #2
On Wed, Sep 25, 2019 at 10:13 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Sep 25, 2019 at 04:30:03AM +0000, Anup Patel wrote:
> > We will be using some of the Goldfish virtual platform devices (such
> > as RTC) on QEMU RISC-V virt machine so this patch enables goldfish
> > kconfig option for RISC-V architecture.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > ---
> >  drivers/platform/goldfish/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig
> > index 77b35df3a801..0ba825030ffe 100644
> > --- a/drivers/platform/goldfish/Kconfig
> > +++ b/drivers/platform/goldfish/Kconfig
> > @@ -1,7 +1,7 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  menuconfig GOLDFISH
> >       bool "Platform support for Goldfish virtual devices"
> > -     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS
> > +     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS || RISCV
>
> Why does this depend on any of these?  Can't we just have:

May be Goldfish drivers were compile tested/tried on these architectures only.

>
> >       depends on HAS_IOMEM
>
> And that's it?

I think it should be just "depends on HAS_IOMEM && HAS_DMA" just like
VirtIO MMIO. Agree ??

Regards,
Anup
Greg Kroah-Hartman Sept. 25, 2019, 5:06 a.m. UTC | #3
On Wed, Sep 25, 2019 at 10:30:00AM +0530, Anup Patel wrote:
> On Wed, Sep 25, 2019 at 10:13 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Sep 25, 2019 at 04:30:03AM +0000, Anup Patel wrote:
> > > We will be using some of the Goldfish virtual platform devices (such
> > > as RTC) on QEMU RISC-V virt machine so this patch enables goldfish
> > > kconfig option for RISC-V architecture.
> > >
> > > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > > ---
> > >  drivers/platform/goldfish/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig
> > > index 77b35df3a801..0ba825030ffe 100644
> > > --- a/drivers/platform/goldfish/Kconfig
> > > +++ b/drivers/platform/goldfish/Kconfig
> > > @@ -1,7 +1,7 @@
> > >  # SPDX-License-Identifier: GPL-2.0-only
> > >  menuconfig GOLDFISH
> > >       bool "Platform support for Goldfish virtual devices"
> > > -     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS
> > > +     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS || RISCV
> >
> > Why does this depend on any of these?  Can't we just have:
> 
> May be Goldfish drivers were compile tested/tried on these architectures only.

True, but that does not mean a driver should only have a specific list
of arches.  This should only be needed if you _know_ it doesn't work on
a specific arch, not the other way around.

> > >       depends on HAS_IOMEM
> >
> > And that's it?
> 
> I think it should be just "depends on HAS_IOMEM && HAS_DMA" just like
> VirtIO MMIO. Agree ??

No idea, but if that's what  is needed for building, then sure :)

thanks,

greg k-h
Anup Patel Sept. 25, 2019, 5:16 a.m. UTC | #4
On Wed, Sep 25, 2019 at 10:37 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Sep 25, 2019 at 10:30:00AM +0530, Anup Patel wrote:
> > On Wed, Sep 25, 2019 at 10:13 AM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Wed, Sep 25, 2019 at 04:30:03AM +0000, Anup Patel wrote:
> > > > We will be using some of the Goldfish virtual platform devices (such
> > > > as RTC) on QEMU RISC-V virt machine so this patch enables goldfish
> > > > kconfig option for RISC-V architecture.
> > > >
> > > > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > > > ---
> > > >  drivers/platform/goldfish/Kconfig | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig
> > > > index 77b35df3a801..0ba825030ffe 100644
> > > > --- a/drivers/platform/goldfish/Kconfig
> > > > +++ b/drivers/platform/goldfish/Kconfig
> > > > @@ -1,7 +1,7 @@
> > > >  # SPDX-License-Identifier: GPL-2.0-only
> > > >  menuconfig GOLDFISH
> > > >       bool "Platform support for Goldfish virtual devices"
> > > > -     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS
> > > > +     depends on X86_32 || X86_64 || ARM || ARM64 || MIPS || RISCV
> > >
> > > Why does this depend on any of these?  Can't we just have:
> >
> > May be Goldfish drivers were compile tested/tried on these architectures only.
>
> True, but that does not mean a driver should only have a specific list
> of arches.  This should only be needed if you _know_ it doesn't work on
> a specific arch, not the other way around.

No problem, I will drop depends on various architectures line

>
> > > >       depends on HAS_IOMEM
> > >
> > > And that's it?
> >
> > I think it should be just "depends on HAS_IOMEM && HAS_DMA" just like
> > VirtIO MMIO. Agree ??
>
> No idea, but if that's what  is needed for building, then sure :)

The Goldfish framebuffer can do DMA access so I add dependency on
HAS_DMA.

Refer, https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT

I will send v2 as-per above.

Regards,
Anup
diff mbox series

Patch

diff --git a/drivers/platform/goldfish/Kconfig b/drivers/platform/goldfish/Kconfig
index 77b35df3a801..0ba825030ffe 100644
--- a/drivers/platform/goldfish/Kconfig
+++ b/drivers/platform/goldfish/Kconfig
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 menuconfig GOLDFISH
 	bool "Platform support for Goldfish virtual devices"
-	depends on X86_32 || X86_64 || ARM || ARM64 || MIPS
+	depends on X86_32 || X86_64 || ARM || ARM64 || MIPS || RISCV
 	depends on HAS_IOMEM
 	help
 	  Say Y here to get to see options for the Goldfish virtual platform.