[V2,4/5] pinctrl: renesas: Enable R8A774A1 PFC tables

Message ID 20200619135830.501470-5-aford173@gmail.com
State Superseded
Headers show
Series
  • Add Basic support for R8A774A1 (RZ/G2M)
Related show

Commit Message

Adam Ford June 19, 2020, 1:58 p.m.
The PFC tables for the R8A774A1 are already available, but they
not enabled.

This patch adds the Kconfig option and builds the corresponding file
when PINCTRL_PFC_R8A774A1 is enabled.

Signed-off-by: Adam Ford <aford173 at gmail.com>
---
V2:  Use tables already build into pfc-r8a7796 instead of creating a new file
     Fix pfc references so the pinmuxer acutally gets loaded

Comments

Marek Vasut June 19, 2020, 2:04 p.m. | #1
On 6/19/20 3:58 PM, Adam Ford wrote:
> The PFC tables for the R8A774A1 are already available, but they
> not enabled.
> 
> This patch adds the Kconfig option and builds the corresponding file
> when PINCTRL_PFC_R8A774A1 is enabled.

[...]

> diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
> index db3d513358..b9ce471007 100644
> --- a/drivers/pinctrl/renesas/sh_pfc.h
> +++ b/drivers/pinctrl/renesas/sh_pfc.h
> @@ -300,6 +300,7 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
> +extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
>  extern const struct sh_pfc_soc_info r8a77980_pinmux_info;

Please keep the lists sorted, all of them, where it makes sense.
Adam Ford June 19, 2020, 2:25 p.m. | #2
On Fri, Jun 19, 2020 at 9:18 AM Marek Vasut <marek.vasut at gmail.com> wrote:
>
> On 6/19/20 3:58 PM, Adam Ford wrote:
> > The PFC tables for the R8A774A1 are already available, but they
> > not enabled.
> >
> > This patch adds the Kconfig option and builds the corresponding file
> > when PINCTRL_PFC_R8A774A1 is enabled.
>
> [...]
>
> > diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
> > index db3d513358..b9ce471007 100644
> > --- a/drivers/pinctrl/renesas/sh_pfc.h
> > +++ b/drivers/pinctrl/renesas/sh_pfc.h
> > @@ -300,6 +300,7 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
> > +extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
> >  extern const struct sh_pfc_soc_info r8a77980_pinmux_info;
>
> Please keep the lists sorted, all of them, where it makes sense.

I was trying to do that.  At least in hex. Doesn't 774a1 comes after
7796 and before 77965?

adam
Marek Vasut June 19, 2020, 2:27 p.m. | #3
On 6/19/20 4:25 PM, Adam Ford wrote:
> On Fri, Jun 19, 2020 at 9:18 AM Marek Vasut <marek.vasut at gmail.com> wrote:
>>
>> On 6/19/20 3:58 PM, Adam Ford wrote:
>>> The PFC tables for the R8A774A1 are already available, but they
>>> not enabled.
>>>
>>> This patch adds the Kconfig option and builds the corresponding file
>>> when PINCTRL_PFC_R8A774A1 is enabled.
>>
>> [...]
>>
>>> diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
>>> index db3d513358..b9ce471007 100644
>>> --- a/drivers/pinctrl/renesas/sh_pfc.h
>>> +++ b/drivers/pinctrl/renesas/sh_pfc.h
>>> @@ -300,6 +300,7 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
>>> +extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
>>>  extern const struct sh_pfc_soc_info r8a77980_pinmux_info;
>>
>> Please keep the lists sorted, all of them, where it makes sense.
> 
> I was trying to do that.  At least in hex. Doesn't 774a1 comes after
> 7796 and before 77965?

I honestly don't know how to sort these lists well either, neither
option seems particularly good. What does Linux do ?
Adam Ford June 19, 2020, 3:55 p.m. | #4
On Fri, Jun 19, 2020 at 9:27 AM Marek Vasut <marek.vasut at gmail.com> wrote:
>
> On 6/19/20 4:25 PM, Adam Ford wrote:
> > On Fri, Jun 19, 2020 at 9:18 AM Marek Vasut <marek.vasut at gmail.com> wrote:
> >>
> >> On 6/19/20 3:58 PM, Adam Ford wrote:
> >>> The PFC tables for the R8A774A1 are already available, but they
> >>> not enabled.
> >>>
> >>> This patch adds the Kconfig option and builds the corresponding file
> >>> when PINCTRL_PFC_R8A774A1 is enabled.
> >>
> >> [...]
> >>
> >>> diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
> >>> index db3d513358..b9ce471007 100644
> >>> --- a/drivers/pinctrl/renesas/sh_pfc.h
> >>> +++ b/drivers/pinctrl/renesas/sh_pfc.h
> >>> @@ -300,6 +300,7 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
> >>> +extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
> >>>  extern const struct sh_pfc_soc_info r8a77980_pinmux_info;
> >>
> >> Please keep the lists sorted, all of them, where it makes sense.
> >
> > I was trying to do that.  At least in hex. Doesn't 774a1 comes after
> > 7796 and before 77965?
>
> I honestly don't know how to sort these lists well either, neither
> option seems particularly good. What does Linux do ?

I can make it match Linux or at least place it where it would be.
Some of the entries in Linux don't exist in U-Boot, so would mean
putting this at the top of the list.

adam
Marek Vasut June 19, 2020, 4:04 p.m. | #5
On 6/19/20 5:55 PM, Adam Ford wrote:
[...]
>>>>> diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
>>>>> index db3d513358..b9ce471007 100644
>>>>> --- a/drivers/pinctrl/renesas/sh_pfc.h
>>>>> +++ b/drivers/pinctrl/renesas/sh_pfc.h
>>>>> @@ -300,6 +300,7 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
>>>>> +extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
>>>>>  extern const struct sh_pfc_soc_info r8a77980_pinmux_info;
>>>>
>>>> Please keep the lists sorted, all of them, where it makes sense.
>>>
>>> I was trying to do that.  At least in hex. Doesn't 774a1 comes after
>>> 7796 and before 77965?
>>
>> I honestly don't know how to sort these lists well either, neither
>> option seems particularly good. What does Linux do ?
> 
> I can make it match Linux or at least place it where it would be.
> Some of the entries in Linux don't exist in U-Boot, so would mean
> putting this at the top of the list.

Sounds good.

Patch

diff --git a/drivers/pinctrl/renesas/Kconfig b/drivers/pinctrl/renesas/Kconfig
index 4d3d68d307..8327bcabd6 100644
--- a/drivers/pinctrl/renesas/Kconfig
+++ b/drivers/pinctrl/renesas/Kconfig
@@ -77,6 +77,16 @@  config PINCTRL_PFC_R8A7796
 	  the GPIO definitions and pin control functions for each available
 	  multiplex function.
 
+config PINCTRL_PFC_R8A774A1
+        bool "Renesas RCar Gen3 R8A774A1 pin control driver"
+        depends on PINCTRL_PFC
+        help
+          Support pin multiplexing control on Renesas RZG2M R8A774A1 SoCs.
+
+          The driver is controlled by a device tree node which contains both
+          the GPIO definitions and pin control functions for each available
+          multiplex function.
+
 config PINCTRL_PFC_R8A77965
 	bool "Renesas RCar Gen3 R8A77965 pin control driver"
 	depends on PINCTRL_PFC
diff --git a/drivers/pinctrl/renesas/Makefile b/drivers/pinctrl/renesas/Makefile
index a92f787a89..f41249ca9d 100644
--- a/drivers/pinctrl/renesas/Makefile
+++ b/drivers/pinctrl/renesas/Makefile
@@ -6,6 +6,7 @@  obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
+obj-$(CONFIG_PINCTRL_PFC_R8A774A1) += pfc-r8a7796.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77970) += pfc-r8a77970.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77980) += pfc-r8a77980.o
diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c
index 1179afd2e7..7ba7849593 100644
--- a/drivers/pinctrl/renesas/pfc.c
+++ b/drivers/pinctrl/renesas/pfc.c
@@ -32,6 +32,7 @@  enum sh_pfc_model {
 	SH_PFC_R8A7794,
 	SH_PFC_R8A7795,
 	SH_PFC_R8A7796,
+	SH_PFC_R8A774A1,
 	SH_PFC_R8A77965,
 	SH_PFC_R8A77970,
 	SH_PFC_R8A77980,
@@ -853,6 +854,10 @@  static int sh_pfc_pinctrl_probe(struct udevice *dev)
 	if (model == SH_PFC_R8A7796)
 		priv->pfc.info = &r8a7796_pinmux_info;
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774A1
+	if (model == SH_PFC_R8A774A1)
+		priv->pfc.info = &r8a774a1_pinmux_info;
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	if (model == SH_PFC_R8A77965)
 		priv->pfc.info = &r8a77965_pinmux_info;
@@ -924,6 +929,12 @@  static const struct udevice_id sh_pfc_pinctrl_ids[] = {
 		.data = SH_PFC_R8A7796,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774A1
+	{
+		.compatible = "renesas,pfc-r8a774a1",
+		.data = SH_PFC_R8A774A1,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	{
 		.compatible = "renesas,pfc-r8a77965",
diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
index db3d513358..b9ce471007 100644
--- a/drivers/pinctrl/renesas/sh_pfc.h
+++ b/drivers/pinctrl/renesas/sh_pfc.h
@@ -300,6 +300,7 @@  extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
+extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77980_pinmux_info;