diff mbox series

pinctrl: ocelot: Add platform dependency

Message ID 20200507114015.24461-1-geert+renesas@glider.be
State New
Headers show
Series pinctrl: ocelot: Add platform dependency | expand

Commit Message

Geert Uytterhoeven May 7, 2020, 11:40 a.m. UTC
The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
config symbol, to avoid asking the user about it when configuring a
kernel without Ocelot or Jaguar2 support.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/pinctrl/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexandre Belloni May 7, 2020, 11:45 a.m. UTC | #1
Hi,

On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> config symbol, to avoid asking the user about it when configuring a
> kernel without Ocelot or Jaguar2 support.
> 

I have to NAK here because there are upcoming (hopefully this cycle)
SoCs using this driver.

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  drivers/pinctrl/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> index f0ce4ce3e0f52456..bed67c08a0892240 100644
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig
> @@ -394,8 +394,8 @@ config PINCTRL_RK805
>  
>  config PINCTRL_OCELOT
>  	bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> -	depends on OF
> -	depends on HAS_IOMEM
> +	depends on OF && HAS_IOMEM
> +	depends on MSCC_OCELOT || COMPILE_TEST
>  	select GPIOLIB
>  	select GPIOLIB_IRQCHIP
>  	select GENERIC_PINCONF
> -- 
> 2.17.1
>
Geert Uytterhoeven May 7, 2020, 11:52 a.m. UTC | #2
Hi Alexandre,

On Thu, May 7, 2020 at 1:46 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> > The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> > and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> > config symbol, to avoid asking the user about it when configuring a
> > kernel without Ocelot or Jaguar2 support.
>
> I have to NAK here because there are upcoming (hopefully this cycle)
> SoCs using this driver.

So which symbol do I have to extend the dependency with? ;-)

> > --- a/drivers/pinctrl/Kconfig
> > +++ b/drivers/pinctrl/Kconfig
> > @@ -394,8 +394,8 @@ config PINCTRL_RK805
> >
> >  config PINCTRL_OCELOT
> >       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> > -     depends on OF
> > -     depends on HAS_IOMEM
> > +     depends on OF && HAS_IOMEM
> > +     depends on MSCC_OCELOT || COMPILE_TEST
> >       select GPIOLIB
> >       select GPIOLIB_IRQCHIP
> >       select GENERIC_PINCONF

Gr{oetje,eeting}s,

                        Geert
Lars Povlsen May 7, 2020, 12:27 p.m. UTC | #3
Alexandre Belloni writes:

> Hi,
>
> On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
>> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
>> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
>> config symbol, to avoid asking the user about it when configuring a
>> kernel without Ocelot or Jaguar2 support.
>>
>
> I have to NAK here because there are upcoming (hopefully this cycle)
> SoCs using this driver.
>

Not only because of that, but also an arbitrary system connecting to
ocelot by PCI could be using the driver.

>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>>  drivers/pinctrl/Kconfig | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
>> index f0ce4ce3e0f52456..bed67c08a0892240 100644
>> --- a/drivers/pinctrl/Kconfig
>> +++ b/drivers/pinctrl/Kconfig
>> @@ -394,8 +394,8 @@ config PINCTRL_RK805
>>
>>  config PINCTRL_OCELOT
>>       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
>> -     depends on OF
>> -     depends on HAS_IOMEM
>> +     depends on OF && HAS_IOMEM
>> +     depends on MSCC_OCELOT || COMPILE_TEST
>>       select GPIOLIB
>>       select GPIOLIB_IRQCHIP
>>       select GENERIC_PINCONF
>> --
>> 2.17.1
>>
Alexandre Belloni May 7, 2020, 12:44 p.m. UTC | #4
On 07/05/2020 14:27:06+0200, Lars Povlsen wrote:
> 
> Alexandre Belloni writes:
> 
> > Hi,
> >
> > On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> >> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> >> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> >> config symbol, to avoid asking the user about it when configuring a
> >> kernel without Ocelot or Jaguar2 support.
> >>
> >
> > I have to NAK here because there are upcoming (hopefully this cycle)
> > SoCs using this driver.
> >
> 
> Not only because of that, but also an arbitrary system connecting to
> ocelot by PCI could be using the driver.
> 

Right, and that was why I removed the dependency when adding jaguar2
support I never booted the mips core of jaguar2, I used it using PCIe.

> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >>  drivers/pinctrl/Kconfig | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> >> index f0ce4ce3e0f52456..bed67c08a0892240 100644
> >> --- a/drivers/pinctrl/Kconfig
> >> +++ b/drivers/pinctrl/Kconfig
> >> @@ -394,8 +394,8 @@ config PINCTRL_RK805
> >>
> >>  config PINCTRL_OCELOT
> >>       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> >> -     depends on OF
> >> -     depends on HAS_IOMEM
> >> +     depends on OF && HAS_IOMEM
> >> +     depends on MSCC_OCELOT || COMPILE_TEST
> >>       select GPIOLIB
> >>       select GPIOLIB_IRQCHIP
> >>       select GENERIC_PINCONF
> >> --
> >> 2.17.1
> >>
> 
> -- 
> Lars Povlsen,
> Microchip
Geert Uytterhoeven May 11, 2020, 11:39 a.m. UTC | #5
Hi Alexandre,

On Thu, May 7, 2020 at 2:47 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 07/05/2020 14:27:06+0200, Lars Povlsen wrote:
> > Alexandre Belloni writes:
> > > On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> > >> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> > >> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> > >> config symbol, to avoid asking the user about it when configuring a
> > >> kernel without Ocelot or Jaguar2 support.
> > >>
> > >
> > > I have to NAK here because there are upcoming (hopefully this cycle)
> > > SoCs using this driver.
> >
> > Not only because of that, but also an arbitrary system connecting to
> > ocelot by PCI could be using the driver.
>
> Right, and that was why I removed the dependency when adding jaguar2

That is far from obvious from the description of commit da801ab56ad87489
("pinctrl: ocelot: add MSCC Jaguar2 support")....
BTW, probably PINCTRL_OCELOT should have got "default y if MSCC_OCELOT",
to avoid breaking old configs?

> support I never booted the mips core of jaguar2, I used it using PCIe.

Ah, you're using it as a PCIe endpoint. So what about ...

> > >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >> ---
> > >>  drivers/pinctrl/Kconfig | 4 ++--
> > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > >>
> > >> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> > >> index f0ce4ce3e0f52456..bed67c08a0892240 100644
> > >> --- a/drivers/pinctrl/Kconfig
> > >> +++ b/drivers/pinctrl/Kconfig
> > >> @@ -394,8 +394,8 @@ config PINCTRL_RK805
> > >>
> > >>  config PINCTRL_OCELOT
> > >>       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> > >> -     depends on OF
> > >> -     depends on HAS_IOMEM
> > >> +     depends on OF && HAS_IOMEM
> > >> +     depends on MSCC_OCELOT || COMPILE_TEST

... "depends on MSCC_OCELOT || PCI || COMPILE_TEST" instead?

If other SoCs gain support, the dependency list can be extended.

Thanks!

Gr{oetje,eeting}s,

                        Geert
Alexandre Belloni May 11, 2020, 2:20 p.m. UTC | #6
On 11/05/2020 13:39:42+0200, Geert Uytterhoeven wrote:
> Hi Alexandre,
> 
> On Thu, May 7, 2020 at 2:47 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
> > On 07/05/2020 14:27:06+0200, Lars Povlsen wrote:
> > > Alexandre Belloni writes:
> > > > On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> > > >> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> > > >> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> > > >> config symbol, to avoid asking the user about it when configuring a
> > > >> kernel without Ocelot or Jaguar2 support.
> > > >>
> > > >
> > > > I have to NAK here because there are upcoming (hopefully this cycle)
> > > > SoCs using this driver.
> > >
> > > Not only because of that, but also an arbitrary system connecting to
> > > ocelot by PCI could be using the driver.
> >
> > Right, and that was why I removed the dependency when adding jaguar2
> 
> That is far from obvious from the description of commit da801ab56ad87489
> ("pinctrl: ocelot: add MSCC Jaguar2 support")....
> BTW, probably PINCTRL_OCELOT should have got "default y if MSCC_OCELOT",
> to avoid breaking old configs?
> 
> > support I never booted the mips core of jaguar2, I used it using PCIe.
> 
> Ah, you're using it as a PCIe endpoint. So what about ...
> 
> > > >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > >> ---
> > > >>  drivers/pinctrl/Kconfig | 4 ++--
> > > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >>
> > > >> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> > > >> index f0ce4ce3e0f52456..bed67c08a0892240 100644
> > > >> --- a/drivers/pinctrl/Kconfig
> > > >> +++ b/drivers/pinctrl/Kconfig
> > > >> @@ -394,8 +394,8 @@ config PINCTRL_RK805
> > > >>
> > > >>  config PINCTRL_OCELOT
> > > >>       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> > > >> -     depends on OF
> > > >> -     depends on HAS_IOMEM
> > > >> +     depends on OF && HAS_IOMEM
> > > >> +     depends on MSCC_OCELOT || COMPILE_TEST
> 
> ... "depends on MSCC_OCELOT || PCI || COMPILE_TEST" instead?
> 
> If other SoCs gain support, the dependency list can be extended.
> 

Hum ok, note that it can also be connected as a SPI slave but I think
this is a bit far fetched currently.
Geert Uytterhoeven May 11, 2020, 2:48 p.m. UTC | #7
Hi  Alexandre,

On Mon, May 11, 2020 at 4:20 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 11/05/2020 13:39:42+0200, Geert Uytterhoeven wrote:
> > On Thu, May 7, 2020 at 2:47 PM Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> > > On 07/05/2020 14:27:06+0200, Lars Povlsen wrote:
> > > > Alexandre Belloni writes:
> > > > > On 07/05/2020 13:40:15+0200, Geert Uytterhoeven wrote:
> > > > >> The Microsemi Ocelot pin controller is only present on Microsemi Ocelot
> > > > >> and Jaguar2 SoCs.  Add a platform dependency to the PINCTRL_OCELOT
> > > > >> config symbol, to avoid asking the user about it when configuring a
> > > > >> kernel without Ocelot or Jaguar2 support.
> > > > >>
> > > > >
> > > > > I have to NAK here because there are upcoming (hopefully this cycle)
> > > > > SoCs using this driver.
> > > >
> > > > Not only because of that, but also an arbitrary system connecting to
> > > > ocelot by PCI could be using the driver.
> > >
> > > Right, and that was why I removed the dependency when adding jaguar2
> >
> > That is far from obvious from the description of commit da801ab56ad87489
> > ("pinctrl: ocelot: add MSCC Jaguar2 support")....
> > BTW, probably PINCTRL_OCELOT should have got "default y if MSCC_OCELOT",
> > to avoid breaking old configs?
> >
> > > support I never booted the mips core of jaguar2, I used it using PCIe.
> >
> > Ah, you're using it as a PCIe endpoint. So what about ...
> >
> > > > >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > > >> ---
> > > > >>  drivers/pinctrl/Kconfig | 4 ++--
> > > > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > >>
> > > > >> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> > > > >> index f0ce4ce3e0f52456..bed67c08a0892240 100644
> > > > >> --- a/drivers/pinctrl/Kconfig
> > > > >> +++ b/drivers/pinctrl/Kconfig
> > > > >> @@ -394,8 +394,8 @@ config PINCTRL_RK805
> > > > >>
> > > > >>  config PINCTRL_OCELOT
> > > > >>       bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
> > > > >> -     depends on OF
> > > > >> -     depends on HAS_IOMEM
> > > > >> +     depends on OF && HAS_IOMEM
> > > > >> +     depends on MSCC_OCELOT || COMPILE_TEST
> >
> > ... "depends on MSCC_OCELOT || PCI || COMPILE_TEST" instead?
> >
> > If other SoCs gain support, the dependency list can be extended.
>
> Hum ok, note that it can also be connected as a SPI slave but I think
> this is a bit far fetched currently.

I can connect whatever other system using SPI, i2c, CAN, or Ethernet ;-)
That doesn't mean I will directly program the other system's pin controller
over that link, using the standard (MMIO) pinctrl driver.

Gr{oetje,eeting}s,

                        Geert
Alexandre Belloni May 11, 2020, 2:53 p.m. UTC | #8
On 11/05/2020 16:48:01+0200, Geert Uytterhoeven wrote:
> I can connect whatever other system using SPI, i2c, CAN, or Ethernet ;-)
> That doesn't mean I will directly program the other system's pin controller
> over that link, using the standard (MMIO) pinctrl driver.
> 

Yes, my point is that you can access all the SoC registers over SPI and
so you will probably need to also control the pinctrl for example to be
able to actually use the on-SoC switch.
diff mbox series

Patch

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index f0ce4ce3e0f52456..bed67c08a0892240 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -394,8 +394,8 @@  config PINCTRL_RK805
 
 config PINCTRL_OCELOT
 	bool "Pinctrl driver for the Microsemi Ocelot and Jaguar2 SoCs"
-	depends on OF
-	depends on HAS_IOMEM
+	depends on OF && HAS_IOMEM
+	depends on MSCC_OCELOT || COMPILE_TEST
 	select GPIOLIB
 	select GPIOLIB_IRQCHIP
 	select GENERIC_PINCONF