Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
[oweals/u-boot.git] / drivers / pinctrl / renesas / pfc-r8a77970.c
index c44e1bc961c268fbd4fbeac19fbe42d2e6e09972..33ecd9339867999aa713243bee558e9727ae1caf 100644 (file)
@@ -3,6 +3,7 @@
  * R8A77970 processor support - PFC hardware block.
  *
  * Copyright (C) 2016 Renesas Electronics Corp.
+ * Copyright (C) 2017 Cogent Embedded, Inc. <source@cogentembedded.com>
  *
  * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7795.c
  *
 #include "sh_pfc.h"
 
 #define CPU_ALL_PORT(fn, sfx)                                          \
-       PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),       \
-       PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH)
+       PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_28(1, fn, sfx),                                         \
+       PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_6(4,  fn, sfx),                                         \
+       PORT_GP_15(5, fn, sfx)
 /*
  * F_() : just information
  * FM() : macro for FN_xxx / xxx_MARK
 #define IP2_15_12      FM(DU_EXHSYNC_DU_HSYNC)         FM(HRX0)                F_(0, 0)        FM(A19)         FM(IRQ3)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP2_19_16      FM(DU_EXVSYNC_DU_VSYNC)         FM(MSIOF3_SCK)          F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP2_23_20      FM(DU_EXODDF_DU_ODDF_DISP_CDE)  FM(MSIOF3_SYNC)         F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP2_27_24      FM(IRQ0)                        FM(CC5_OSCOUT)          F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_27_24      FM(IRQ0)                        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP2_31_28      FM(VI0_CLK)                     FM(MSIOF2_SCK)          FM(SCK3)        F_(0, 0)        FM(HSCK3)               F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_3_0                FM(VI0_CLKENB)                  FM(MSIOF2_RXD)          FM(RX3)         FM(RD_WR_N)     FM(HCTS3_N)             F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_7_4                FM(VI0_HSYNC_N)                 FM(MSIOF2_TXD)          FM(TX3)         F_(0, 0)        FM(HRTS3_N)             F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_11_8       FM(VI0_VSYNC_N)                 FM(MSIOF2_SYNC)         FM(CTS3_N)      F_(0, 0)        FM(HTX3)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP3_15_12      FM(VI0_DATA0)                   FM(MSIOF2_SS1)          FM(RTS3_N_TANS) F_(0, 0)        FM(HRX3)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_15_12      FM(VI0_DATA0)                   FM(MSIOF2_SS1)          FM(RTS3_N)      F_(0, 0)        FM(HRX3)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_19_16      FM(VI0_DATA1)                   FM(MSIOF2_SS2)          FM(SCK1)        F_(0, 0)        FM(SPEEDIN_A)           F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_23_20      FM(VI0_DATA2)                   FM(AVB0_AVTP_PPS)       FM(SDA3_A)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_27_24      FM(VI0_DATA3)                   FM(HSCK1)               FM(SCL3_A)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_31_28      FM(VI0_DATA4)                   FM(HRTS1_N)             FM(RX1_A)       F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP4_3_0                FM(VI0_DATA5)                   FM(HCTS1_N)             FM(TX1_A)       F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP4_7_4                FM(VI0_DATA6)                   FM(HTX1)                FM(CTS1_N)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP4_11_8       FM(VI0_DATA7)                   FM(HRX1)                FM(RTS1_N_TANS) F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_11_8       FM(VI0_DATA7)                   FM(HRX1)                FM(RTS1_N)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP4_15_12      FM(VI0_DATA8)                   FM(HSCK2)               FM(PWM0_A)      FM(A22)         F_(0, 0)                F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP4_19_16      FM(VI0_DATA9)                   FM(HCTS2_N)             FM(PWM1_A)      FM(A23)         FM(FSO_CFE_0_N_B)       F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP4_23_20      FM(VI0_DATA10)                  FM(HRTS2_N)             FM(PWM2_A)      FM(A24)         FM(FSO_CFE_1_N_B)       F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_27_24      FM(VI1_DATA2)                   FM(CANFD0_TX_B)         F_(0, 0)        FM(D5)          FM(MMC_D0)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_31_28      FM(VI1_DATA3)                   FM(CANFD0_RX_B)         F_(0, 0)        FM(D6)          FM(MMC_D1)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_3_0                FM(VI1_DATA4)                   FM(CANFD_CLK_B)         F_(0, 0)        FM(D7)          FM(MMC_D2)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_7_4                FM(VI1_DATA5)                   F_(0,0)                 FM(SCK4)        FM(D8)          FM(MMC_D3)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_11_8       FM(VI1_DATA6)                   F_(0,0)                 FM(RX4)         FM(D9)          FM(MMC_CLK)             F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_15_12      FM(VI1_DATA7)                   F_(0,0)                 FM(TX4)         FM(D10)         FM(MMC_D4)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_19_16      FM(VI1_DATA8)                   F_(0,0)                 FM(CTS4_N)      FM(D11)         FM(MMC_D5)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_23_20      FM(VI1_DATA9)                   F_(0,0)                 FM(RTS4_N_TANS) FM(D12)         FM(MMC_D6)              FM(SCL3_B)      F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_27_24      FM(VI1_DATA10)                  F_(0,0)                 F_(0, 0)        FM(D13)         FM(MMC_D7)              FM(SDA3_B)      F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_7_4                FM(VI1_DATA5)                   F_(0, 0)                FM(SCK4)        FM(D8)          FM(MMC_D3)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_11_8       FM(VI1_DATA6)                   F_(0, 0)                FM(RX4)         FM(D9)          FM(MMC_CLK)             F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_15_12      FM(VI1_DATA7)                   F_(0, 0)                FM(TX4)         FM(D10)         FM(MMC_D4)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_19_16      FM(VI1_DATA8)                   F_(0, 0)                FM(CTS4_N)      FM(D11)         FM(MMC_D5)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_23_20      FM(VI1_DATA9)                   F_(0, 0)                FM(RTS4_N)      FM(D12)         FM(MMC_D6)              FM(SCL3_B)      F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_27_24      FM(VI1_DATA10)                  F_(0, 0)                F_(0, 0)        FM(D13)         FM(MMC_D7)              FM(SDA3_B)      F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_31_28      FM(VI1_DATA11)                  FM(SCL4)                FM(IRQ4)        FM(D14)         FM(MMC_WP)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_3_0                FM(VI1_FIELD)                   FM(SDA4)                FM(IRQ5)        FM(D15)         FM(MMC_CD)              F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_7_4                FM(SCL0)                        FM(DU_DR0)              FM(TPU0TO0)     FM(CLKOUT)      F_(0, 0)                FM(MSIOF0_RXD)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_11_8       FM(SDA0)                        FM(DU_DR1)              FM(TPU0TO1)     FM(BS_N)        FM(SCK0)                FM(MSIOF0_TXD)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_15_12      FM(SCL1)                        FM(DU_DG0)              FM(TPU0TO2)     FM(RD_N)        FM(CTS0_N)              FM(MSIOF0_SCK)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP7_19_16      FM(SDA1)                        FM(DU_DG1)              FM(TPU0TO3)     FM(WE0_N)       FM(RTS0_N_TANS)         FM(MSIOF0_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_19_16      FM(SDA1)                        FM(DU_DG1)              FM(TPU0TO3)     FM(WE0_N)       FM(RTS0_N)              FM(MSIOF0_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_23_20      FM(SCL2)                        FM(DU_DB0)              FM(TCLK1_A)     FM(WE1_N)       FM(RX0)                 FM(MSIOF0_SS1)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_27_24      FM(SDA2)                        FM(DU_DB1)              FM(TCLK2_A)     FM(EX_WAIT0)    FM(TX0)                 FM(MSIOF0_SS2)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP7_31_28      FM(AVB0_AVTP_CAPTURE)           F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(FSCLKST2_N_B)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -471,7 +472,6 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP2_23_20,     MSIOF3_SYNC),
 
        PINMUX_IPSR_GPSR(IP2_27_24,     IRQ0),
-       PINMUX_IPSR_GPSR(IP2_27_24,     CC5_OSCOUT),
 
        PINMUX_IPSR_GPSR(IP2_31_28,     VI0_CLK),
        PINMUX_IPSR_GPSR(IP2_31_28,     MSIOF2_SCK),
@@ -497,7 +497,7 @@ static const u16 pinmux_data[] = {
 
        PINMUX_IPSR_GPSR(IP3_15_12,     VI0_DATA0),
        PINMUX_IPSR_GPSR(IP3_15_12,     MSIOF2_SS1),
-       PINMUX_IPSR_GPSR(IP3_15_12,     RTS3_N_TANS),
+       PINMUX_IPSR_GPSR(IP3_15_12,     RTS3_N),
        PINMUX_IPSR_GPSR(IP3_15_12,     HRX3),
 
        PINMUX_IPSR_GPSR(IP3_19_16,     VI0_DATA1),
@@ -528,7 +528,7 @@ static const u16 pinmux_data[] = {
 
        PINMUX_IPSR_GPSR(IP4_11_8,      VI0_DATA7),
        PINMUX_IPSR_GPSR(IP4_11_8,      HRX1),
-       PINMUX_IPSR_GPSR(IP4_11_8,      RTS1_N_TANS),
+       PINMUX_IPSR_GPSR(IP4_11_8,      RTS1_N),
 
        PINMUX_IPSR_GPSR(IP4_15_12,     VI0_DATA8),
        PINMUX_IPSR_GPSR(IP4_15_12,     HSCK2),
@@ -618,7 +618,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP6_19_16,     MMC_D5),
 
        PINMUX_IPSR_GPSR(IP6_23_20,     VI1_DATA9),
-       PINMUX_IPSR_GPSR(IP6_23_20,     RTS4_N_TANS),
+       PINMUX_IPSR_GPSR(IP6_23_20,     RTS4_N),
        PINMUX_IPSR_GPSR(IP6_23_20,     D12),
        PINMUX_IPSR_GPSR(IP6_23_20,     MMC_D6),
        PINMUX_IPSR_MSEL(IP6_23_20,     SCL3_B, SEL_I2C3_1),
@@ -665,7 +665,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP7_19_16,     DU_DG1),
        PINMUX_IPSR_GPSR(IP7_19_16,     TPU0TO3),
        PINMUX_IPSR_GPSR(IP7_19_16,     WE0_N),
-       PINMUX_IPSR_GPSR(IP7_19_16,     RTS0_N_TANS),
+       PINMUX_IPSR_GPSR(IP7_19_16,     RTS0_N),
        PINMUX_IPSR_GPSR(IP7_19_16,     MSIOF0_SYNC),
 
        PINMUX_IPSR_GPSR(IP7_23_20,     SCL2),
@@ -1383,6 +1383,56 @@ static const unsigned int pwm4_b_mux[] = {
        PWM4_B_MARK,
 };
 
+/* - QSPI0 ------------------------------------------------------------------ */
+static const unsigned int qspi0_ctrl_pins[] = {
+       /* SPCLK, SSL */
+       RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 5),
+};
+static const unsigned int qspi0_ctrl_mux[] = {
+       QSPI0_SPCLK_MARK, QSPI0_SSL_MARK,
+};
+static const unsigned int qspi0_data2_pins[] = {
+       /* MOSI_IO0, MISO_IO1 */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+};
+static const unsigned int qspi0_data2_mux[] = {
+       QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
+};
+static const unsigned int qspi0_data4_pins[] = {
+       /* MOSI_IO0, MISO_IO1, IO2, IO3 */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+       RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4),
+};
+static const unsigned int qspi0_data4_mux[] = {
+       QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
+       QSPI0_IO2_MARK, QSPI0_IO3_MARK
+};
+
+/* - QSPI1 ------------------------------------------------------------------ */
+static const unsigned int qspi1_ctrl_pins[] = {
+       /* SPCLK, SSL */
+       RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 11),
+};
+static const unsigned int qspi1_ctrl_mux[] = {
+       QSPI1_SPCLK_MARK, QSPI1_SSL_MARK,
+};
+static const unsigned int qspi1_data2_pins[] = {
+       /* MOSI_IO0, MISO_IO1 */
+       RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8),
+};
+static const unsigned int qspi1_data2_mux[] = {
+       QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
+};
+static const unsigned int qspi1_data4_pins[] = {
+       /* MOSI_IO0, MISO_IO1, IO2, IO3 */
+       RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8),
+       RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 10),
+};
+static const unsigned int qspi1_data4_mux[] = {
+       QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
+       QSPI1_IO2_MARK, QSPI1_IO3_MARK
+};
+
 /* - SCIF Clock ------------------------------------------------------------- */
 static const unsigned int scif_clk_a_pins[] = {
        /* SCIF_CLK */
@@ -1419,7 +1469,7 @@ static const unsigned int scif0_ctrl_pins[] = {
        RCAR_GP_PIN(4, 3), RCAR_GP_PIN(4, 2),
 };
 static const unsigned int scif0_ctrl_mux[] = {
-       RTS0_N_TANS_MARK, CTS0_N_MARK,
+       RTS0_N_MARK, CTS0_N_MARK,
 };
 
 /* - SCIF1 ------------------------------------------------------------------ */
@@ -1442,7 +1492,7 @@ static const unsigned int scif1_ctrl_pins[] = {
        RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 10),
 };
 static const unsigned int scif1_ctrl_mux[] = {
-       RTS1_N_TANS_MARK, CTS1_N_MARK,
+       RTS1_N_MARK, CTS1_N_MARK,
 };
 static const unsigned int scif1_data_b_pins[] = {
        /* RX, TX */
@@ -1472,7 +1522,7 @@ static const unsigned int scif3_ctrl_pins[] = {
        RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 3),
 };
 static const unsigned int scif3_ctrl_mux[] = {
-       RTS3_N_TANS_MARK, CTS3_N_MARK,
+       RTS3_N_MARK, CTS3_N_MARK,
 };
 
 /* - SCIF4 ------------------------------------------------------------------ */
@@ -1495,7 +1545,7 @@ static const unsigned int scif4_ctrl_pins[] = {
        RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12),
 };
 static const unsigned int scif4_ctrl_mux[] = {
-       RTS4_N_TANS_MARK, CTS4_N_MARK,
+       RTS4_N_MARK, CTS4_N_MARK,
 };
 
 /* - TMU -------------------------------------------------------------------- */
@@ -1529,47 +1579,25 @@ static const unsigned int tmu_tclk2_b_mux[] = {
 };
 
 /* - VIN0 ------------------------------------------------------------------- */
-static const unsigned int vin0_data8_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-};
-static const unsigned int vin0_data8_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
+static const union vin_data12 vin0_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+               RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+               RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
+               RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
+               RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
+               RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
+       },
 };
-static const unsigned int vin0_data10_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-};
-static const unsigned int vin0_data10_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-};
-static const unsigned int vin0_data12_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
-};
-static const unsigned int vin0_data12_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-       VI0_DATA10_MARK, VI0_DATA11_MARK,
+static const union vin_data12 vin0_data_mux = {
+       .data12 = {
+               VI0_DATA0_MARK, VI0_DATA1_MARK,
+               VI0_DATA2_MARK, VI0_DATA3_MARK,
+               VI0_DATA4_MARK, VI0_DATA5_MARK,
+               VI0_DATA6_MARK, VI0_DATA7_MARK,
+               VI0_DATA8_MARK,  VI0_DATA9_MARK,
+               VI0_DATA10_MARK, VI0_DATA11_MARK,
+       },
 };
 static const unsigned int vin0_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1601,47 +1629,25 @@ static const unsigned int vin0_clk_mux[] = {
 };
 
 /* - VIN1 ------------------------------------------------------------------- */
-static const unsigned int vin1_data8_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-};
-static const unsigned int vin1_data8_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-};
-static const unsigned int vin1_data10_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-};
-static const unsigned int vin1_data10_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-};
-static const unsigned int vin1_data12_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-       RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+static const union vin_data12 vin1_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
+               RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
+               RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
+               RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
+               RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
+               RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+       },
 };
-static const unsigned int vin1_data12_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-       VI1_DATA10_MARK, VI1_DATA11_MARK,
+static const union vin_data12 vin1_data_mux = {
+       .data12 = {
+               VI1_DATA0_MARK, VI1_DATA1_MARK,
+               VI1_DATA2_MARK, VI1_DATA3_MARK,
+               VI1_DATA4_MARK, VI1_DATA5_MARK,
+               VI1_DATA6_MARK, VI1_DATA7_MARK,
+               VI1_DATA8_MARK,  VI1_DATA9_MARK,
+               VI1_DATA10_MARK, VI1_DATA11_MARK,
+       },
 };
 static const unsigned int vin1_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1757,6 +1763,12 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(pwm3_b),
        SH_PFC_PIN_GROUP(pwm4_a),
        SH_PFC_PIN_GROUP(pwm4_b),
+       SH_PFC_PIN_GROUP(qspi0_ctrl),
+       SH_PFC_PIN_GROUP(qspi0_data2),
+       SH_PFC_PIN_GROUP(qspi0_data4),
+       SH_PFC_PIN_GROUP(qspi1_ctrl),
+       SH_PFC_PIN_GROUP(qspi1_data2),
+       SH_PFC_PIN_GROUP(qspi1_data4),
        SH_PFC_PIN_GROUP(scif_clk_a),
        SH_PFC_PIN_GROUP(scif_clk_b),
        SH_PFC_PIN_GROUP(scif0_data),
@@ -1776,16 +1788,16 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(tmu_tclk1_b),
        SH_PFC_PIN_GROUP(tmu_tclk2_a),
        SH_PFC_PIN_GROUP(tmu_tclk2_b),
-       SH_PFC_PIN_GROUP(vin0_data8),
-       SH_PFC_PIN_GROUP(vin0_data10),
-       SH_PFC_PIN_GROUP(vin0_data12),
+       VIN_DATA_PIN_GROUP(vin0_data, 8),
+       VIN_DATA_PIN_GROUP(vin0_data, 10),
+       VIN_DATA_PIN_GROUP(vin0_data, 12),
        SH_PFC_PIN_GROUP(vin0_sync),
        SH_PFC_PIN_GROUP(vin0_field),
        SH_PFC_PIN_GROUP(vin0_clkenb),
        SH_PFC_PIN_GROUP(vin0_clk),
-       SH_PFC_PIN_GROUP(vin1_data8),
-       SH_PFC_PIN_GROUP(vin1_data10),
-       SH_PFC_PIN_GROUP(vin1_data12),
+       VIN_DATA_PIN_GROUP(vin1_data, 8),
+       VIN_DATA_PIN_GROUP(vin1_data, 10),
+       VIN_DATA_PIN_GROUP(vin1_data, 12),
        SH_PFC_PIN_GROUP(vin1_sync),
        SH_PFC_PIN_GROUP(vin1_field),
        SH_PFC_PIN_GROUP(vin1_clkenb),
@@ -1951,6 +1963,18 @@ static const char * const pwm4_groups[] = {
        "pwm4_b",
 };
 
+static const char * const qspi0_groups[] = {
+       "qspi0_ctrl",
+       "qspi0_data2",
+       "qspi0_data4",
+};
+
+static const char * const qspi1_groups[] = {
+       "qspi1_ctrl",
+       "qspi1_data2",
+       "qspi1_data4",
+};
+
 static const char * const scif_clk_groups[] = {
        "scif_clk_a",
        "scif_clk_b",
@@ -2034,6 +2058,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(pwm2),
        SH_PFC_FUNCTION(pwm3),
        SH_PFC_FUNCTION(pwm4),
+       SH_PFC_FUNCTION(qspi0),
+       SH_PFC_FUNCTION(qspi1),
        SH_PFC_FUNCTION(scif_clk),
        SH_PFC_FUNCTION(scif0),
        SH_PFC_FUNCTION(scif1),
@@ -2047,7 +2073,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 #define F_(x, y)       FN_##y
 #define FM(x)          FN_##x
-       { PINMUX_CFG_REG("GPSR0", 0xe6060100, 32, 1) {
+       { PINMUX_CFG_REG("GPSR0", 0xe6060100, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2079,9 +2105,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_0_3_FN,      GPSR0_3,
                GP_0_2_FN,      GPSR0_2,
                GP_0_1_FN,      GPSR0_1,
-               GP_0_0_FN,      GPSR0_0, }
+               GP_0_0_FN,      GPSR0_0, ))
        },
-       { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1) {
+       { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2113,9 +2139,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_1_3_FN,      GPSR1_3,
                GP_1_2_FN,      GPSR1_2,
                GP_1_1_FN,      GPSR1_1,
-               GP_1_0_FN,      GPSR1_0, }
+               GP_1_0_FN,      GPSR1_0, ))
        },
-       { PINMUX_CFG_REG("GPSR2", 0xe6060108, 32, 1) {
+       { PINMUX_CFG_REG("GPSR2", 0xe6060108, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2147,9 +2173,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_2_3_FN,      GPSR2_3,
                GP_2_2_FN,      GPSR2_2,
                GP_2_1_FN,      GPSR2_1,
-               GP_2_0_FN,      GPSR2_0, }
+               GP_2_0_FN,      GPSR2_0, ))
        },
-       { PINMUX_CFG_REG("GPSR3", 0xe606010c, 32, 1) {
+       { PINMUX_CFG_REG("GPSR3", 0xe606010c, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2181,9 +2207,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_3_3_FN,      GPSR3_3,
                GP_3_2_FN,      GPSR3_2,
                GP_3_1_FN,      GPSR3_1,
-               GP_3_0_FN,      GPSR3_0, }
+               GP_3_0_FN,      GPSR3_0, ))
        },
-       { PINMUX_CFG_REG("GPSR4", 0xe6060110, 32, 1) {
+       { PINMUX_CFG_REG("GPSR4", 0xe6060110, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2215,9 +2241,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_4_3_FN,      GPSR4_3,
                GP_4_2_FN,      GPSR4_2,
                GP_4_1_FN,      GPSR4_1,
-               GP_4_0_FN,      GPSR4_0, }
+               GP_4_0_FN,      GPSR4_0, ))
        },
-       { PINMUX_CFG_REG("GPSR5", 0xe6060114, 32, 1) {
+       { PINMUX_CFG_REG("GPSR5", 0xe6060114, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2249,14 +2275,14 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_5_3_FN,      GPSR5_3,
                GP_5_2_FN,      GPSR5_2,
                GP_5_1_FN,      GPSR5_1,
-               GP_5_0_FN,      GPSR5_0, }
+               GP_5_0_FN,      GPSR5_0, ))
        },
 #undef F_
 #undef FM
 
 #define F_(x, y)       x,
 #define FM(x)          FN_##x,
-       { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4) {
+       { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4, GROUP(
                IP0_31_28
                IP0_27_24
                IP0_23_20
@@ -2264,9 +2290,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP0_15_12
                IP0_11_8
                IP0_7_4
-               IP0_3_0 }
+               IP0_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4) {
+       { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4, GROUP(
                IP1_31_28
                IP1_27_24
                IP1_23_20
@@ -2274,9 +2300,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP1_15_12
                IP1_11_8
                IP1_7_4
-               IP1_3_0 }
+               IP1_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4) {
+       { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4, GROUP(
                IP2_31_28
                IP2_27_24
                IP2_23_20
@@ -2284,9 +2310,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP2_15_12
                IP2_11_8
                IP2_7_4
-               IP2_3_0 }
+               IP2_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4) {
+       { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4, GROUP(
                IP3_31_28
                IP3_27_24
                IP3_23_20
@@ -2294,9 +2320,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP3_15_12
                IP3_11_8
                IP3_7_4
-               IP3_3_0 }
+               IP3_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4) {
+       { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4, GROUP(
                IP4_31_28
                IP4_27_24
                IP4_23_20
@@ -2304,9 +2330,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP4_15_12
                IP4_11_8
                IP4_7_4
-               IP4_3_0 }
+               IP4_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4) {
+       { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4, GROUP(
                IP5_31_28
                IP5_27_24
                IP5_23_20
@@ -2314,9 +2340,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP5_15_12
                IP5_11_8
                IP5_7_4
-               IP5_3_0 }
+               IP5_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4) {
+       { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4, GROUP(
                IP6_31_28
                IP6_27_24
                IP6_23_20
@@ -2324,9 +2350,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP6_15_12
                IP6_11_8
                IP6_7_4
-               IP6_3_0 }
+               IP6_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4) {
+       { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4, GROUP(
                IP7_31_28
                IP7_27_24
                IP7_23_20
@@ -2334,9 +2360,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP7_15_12
                IP7_11_8
                IP7_7_4
-               IP7_3_0 }
+               IP7_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR8", 0xe6060220, 32, 4) {
+       { PINMUX_CFG_REG("IPSR8", 0xe6060220, 32, 4, GROUP(
                IP8_31_28
                IP8_27_24
                IP8_23_20
@@ -2344,7 +2370,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP8_15_12
                IP8_11_8
                IP8_7_4
-               IP8_3_0 }
+               IP8_3_0 ))
        },
 #undef F_
 #undef FM
@@ -2352,8 +2378,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 #define F_(x, y)       x,
 #define FM(x)          FN_##x,
        { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
-                            4, 4, 4, 4,
-                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) {
+                            GROUP(4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
+                                  1, 1, 1, 1, 1),
+                            GROUP(
                /* RESERVED 31, 30, 29, 28 */
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                /* RESERVED 27, 26, 25, 24 */
@@ -2375,23 +2402,38 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                MOD_SEL0_3
                MOD_SEL0_2
                MOD_SEL0_1
-               MOD_SEL0_0 }
+               MOD_SEL0_0 ))
        },
        { },
 };
 
+enum ioctrl_regs {
+       POCCTRL0,
+       POCCTRL1,
+       POCCTRL2,
+       TDSELCTRL,
+};
+
+static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
+       [POCCTRL0] = { 0xe6060380 },
+       [POCCTRL1] = { 0xe6060384 },
+       [POCCTRL2] = { 0xe6060388 },
+       [TDSELCTRL] = { 0xe60603c0, },
+       { /* sentinel */ },
+};
+
 static int r8a77970_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
                                   u32 *pocctrl)
 {
        int bit = pin & 0x1f;
 
-       *pocctrl = 0xe6060380;
+       *pocctrl = pinmux_ioctrl_regs[POCCTRL0].reg;
        if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
                return bit;
        if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
                return bit + 22;
 
-       *pocctrl += 4;
+       *pocctrl = pinmux_ioctrl_regs[POCCTRL1].reg;
        if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
                return bit - 10;
        if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16))
@@ -2419,6 +2461,7 @@ const struct sh_pfc_soc_info r8a77970_pinmux_info = {
        .nr_functions = ARRAY_SIZE(pinmux_functions),
 
        .cfg_regs = pinmux_config_regs,
+       .ioctrl_regs = pinmux_ioctrl_regs,
 
        .pinmux_data = pinmux_data,
        .pinmux_data_size = ARRAY_SIZE(pinmux_data),