diff mbox series

hwrng: imx-rngc: improve dependencies

Message ID 20200205140002.26273-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series hwrng: imx-rngc: improve dependencies | expand

Commit Message

Uwe Kleine-König Feb. 5, 2020, 2 p.m. UTC
The imx-rngc driver binds to devices that are compatible to
"fsl,imx25-rngb". Grepping through the device tree sources suggests this
only exists on i.MX25. So restrict dependencies to configs that have
this SoC enabled, but allow compile testing. For the latter additional
dependencies for clk and readl/writel are necessary.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/char/hw_random/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Horia Geanta Feb. 12, 2020, 7:51 p.m. UTC | #1
On 2/5/2020 4:00 PM, Uwe Kleine-König wrote:
> The imx-rngc driver binds to devices that are compatible to
> "fsl,imx25-rngb". Grepping through the device tree sources suggests this
> only exists on i.MX25. So restrict dependencies to configs that have
The driver could also be used by some i.MX6 SoCs (SL, SLL),
that have a compatible rngb.

Actually i.MX6SL has a rngb node in the DT, but unfortunately it lacks
a compatible string.

I am planning to address this short term.

> this SoC enabled, but allow compile testing. For the latter additional
> dependencies for clk and readl/writel are necessary.
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/char/hw_random/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> index 8486c29d8324..17fe954fccde 100644
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -244,7 +244,8 @@ config HW_RANDOM_MXC_RNGA
>  
>  config HW_RANDOM_IMX_RNGC
>  	tristate "Freescale i.MX RNGC Random Number Generator"
> -	depends on ARCH_MXC
> +	depends on HAS_IOMEM && HAVE_CLK
> +	depends on SOC_IMX25 || COMPILE_TEST
I guess SOC_IMX6SL and SOC_IMX6SLL will have to be added.
Does this sound good?

Thanks,
Horia
Uwe Kleine-König Feb. 12, 2020, 8:45 p.m. UTC | #2
On Wed, Feb 12, 2020 at 07:51:46PM +0000, Horia Geanta wrote:
> On 2/5/2020 4:00 PM, Uwe Kleine-König wrote:
> > The imx-rngc driver binds to devices that are compatible to
> > "fsl,imx25-rngb". Grepping through the device tree sources suggests this
> > only exists on i.MX25. So restrict dependencies to configs that have
> The driver could also be used by some i.MX6 SoCs (SL, SLL),
> that have a compatible rngb.
> 
> Actually i.MX6SL has a rngb node in the DT, but unfortunately it lacks
> a compatible string.

Also the i.MX6ULL might have a compatible device?

> I am planning to address this short term.
> 
> > this SoC enabled, but allow compile testing. For the latter additional
> > dependencies for clk and readl/writel are necessary.
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  drivers/char/hw_random/Kconfig | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> > index 8486c29d8324..17fe954fccde 100644
> > --- a/drivers/char/hw_random/Kconfig
> > +++ b/drivers/char/hw_random/Kconfig
> > @@ -244,7 +244,8 @@ config HW_RANDOM_MXC_RNGA
> >  
> >  config HW_RANDOM_IMX_RNGC
> >  	tristate "Freescale i.MX RNGC Random Number Generator"
> > -	depends on ARCH_MXC
> > +	depends on HAS_IOMEM && HAVE_CLK
> > +	depends on SOC_IMX25 || COMPILE_TEST
> I guess SOC_IMX6SL and SOC_IMX6SLL will have to be added.
> Does this sound good?

I'd say currently the patch is right and once the device trees for the
imx6 variants were expanded to include these, the list here can be
expanded.

Best regards
Uwe
Herbert Xu Feb. 22, 2020, 1:41 a.m. UTC | #3
On Wed, Feb 05, 2020 at 03:00:02PM +0100, Uwe Kleine-König wrote:
> The imx-rngc driver binds to devices that are compatible to
> "fsl,imx25-rngb". Grepping through the device tree sources suggests this
> only exists on i.MX25. So restrict dependencies to configs that have
> this SoC enabled, but allow compile testing. For the latter additional
> dependencies for clk and readl/writel are necessary.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/char/hw_random/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 8486c29d8324..17fe954fccde 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -244,7 +244,8 @@  config HW_RANDOM_MXC_RNGA
 
 config HW_RANDOM_IMX_RNGC
 	tristate "Freescale i.MX RNGC Random Number Generator"
-	depends on ARCH_MXC
+	depends on HAS_IOMEM && HAVE_CLK
+	depends on SOC_IMX25 || COMPILE_TEST
 	default HW_RANDOM
 	---help---
 	  This driver provides kernel-side support for the Random Number