Skip to contentSkip to conversation

Pin control support for RZ/G2[HN]

PATCH New Biju Das 2 participants 15 messages Oct 28, 2020 – Nov 1, 2020

Subsystems (4)
lore
Share & tools
lore

Biju Das

author
#0 lore raw

cover Pin control support for RZ/G2[HN]

This patch series adds pin control support for RZ/G2[HN] SoC's.

Also added pinctrl optimization for RZ/G2[HMN] SoC's.

This patches are based on u-boot-sh/next.

+ Geert

The last 3 patches in this series are RFC, which aims to optimize pinctrl size for RCar SoC 's( The u-boot size is reduced from 1025221 to 964365 bytes) The saving is around ~60K. Please share your comments.

Note:-
1) I haven't tested the RFC changes on r-car boards due to unavailability of the boards.
2) Optimization is based on the fact that some pins are not enabled in board dts(like DRIF,MSIOF etc..)

u-boot-sh\next
--------------

$ size drivers/pinctrl/renesas/*.o
   text	   data	    bss	    dec	    hex	filename
 151332	    288	      1	 151621	  25045	drivers/pinctrl/renesas/built-in.o
   3811	    288	      1	   4100	   1004	drivers/pinctrl/renesas/pfc.o
  48123	      0	      0	  48123	   bbfb	drivers/pinctrl/renesas/pfc-r8a7795.o
  47939	      0	      0	  47939	   bb43	drivers/pinctrl/renesas/pfc-r8a77965.o
  47751	      0	      0	  47751	   ba87	drivers/pinctrl/renesas/pfc-r8a7796.o
$ ls -al u-boot.bin 
-rw-r--r-- 1 biju biju 1025221 Oct 28 08:48 u-boot.bin
$ size u-boot
   text	   data	    bss	    dec	    hex	filename
 942336	  36208	  71632	1050176	 100640	u-boot

After Applying patch 1-5
----------------------

$ size drivers/pinctrl/renesas/*.o
   text	   data	    bss	    dec	    hex	filename
 151868	    288	      1	 152157	  2525d	drivers/pinctrl/renesas/built-in.o
   3811	    288	      1	   4100	   1004	drivers/pinctrl/renesas/pfc.o
  48375	      0	      0	  48375	   bcf7	drivers/pinctrl/renesas/pfc-r8a7795.o
  48191	      0	      0	  48191	   bc3f	drivers/pinctrl/renesas/pfc-r8a77965.o
  47751	      0	      0	  47751	   ba87	drivers/pinctrl/renesas/pfc-r8a7796.o
$ ls -al u-boot.bin 
-rw-r--r-- 1 biju biju 1026621 Oct 28 08:42 u-boot.bin
$ size u-boot
   text	   data	    bss	    dec	    hex	filename
 943732	  36208	  71632	1051572	 100bb4	u-boot

After applying RFC patches
--------------------------

$ size drivers/pinctrl/renesas/*.o
   text	   data	    bss	    dec	    hex	filename
 125310	    288	      1	 125599	  1ea9f	drivers/pinctrl/renesas/built-in.o
   3811	    288	      1	   4100	   1004	drivers/pinctrl/renesas/pfc.o
  40157	      0	      0	  40157	   9cdd	drivers/pinctrl/renesas/pfc-r8a7795.o
  39973	      0	      0	  39973	   9c25	drivers/pinctrl/renesas/pfc-r8a77965.o
  39533	      0	      0	  39533	   9a6d	drivers/pinctrl/renesas/pfc-r8a7796.o
$ ls -al u-boot.bin 
-rw-r--r-- 1 biju biju 964365 Oct 28 09:32 u-boot.bin
$ size u-boot
   text	   data	    bss	    dec	    hex	filename
 881478	  36208	  71632	 989318	  f1886	u-boot

Biju Das (8):
pinctrl: renesas: r8a77965: Add R8A774B1 PFC support
pinctrl: renesas: r8a77951: Add R8A774E1 PFC support
pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A774A1
pinctrl: renesas: r8a77965: Optimize pinctrl image size for R8A774B1
pinctrl: renesas: r8a7795: Optimize pinctrl image size for R8A774E1
pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A7796
pinctrl: renesas: r8a77965: Optimize pinctrl image size for R8A77965
pinctrl: renesas: r8a7795: Optimize pinctrl image size for R8A7795

 arch/arm/mach-rmobile/Kconfig.64       |   2 +
 drivers/pinctrl/renesas/Kconfig        |  26 +
 drivers/pinctrl/renesas/Makefile       |   2 +
 drivers/pinctrl/renesas/pfc-r8a7795.c  | 939 ++++++++++++++-----------
 drivers/pinctrl/renesas/pfc-r8a7796.c  |  36 +
 drivers/pinctrl/renesas/pfc-r8a77965.c | 931 +++++++++++++-----------
 drivers/pinctrl/renesas/pfc.c          |  22 +
 drivers/pinctrl/renesas/sh_pfc.h       |   2 +
 8 files changed, 1146 insertions(+), 814 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/8 pinctrl: renesas: r8a77965: Add R8A774B1 PFC support

Renesas RZ/G2N (r8a774b1) is pin compatible with R-Car M3-N (r8a77965), however it doesn't have several automotive specific peripherals. Add a r8a77965 specific pin groups/functions along with common pin groups/functions for supporting both r8a77965 and r8a774b1 SoC.

PFC changes are synced from mainline linux-5.9 commit bbf5c979011a ("Linux 5.9").

---
 arch/arm/mach-rmobile/Kconfig.64       |   1 +
 drivers/pinctrl/renesas/Kconfig        |  10 +
 drivers/pinctrl/renesas/Makefile       |   1 +
 drivers/pinctrl/renesas/pfc-r8a77965.c | 895 ++++++++++++++-----------
 drivers/pinctrl/renesas/pfc.c          |  11 +
 drivers/pinctrl/renesas/sh_pfc.h       |   1 +
 6 files changed, 514 insertions(+), 405 deletions(-)
arch/arm/mach-rmobile/Kconfig.64 +1 -0
index be3ea3c1a9..91aa4ddbae 100644
@@ -8,6 +8,7 @@ config R8A774A1
 config R8A774B1
 	bool "Renesas SoC R8A774B1"
 	imply CLK_R8A774B1
+	imply PINCTRL_PFC_R8A774B1
 
 config R8A774C0
 	bool "Renesas SoC R8A774C0"
drivers/pinctrl/renesas/Kconfig +10 -0
index e14294b6e7..0d839eecad 100644
@@ -67,6 +67,16 @@ config PINCTRL_PFC_R8A774A1
           the GPIO definitions and pin control functions for each available
           multiplex function.
 
+config PINCTRL_PFC_R8A774B1
+        bool "Renesas RZ/G2 R8A774B1 pin control driver"
+        depends on PINCTRL_PFC
+        help
+          Support pin multiplexing control on Renesas RZ/G2N R8A774B1 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_R8A7795
 	bool "Renesas RCar Gen3 R8A7795 pin control driver"
 	depends on PINCTRL_PFC
drivers/pinctrl/renesas/Makefile +1 -0
index a4eb912d54..59dfd05b2c 100644
@@ -1,5 +1,6 @@
 obj-$(CONFIG_PINCTRL_PFC) += pfc.o
 obj-$(CONFIG_PINCTRL_PFC_R8A774A1) += pfc-r8a7796.o
+obj-$(CONFIG_PINCTRL_PFC_R8A774B1) += pfc-r8a77965.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7791) += pfc-r8a7791.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o
drivers/pinctrl/renesas/pfc-r8a77965.c +490 -405

940 lines not on this page · raw message

drivers/pinctrl/renesas/pfc.c +11 -0
index 7183b11808..568ed3e7df 100644
@@ -33,6 +33,7 @@ enum sh_pfc_model {
 	SH_PFC_R8A7795,
 	SH_PFC_R8A7796,
 	SH_PFC_R8A774A1,
+	SH_PFC_R8A774B1,
 	SH_PFC_R8A77965,
 	SH_PFC_R8A77970,
 	SH_PFC_R8A77980,
@@ -858,6 +859,10 @@ static int sh_pfc_pinctrl_probe(struct udevice *dev)
 	if (model == SH_PFC_R8A774A1)
 		priv->pfc.info = &r8a774a1_pinmux_info;
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774B1
+	if (model == SH_PFC_R8A774B1)
+		priv->pfc.info = &r8a774b1_pinmux_info;
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	if (model == SH_PFC_R8A77965)
 		priv->pfc.info = &r8a77965_pinmux_info;
@@ -935,6 +940,12 @@ static const struct udevice_id sh_pfc_pinctrl_ids[] = {
 		.data = SH_PFC_R8A774A1,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774B1
+	{
+		.compatible = "renesas,pfc-r8a774b1",
+		.data = SH_PFC_R8A774B1,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	{
 		.compatible = "renesas,pfc-r8a77965",
drivers/pinctrl/renesas/sh_pfc.h +1 -0
index 81c0179948..f5cf31d26f 100644
@@ -294,6 +294,7 @@ sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
 		       unsigned int *bit);
 
 extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
+extern const struct sh_pfc_soc_info r8a774b1_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7791_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7792_pinmux_info;
Signature · 1 line
2.17.1
Applied
#2 lore raw

PATCH 1/8 pinctrl: renesas: r8a77965: Add R8A774B1 PFC support

Quoted 7 lines · Biju Das

Renesas RZ/G2N (r8a774b1) is pin compatible with R-Car M3-N (r8a77965), however it doesn't have several automotive specific peripherals. Add a r8a77965 specific pin groups/functions along with common pin groups/functions for supporting both r8a77965 and r8a774b1 SoC.

PFC changes are synced from mainline linux-5.9 commit bbf5c979011a ("Linux 5.9").

Applied, thanks

author
#3 lore raw

PATCH 2/8 pinctrl: renesas: r8a77951: Add R8A774E1 PFC support

In reply to Biju Das

Renesas RZ/G2H (r8a774e1) is pin compatible with R-Car H3 (r8a77951), however it doesn't have several automotive specific peripherals. Add a r8a77951 specific pin groups/functions along with common pin groups/functions for supporting both r8a77951 and r8a774e1 SoC.

PFC changes are synced from mainline linux-5.9 commit bbf5c979011a ("Linux 5.9").

---
 arch/arm/mach-rmobile/Kconfig.64      |   1 +
 drivers/pinctrl/renesas/Kconfig       |  10 +
 drivers/pinctrl/renesas/Makefile      |   1 +
 drivers/pinctrl/renesas/pfc-r8a7795.c | 905 ++++++++++++++------------
 drivers/pinctrl/renesas/pfc.c         |  11 +
 drivers/pinctrl/renesas/sh_pfc.h      |   1 +
 6 files changed, 520 insertions(+), 409 deletions(-)
arch/arm/mach-rmobile/Kconfig.64 +1 -0
index 91aa4ddbae..0ef6cf619b 100644
@@ -17,6 +17,7 @@ config R8A774C0
 config R8A774E1
 	bool "Renesas SoC R8A774E1"
 	imply CLK_R8A774E1
+	imply PINCTRL_PFC_R8A774E1
 
 config R8A7795
 	bool "Renesas SoC R8A7795"
drivers/pinctrl/renesas/Kconfig +10 -0
index 0d839eecad..d2be4c84ba 100644
@@ -77,6 +77,16 @@ config PINCTRL_PFC_R8A774B1
           the GPIO definitions and pin control functions for each available
           multiplex function.
 
+config PINCTRL_PFC_R8A774E1
+        bool "Renesas RZ/G2 R8A774E1 pin control driver"
+        depends on PINCTRL_PFC
+        help
+          Support pin multiplexing control on Renesas RZ/G2H R8A774E1 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_R8A7795
 	bool "Renesas RCar Gen3 R8A7795 pin control driver"
 	depends on PINCTRL_PFC
drivers/pinctrl/renesas/Makefile +1 -0
index 59dfd05b2c..1d00752051 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_PINCTRL_PFC) += pfc.o
 obj-$(CONFIG_PINCTRL_PFC_R8A774A1) += pfc-r8a7796.o
 obj-$(CONFIG_PINCTRL_PFC_R8A774B1) += pfc-r8a77965.o
+obj-$(CONFIG_PINCTRL_PFC_R8A774E1) += pfc-r8a7795.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7791) += pfc-r8a7791.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7792) += pfc-r8a7792.o
drivers/pinctrl/renesas/pfc-r8a7795.c +496 -409

950 lines not on this page · raw message

drivers/pinctrl/renesas/pfc.c +11 -0
index 568ed3e7df..db0fa9b728 100644
@@ -34,6 +34,7 @@ enum sh_pfc_model {
 	SH_PFC_R8A7796,
 	SH_PFC_R8A774A1,
 	SH_PFC_R8A774B1,
+	SH_PFC_R8A774E1,
 	SH_PFC_R8A77965,
 	SH_PFC_R8A77970,
 	SH_PFC_R8A77980,
@@ -863,6 +864,10 @@ static int sh_pfc_pinctrl_probe(struct udevice *dev)
 	if (model == SH_PFC_R8A774B1)
 		priv->pfc.info = &r8a774b1_pinmux_info;
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774E1
+	if (model == SH_PFC_R8A774E1)
+		priv->pfc.info = &r8a774e1_pinmux_info;
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	if (model == SH_PFC_R8A77965)
 		priv->pfc.info = &r8a77965_pinmux_info;
@@ -946,6 +951,12 @@ static const struct udevice_id sh_pfc_pinctrl_ids[] = {
 		.data = SH_PFC_R8A774B1,
 	},
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A774E1
+	{
+		.compatible = "renesas,pfc-r8a774e1",
+		.data = SH_PFC_R8A774E1,
+	},
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77965
 	{
 		.compatible = "renesas,pfc-r8a77965",
drivers/pinctrl/renesas/sh_pfc.h +1 -0
index f5cf31d26f..22cc860f29 100644
@@ -295,6 +295,7 @@ sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
 
 extern const struct sh_pfc_soc_info r8a774a1_pinmux_info;
 extern const struct sh_pfc_soc_info r8a774b1_pinmux_info;
+extern const struct sh_pfc_soc_info r8a774e1_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7791_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7792_pinmux_info;
Signature · 1 line
2.17.1
Applied
#4 lore raw

PATCH 2/8 pinctrl: renesas: r8a77951: Add R8A774E1 PFC support

Quoted 7 lines · Biju Das

Renesas RZ/G2H (r8a774e1) is pin compatible with R-Car H3 (r8a77951), however it doesn't have several automotive specific peripherals. Add a r8a77951 specific pin groups/functions along with common pin groups/functions for supporting both r8a77951 and r8a774e1 SoC.

PFC changes are synced from mainline linux-5.9 commit bbf5c979011a ("Linux 5.9").

Applied, thanks

author
#5 lore raw

PATCH 3/8 pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A774A1

In reply to Biju Das

This driver supports both RZ/G2M and R-Car M3-W/W+ SoCs. Optimize pinctrl image size for RZ/G2M, when support for R-Car M3-W/W+ (R8A7796[01]) is not enabled.

Based on the similar patch on Linux.

---
 drivers/pinctrl/renesas/pfc-r8a7796.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pinctrl/renesas/pfc-r8a7796.c +12 -0
index a92c8ad18c..da7901ea6e 100644
@@ -1841,6 +1841,7 @@ static const unsigned int canfd1_data_mux[] = {
 	CANFD1_TX_MARK,         CANFD1_RX_MARK,
 };
 
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 /* - DRIF0 --------------------------------------------------------------- */
 static const unsigned int drif0_ctrl_a_pins[] = {
 	/* CLK, SYNC */
@@ -2055,6 +2056,7 @@ static const unsigned int drif3_data1_b_pins[] = {
 static const unsigned int drif3_data1_b_mux[] = {
 	RIF3_D1_B_MARK,
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A7796 */
 
 /* - DU --------------------------------------------------------------------- */
 static const unsigned int du_rgb666_pins[] = {
@@ -4113,7 +4115,9 @@ static const unsigned int vin5_clk_mux[] = {
 
 static const struct {
 	struct sh_pfc_pin_group common[312];
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 	struct sh_pfc_pin_group automotive[30];
+#endif
 } pinmux_groups = {
 	.common = {
 		SH_PFC_PIN_GROUP(audio_clk_a_a),
@@ -4429,6 +4433,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(vin5_clkenb),
 		SH_PFC_PIN_GROUP(vin5_clk),
 	},
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 	.automotive = {
 		SH_PFC_PIN_GROUP(drif0_ctrl_a),
 		SH_PFC_PIN_GROUP(drif0_data0_a),
@@ -4461,6 +4466,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(drif3_data0_b),
 		SH_PFC_PIN_GROUP(drif3_data1_b),
 	}
+#endif /* CONFIG_PINCTRL_PFC_R8A7796 */
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4519,6 +4525,7 @@ static const char * const canfd1_groups[] = {
 	"canfd1_data",
 };
 
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 static const char * const drif0_groups[] = {
 	"drif0_ctrl_a",
 	"drif0_data0_a",
@@ -4560,6 +4567,7 @@ static const char * const drif3_groups[] = {
 	"drif3_data0_b",
 	"drif3_data1_b",
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A7796 */
 
 static const char * const du_groups[] = {
 	"du_rgb666",
@@ -4966,7 +4974,9 @@ static const char * const vin5_groups[] = {
 
 static const struct {
 	struct sh_pfc_function common[49];
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 	struct sh_pfc_function automotive[4];
+#endif
 } pinmux_functions = {
 	.common = {
 		SH_PFC_FUNCTION(audio_clk),
@@ -5019,12 +5029,14 @@ static const struct {
 		SH_PFC_FUNCTION(vin4),
 		SH_PFC_FUNCTION(vin5),
 	},
+#if defined(CONFIG_PINCTRL_PFC_R8A7796)
 	.automotive = {
 		SH_PFC_FUNCTION(drif0),
 		SH_PFC_FUNCTION(drif1),
 		SH_PFC_FUNCTION(drif2),
 		SH_PFC_FUNCTION(drif3),
 	}
+#endif /* CONFIG_PINCTRL_PFC_R8A7796 */
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
Signature · 1 line
2.17.1
Applied
#6 lore raw

PATCH 3/8 pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A774A1

Quoted 5 lines · Biju Das

This driver supports both RZ/G2M and R-Car M3-W/W+ SoCs. Optimize pinctrl image size for RZ/G2M, when support for R-Car M3-W/W+ (R8A7796[01]) is not enabled.

Based on the similar patch on Linux.

Is this patch now part of mainline Linux or is there a patchwork link?

Applied, thanks

author
#7 lore raw

PATCH 3/8 pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A774A1

Hi Marek,

Quoted 11 lines

Subject: Re: [PATCH 3/8] pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A774A1

Quoted 5 lines · Biju Das

This driver supports both RZ/G2M and R-Car M3-W/W+ SoCs. Optimize pinctrl image size for RZ/G2M, when support for R-Car M3-W/W+ (R8A7796[01]) is not enabled.

Based on the similar patch on Linux.

Is this patch now part of mainline Linux or is there a patchwork link?

This patch [1] is accepted by Renesas kernel maintainer and is hit on Renesas drivers linux kernel tree.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/commit/?h=renesas-pinctrl&id=ea750cfbb81cc45dee6fcb70b2f36db858f2d3ee

Regards,
Biju

Quoted 1 line

Applied, thanks

author
#8 lore raw

PATCH 4/8 pinctrl: renesas: r8a77965: Optimize pinctrl image size for R8A774B1

In reply to Biju Das

This driver supports both RZ/G2N and R-Car M3-N SoCs. Optimize pinctrl image size for RZ/G2N, when support for R-Car M3-N (R8A77965) is not enabled.

Based on the simialr patch on Linux.

---
 drivers/pinctrl/renesas/pfc-r8a77965.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pinctrl/renesas/pfc-r8a77965.c +12 -0
index 387330e4a3..d143750c2d 100644
@@ -1857,6 +1857,7 @@ static const unsigned int canfd1_data_mux[] = {
 	CANFD1_TX_MARK,         CANFD1_RX_MARK,
 };
 
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 /* - DRIF0 --------------------------------------------------------------- */
 static const unsigned int drif0_ctrl_a_pins[] = {
 	/* CLK, SYNC */
@@ -2130,6 +2131,7 @@ static const unsigned int drif3_data1_b_pins[] = {
 static const unsigned int drif3_data1_b_mux[] = {
 	RIF3_D1_B_MARK,
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
 
 /* - DU --------------------------------------------------------------------- */
 static const unsigned int du_rgb666_pins[] = {
@@ -4390,7 +4392,9 @@ static const unsigned int vin5_clk_mux[] = {
 
 static const struct {
 	struct sh_pfc_pin_group common[318];
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 	struct sh_pfc_pin_group automotive[30];
+#endif
 } pinmux_groups = {
 	.common = {
 		SH_PFC_PIN_GROUP(audio_clk_a_a),
@@ -4712,6 +4716,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(vin5_clkenb),
 		SH_PFC_PIN_GROUP(vin5_clk),
 	},
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 	.automotive = {
 		SH_PFC_PIN_GROUP(drif0_ctrl_a),
 		SH_PFC_PIN_GROUP(drif0_data0_a),
@@ -4744,6 +4749,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(drif3_data0_b),
 		SH_PFC_PIN_GROUP(drif3_data1_b),
 	}
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4802,6 +4808,7 @@ static const char * const canfd1_groups[] = {
 	"canfd1_data",
 };
 
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 static const char * const drif0_groups[] = {
 	"drif0_ctrl_a",
 	"drif0_data0_a",
@@ -4843,6 +4850,7 @@ static const char * const drif3_groups[] = {
 	"drif3_data0_b",
 	"drif3_data1_b",
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
 
 static const char * const du_groups[] = {
 	"du_rgb666",
@@ -5260,7 +5268,9 @@ static const char * const vin5_groups[] = {
 
 static const struct {
 	struct sh_pfc_function common[51];
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 	struct sh_pfc_function automotive[4];
+#endif
 } pinmux_functions = {
 	.common = {
 		SH_PFC_FUNCTION(audio_clk),
@@ -5315,12 +5325,14 @@ static const struct {
 		SH_PFC_FUNCTION(vin4),
 		SH_PFC_FUNCTION(vin5),
 	},
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
 	.automotive = {
 		SH_PFC_FUNCTION(drif0),
 		SH_PFC_FUNCTION(drif1),
 		SH_PFC_FUNCTION(drif2),
 		SH_PFC_FUNCTION(drif3),
 	}
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
Signature · 1 line
2.17.1
Applied
#9 lore raw

PATCH 4/8 pinctrl: renesas: r8a77965: Optimize pinctrl image size for R8A774B1

Quoted 5 lines · Biju Das

This driver supports both RZ/G2N and R-Car M3-N SoCs. Optimize pinctrl image size for RZ/G2N, when support for R-Car M3-N (R8A77965) is not enabled.

Based on the simialr patch on Linux.

Applied, thanks

author
#10 lore raw

PATCH 5/8 pinctrl: renesas: r8a7795: Optimize pinctrl image size for R8A774E1

In reply to Biju Das

This driver supports both RZ/G2H and R-Car H3 SoCs. Optimize pinctrl image size for RZ/G2H, when support for R-Car H3 (R8A7795) is not enabled

Based on the similar patch on Linux.

---
 drivers/pinctrl/renesas/pfc-r8a7795.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/pinctrl/renesas/pfc-r8a7795.c +12 -2
index b787c4883a..898f837950 100644
@@ -1836,6 +1836,7 @@ static const unsigned int canfd1_data_mux[] = {
 	CANFD1_TX_MARK,         CANFD1_RX_MARK,
 };
 
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 /* - DRIF0 --------------------------------------------------------------- */
 static const unsigned int drif0_ctrl_a_pins[] = {
 	/* CLK, SYNC */
@@ -2050,6 +2051,7 @@ static const unsigned int drif3_data1_b_pins[] = {
 static const unsigned int drif3_data1_b_mux[] = {
 	RIF3_D1_B_MARK,
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
 
 /* - DU --------------------------------------------------------------------- */
 static const unsigned int du_rgb666_pins[] = {
@@ -4168,7 +4170,9 @@ static const unsigned int vin5_clk_mux[] = {
 
 static const struct {
 	struct sh_pfc_pin_group common[320];
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 	struct sh_pfc_pin_group automotive[30];
+#endif
 } pinmux_groups = {
 	.common = {
 		SH_PFC_PIN_GROUP(audio_clk_a_a),
@@ -4492,6 +4496,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(vin5_clkenb),
 		SH_PFC_PIN_GROUP(vin5_clk),
 	},
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 	.automotive = {
 		SH_PFC_PIN_GROUP(drif0_ctrl_a),
 		SH_PFC_PIN_GROUP(drif0_data0_a),
@@ -4524,7 +4529,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(drif3_data0_b),
 		SH_PFC_PIN_GROUP(drif3_data1_b),
 	}
-
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4583,6 +4588,7 @@ static const char * const canfd1_groups[] = {
 	"canfd1_data",
 };
 
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 static const char * const drif0_groups[] = {
 	"drif0_ctrl_a",
 	"drif0_data0_a",
@@ -4624,6 +4630,7 @@ static const char * const drif3_groups[] = {
 	"drif3_data0_b",
 	"drif3_data1_b",
 };
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
 
 static const char * const du_groups[] = {
 	"du_rgb666",
@@ -5050,7 +5057,9 @@ static const char * const vin5_groups[] = {
 
 static const struct {
 	struct sh_pfc_function common[53];
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 	struct sh_pfc_function automotive[4];
+#endif
 } pinmux_functions = {
 	.common = {
 		SH_PFC_FUNCTION(audio_clk),
@@ -5107,13 +5116,14 @@ static const struct {
 		SH_PFC_FUNCTION(vin4),
 		SH_PFC_FUNCTION(vin5),
 	},
+#ifdef CONFIG_PINCTRL_PFC_R8A7795
 	.automotive = {
 		SH_PFC_FUNCTION(drif0),
 		SH_PFC_FUNCTION(drif1),
 		SH_PFC_FUNCTION(drif2),
 		SH_PFC_FUNCTION(drif3),
 	}
-
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
Signature · 1 line
2.17.1
Applied
#11 lore raw

PATCH 5/8 pinctrl: renesas: r8a7795: Optimize pinctrl image size for R8A774E1

Quoted 5 lines · Biju Das

This driver supports both RZ/G2H and R-Car H3 SoCs. Optimize pinctrl image size for RZ/G2H, when support for R-Car H3 (R8A7795) is not enabled

Based on the similar patch on Linux.

Applied, thanks

author
#12 lore raw

RFC PATCH 6/8 pinctrl: renesas: r8a7796: Optimize pinctrl image size for R8A7796

In reply to Biju Das

Optimize pinctrl image size by disabling pins which are not used by u-boot (ie, not enabled in board dts file)

---
 drivers/pinctrl/renesas/Kconfig       |  6 ++++
 drivers/pinctrl/renesas/pfc-r8a7796.c | 44 +++++++++++++++++++++------
 2 files changed, 40 insertions(+), 10 deletions(-)
drivers/pinctrl/renesas/Kconfig +6 -0
index d2be4c84ba..9a651c6280 100644
@@ -7,6 +7,12 @@ config PINCTRL_PFC
 	help
 	  Enable support for clock present on Renesas RCar SoCs.
 
+config PINCTRL_PFC_EXTRAS
+        bool "Renesas pin control options for enabling extras"
+        depends on PINCTRL_PFC
+        help
+          Options for enabling pin control extras.
+
 config PINCTRL_PFC_R8A7790
 	bool "Renesas RCar Gen2 R8A7790 pin control driver"
 	depends on PINCTRL_PFC
drivers/pinctrl/renesas/pfc-r8a7796.c +34 -10

167 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#13 lore raw

RFC PATCH 7/8 pinctrl: renesas: r8a77965: Optimize pinctrl image size for R8A77965

In reply to Biju Das

Optimize pinctrl image size by disabling pins which are not used by u-boot (ie, not enabled in board dts file).

---
 drivers/pinctrl/renesas/pfc-r8a77965.c | 48 +++++++++++++++++++-------
 1 file changed, 36 insertions(+), 12 deletions(-)
drivers/pinctrl/renesas/pfc-r8a77965.c +36 -12
index d143750c2d..f8ad66841f 100644
@@ -1857,7 +1857,7 @@ static const unsigned int canfd1_data_mux[] = {
 	CANFD1_TX_MARK,         CANFD1_RX_MARK,
 };
 
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 /* - DRIF0 --------------------------------------------------------------- */
 static const unsigned int drif0_ctrl_a_pins[] = {
 	/* CLK, SYNC */
@@ -2131,7 +2131,7 @@ static const unsigned int drif3_data1_b_pins[] = {
 static const unsigned int drif3_data1_b_mux[] = {
 	RIF3_D1_B_MARK,
 };
-#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 && CONFIG_PINCTRL_PFC_EXTRAS */
 
 /* - DU --------------------------------------------------------------------- */
 static const unsigned int du_rgb666_pins[] = {
@@ -2621,6 +2621,7 @@ static const unsigned int intc_ex_irq5_mux[] = {
 	IRQ5_MARK,
 };
 
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 /* - MSIOF0 ----------------------------------------------------------------- */
 static const unsigned int msiof0_clk_pins[] = {
 	/* SCK */
@@ -3318,6 +3319,7 @@ static const unsigned int msiof3_rxd_e_pins[] = {
 static const unsigned int msiof3_rxd_e_mux[] = {
 	MSIOF3_RXD_E_MARK,
 };
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 
 /* - PWM0 --------------------------------------------------------------------*/
 static const unsigned int pwm0_pins[] = {
@@ -4391,10 +4393,14 @@ static const unsigned int vin5_clk_mux[] = {
 };
 
 static const struct {
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	struct sh_pfc_pin_group common[318];
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965)
 	struct sh_pfc_pin_group automotive[30];
-#endif
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#else  /* CONFIG_PINCTRL_PFC_EXTRAS */
+	struct sh_pfc_pin_group common[219];
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 } pinmux_groups = {
 	.common = {
 		SH_PFC_PIN_GROUP(audio_clk_a_a),
@@ -4484,6 +4490,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(intc_ex_irq3),
 		SH_PFC_PIN_GROUP(intc_ex_irq4),
 		SH_PFC_PIN_GROUP(intc_ex_irq5),
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 		SH_PFC_PIN_GROUP(msiof0_clk),
 		SH_PFC_PIN_GROUP(msiof0_sync),
 		SH_PFC_PIN_GROUP(msiof0_ss1),
@@ -4583,6 +4590,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(msiof3_ss2_e),
 		SH_PFC_PIN_GROUP(msiof3_txd_e),
 		SH_PFC_PIN_GROUP(msiof3_rxd_e),
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 		SH_PFC_PIN_GROUP(pwm0),
 		SH_PFC_PIN_GROUP(pwm1_a),
 		SH_PFC_PIN_GROUP(pwm1_b),
@@ -4716,7 +4724,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(vin5_clkenb),
 		SH_PFC_PIN_GROUP(vin5_clk),
 	},
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.automotive = {
 		SH_PFC_PIN_GROUP(drif0_ctrl_a),
 		SH_PFC_PIN_GROUP(drif0_data0_a),
@@ -4749,7 +4757,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(drif3_data0_b),
 		SH_PFC_PIN_GROUP(drif3_data1_b),
 	}
-#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 && CONFIG_PINCTRL_PFC_EXTRAS */
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4808,7 +4816,7 @@ static const char * const canfd1_groups[] = {
 	"canfd1_data",
 };
 
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 static const char * const drif0_groups[] = {
 	"drif0_ctrl_a",
 	"drif0_data0_a",
@@ -4850,7 +4858,7 @@ static const char * const drif3_groups[] = {
 	"drif3_data0_b",
 	"drif3_data1_b",
 };
-#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 && CONFIG_PINCTRL_PFC_EXTRAS */
 
 static const char * const du_groups[] = {
 	"du_rgb666",
@@ -4943,6 +4951,7 @@ static const char * const intc_ex_groups[] = {
 	"intc_ex_irq5",
 };
 
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 static const char * const msiof0_groups[] = {
 	"msiof0_clk",
 	"msiof0_sync",
@@ -5053,6 +5062,7 @@ static const char * const msiof3_groups[] = {
 	"msiof3_txd_e",
 	"msiof3_rxd_e",
 };
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 
 static const char * const pwm0_groups[] = {
 	"pwm0",
@@ -5267,10 +5277,14 @@ static const char * const vin5_groups[] = {
 };
 
 static const struct {
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	struct sh_pfc_function common[51];
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965)
 	struct sh_pfc_function automotive[4];
-#endif
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#else /* CONFIG_PINCTRL_PFC_EXTRAS */
+	struct sh_pfc_function common[47];
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 } pinmux_functions = {
 	.common = {
 		SH_PFC_FUNCTION(audio_clk),
@@ -5293,10 +5307,12 @@ static const struct {
 		SH_PFC_FUNCTION(i2c5),
 		SH_PFC_FUNCTION(i2c6),
 		SH_PFC_FUNCTION(intc_ex),
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 		SH_PFC_FUNCTION(msiof0),
 		SH_PFC_FUNCTION(msiof1),
 		SH_PFC_FUNCTION(msiof2),
 		SH_PFC_FUNCTION(msiof3),
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 		SH_PFC_FUNCTION(pwm0),
 		SH_PFC_FUNCTION(pwm1),
 		SH_PFC_FUNCTION(pwm2),
@@ -5325,14 +5341,14 @@ static const struct {
 		SH_PFC_FUNCTION(vin4),
 		SH_PFC_FUNCTION(vin5),
 	},
-#ifdef CONFIG_PINCTRL_PFC_R8A77965
+#if defined(CONFIG_PINCTRL_PFC_R8A77965) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.automotive = {
 		SH_PFC_FUNCTION(drif0),
 		SH_PFC_FUNCTION(drif1),
 		SH_PFC_FUNCTION(drif2),
 		SH_PFC_FUNCTION(drif3),
 	}
-#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
+#endif /* CONFIG_PINCTRL_PFC_R8A77965 && CONFIG_PINCTRL_PFC_EXTRAS */
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -6497,11 +6513,19 @@ const struct sh_pfc_soc_info r8a77965_pinmux_info = {
 	.pins = pinmux_pins,
 	.nr_pins = ARRAY_SIZE(pinmux_pins),
 	.groups = pinmux_groups.common,
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.nr_groups = ARRAY_SIZE(pinmux_groups.common) +
 		ARRAY_SIZE(pinmux_groups.automotive),
+#else
+	.nr_groups = ARRAY_SIZE(pinmux_groups.common),
+#endif
 	.functions = pinmux_functions.common,
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.nr_functions = ARRAY_SIZE(pinmux_functions.common) +
 		ARRAY_SIZE(pinmux_functions.automotive),
+#else
+	.nr_functions = ARRAY_SIZE(pinmux_functions.common),
+#endif
 
 	.cfg_regs = pinmux_config_regs,
 	.drive_regs = pinmux_drive_regs,
Signature · 1 line
2.17.1
author
#14 lore raw

RFC PATCH 8/8 pinctrl: renesas: r8a7795: Optimize pinctrl image size for R8A7795

In reply to Biju Das

Optimize pinctrl image size by disabling pins which are not used by u-boot(ie, not enabled in board dts file).

---
 drivers/pinctrl/renesas/pfc-r8a7795.c | 52 +++++++++++++++++++--------
 1 file changed, 38 insertions(+), 14 deletions(-)
drivers/pinctrl/renesas/pfc-r8a7795.c +38 -14
index 898f837950..eb178494a9 100644
@@ -1836,7 +1836,7 @@ static const unsigned int canfd1_data_mux[] = {
 	CANFD1_TX_MARK,         CANFD1_RX_MARK,
 };
 
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 /* - DRIF0 --------------------------------------------------------------- */
 static const unsigned int drif0_ctrl_a_pins[] = {
 	/* CLK, SYNC */
@@ -2051,7 +2051,7 @@ static const unsigned int drif3_data1_b_pins[] = {
 static const unsigned int drif3_data1_b_mux[] = {
 	RIF3_D1_B_MARK,
 };
-#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 && CONFIG_PINCTRL_PFC_EXTRAS */
 
 /* - DU --------------------------------------------------------------------- */
 static const unsigned int du_rgb666_pins[] = {
@@ -2464,6 +2464,7 @@ static const unsigned int intc_ex_irq5_mux[] = {
 	IRQ5_MARK,
 };
 
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 /* - MSIOF0 ----------------------------------------------------------------- */
 static const unsigned int msiof0_clk_pins[] = {
 	/* SCK */
@@ -3161,6 +3162,7 @@ static const unsigned int msiof3_rxd_e_pins[] = {
 static const unsigned int msiof3_rxd_e_mux[] = {
 	MSIOF3_RXD_E_MARK,
 };
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 
 /* - PWM0 --------------------------------------------------------------------*/
 static const unsigned int pwm0_pins[] = {
@@ -4169,10 +4171,14 @@ static const unsigned int vin5_clk_mux[] = {
 };
 
 static const struct {
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	struct sh_pfc_pin_group common[320];
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795)
 	struct sh_pfc_pin_group automotive[30];
-#endif
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
+#else  /* CONFIG_PINCTRL_PFC_EXTRAS */
+	struct sh_pfc_pin_group common[221];
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 } pinmux_groups = {
 	.common = {
 		SH_PFC_PIN_GROUP(audio_clk_a_a),
@@ -4262,6 +4268,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(intc_ex_irq3),
 		SH_PFC_PIN_GROUP(intc_ex_irq4),
 		SH_PFC_PIN_GROUP(intc_ex_irq5),
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 		SH_PFC_PIN_GROUP(msiof0_clk),
 		SH_PFC_PIN_GROUP(msiof0_sync),
 		SH_PFC_PIN_GROUP(msiof0_ss1),
@@ -4361,6 +4368,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(msiof3_ss2_e),
 		SH_PFC_PIN_GROUP(msiof3_txd_e),
 		SH_PFC_PIN_GROUP(msiof3_rxd_e),
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 		SH_PFC_PIN_GROUP(pwm0),
 		SH_PFC_PIN_GROUP(pwm1_a),
 		SH_PFC_PIN_GROUP(pwm1_b),
@@ -4496,7 +4504,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(vin5_clkenb),
 		SH_PFC_PIN_GROUP(vin5_clk),
 	},
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.automotive = {
 		SH_PFC_PIN_GROUP(drif0_ctrl_a),
 		SH_PFC_PIN_GROUP(drif0_data0_a),
@@ -4529,7 +4537,7 @@ static const struct {
 		SH_PFC_PIN_GROUP(drif3_data0_b),
 		SH_PFC_PIN_GROUP(drif3_data1_b),
 	}
-#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 && CONFIG_PINCTRL_PFC_EXTRAS */
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4588,7 +4596,7 @@ static const char * const canfd1_groups[] = {
 	"canfd1_data",
 };
 
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 static const char * const drif0_groups[] = {
 	"drif0_ctrl_a",
 	"drif0_data0_a",
@@ -4630,7 +4638,7 @@ static const char * const drif3_groups[] = {
 	"drif3_data0_b",
 	"drif3_data1_b",
 };
-#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 && CONFIG_PINCTRL_PFC_EXTRAS */
 
 static const char * const du_groups[] = {
 	"du_rgb666",
@@ -4723,6 +4731,7 @@ static const char * const intc_ex_groups[] = {
 	"intc_ex_irq5",
 };
 
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 static const char * const msiof0_groups[] = {
 	"msiof0_clk",
 	"msiof0_sync",
@@ -4833,6 +4842,7 @@ static const char * const msiof3_groups[] = {
 	"msiof3_txd_e",
 	"msiof3_rxd_e",
 };
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 
 static const char * const pwm0_groups[] = {
 	"pwm0",
@@ -5056,10 +5066,14 @@ static const char * const vin5_groups[] = {
 };
 
 static const struct {
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	struct sh_pfc_function common[53];
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795)
 	struct sh_pfc_function automotive[4];
-#endif
+#endif  /* CONFIG_PINCTRL_PFC_R8A7795 */
+#else /* CONFIG_PINCTRL_PFC_EXTRAS */
+	struct sh_pfc_function common[49];
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 } pinmux_functions = {
 	.common = {
 		SH_PFC_FUNCTION(audio_clk),
@@ -5082,10 +5096,12 @@ static const struct {
 		SH_PFC_FUNCTION(i2c5),
 		SH_PFC_FUNCTION(i2c6),
 		SH_PFC_FUNCTION(intc_ex),
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 		SH_PFC_FUNCTION(msiof0),
 		SH_PFC_FUNCTION(msiof1),
 		SH_PFC_FUNCTION(msiof2),
 		SH_PFC_FUNCTION(msiof3),
+#endif /* CONFIG_PINCTRL_PFC_EXTRAS */
 		SH_PFC_FUNCTION(pwm0),
 		SH_PFC_FUNCTION(pwm1),
 		SH_PFC_FUNCTION(pwm2),
@@ -5116,14 +5132,14 @@ static const struct {
 		SH_PFC_FUNCTION(vin4),
 		SH_PFC_FUNCTION(vin5),
 	},
-#ifdef CONFIG_PINCTRL_PFC_R8A7795
+#if defined(CONFIG_PINCTRL_PFC_R8A7795) && defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.automotive = {
 		SH_PFC_FUNCTION(drif0),
 		SH_PFC_FUNCTION(drif1),
 		SH_PFC_FUNCTION(drif2),
 		SH_PFC_FUNCTION(drif3),
 	}
-#endif /* CONFIG_PINCTRL_PFC_R8A7795 */
+#endif /* CONFIG_PINCTRL_PFC_R8A7795 && CONFIG_PINCTRL_PFC_EXTRAS */
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -6290,11 +6306,19 @@ const struct sh_pfc_soc_info r8a7795_pinmux_info = {
 	.pins = pinmux_pins,
 	.nr_pins = ARRAY_SIZE(pinmux_pins),
 	.groups = pinmux_groups.common,
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.nr_groups = ARRAY_SIZE(pinmux_groups.common) +
-			ARRAY_SIZE(pinmux_groups.automotive),
+		ARRAY_SIZE(pinmux_groups.automotive),
+#else
+	.nr_groups = ARRAY_SIZE(pinmux_groups.common),
+#endif
 	.functions = pinmux_functions.common,
+#if defined(CONFIG_PINCTRL_PFC_EXTRAS)
 	.nr_functions = ARRAY_SIZE(pinmux_functions.common) +
-			ARRAY_SIZE(pinmux_functions.automotive),
+		ARRAY_SIZE(pinmux_functions.automotive),
+#else
+	.nr_functions = ARRAY_SIZE(pinmux_functions.common),
+#endif
 
 	.cfg_regs = pinmux_config_regs,
 	.drive_regs = pinmux_drive_regs,
Signature · 1 line
2.17.1