Merge tag 'u-boot-rockchip-20190809' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / pinctrl / renesas / pfc-r8a77995.c
index 97f75a1..724cf4a 100644 (file)
 #define IP10_23_20     FM(SSI_SDATA4_A)        FM(HTX0)                FM(SCL2_A)              FM(CAN1_RX_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) F_(0, 0)
 #define IP10_27_24     FM(SSI_WS4_A)           FM(HRX0)                FM(SDA2_A)              FM(CAN1_TX_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) F_(0, 0)
 #define IP10_31_28     FM(SCL1)                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) F_(0, 0)
-#define IP11_3_0       FM(SDA1)                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) F_(0, 0)
+#define IP11_3_0       FM(SDA1)                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) F_(0, 0)
 #define IP11_7_4       FM(MSIOF1_SCK)          FM(AVB0_AVTP_PPS_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) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_11_8      FM(MSIOF1_TXD)          FM(AVB0_AVTP_CAPTURE_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) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_15_12     FM(MSIOF1_RXD)          FM(AVB0_AVTP_MATCH_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) F_(0, 0) F_(0, 0) F_(0, 0)
 
 /* IPSRx */            /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */         /* 4 */                 /* 5 */         /* 6  - F */
 #define IP12_3_0       FM(RX1_A)               FM(CTS0_N)              FM(TPU0TO0_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) F_(0, 0) F_(0, 0)
-#define IP12_7_4       FM(TX1_A)               FM(RTS0_N_TANS)         FM(TPU0TO1_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) F_(0, 0) F_(0, 0)
+#define IP12_7_4       FM(TX1_A)               FM(RTS0_N)              FM(TPU0TO1_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) F_(0, 0) F_(0, 0)
 #define IP12_11_8      FM(SCK2)                FM(MSIOF1_SS1)          FM(TPU0TO3_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) F_(0, 0) F_(0, 0)
 #define IP12_15_12     FM(TPU0TO0_A)           FM(AVB0_AVTP_CAPTURE_A) FM(HCTS0_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 IP12_19_16     FM(TPU0TO1_A)           FM(AVB0_AVTP_MATCH_A)   FM(HRTS0_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)
@@ -384,6 +384,9 @@ FM(IP12_23_20)      IP12_23_20 \
 FM(IP12_27_24) IP12_27_24 \
 FM(IP12_31_28) IP12_31_28 \
 
+/* The bit numbering in MOD_SEL fields is reversed */
+#define REV4(f0, f1, f2, f3)                   f0 f2 f1 f3
+
 /* MOD_SEL0 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */
 #define MOD_SEL0_30            FM(SEL_MSIOF2_0)        FM(SEL_MSIOF2_1)
 #define MOD_SEL0_29            FM(SEL_I2C3_0)          FM(SEL_I2C3_1)
@@ -391,10 +394,10 @@ FM(IP12_31_28)    IP12_31_28 \
 #define MOD_SEL0_27            FM(SEL_MSIOF3_0)        FM(SEL_MSIOF3_1)
 #define MOD_SEL0_26            FM(SEL_HSCIF3_0)        FM(SEL_HSCIF3_1)
 #define MOD_SEL0_25            FM(SEL_SCIF4_0)         FM(SEL_SCIF4_1)
-#define MOD_SEL0_24_23         FM(SEL_PWM0_0)          FM(SEL_PWM0_1)          FM(SEL_PWM0_2)          FM(SEL_PWM0_3)
-#define MOD_SEL0_22_21         FM(SEL_PWM1_0)          FM(SEL_PWM1_1)          FM(SEL_PWM1_2)          FM(SEL_PWM1_3)
-#define MOD_SEL0_20_19         FM(SEL_PWM2_0)          FM(SEL_PWM2_1)          FM(SEL_PWM2_2)          FM(SEL_PWM2_3)
-#define MOD_SEL0_18_17         FM(SEL_PWM3_0)          FM(SEL_PWM3_1)          FM(SEL_PWM3_2)          FM(SEL_PWM3_3)
+#define MOD_SEL0_24_23    REV4(FM(SEL_PWM0_0),         FM(SEL_PWM0_1),         FM(SEL_PWM0_2),         F_(0, 0))
+#define MOD_SEL0_22_21    REV4(FM(SEL_PWM1_0),         FM(SEL_PWM1_1),         FM(SEL_PWM1_2),         F_(0, 0))
+#define MOD_SEL0_20_19    REV4(FM(SEL_PWM2_0),         FM(SEL_PWM2_1),         FM(SEL_PWM2_2),         F_(0, 0))
+#define MOD_SEL0_18_17    REV4(FM(SEL_PWM3_0),         FM(SEL_PWM3_1),         FM(SEL_PWM3_2),         F_(0, 0))
 #define MOD_SEL0_15            FM(SEL_IRQ_0_0)         FM(SEL_IRQ_0_1)
 #define MOD_SEL0_14            FM(SEL_IRQ_1_0)         FM(SEL_IRQ_1_1)
 #define MOD_SEL0_13            FM(SEL_IRQ_2_0)         FM(SEL_IRQ_2_1)
@@ -471,12 +474,6 @@ enum {
 #undef FM
 };
 
-#define PINMUX_IPSR_MSEL2(ipsr, fn, msel1, msel2) \
-       PINMUX_DATA(fn##_MARK, FN_##msel1, FN_##msel2, FN_##fn, FN_##ipsr)
-
-#define PINMUX_IPSR_PHYS(ipsr, fn, msel) \
-       PINMUX_DATA(fn##_MARK, FN_##msel)
-
 static const u16 pinmux_data[] = {
        PINMUX_DATA_GP_ALL(),
 
@@ -520,6 +517,10 @@ static const u16 pinmux_data[] = {
        PINMUX_SINGLE(QSPI0_SPCLK),
        PINMUX_SINGLE(SCL0),
        PINMUX_SINGLE(SDA0),
+       PINMUX_SINGLE(MSIOF0_RXD),
+       PINMUX_SINGLE(MSIOF0_TXD),
+       PINMUX_SINGLE(MSIOF0_SYNC),
+       PINMUX_SINGLE(MSIOF0_SCK),
 
        /* IPSR0 */
        PINMUX_IPSR_MSEL(IP0_3_0,       IRQ0_A, SEL_IRQ_0_0),
@@ -859,7 +860,7 @@ static const u16 pinmux_data[] = {
 
        /* IPSR11 */
        PINMUX_IPSR_GPSR(IP11_3_0,      SDA1),
-       PINMUX_IPSR_GPSR(IP11_3_0,      RTS1_N_TANS),
+       PINMUX_IPSR_GPSR(IP11_3_0,      RTS1_N),
 
        PINMUX_IPSR_GPSR(IP11_7_4,      MSIOF1_SCK),
        PINMUX_IPSR_MSEL(IP11_7_4,      AVB0_AVTP_PPS_B, SEL_ETHERAVB_1),
@@ -894,7 +895,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP12_3_0,      TPU0TO0_B),
 
        PINMUX_IPSR_MSEL(IP12_7_4,      TX1_A, SEL_SCIF1_0),
-       PINMUX_IPSR_GPSR(IP12_7_4,      RTS0_N_TANS),
+       PINMUX_IPSR_GPSR(IP12_7_4,      RTS0_N),
        PINMUX_IPSR_GPSR(IP12_7_4,      TPU0TO1_B),
 
        PINMUX_IPSR_GPSR(IP12_11_8,     SCK2),
@@ -1277,6 +1278,289 @@ static const unsigned int mmc_ctrl_mux[] = {
        MMC_CLK_MARK, MMC_CMD_MARK,
 };
 
+/* - MSIOF0 ----------------------------------------------------------------- */
+static const unsigned int msiof0_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(4, 12),
+};
+
+static const unsigned int msiof0_clk_mux[] = {
+       MSIOF0_SCK_MARK,
+};
+
+static const unsigned int msiof0_sync_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(4, 13),
+};
+
+static const unsigned int msiof0_sync_mux[] = {
+       MSIOF0_SYNC_MARK,
+};
+
+static const unsigned int msiof0_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(4, 20),
+};
+
+static const unsigned int msiof0_ss1_mux[] = {
+       MSIOF0_SS1_MARK,
+};
+
+static const unsigned int msiof0_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(4, 21),
+};
+
+static const unsigned int msiof0_ss2_mux[] = {
+       MSIOF0_SS2_MARK,
+};
+
+static const unsigned int msiof0_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(4, 14),
+};
+
+static const unsigned int msiof0_txd_mux[] = {
+       MSIOF0_TXD_MARK,
+};
+
+static const unsigned int msiof0_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(4, 15),
+};
+
+static const unsigned int msiof0_rxd_mux[] = {
+       MSIOF0_RXD_MARK,
+};
+
+/* - MSIOF1 ----------------------------------------------------------------- */
+static const unsigned int msiof1_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(4, 16),
+};
+
+static const unsigned int msiof1_clk_mux[] = {
+       MSIOF1_SCK_MARK,
+};
+
+static const unsigned int msiof1_sync_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(4, 19),
+};
+
+static const unsigned int msiof1_sync_mux[] = {
+       MSIOF1_SYNC_MARK,
+};
+
+static const unsigned int msiof1_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(4, 25),
+};
+
+static const unsigned int msiof1_ss1_mux[] = {
+       MSIOF1_SS1_MARK,
+};
+
+static const unsigned int msiof1_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(4, 22),
+};
+
+static const unsigned int msiof1_ss2_mux[] = {
+       MSIOF1_SS2_MARK,
+};
+
+static const unsigned int msiof1_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(4, 17),
+};
+
+static const unsigned int msiof1_txd_mux[] = {
+       MSIOF1_TXD_MARK,
+};
+
+static const unsigned int msiof1_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(4, 18),
+};
+
+static const unsigned int msiof1_rxd_mux[] = {
+       MSIOF1_RXD_MARK,
+};
+
+/* - MSIOF2 ----------------------------------------------------------------- */
+static const unsigned int msiof2_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 3),
+};
+
+static const unsigned int msiof2_clk_mux[] = {
+       MSIOF2_SCK_MARK,
+};
+
+static const unsigned int msiof2_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 6),
+};
+
+static const unsigned int msiof2_sync_a_mux[] = {
+       MSIOF2_SYNC_A_MARK,
+};
+
+static const unsigned int msiof2_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 2),
+};
+
+static const unsigned int msiof2_sync_b_mux[] = {
+       MSIOF2_SYNC_B_MARK,
+};
+
+static const unsigned int msiof2_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int msiof2_ss1_mux[] = {
+       MSIOF2_SS1_MARK,
+};
+
+static const unsigned int msiof2_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(0, 8),
+};
+
+static const unsigned int msiof2_ss2_mux[] = {
+       MSIOF2_SS2_MARK,
+};
+
+static const unsigned int msiof2_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(0, 4),
+};
+
+static const unsigned int msiof2_txd_mux[] = {
+       MSIOF2_TXD_MARK,
+};
+
+static const unsigned int msiof2_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(0, 5),
+};
+
+static const unsigned int msiof2_rxd_mux[] = {
+       MSIOF2_RXD_MARK,
+};
+
+/* - MSIOF3 ----------------------------------------------------------------- */
+static const unsigned int msiof3_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(2, 24),
+};
+
+static const unsigned int msiof3_clk_a_mux[] = {
+       MSIOF3_SCK_A_MARK,
+};
+
+static const unsigned int msiof3_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(2, 21),
+};
+
+static const unsigned int msiof3_sync_a_mux[] = {
+       MSIOF3_SYNC_A_MARK,
+};
+
+static const unsigned int msiof3_ss1_a_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(2, 14),
+};
+
+static const unsigned int msiof3_ss1_a_mux[] = {
+       MSIOF3_SS1_A_MARK,
+};
+
+static const unsigned int msiof3_ss2_a_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(2, 10),
+};
+
+static const unsigned int msiof3_ss2_a_mux[] = {
+       MSIOF3_SS2_A_MARK,
+};
+
+static const unsigned int msiof3_txd_a_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(2, 22),
+};
+
+static const unsigned int msiof3_txd_a_mux[] = {
+       MSIOF3_TXD_A_MARK,
+};
+
+static const unsigned int msiof3_rxd_a_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(2, 23),
+};
+
+static const unsigned int msiof3_rxd_a_mux[] = {
+       MSIOF3_RXD_A_MARK,
+};
+
+static const unsigned int msiof3_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 8),
+};
+
+static const unsigned int msiof3_clk_b_mux[] = {
+       MSIOF3_SCK_B_MARK,
+};
+
+static const unsigned int msiof3_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 9),
+};
+
+static const unsigned int msiof3_sync_b_mux[] = {
+       MSIOF3_SYNC_B_MARK,
+};
+
+static const unsigned int msiof3_ss1_b_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(1, 6),
+};
+
+static const unsigned int msiof3_ss1_b_mux[] = {
+       MSIOF3_SS1_B_MARK,
+};
+
+static const unsigned int msiof3_ss2_b_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(1, 7),
+};
+
+static const unsigned int msiof3_ss2_b_mux[] = {
+       MSIOF3_SS2_B_MARK,
+};
+
+static const unsigned int msiof3_txd_b_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 0),
+};
+
+static const unsigned int msiof3_txd_b_mux[] = {
+       MSIOF3_TXD_B_MARK,
+};
+
+static const unsigned int msiof3_rxd_b_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 1),
+};
+
+static const unsigned int msiof3_rxd_b_mux[] = {
+       MSIOF3_RXD_B_MARK,
+};
+
 /* - PWM0 ------------------------------------------------------------------ */
 static const unsigned int pwm0_a_pins[] = {
        /* PWM */
@@ -1423,7 +1707,7 @@ static const unsigned int scif0_ctrl_pins[] = {
        RCAR_GP_PIN(4, 24), RCAR_GP_PIN(4, 23),
 };
 static const unsigned int scif0_ctrl_mux[] = {
-       RTS0_N_TANS_MARK, CTS0_N_MARK,
+       RTS0_N_MARK, CTS0_N_MARK,
 };
 /* - SCIF1 ------------------------------------------------------------------ */
 static const unsigned int scif1_data_a_pins[] = {
@@ -1459,7 +1743,7 @@ static const unsigned int scif1_ctrl_pins[] = {
        RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 10),
 };
 static const unsigned int scif1_ctrl_mux[] = {
-       RTS1_N_TANS_MARK, CTS1_N_MARK,
+       RTS1_N_MARK, CTS1_N_MARK,
 };
 
 /* - SCIF2 ------------------------------------------------------------------ */
@@ -1752,6 +2036,37 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(mmc_data4),
        SH_PFC_PIN_GROUP(mmc_data8),
        SH_PFC_PIN_GROUP(mmc_ctrl),
+       SH_PFC_PIN_GROUP(msiof0_clk),
+       SH_PFC_PIN_GROUP(msiof0_sync),
+       SH_PFC_PIN_GROUP(msiof0_ss1),
+       SH_PFC_PIN_GROUP(msiof0_ss2),
+       SH_PFC_PIN_GROUP(msiof0_txd),
+       SH_PFC_PIN_GROUP(msiof0_rxd),
+       SH_PFC_PIN_GROUP(msiof1_clk),
+       SH_PFC_PIN_GROUP(msiof1_sync),
+       SH_PFC_PIN_GROUP(msiof1_ss1),
+       SH_PFC_PIN_GROUP(msiof1_ss2),
+       SH_PFC_PIN_GROUP(msiof1_txd),
+       SH_PFC_PIN_GROUP(msiof1_rxd),
+       SH_PFC_PIN_GROUP(msiof2_clk),
+       SH_PFC_PIN_GROUP(msiof2_sync_a),
+       SH_PFC_PIN_GROUP(msiof2_sync_b),
+       SH_PFC_PIN_GROUP(msiof2_ss1),
+       SH_PFC_PIN_GROUP(msiof2_ss2),
+       SH_PFC_PIN_GROUP(msiof2_txd),
+       SH_PFC_PIN_GROUP(msiof2_rxd),
+       SH_PFC_PIN_GROUP(msiof3_clk_a),
+       SH_PFC_PIN_GROUP(msiof3_sync_a),
+       SH_PFC_PIN_GROUP(msiof3_ss1_a),
+       SH_PFC_PIN_GROUP(msiof3_ss2_a),
+       SH_PFC_PIN_GROUP(msiof3_txd_a),
+       SH_PFC_PIN_GROUP(msiof3_rxd_a),
+       SH_PFC_PIN_GROUP(msiof3_clk_b),
+       SH_PFC_PIN_GROUP(msiof3_sync_b),
+       SH_PFC_PIN_GROUP(msiof3_ss1_b),
+       SH_PFC_PIN_GROUP(msiof3_ss2_b),
+       SH_PFC_PIN_GROUP(msiof3_txd_b),
+       SH_PFC_PIN_GROUP(msiof3_rxd_b),
        SH_PFC_PIN_GROUP(pwm0_a),
        SH_PFC_PIN_GROUP(pwm0_b),
        SH_PFC_PIN_GROUP(pwm0_c),
@@ -1982,6 +2297,49 @@ static const char * const vin4_groups[] = {
        "vin4_clk",
 };
 
+static const char * const msiof0_groups[] = {
+       "msiof0_clk",
+       "msiof0_sync",
+       "msiof0_ss1",
+       "msiof0_ss2",
+       "msiof0_txd",
+       "msiof0_rxd",
+};
+
+static const char * const msiof1_groups[] = {
+       "msiof1_clk",
+       "msiof1_sync",
+       "msiof1_ss1",
+       "msiof1_ss2",
+       "msiof1_txd",
+       "msiof1_rxd",
+};
+
+static const char * const msiof2_groups[] = {
+       "msiof2_clk",
+       "msiof2_sync_a",
+       "msiof2_sync_b",
+       "msiof2_ss1",
+       "msiof2_ss2",
+       "msiof2_txd",
+       "msiof2_rxd",
+};
+
+static const char * const msiof3_groups[] = {
+       "msiof3_clk_a",
+       "msiof3_sync_a",
+       "msiof3_ss1_a",
+       "msiof3_ss2_a",
+       "msiof3_txd_a",
+       "msiof3_rxd_a",
+       "msiof3_clk_b",
+       "msiof3_sync_b",
+       "msiof3_ss1_b",
+       "msiof3_ss2_b",
+       "msiof3_txd_b",
+       "msiof3_rxd_b",
+};
+
 static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(audio_clk),
        SH_PFC_FUNCTION(avb0),
@@ -1996,6 +2354,10 @@ static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(i2c2),
        SH_PFC_FUNCTION(i2c3),
        SH_PFC_FUNCTION(mmc),
+       SH_PFC_FUNCTION(msiof0),
+       SH_PFC_FUNCTION(msiof1),
+       SH_PFC_FUNCTION(msiof2),
+       SH_PFC_FUNCTION(msiof3),
        SH_PFC_FUNCTION(pwm0),
        SH_PFC_FUNCTION(pwm1),
        SH_PFC_FUNCTION(pwm2),
@@ -2015,7 +2377,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,
@@ -2047,9 +2409,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(
                GP_1_31_FN,     GPSR1_31,
                GP_1_30_FN,     GPSR1_30,
                GP_1_29_FN,     GPSR1_29,
@@ -2081,9 +2443,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(
                GP_2_31_FN,     GPSR2_31,
                GP_2_30_FN,     GPSR2_30,
                GP_2_29_FN,     GPSR2_29,
@@ -2115,9 +2477,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,
@@ -2149,9 +2511,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(
                GP_4_31_FN,     GPSR4_31,
                GP_4_30_FN,     GPSR4_30,
                GP_4_29_FN,     GPSR4_29,
@@ -2183,9 +2545,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,
@@ -2217,9 +2579,9 @@ 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, ))
        },
-       { PINMUX_CFG_REG("GPSR6", 0xe6060118, 32, 1) {
+       { PINMUX_CFG_REG("GPSR6", 0xe6060118, 32, 1, GROUP(
                0, 0,
                0, 0,
                0, 0,
@@ -2251,14 +2613,14 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                GP_6_3_FN,      GPSR6_3,
                GP_6_2_FN,      GPSR6_2,
                GP_6_1_FN,      GPSR6_1,
-               GP_6_0_FN,      GPSR6_0, }
+               GP_6_0_FN,      GPSR6_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
@@ -2266,9 +2628,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
@@ -2276,9 +2638,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
@@ -2286,9 +2648,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
@@ -2296,9 +2658,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
@@ -2306,9 +2668,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
@@ -2316,9 +2678,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
@@ -2326,9 +2688,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
@@ -2336,9 +2698,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
@@ -2346,9 +2708,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP8_15_12
                IP8_11_8
                IP8_7_4
-               IP8_3_0 }
+               IP8_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR9", 0xe6060224, 32, 4) {
+       { PINMUX_CFG_REG("IPSR9", 0xe6060224, 32, 4, GROUP(
                IP9_31_28
                IP9_27_24
                IP9_23_20
@@ -2356,9 +2718,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP9_15_12
                IP9_11_8
                IP9_7_4
-               IP9_3_0 }
+               IP9_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR10", 0xe6060228, 32, 4) {
+       { PINMUX_CFG_REG("IPSR10", 0xe6060228, 32, 4, GROUP(
                IP10_31_28
                IP10_27_24
                IP10_23_20
@@ -2366,9 +2728,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP10_15_12
                IP10_11_8
                IP10_7_4
-               IP10_3_0 }
+               IP10_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR11", 0xe606022c, 32, 4) {
+       { PINMUX_CFG_REG("IPSR11", 0xe606022c, 32, 4, GROUP(
                IP11_31_28
                IP11_27_24
                IP11_23_20
@@ -2376,9 +2738,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP11_15_12
                IP11_11_8
                IP11_7_4
-               IP11_3_0 }
+               IP11_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR12", 0xe6060230, 32, 4) {
+       { PINMUX_CFG_REG("IPSR12", 0xe6060230, 32, 4, GROUP(
                IP12_31_28
                IP12_27_24
                IP12_23_20
@@ -2386,9 +2748,9 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                IP12_15_12
                IP12_11_8
                IP12_7_4
-               IP12_3_0 }
+               IP12_3_0 ))
        },
-       { PINMUX_CFG_REG("IPSR13", 0xe6060234, 32, 4) {
+       { PINMUX_CFG_REG("IPSR13", 0xe6060234, 32, 4, GROUP(
                /* IP13_31_28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                /* IP13_27_24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                /* IP13_23_20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -2396,7 +2758,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                /* IP13_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                /* IP13_11_8  */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                IP13_7_4
-               IP13_3_0 }
+               IP13_3_0 ))
        },
 #undef F_
 #undef FM
@@ -2404,8 +2766,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,
-                            1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1,
-                            1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1) {
+                            GROUP(1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1,
+                                  1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1),
+                            GROUP(
                /* RESERVED 31 */
                0, 0,
                MOD_SEL0_30
@@ -2433,11 +2796,11 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                MOD_SEL0_3
                MOD_SEL0_2
                MOD_SEL0_1
-               MOD_SEL0_0 }
+               MOD_SEL0_0 ))
        },
        { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6060504, 32,
-                            1, 1, 1, 1, 1, 1, 2, 4, 4,
-                            4, 4, 4, 4) {
+                            GROUP(1, 1, 1, 1, 1, 1, 2, 4, 4, 4, 4, 4, 4),
+                            GROUP(
                MOD_SEL1_31
                MOD_SEL1_30
                MOD_SEL1_29
@@ -2457,7 +2820,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                /* RESERVED 7, 6, 5, 4  */
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                /* RESERVED 3, 2, 1, 0  */
-               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ))
        },
        { },
 };
@@ -2474,6 +2837,15 @@ static int r8a77995_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *po
        return bit;
 }
 
+enum ioctrl_regs {
+       TDSELCTRL,
+};
+
+static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
+       [TDSELCTRL] = { 0xe60603c0, },
+       { /* sentinel */ },
+};
+
 static const struct sh_pfc_soc_operations r8a77995_pinmux_ops = {
        .pin_to_pocctrl = r8a77995_pin_to_pocctrl,
 };
@@ -2493,6 +2865,7 @@ const struct sh_pfc_soc_info r8a77995_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),