mbox series

[v3,00/21] pinctrl: renesas: r8a779g0: Add pins, groups and functions

Message ID 874k0nlrbw.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series pinctrl: renesas: r8a779g0: Add pins, groups and functions | expand

Message

Kuninori Morimoto June 14, 2022, 5:57 a.m. UTC
Hi Geert

These are v3 of V4H (r8a779g0) pinctrl patches.
These are based on renesas-pinctrl/renesas-pinctrl-for-v5.20.

As I have mentioned before, I want to keep original code as much as
possible to avoid unexpected bug at [03/21][04/21].
v3 patch uses incremental patch to add missing pin settings, etc.

Basically, [03/21][04/21] of v3 is cleaup comment, alphabetical order, etc,
no code was changed. [05/21] or later change the code.

Please let me know if something was missing.
I'm happy to add it as incremental patch.

This patch didn't care about GP1_23 - GP1_28 voltage control,
because the code is same as document.
This patch didn't care about RMII pins, because I'm not sure.
This patch didn't care about I2C-capable pins, because I'm not sure.

v2 -> v2
	- for [03/21]
		- remove "core.h"
		- drop DRV1 from CANFD7 comment
		- rename pinmux_ops to r8a779g0_pfc_ops
		- fixup comment XR_TXENA_N -> FXR_TXENA_N
		- fixup comment RPC_RESET -> RPC_RESET_N
		- fixup TPU0TO1/TPU0TO0 order at PUEN2
	- for [04/21]
		- Missing blank line.
		- sort modules alphabetically
		- fixup comment RX,TX -> RX1, TX1
		- fixup comment MSIOF1_xxx -> MSIOF2_xxx
		- fixup comment RTS3#/CTS3# -> RTS3_N/CTS3_N
		- fixup comment RTS1#/CTS1# -> RTS1_N/CTS1_N
	- add missing pin settings.

v1 -> v2

	- add r8a779g0 on renesas,pfc Document at [1/4]
	- use CFG_13 on CFG_14 [2/4]
	- tidyup WARNINGs [3/4]
	  - tidyup tab and/or white space
	  - care reserve bit/fields	  
	  - fixup settings miss
	- tidyup tab and/or white space [4/4]


  [01/21] dt-bindings: pinctrl: renesas,pfc: Document r8a779g0 support
  [02/21] pinctrl: renesas: Add PORT_GP_CFG_13 macros
  [03/21] pinctrl: renesas: Initial R8A779G0 (V4H) PFC support
  [04/21] pinctrl: renesas: r8a779g0: Add pins, groups and functions
  [05/21] pinctrl: renesas: r8a779g0: remove not used NOGP definitions
  [06/21] pinctrl: renesas: r8a779g0: remove not used IPxSRx definitions
  [07/21] pinctrl: renesas: r8a779g0: remove not used MOD_SELx definitions
  [08/21] pinctrl: renesas: r8a779g0: tidyup ioctrl_regs
  [09/21] pinctrl: renesas: r8a779g0: add missing TCLKx_A/TCLK_B/TCLKx_X
  [10/21] pinctrl: renesas: r8a779g0: add missing IRQx_A/IRQx_B
  [11/21] pinctrl: renesas: r8a779g0: add missing HSCIF3_A
  [12/21] pinctrl: renesas: r8a779g0: add missing HSCIF1_X
  [13/21] pinctrl: renesas: r8a779g0: add missing SCIF3
  [14/21] pinctrl: renesas: r8a779g0: add missing SCIF1_X
  [15/21] pinctrl: renesas: r8a779g0: add missing CANFD5_B
  [16/21] pinctrl: renesas: r8a779g0: add missing TPU0TOx_A
  [17/21] pinctrl: renesas: r8a779g0: add missing FlaxRay
  [18/21] pinctrl: renesas: r8a779g0: add missing PWM
  [19/21] pinctrl: renesas: r8a779g0: add missing ERROROUTC_A
  [20/21] pinctrl: renesas: r8a779g0: add missing MODSELx for TSN0
  [21/21] pinctrl: renesas: r8a779g0: add missing MODSELx for AVBx


 .../bindings/pinctrl/renesas,pfc.yaml         |    1 +
 drivers/pinctrl/renesas/Kconfig               |    5 +
 drivers/pinctrl/renesas/Makefile              |    1 +
 drivers/pinctrl/renesas/core.c                |    6 +
 drivers/pinctrl/renesas/pfc-r8a779g0.c        | 4316 +++++++++++++++++
 drivers/pinctrl/renesas/sh_pfc.h              |    9 +-
 6 files changed, 4336 insertions(+), 2 deletions(-)
 create mode 100644 drivers/pinctrl/renesas/pfc-r8a779g0.c

Comments

Geert Uytterhoeven June 17, 2022, 3:13 p.m. UTC | #1
Hi Morimoto-san,

On Tue, Jun 14, 2022 at 7:58 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: LUU HOAI <hoai.luu.ub@renesas.com>
>
> This patch adds initial pinctrl support for the R8A779G0 (V4H) SoC,
> including bias, drive strength and voltage control.
>
> [Morimoto merged Kihara-san's MODSEL8 fixup patch,
>  cleanuped white space, care reserved bit on each configs,
>  fixup comments, etc]
> Signed-off-by: LUU HOAI <hoai.luu.ub@renesas.com>
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/drivers/pinctrl/renesas/pfc-r8a779g0.c

> +static const u16 pinmux_data[] = {

> +       /* IP0SR8 */
> +       PINMUX_IPSR_MSEL(IP0SR8_3_0,    SCL0,                   SEL_SCL0_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_7_4,    SDA0,                   SEL_SDA0_0),

These are definitely still wrong, and not fixed by any of your
subsequent patches: to enable I2C0 functionality, the corresponding
SEL_{SCL,SDA}0 bit should be set to 1, not 0.
Same for I2C[1-5] below.

> +       PINMUX_IPSR_MSEL(IP0SR8_11_8,   SCL1,                   SEL_SCL1_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_15_12,  SDA1,                   SEL_SDA1_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_19_16,  SCL2,                   SEL_SCL2_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_23_20,  SDA2,                   SEL_SDA2_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_27_24,  SCL3,                   SEL_SCL3_0),
> +       PINMUX_IPSR_MSEL(IP0SR8_31_28,  SDA3,                   SEL_SDA3_0),
> +
> +       /* IP1SR8 */
> +       PINMUX_IPSR_MSEL(IP1SR8_3_0,    SCL4,                   SEL_SCL4_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_3_0,    HRX2,                   SEL_SCL4_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_3_0,    SCK4,                   SEL_SCL4_0),
> +
> +       PINMUX_IPSR_MSEL(IP1SR8_7_4,    SDA4,                   SEL_SDA4_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_7_4,    HTX2,                   SEL_SDA4_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_7_4,    CTS4_N,                 SEL_SDA4_0),
> +
> +       PINMUX_IPSR_MSEL(IP1SR8_11_8,   SCL5,                   SEL_SCL5_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_11_8,   HRTS2_N,                SEL_SCL5_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_11_8,   RTS4_N,                 SEL_SCL5_0),
> +
> +       PINMUX_IPSR_MSEL(IP1SR8_15_12,  SDA5,                   SEL_SDA5_0),
> +       PINMUX_IPSR_MSEL(IP1SR8_15_12,  SCIF_CLK2,              SEL_SDA5_0),
> +
> +       PINMUX_IPSR_GPSR(IP1SR8_19_16,  HCTS2_N),
> +       PINMUX_IPSR_GPSR(IP1SR8_19_16,  TX4),
> +
> +       PINMUX_IPSR_GPSR(IP1SR8_23_20,  HSCK2),
> +       PINMUX_IPSR_GPSR(IP1SR8_23_20,  RX4),
> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Kuninori Morimoto June 20, 2022, 12:18 a.m. UTC | #2
Hi Geert

Thank you for review.

> > +       /* IP0SR8 */
> > +       PINMUX_IPSR_MSEL(IP0SR8_3_0,    SCL0,                   SEL_SCL0_0),
> > +       PINMUX_IPSR_MSEL(IP0SR8_7_4,    SDA0,                   SEL_SDA0_0),
> 
> These are definitely still wrong, and not fixed by any of your
> subsequent patches: to enable I2C0 functionality, the corresponding
> SEL_{SCL,SDA}0 bit should be set to 1, not 0.
> Same for I2C[1-5] below.

There was such patch, and this patch series merged it.
Now I'm asking why the patch was needed.

I will fix and re-post v4.

But, 1 things. As I mentioned before, I want to keep original patch as much as possible,
even though it has bug (missing pins, having unnecessary settings).
In other words, the difference from original patch is only cleanup:ed.
I will keep current style on v4, too.

About suffix, I'm asking it to Doc team.

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Geert Uytterhoeven June 20, 2022, 6:21 a.m. UTC | #3
Hi Morimoto-san,

On Mon, Jun 20, 2022 at 2:18 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> > > +       /* IP0SR8 */
> > > +       PINMUX_IPSR_MSEL(IP0SR8_3_0,    SCL0,                   SEL_SCL0_0),
> > > +       PINMUX_IPSR_MSEL(IP0SR8_7_4,    SDA0,                   SEL_SDA0_0),
> >
> > These are definitely still wrong, and not fixed by any of your
> > subsequent patches: to enable I2C0 functionality, the corresponding
> > SEL_{SCL,SDA}0 bit should be set to 1, not 0.
> > Same for I2C[1-5] below.
>
> There was such patch, and this patch series merged it.

I don't see such a patch in this series?

> Now I'm asking why the patch was needed.

Sorry, I don't understand.

> I will fix and re-post v4.
>
> But, 1 things. As I mentioned before, I want to keep original patch as much as possible,
> even though it has bug (missing pins, having unnecessary settings).
> In other words, the difference from original patch is only cleanup:ed.
> I will keep current style on v4, too.

OK.

> About suffix, I'm asking it to Doc team.

Thank you!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Kuninori Morimoto June 20, 2022, 6:58 a.m. UTC | #4
Hi Geert

> > > These are definitely still wrong, and not fixed by any of your
> > > subsequent patches: to enable I2C0 functionality, the corresponding
> > > SEL_{SCL,SDA}0 bit should be set to 1, not 0.
> > > Same for I2C[1-5] below.
> >
> > There was such patch, and this patch series merged it.
> 
> I don't see such a patch in this series?
>
> > Now I'm asking why the patch was needed.
> 
> Sorry, I don't understand.

Sorry for un-clear explaination.

[03/21] and [04/21] merged some/many BSP original patches into one.
[03/21] is including I2C fixup patch from Kihara-san
which fixup the SEL_{SCL,SDA} value from 1 to 0,
but this fixup seems strange, and you are now pointing it.
I'm not sure why this patch was needed, now, I'm asking.

https://github.com/renesas-rcar/linux-bsp/commit/2155127dacd61a4bb2f6f316f716a9338799a786

Thank you for your help !!

Best regards
---
Kuninori Morimoto