Skip to contentSkip to conversation

pinctrl: sh-pfc: add R8A77970 PFC support

PATCH In review Sergei Shtylyov 3 participants 4 messages Nov 10, 2017 – Nov 15, 2017 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 pinctrl: sh-pfc: add R8A77970 PFC support

Add the PFC support for the R8A77970 SoC including pin groups for some on-chip devices such as CAN-FD, EtherAVB, [H]SCIF, I2C, INTC-EX, MMC, MSIOF, PWM, VIN...

Based on the original (and large) patch by Daisuke Matsushita <[email protected]>.

---
 Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt |    1 
 drivers/pinctrl/sh-pfc/Kconfig                                    |    5 
 drivers/pinctrl/sh-pfc/Makefile                                   |    1 
 drivers/pinctrl/sh-pfc/core.c                                     |    6 
 drivers/pinctrl/sh-pfc/pfc-r8a77970.c                             | 2421 ++++++++++
 drivers/pinctrl/sh-pfc/sh_pfc.h                                   |    1 
 6 files changed, 2435 insertions(+)
Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt +1 -0
Index: renesas-drivers/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
===================================================================
@@ -24,6 +24,7 @@ Required Properties:
     - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller.
     - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller.
     - "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) compatible pin-controller.
+    - "renesas,pfc-r8a77970": for R8A77970 (R-Car V3M) compatible pin-controller.
     - "renesas,pfc-r8a77995": for R8A77995 (R-Car D3) compatible pin-controller.
     - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
 
drivers/pinctrl/sh-pfc/Kconfig +5 -0
Index: renesas-drivers/drivers/pinctrl/sh-pfc/Kconfig
===================================================================
@@ -89,6 +89,11 @@ config PINCTRL_PFC_R8A7796
         depends on ARCH_R8A7796
         select PINCTRL_SH_PFC
 
+config PINCTRL_PFC_R8A77970
+	def_bool y
+	depends on ARCH_R8A77970
+	select PINCTRL_SH_PFC
+
 config PINCTRL_PFC_R8A77995
         def_bool y
         depends on ARCH_R8A77995
drivers/pinctrl/sh-pfc/Makefile +1 -0
Index: renesas-drivers/drivers/pinctrl/sh-pfc/Makefile
===================================================================
@@ -15,6 +15,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7794)	+= pfc
 obj-$(CONFIG_PINCTRL_PFC_R8A7795)	+= pfc-r8a7795.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7795)	+= pfc-r8a7795-es1.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7796)	+= pfc-r8a7796.o
+obj-$(CONFIG_PINCTRL_PFC_R8A77970)	+= pfc-r8a77970.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77995)	+= pfc-r8a77995.o
 obj-$(CONFIG_PINCTRL_PFC_SH7203)	+= pfc-sh7203.o
 obj-$(CONFIG_PINCTRL_PFC_SH7264)	+= pfc-sh7264.o
drivers/pinctrl/sh-pfc/core.c +6 -0
Index: renesas-drivers/drivers/pinctrl/sh-pfc/core.c
===================================================================
@@ -557,6 +557,12 @@ static const struct of_device_id sh_pfc_
 		.data = &r8a7796_pinmux_info,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A77970
+	{
+		.compatible = "renesas,pfc-r8a77970",
+		.data = &r8a77970_pinmux_info,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77995
 	{
 		.compatible = "renesas,pfc-r8a77995",
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +2421 -0

2,421 lines not on this page · raw message

drivers/pinctrl/sh-pfc/sh_pfc.h +1 -0
Index: renesas-drivers/drivers/pinctrl/sh-pfc/sh_pfc.h
===================================================================
@@ -283,6 +283,7 @@ extern const struct sh_pfc_soc_info r8a7
 extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7795es1_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
+extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
 extern const struct sh_pfc_soc_info sh7203_pinmux_info;
 extern const struct sh_pfc_soc_info sh7264_pinmux_info;

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reviewed-by on v1 2/2
#1 lore raw

Hi Sergei,

Quoted 9 lines · Sergei Shtylyov

Add the PFC support for the R8A77970 SoC including pin groups for some on-chip devices such as CAN-FD, EtherAVB, [H]SCIF, I2C, INTC-EX, MMC, MSIOF, PWM, VIN...

Based on the original (and large) patch by Daisuke Matsushita <[email protected]>.

Thanks for your patch!

For CPU_ALL_PORT(), pins, groups, and functions:

i.e. will queue in sh-pfc-for-v4.16, with the two nits below fixed.

Quoted 2 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +0 -0

[...]

Quoted 1 line

+/* - VIN0 ------------------------------------------------------------------- */

[...]

drivers/pinctrl/sh-pfc/pfc-r8a77970.c line 1574

Quoted 3 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +3 -0
+static const unsigned int vin0_sync_pins[] = {
+       /* VSYNC#, HSYNC# */
+       RCAR_GP_PIN(2, 3), RCAR_GP_PIN(2, 2),

The order of the above doesn't match the order below (will fix while applying).

Quoted 6 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +5 -0
+};
+static const unsigned int vin0_sync_mux[] = {
+       VI0_HSYNC_N_MARK, VI0_VSYNC_N_MARK,
+};
 
+/* - VIN1 ------------------------------------------------------------------- */

[...]

drivers/pinctrl/sh-pfc/pfc-r8a77970.c line 1646

Quoted 3 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +3 -0
+static const unsigned int vin1_sync_pins[] = {
+       /* VSYNC#, HSYNC# */
+       RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 2),

Likewise.

drivers/pinctrl/sh-pfc/pfc-r8a77970.c line 1650

Quoted 4 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +4 -0
+};
+static const unsigned int vin1_sync_mux[] = {
+       VI1_HSYNC_N_MARK, VI1_VSYNC_N_MARK,
+};

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#2 lore raw
In reply to Sergei Shtylyov

Hi Sergei,

Quoted 12 lines · Sergei Shtylyov

Add the PFC support for the R8A77970 SoC including pin groups for some on-chip devices such as CAN-FD, EtherAVB, [H]SCIF, I2C, INTC-EX, MMC, MSIOF, PWM, VIN...

Based on the original (and large) patch by Daisuke Matsushita <[email protected]>.

drivers/pinctrl/sh-pfc/pfc-r8a77970.c line 759

Quoted 10 lines
drivers/pinctrl/sh-pfc/pfc-r8a77970.c new file +8 -0
 
+/* - EtherAVB --------------------------------------------------------------- */
 
+static const unsigned int avb0_mdio_pins[] = {
+       /* AVB0_MDC, AVB0_MDIO */
+       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14),
+};
+static const unsigned int avb0_mdio_mux[] = {
+       AVB0_MDC_MARK, AVB0_MDIO_MARK,
+};

Upon second look: this group is called "avb(0)_mdc" instead of "avb(0)_mdio" on all other R-Car Gen3 SoCs?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

A message that is not in the archive (sent off-list or not yet received): 20171110181552.227541251-M4DtvfQ/[email protected]

Acked-by
#4 lore raw
Quoted 4 lines · Sergei Shtylyov

Add the PFC support for the R8A77970 SoC including pin groups for some on-chip devices such as CAN-FD, EtherAVB, [H]SCIF, I2C, INTC-EX, MMC, MSIOF, PWM, VIN...

Quoted 8 lines

Based on the original (and large) patch by Daisuke Matsushita <[email protected]>.

---
 Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt |    1 
Quoted 6 lines
 drivers/pinctrl/sh-pfc/Kconfig                                    |    5 
 drivers/pinctrl/sh-pfc/Makefile                                   |    1 
 drivers/pinctrl/sh-pfc/core.c                                     |    6 
 drivers/pinctrl/sh-pfc/pfc-r8a77970.c                             | 2421 ++++++++++
 drivers/pinctrl/sh-pfc/sh_pfc.h                                   |    1 
 6 files changed, 2435 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html