blob: de5ec6c812ac3c39d13478ce7fd4e7356a91fc53 [file] [log] [blame]
LUU HOAI9b68f5d2023-02-28 22:34:40 +01001// SPDX-License-Identifier: GPL-2.0
2/*
3 * R8A779F0 processor support - PFC hardware block.
4 *
5 * Copyright (C) 2021 Renesas Electronics Corp.
6 *
7 * This file is based on the drivers/pinctrl/renesas/pfc-r8a779a0.c
8 */
9
LUU HOAI9b68f5d2023-02-28 22:34:40 +010010#include <dm.h>
11#include <errno.h>
12#include <dm/pinctrl.h>
13#include <linux/bitops.h>
14#include <linux/kernel.h>
15
16#include "sh_pfc.h"
17
18#define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | SH_PFC_PIN_CFG_PULL_UP_DOWN)
19
20#define CPU_ALL_GP(fn, sfx) \
21 PORT_GP_CFG_21(0, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33), \
22 PORT_GP_CFG_25(1, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33), \
23 PORT_GP_CFG_17(2, fn, sfx, CFG_FLAGS), \
24 PORT_GP_CFG_19(3, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE_18_33)
25
26#define CPU_ALL_NOGP(fn) \
27 PIN_NOGP_CFG(PRESETOUT0_N, "PRESETOUT0#", fn, SH_PFC_PIN_CFG_PULL_DOWN), \
28 PIN_NOGP_CFG(EXTALR, "EXTALR", fn, SH_PFC_PIN_CFG_PULL_UP_DOWN)
29
30/*
31 * F_() : just information
32 * FM() : macro for FN_xxx / xxx_MARK
33 */
34
35/* GPSR0 */
36#define GPSR0_20 F_(IRQ3, IP2SR0_19_16)
37#define GPSR0_19 F_(IRQ2, IP2SR0_15_12)
38#define GPSR0_18 F_(IRQ1, IP2SR0_11_8)
39#define GPSR0_17 F_(IRQ0, IP2SR0_7_4)
40#define GPSR0_16 F_(MSIOF0_SS2, IP2SR0_3_0)
41#define GPSR0_15 F_(MSIOF0_SS1, IP1SR0_31_28)
42#define GPSR0_14 F_(MSIOF0_SCK, IP1SR0_27_24)
43#define GPSR0_13 F_(MSIOF0_TXD, IP1SR0_23_20)
44#define GPSR0_12 F_(MSIOF0_RXD, IP1SR0_19_16)
45#define GPSR0_11 F_(MSIOF0_SYNC, IP1SR0_15_12)
46#define GPSR0_10 F_(CTS0_N, IP1SR0_11_8)
47#define GPSR0_9 F_(RTS0_N, IP1SR0_7_4)
48#define GPSR0_8 F_(SCK0, IP1SR0_3_0)
49#define GPSR0_7 F_(TX0, IP0SR0_31_28)
50#define GPSR0_6 F_(RX0, IP0SR0_27_24)
51#define GPSR0_5 F_(HRTS0_N, IP0SR0_23_20)
52#define GPSR0_4 F_(HCTS0_N, IP0SR0_19_16)
53#define GPSR0_3 F_(HTX0, IP0SR0_15_12)
54#define GPSR0_2 F_(HRX0, IP0SR0_11_8)
55#define GPSR0_1 F_(HSCK0, IP0SR0_7_4)
56#define GPSR0_0 F_(SCIF_CLK, IP0SR0_3_0)
57
58/* GPSR1 */
59#define GPSR1_24 FM(SD_WP)
60#define GPSR1_23 FM(SD_CD)
61#define GPSR1_22 FM(MMC_SD_CMD)
62#define GPSR1_21 FM(MMC_D7)
63#define GPSR1_20 FM(MMC_DS)
64#define GPSR1_19 FM(MMC_D6)
65#define GPSR1_18 FM(MMC_D4)
66#define GPSR1_17 FM(MMC_D5)
67#define GPSR1_16 FM(MMC_SD_D3)
68#define GPSR1_15 FM(MMC_SD_D2)
69#define GPSR1_14 FM(MMC_SD_D1)
70#define GPSR1_13 FM(MMC_SD_D0)
71#define GPSR1_12 FM(MMC_SD_CLK)
72#define GPSR1_11 FM(GP1_11)
73#define GPSR1_10 FM(GP1_10)
74#define GPSR1_9 FM(GP1_09)
75#define GPSR1_8 FM(GP1_08)
76#define GPSR1_7 F_(GP1_07, IP0SR1_31_28)
77#define GPSR1_6 F_(GP1_06, IP0SR1_27_24)
78#define GPSR1_5 F_(GP1_05, IP0SR1_23_20)
79#define GPSR1_4 F_(GP1_04, IP0SR1_19_16)
80#define GPSR1_3 F_(GP1_03, IP0SR1_15_12)
81#define GPSR1_2 F_(GP1_02, IP0SR1_11_8)
82#define GPSR1_1 F_(GP1_01, IP0SR1_7_4)
83#define GPSR1_0 F_(GP1_00, IP0SR1_3_0)
84
85/* GPSR2 */
86#define GPSR2_16 FM(PCIE1_CLKREQ_N)
87#define GPSR2_15 FM(PCIE0_CLKREQ_N)
88#define GPSR2_14 FM(QSPI0_IO3)
89#define GPSR2_13 FM(QSPI0_SSL)
90#define GPSR2_12 FM(QSPI0_MISO_IO1)
91#define GPSR2_11 FM(QSPI0_IO2)
92#define GPSR2_10 FM(QSPI0_SPCLK)
93#define GPSR2_9 FM(QSPI0_MOSI_IO0)
94#define GPSR2_8 FM(QSPI1_SPCLK)
95#define GPSR2_7 FM(QSPI1_MOSI_IO0)
96#define GPSR2_6 FM(QSPI1_IO2)
97#define GPSR2_5 FM(QSPI1_MISO_IO1)
98#define GPSR2_4 FM(QSPI1_IO3)
99#define GPSR2_3 FM(QSPI1_SSL)
100#define GPSR2_2 FM(RPC_RESET_N)
101#define GPSR2_1 FM(RPC_WP_N)
102#define GPSR2_0 FM(RPC_INT_N)
103
104/* GPSR3 */
105#define GPSR3_18 FM(TSN0_AVTP_CAPTURE_B)
106#define GPSR3_17 FM(TSN0_AVTP_MATCH_B)
107#define GPSR3_16 FM(TSN0_AVTP_PPS)
108#define GPSR3_15 FM(TSN1_AVTP_CAPTURE_B)
109#define GPSR3_14 FM(TSN1_AVTP_MATCH_B)
110#define GPSR3_13 FM(TSN1_AVTP_PPS)
111#define GPSR3_12 FM(TSN0_MAGIC_B)
112#define GPSR3_11 FM(TSN1_PHY_INT_B)
113#define GPSR3_10 FM(TSN0_PHY_INT_B)
114#define GPSR3_9 FM(TSN2_PHY_INT_B)
115#define GPSR3_8 FM(TSN0_LINK_B)
116#define GPSR3_7 FM(TSN2_LINK_B)
117#define GPSR3_6 FM(TSN1_LINK_B)
118#define GPSR3_5 FM(TSN1_MDC_B)
119#define GPSR3_4 FM(TSN0_MDC_B)
120#define GPSR3_3 FM(TSN2_MDC_B)
121#define GPSR3_2 FM(TSN0_MDIO_B)
122#define GPSR3_1 FM(TSN2_MDIO_B)
123#define GPSR3_0 FM(TSN1_MDIO_B)
124
125/* IP0SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
126#define IP0SR0_3_0 FM(SCIF_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) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
127#define IP0SR0_7_4 FM(HSCK0) FM(SCK3) FM(MSIOF3_SCK) F_(0, 0) F_(0, 0) FM(TSN0_AVTP_CAPTURE_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)
128#define IP0SR0_11_8 FM(HRX0) FM(RX3) FM(MSIOF3_RXD) F_(0, 0) F_(0, 0) FM(TSN0_AVTP_MATCH_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)
129#define IP0SR0_15_12 FM(HTX0) FM(TX3) FM(MSIOF3_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) F_(0, 0) F_(0, 0) F_(0, 0)
130#define IP0SR0_19_16 FM(HCTS0_N) FM(CTS3_N) FM(MSIOF3_SS1) F_(0, 0) F_(0, 0) FM(TSN0_MDC_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)
131#define IP0SR0_23_20 FM(HRTS0_N) FM(RTS3_N) FM(MSIOF3_SS2) F_(0, 0) F_(0, 0) FM(TSN0_MDIO_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)
132#define IP0SR0_27_24 FM(RX0) FM(HRX1) F_(0, 0) FM(MSIOF1_RXD) F_(0, 0) FM(TSN1_AVTP_MATCH_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)
133#define IP0SR0_31_28 FM(TX0) FM(HTX1) F_(0, 0) FM(MSIOF1_TXD) F_(0, 0) FM(TSN1_AVTP_CAPTURE_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)
134/* IP1SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
135#define IP1SR0_3_0 FM(SCK0) FM(HSCK1) F_(0, 0) FM(MSIOF1_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)
136#define IP1SR0_7_4 FM(RTS0_N) FM(HRTS1_N) FM(MSIOF3_SYNC) F_(0, 0) F_(0, 0) FM(TSN1_MDIO_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)
137#define IP1SR0_11_8 FM(CTS0_N) FM(HCTS1_N) F_(0, 0) FM(MSIOF1_SYNC) F_(0, 0) FM(TSN1_MDC_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)
138#define IP1SR0_15_12 FM(MSIOF0_SYNC) FM(HCTS3_N) FM(CTS1_N) FM(IRQ4) F_(0, 0) FM(TSN0_LINK_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)
139#define IP1SR0_19_16 FM(MSIOF0_RXD) FM(HRX3) FM(RX1) 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)
140#define IP1SR0_23_20 FM(MSIOF0_TXD) FM(HTX3) FM(TX1) 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)
141#define IP1SR0_27_24 FM(MSIOF0_SCK) FM(HSCK3) FM(SCK1) 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)
142#define IP1SR0_31_28 FM(MSIOF0_SS1) FM(HRTS3_N) FM(RTS1_N) FM(IRQ5) F_(0, 0) FM(TSN1_LINK_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)
143/* IP2SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
144#define IP2SR0_3_0 FM(MSIOF0_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN2_LINK_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)
145#define IP2SR0_7_4 FM(IRQ0) F_(0, 0) F_(0, 0) FM(MSIOF1_SS1) F_(0, 0) FM(TSN0_MAGIC_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)
146#define IP2SR0_11_8 FM(IRQ1) F_(0, 0) F_(0, 0) FM(MSIOF1_SS2) F_(0, 0) FM(TSN0_PHY_INT_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)
147#define IP2SR0_15_12 FM(IRQ2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN1_PHY_INT_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)
148#define IP2SR0_19_16 FM(IRQ3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TSN2_PHY_INT_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)
149
150/* IP0SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 - F */
151#define IP0SR1_3_0 FM(GP1_00) FM(TCLK1) FM(HSCK2) 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)
152#define IP0SR1_7_4 FM(GP1_01) FM(TCLK4) FM(HRX2) 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)
153#define IP0SR1_11_8 FM(GP1_02) F_(0, 0) FM(HTX2) FM(MSIOF2_SS1) F_(0, 0) FM(TSN2_MDC_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)
154#define IP0SR1_15_12 FM(GP1_03) FM(TCLK2) FM(HCTS2_N) FM(MSIOF2_SS2) FM(CTS4_N) FM(TSN2_MDIO_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)
155#define IP0SR1_19_16 FM(GP1_04) FM(TCLK3) FM(HRTS2_N) FM(MSIOF2_SYNC) FM(RTS4_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)
156#define IP0SR1_23_20 FM(GP1_05) FM(MSIOF2_SCK) FM(SCK4) 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)
157#define IP0SR1_27_24 FM(GP1_06) FM(MSIOF2_RXD) FM(RX4) 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)
158#define IP0SR1_31_28 FM(GP1_07) FM(MSIOF2_TXD) FM(TX4) 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)
159
160#define PINMUX_GPSR \
161 GPSR1_24 \
162 GPSR1_23 \
163 GPSR1_22 \
164 GPSR1_21 \
165GPSR0_20 GPSR1_20 \
166GPSR0_19 GPSR1_19 \
167GPSR0_18 GPSR1_18 GPSR3_18 \
168GPSR0_17 GPSR1_17 GPSR3_17 \
169GPSR0_16 GPSR1_16 GPSR2_16 GPSR3_16 \
170GPSR0_15 GPSR1_15 GPSR2_15 GPSR3_15 \
171GPSR0_14 GPSR1_14 GPSR2_14 GPSR3_14 \
172GPSR0_13 GPSR1_13 GPSR2_13 GPSR3_13 \
173GPSR0_12 GPSR1_12 GPSR2_12 GPSR3_12 \
174GPSR0_11 GPSR1_11 GPSR2_11 GPSR3_11 \
175GPSR0_10 GPSR1_10 GPSR2_10 GPSR3_10 \
176GPSR0_9 GPSR1_9 GPSR2_9 GPSR3_9 \
177GPSR0_8 GPSR1_8 GPSR2_8 GPSR3_8 \
178GPSR0_7 GPSR1_7 GPSR2_7 GPSR3_7 \
179GPSR0_6 GPSR1_6 GPSR2_6 GPSR3_6 \
180GPSR0_5 GPSR1_5 GPSR2_5 GPSR3_5 \
181GPSR0_4 GPSR1_4 GPSR2_4 GPSR3_4 \
182GPSR0_3 GPSR1_3 GPSR2_3 GPSR3_3 \
183GPSR0_2 GPSR1_2 GPSR2_2 GPSR3_2 \
184GPSR0_1 GPSR1_1 GPSR2_1 GPSR3_1 \
185GPSR0_0 GPSR1_0 GPSR2_0 GPSR3_0
186
187#define PINMUX_IPSR \
188\
189FM(IP0SR0_3_0) IP0SR0_3_0 FM(IP1SR0_3_0) IP1SR0_3_0 FM(IP2SR0_3_0) IP2SR0_3_0 \
190FM(IP0SR0_7_4) IP0SR0_7_4 FM(IP1SR0_7_4) IP1SR0_7_4 FM(IP2SR0_7_4) IP2SR0_7_4 \
191FM(IP0SR0_11_8) IP0SR0_11_8 FM(IP1SR0_11_8) IP1SR0_11_8 FM(IP2SR0_11_8) IP2SR0_11_8 \
192FM(IP0SR0_15_12) IP0SR0_15_12 FM(IP1SR0_15_12) IP1SR0_15_12 FM(IP2SR0_15_12) IP2SR0_15_12 \
193FM(IP0SR0_19_16) IP0SR0_19_16 FM(IP1SR0_19_16) IP1SR0_19_16 FM(IP2SR0_19_16) IP2SR0_19_16 \
194FM(IP0SR0_23_20) IP0SR0_23_20 FM(IP1SR0_23_20) IP1SR0_23_20 \
195FM(IP0SR0_27_24) IP0SR0_27_24 FM(IP1SR0_27_24) IP1SR0_27_24 \
196FM(IP0SR0_31_28) IP0SR0_31_28 FM(IP1SR0_31_28) IP1SR0_31_28 \
197\
198FM(IP0SR1_3_0) IP0SR1_3_0 \
199FM(IP0SR1_7_4) IP0SR1_7_4 \
200FM(IP0SR1_11_8) IP0SR1_11_8 \
201FM(IP0SR1_15_12) IP0SR1_15_12 \
202FM(IP0SR1_19_16) IP0SR1_19_16 \
203FM(IP0SR1_23_20) IP0SR1_23_20 \
204FM(IP0SR1_27_24) IP0SR1_27_24 \
205FM(IP0SR1_31_28) IP0SR1_31_28
206
207/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */
208#define MOD_SEL1_11_10 FM(SEL_I2C5_0) F_(0, 0) F_(0, 0) FM(SEL_I2C5_3)
209#define MOD_SEL1_9_8 FM(SEL_I2C4_0) F_(0, 0) F_(0, 0) FM(SEL_I2C4_3)
210#define MOD_SEL1_7_6 FM(SEL_I2C3_0) F_(0, 0) F_(0, 0) FM(SEL_I2C3_3)
211#define MOD_SEL1_5_4 FM(SEL_I2C2_0) F_(0, 0) F_(0, 0) FM(SEL_I2C2_3)
212#define MOD_SEL1_3_2 FM(SEL_I2C1_0) F_(0, 0) F_(0, 0) FM(SEL_I2C1_3)
213#define MOD_SEL1_1_0 FM(SEL_I2C0_0) F_(0, 0) F_(0, 0) FM(SEL_I2C0_3)
214
215#define PINMUX_MOD_SELS \
216\
217MOD_SEL1_11_10 \
218MOD_SEL1_9_8 \
219MOD_SEL1_7_6 \
220MOD_SEL1_5_4 \
221MOD_SEL1_3_2 \
222MOD_SEL1_1_0
223
224#define PINMUX_PHYS \
225 FM(SCL0) FM(SDA0) FM(SCL1) FM(SDA1) FM(SCL2) FM(SDA2) FM(SCL3) FM(SDA3) \
226 FM(SCL4) FM(SDA4) FM(SCL5) FM(SDA5)
227
228enum {
229 PINMUX_RESERVED = 0,
230
231 PINMUX_DATA_BEGIN,
232 GP_ALL(DATA),
233 PINMUX_DATA_END,
234
235#define F_(x, y)
236#define FM(x) FN_##x,
237 PINMUX_FUNCTION_BEGIN,
238 GP_ALL(FN),
239 PINMUX_GPSR
240 PINMUX_IPSR
241 PINMUX_MOD_SELS
242 PINMUX_FUNCTION_END,
243#undef F_
244#undef FM
245
246#define F_(x, y)
247#define FM(x) x##_MARK,
248 PINMUX_MARK_BEGIN,
249 PINMUX_GPSR
250 PINMUX_IPSR
251 PINMUX_MOD_SELS
252 PINMUX_PHYS
253 PINMUX_MARK_END,
254#undef F_
255#undef FM
256};
257
258static const u16 pinmux_data[] = {
259/* Using GP_1_[0-9] requires disabling I2C in MOD_SEL1 */
260#define GP_1_0_FN GP_1_0_FN, FN_SEL_I2C0_0
261#define GP_1_1_FN GP_1_1_FN, FN_SEL_I2C0_0
262#define GP_1_2_FN GP_1_2_FN, FN_SEL_I2C1_0
263#define GP_1_3_FN GP_1_3_FN, FN_SEL_I2C1_0
264#define GP_1_4_FN GP_1_4_FN, FN_SEL_I2C2_0
265#define GP_1_5_FN GP_1_5_FN, FN_SEL_I2C2_0
266#define GP_1_6_FN GP_1_6_FN, FN_SEL_I2C3_0
267#define GP_1_7_FN GP_1_7_FN, FN_SEL_I2C3_0
268#define GP_1_8_FN GP_1_8_FN, FN_SEL_I2C4_0
269#define GP_1_9_FN GP_1_9_FN, FN_SEL_I2C4_0
270 PINMUX_DATA_GP_ALL(),
271#undef GP_1_0_FN
272#undef GP_1_1_FN
273#undef GP_1_2_FN
274#undef GP_1_3_FN
275#undef GP_1_4_FN
276#undef GP_1_5_FN
277#undef GP_1_6_FN
278#undef GP_1_7_FN
279#undef GP_1_8_FN
280#undef GP_1_9_FN
281
282 PINMUX_SINGLE(SD_WP),
283 PINMUX_SINGLE(SD_CD),
284 PINMUX_SINGLE(MMC_SD_CMD),
285 PINMUX_SINGLE(MMC_D7),
286 PINMUX_SINGLE(MMC_DS),
287 PINMUX_SINGLE(MMC_D6),
288 PINMUX_SINGLE(MMC_D4),
289 PINMUX_SINGLE(MMC_D5),
290 PINMUX_SINGLE(MMC_SD_D3),
291 PINMUX_SINGLE(MMC_SD_D2),
292 PINMUX_SINGLE(MMC_SD_D1),
293 PINMUX_SINGLE(MMC_SD_D0),
294 PINMUX_SINGLE(MMC_SD_CLK),
295 PINMUX_SINGLE(PCIE1_CLKREQ_N),
296 PINMUX_SINGLE(PCIE0_CLKREQ_N),
297 PINMUX_SINGLE(QSPI0_IO3),
298 PINMUX_SINGLE(QSPI0_SSL),
299 PINMUX_SINGLE(QSPI0_MISO_IO1),
300 PINMUX_SINGLE(QSPI0_IO2),
301 PINMUX_SINGLE(QSPI0_SPCLK),
302 PINMUX_SINGLE(QSPI0_MOSI_IO0),
303 PINMUX_SINGLE(QSPI1_SPCLK),
304 PINMUX_SINGLE(QSPI1_MOSI_IO0),
305 PINMUX_SINGLE(QSPI1_IO2),
306 PINMUX_SINGLE(QSPI1_MISO_IO1),
307 PINMUX_SINGLE(QSPI1_IO3),
308 PINMUX_SINGLE(QSPI1_SSL),
309 PINMUX_SINGLE(RPC_RESET_N),
310 PINMUX_SINGLE(RPC_WP_N),
311 PINMUX_SINGLE(RPC_INT_N),
312
313 PINMUX_SINGLE(TSN0_AVTP_CAPTURE_B),
314 PINMUX_SINGLE(TSN0_AVTP_MATCH_B),
315 PINMUX_SINGLE(TSN0_AVTP_PPS),
316 PINMUX_SINGLE(TSN1_AVTP_CAPTURE_B),
317 PINMUX_SINGLE(TSN1_AVTP_MATCH_B),
318 PINMUX_SINGLE(TSN1_AVTP_PPS),
319 PINMUX_SINGLE(TSN0_MAGIC_B),
320 PINMUX_SINGLE(TSN1_PHY_INT_B),
321 PINMUX_SINGLE(TSN0_PHY_INT_B),
322 PINMUX_SINGLE(TSN2_PHY_INT_B),
323 PINMUX_SINGLE(TSN0_LINK_B),
324 PINMUX_SINGLE(TSN2_LINK_B),
325 PINMUX_SINGLE(TSN1_LINK_B),
326 PINMUX_SINGLE(TSN1_MDC_B),
327 PINMUX_SINGLE(TSN0_MDC_B),
328 PINMUX_SINGLE(TSN2_MDC_B),
329 PINMUX_SINGLE(TSN0_MDIO_B),
330 PINMUX_SINGLE(TSN2_MDIO_B),
331 PINMUX_SINGLE(TSN1_MDIO_B),
332
333 /* IP0SR0 */
334 PINMUX_IPSR_GPSR(IP0SR0_3_0, SCIF_CLK),
335
336 PINMUX_IPSR_GPSR(IP0SR0_7_4, HSCK0),
337 PINMUX_IPSR_GPSR(IP0SR0_7_4, SCK3),
338 PINMUX_IPSR_GPSR(IP0SR0_7_4, MSIOF3_SCK),
339 PINMUX_IPSR_GPSR(IP0SR0_7_4, TSN0_AVTP_CAPTURE_A),
340
341 PINMUX_IPSR_GPSR(IP0SR0_11_8, HRX0),
342 PINMUX_IPSR_GPSR(IP0SR0_11_8, RX3),
343 PINMUX_IPSR_GPSR(IP0SR0_11_8, MSIOF3_RXD),
344 PINMUX_IPSR_GPSR(IP0SR0_11_8, TSN0_AVTP_MATCH_A),
345
346 PINMUX_IPSR_GPSR(IP0SR0_15_12, HTX0),
347 PINMUX_IPSR_GPSR(IP0SR0_15_12, TX3),
348 PINMUX_IPSR_GPSR(IP0SR0_15_12, MSIOF3_TXD),
349
350 PINMUX_IPSR_GPSR(IP0SR0_19_16, HCTS0_N),
351 PINMUX_IPSR_GPSR(IP0SR0_19_16, CTS3_N),
352 PINMUX_IPSR_GPSR(IP0SR0_19_16, MSIOF3_SS1),
353 PINMUX_IPSR_GPSR(IP0SR0_19_16, TSN0_MDC_A),
354
355 PINMUX_IPSR_GPSR(IP0SR0_23_20, HRTS0_N),
356 PINMUX_IPSR_GPSR(IP0SR0_23_20, RTS3_N),
357 PINMUX_IPSR_GPSR(IP0SR0_23_20, MSIOF3_SS2),
358 PINMUX_IPSR_GPSR(IP0SR0_23_20, TSN0_MDIO_A),
359
360 PINMUX_IPSR_GPSR(IP0SR0_27_24, RX0),
361 PINMUX_IPSR_GPSR(IP0SR0_27_24, HRX1),
362 PINMUX_IPSR_GPSR(IP0SR0_27_24, MSIOF1_RXD),
363 PINMUX_IPSR_GPSR(IP0SR0_27_24, TSN1_AVTP_MATCH_A),
364
365 PINMUX_IPSR_GPSR(IP0SR0_31_28, TX0),
366 PINMUX_IPSR_GPSR(IP0SR0_31_28, HTX1),
367 PINMUX_IPSR_GPSR(IP0SR0_31_28, MSIOF1_TXD),
368 PINMUX_IPSR_GPSR(IP0SR0_31_28, TSN1_AVTP_CAPTURE_A),
369
370 /* IP1SR0 */
371 PINMUX_IPSR_GPSR(IP1SR0_3_0, SCK0),
372 PINMUX_IPSR_GPSR(IP1SR0_3_0, HSCK1),
373 PINMUX_IPSR_GPSR(IP1SR0_3_0, MSIOF1_SCK),
374
375 PINMUX_IPSR_GPSR(IP1SR0_7_4, RTS0_N),
376 PINMUX_IPSR_GPSR(IP1SR0_7_4, HRTS1_N),
377 PINMUX_IPSR_GPSR(IP1SR0_7_4, MSIOF3_SYNC),
378 PINMUX_IPSR_GPSR(IP1SR0_7_4, TSN1_MDIO_A),
379
380 PINMUX_IPSR_GPSR(IP1SR0_11_8, CTS0_N),
381 PINMUX_IPSR_GPSR(IP1SR0_11_8, HCTS1_N),
382 PINMUX_IPSR_GPSR(IP1SR0_11_8, MSIOF1_SYNC),
383 PINMUX_IPSR_GPSR(IP1SR0_11_8, TSN1_MDC_A),
384
385 PINMUX_IPSR_GPSR(IP1SR0_15_12, MSIOF0_SYNC),
386 PINMUX_IPSR_GPSR(IP1SR0_15_12, HCTS3_N),
387 PINMUX_IPSR_GPSR(IP1SR0_15_12, CTS1_N),
388 PINMUX_IPSR_GPSR(IP1SR0_15_12, IRQ4),
389 PINMUX_IPSR_GPSR(IP1SR0_15_12, TSN0_LINK_A),
390
391 PINMUX_IPSR_GPSR(IP1SR0_19_16, MSIOF0_RXD),
392 PINMUX_IPSR_GPSR(IP1SR0_19_16, HRX3),
393 PINMUX_IPSR_GPSR(IP1SR0_19_16, RX1),
394
395 PINMUX_IPSR_GPSR(IP1SR0_23_20, MSIOF0_TXD),
396 PINMUX_IPSR_GPSR(IP1SR0_23_20, HTX3),
397 PINMUX_IPSR_GPSR(IP1SR0_23_20, TX1),
398
399 PINMUX_IPSR_GPSR(IP1SR0_27_24, MSIOF0_SCK),
400 PINMUX_IPSR_GPSR(IP1SR0_27_24, HSCK3),
401 PINMUX_IPSR_GPSR(IP1SR0_27_24, SCK1),
402
403 PINMUX_IPSR_GPSR(IP1SR0_31_28, MSIOF0_SS1),
404 PINMUX_IPSR_GPSR(IP1SR0_31_28, HRTS3_N),
405 PINMUX_IPSR_GPSR(IP1SR0_31_28, RTS1_N),
406 PINMUX_IPSR_GPSR(IP1SR0_31_28, IRQ5),
407 PINMUX_IPSR_GPSR(IP1SR0_31_28, TSN1_LINK_A),
408
409 /* IP2SR0 */
410 PINMUX_IPSR_GPSR(IP2SR0_3_0, MSIOF0_SS2),
411 PINMUX_IPSR_GPSR(IP2SR0_3_0, TSN2_LINK_A),
412
413 PINMUX_IPSR_GPSR(IP2SR0_7_4, IRQ0),
414 PINMUX_IPSR_GPSR(IP2SR0_7_4, MSIOF1_SS1),
415 PINMUX_IPSR_GPSR(IP2SR0_7_4, TSN0_MAGIC_A),
416
417 PINMUX_IPSR_GPSR(IP2SR0_11_8, IRQ1),
418 PINMUX_IPSR_GPSR(IP2SR0_11_8, MSIOF1_SS2),
419 PINMUX_IPSR_GPSR(IP2SR0_11_8, TSN0_PHY_INT_A),
420
421 PINMUX_IPSR_GPSR(IP2SR0_15_12, IRQ2),
422 PINMUX_IPSR_GPSR(IP2SR0_15_12, TSN1_PHY_INT_A),
423
424 PINMUX_IPSR_GPSR(IP2SR0_19_16, IRQ3),
425 PINMUX_IPSR_GPSR(IP2SR0_19_16, TSN2_PHY_INT_A),
426
427 /* IP0SR1 */
428 /* GP1_00 = SCL0 */
429 PINMUX_IPSR_MSEL(IP0SR1_3_0, GP1_00, SEL_I2C0_0),
430 PINMUX_IPSR_MSEL(IP0SR1_3_0, TCLK1, SEL_I2C0_0),
431 PINMUX_IPSR_MSEL(IP0SR1_3_0, HSCK2, SEL_I2C0_0),
432 PINMUX_IPSR_PHYS(IP0SR1_3_0, SCL0, SEL_I2C0_3),
433
434 /* GP1_01 = SDA0 */
435 PINMUX_IPSR_MSEL(IP0SR1_7_4, GP1_01, SEL_I2C0_0),
436 PINMUX_IPSR_MSEL(IP0SR1_7_4, TCLK4, SEL_I2C0_0),
437 PINMUX_IPSR_MSEL(IP0SR1_7_4, HRX2, SEL_I2C0_0),
438 PINMUX_IPSR_PHYS(IP0SR1_7_4, SDA0, SEL_I2C0_3),
439
440 /* GP1_02 = SCL1 */
441 PINMUX_IPSR_MSEL(IP0SR1_11_8, GP1_02, SEL_I2C1_0),
442 PINMUX_IPSR_MSEL(IP0SR1_11_8, HTX2, SEL_I2C1_0),
443 PINMUX_IPSR_MSEL(IP0SR1_11_8, MSIOF2_SS1, SEL_I2C1_0),
444 PINMUX_IPSR_MSEL(IP0SR1_11_8, TSN2_MDC_A, SEL_I2C1_0),
445 PINMUX_IPSR_PHYS(IP0SR1_11_8, SCL1, SEL_I2C1_3),
446
447 /* GP1_03 = SDA1 */
448 PINMUX_IPSR_MSEL(IP0SR1_15_12, GP1_03, SEL_I2C1_0),
449 PINMUX_IPSR_MSEL(IP0SR1_15_12, TCLK2, SEL_I2C1_0),
450 PINMUX_IPSR_MSEL(IP0SR1_15_12, HCTS2_N, SEL_I2C1_0),
451 PINMUX_IPSR_MSEL(IP0SR1_15_12, MSIOF2_SS2, SEL_I2C1_0),
452 PINMUX_IPSR_MSEL(IP0SR1_15_12, CTS4_N, SEL_I2C1_0),
453 PINMUX_IPSR_MSEL(IP0SR1_15_12, TSN2_MDIO_A, SEL_I2C1_0),
454 PINMUX_IPSR_PHYS(IP0SR1_15_12, SDA1, SEL_I2C1_3),
455
456 /* GP1_04 = SCL2 */
457 PINMUX_IPSR_MSEL(IP0SR1_19_16, GP1_04, SEL_I2C2_0),
458 PINMUX_IPSR_MSEL(IP0SR1_19_16, TCLK3, SEL_I2C2_0),
459 PINMUX_IPSR_MSEL(IP0SR1_19_16, HRTS2_N, SEL_I2C2_0),
460 PINMUX_IPSR_MSEL(IP0SR1_19_16, MSIOF2_SYNC, SEL_I2C2_0),
461 PINMUX_IPSR_MSEL(IP0SR1_19_16, RTS4_N, SEL_I2C2_0),
462 PINMUX_IPSR_PHYS(IP0SR1_19_16, SCL2, SEL_I2C2_3),
463
464 /* GP1_05 = SDA2 */
465 PINMUX_IPSR_MSEL(IP0SR1_23_20, GP1_05, SEL_I2C2_0),
466 PINMUX_IPSR_MSEL(IP0SR1_23_20, MSIOF2_SCK, SEL_I2C2_0),
467 PINMUX_IPSR_MSEL(IP0SR1_23_20, SCK4, SEL_I2C2_0),
468 PINMUX_IPSR_PHYS(IP0SR1_23_20, SDA2, SEL_I2C2_3),
469
470 /* GP1_06 = SCL3 */
471 PINMUX_IPSR_MSEL(IP0SR1_27_24, GP1_06, SEL_I2C3_0),
472 PINMUX_IPSR_MSEL(IP0SR1_27_24, MSIOF2_RXD, SEL_I2C3_0),
473 PINMUX_IPSR_MSEL(IP0SR1_27_24, RX4, SEL_I2C3_0),
474 PINMUX_IPSR_PHYS(IP0SR1_27_24, SCL3, SEL_I2C3_3),
475
476 /* GP1_07 = SDA3 */
477 PINMUX_IPSR_MSEL(IP0SR1_31_28, GP1_07, SEL_I2C3_0),
478 PINMUX_IPSR_MSEL(IP0SR1_31_28, MSIOF2_TXD, SEL_I2C3_0),
479 PINMUX_IPSR_MSEL(IP0SR1_31_28, TX4, SEL_I2C3_0),
480 PINMUX_IPSR_PHYS(IP0SR1_31_28, SDA3, SEL_I2C3_3),
481
482 /* GP1_08 = SCL4 */
483 PINMUX_IPSR_NOGM(0, GP1_08, SEL_I2C4_0),
484 PINMUX_IPSR_NOFN(GP1_08, SCL4, SEL_I2C4_3),
485
486 /* GP1_09 = SDA4 */
487 PINMUX_IPSR_NOGM(0, GP1_09, SEL_I2C4_0),
488 PINMUX_IPSR_NOFN(GP1_09, SDA4, SEL_I2C4_3),
489
490 /* GP1_10 = SCL5 */
491 PINMUX_IPSR_NOGM(0, GP1_10, SEL_I2C5_0),
492 PINMUX_IPSR_NOFN(GP1_10, SCL5, SEL_I2C5_3),
493
494 /* GP1_11 = SDA5 */
495 PINMUX_IPSR_NOGM(0, GP1_11, SEL_I2C5_0),
496 PINMUX_IPSR_NOFN(GP1_11, SDA5, SEL_I2C5_3),
497};
498
499/*
500 * Pins not associated with a GPIO port.
501 */
502enum {
503 GP_ASSIGN_LAST(),
504 NOGP_ALL(),
505};
506
507static const struct sh_pfc_pin pinmux_pins[] = {
508 PINMUX_GPIO_GP_ALL(),
509};
510
511/* - HSCIF0 ----------------------------------------------------------------- */
512static const unsigned int hscif0_data_pins[] = {
513 /* HRX0, HTX0 */
514 RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
515};
516static const unsigned int hscif0_data_mux[] = {
517 HRX0_MARK, HTX0_MARK,
518};
519static const unsigned int hscif0_clk_pins[] = {
520 /* HSCK0 */
521 RCAR_GP_PIN(0, 1),
522};
523static const unsigned int hscif0_clk_mux[] = {
524 HSCK0_MARK,
525};
526static const unsigned int hscif0_ctrl_pins[] = {
527 /* HRTS0#, HCTS0# */
528 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 4),
529};
530static const unsigned int hscif0_ctrl_mux[] = {
531 HRTS0_N_MARK, HCTS0_N_MARK,
532};
533
534/* - HSCIF1 ----------------------------------------------------------------- */
535static const unsigned int hscif1_data_pins[] = {
536 /* HRX1, HTX1 */
537 RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
538};
539static const unsigned int hscif1_data_mux[] = {
540 HRX1_MARK, HTX1_MARK,
541};
542static const unsigned int hscif1_clk_pins[] = {
543 /* HSCK1 */
544 RCAR_GP_PIN(0, 8),
545};
546static const unsigned int hscif1_clk_mux[] = {
547 HSCK1_MARK,
548};
549static const unsigned int hscif1_ctrl_pins[] = {
550 /* HRTS1#, HCTS1# */
551 RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 10),
552};
553static const unsigned int hscif1_ctrl_mux[] = {
554 HRTS1_N_MARK, HCTS1_N_MARK,
555};
556
557/* - HSCIF2 ----------------------------------------------------------------- */
558static const unsigned int hscif2_data_pins[] = {
559 /* HRX2, HTX2 */
560 RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 2),
561};
562static const unsigned int hscif2_data_mux[] = {
563 HRX2_MARK, HTX2_MARK,
564};
565static const unsigned int hscif2_clk_pins[] = {
566 /* HSCK2 */
567 RCAR_GP_PIN(1, 0),
568};
569static const unsigned int hscif2_clk_mux[] = {
570 HSCK2_MARK,
571};
572static const unsigned int hscif2_ctrl_pins[] = {
573 /* HRTS2#, HCTS2# */
574 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3),
575};
576static const unsigned int hscif2_ctrl_mux[] = {
577 HRTS2_N_MARK, HCTS2_N_MARK,
578};
579
580/* - HSCIF3 ----------------------------------------------------------------- */
581static const unsigned int hscif3_data_pins[] = {
582 /* HRX3, HTX3 */
583 RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
584};
585static const unsigned int hscif3_data_mux[] = {
586 HRX3_MARK, HTX3_MARK,
587};
588static const unsigned int hscif3_clk_pins[] = {
589 /* HSCK3 */
590 RCAR_GP_PIN(0, 14),
591};
592static const unsigned int hscif3_clk_mux[] = {
593 HSCK3_MARK,
594};
595static const unsigned int hscif3_ctrl_pins[] = {
596 /* HRTS3#, HCTS3# */
597 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 11),
598};
599static const unsigned int hscif3_ctrl_mux[] = {
600 HRTS3_N_MARK, HCTS3_N_MARK,
601};
602
603/* - I2C0 ------------------------------------------------------------------- */
604static const unsigned int i2c0_pins[] = {
605 /* SDA0, SCL0 */
606 RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 0),
607};
608static const unsigned int i2c0_mux[] = {
609 SDA0_MARK, SCL0_MARK,
610};
611
612/* - I2C1 ------------------------------------------------------------------- */
613static const unsigned int i2c1_pins[] = {
614 /* SDA1, SCL1 */
615 RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2),
616};
617static const unsigned int i2c1_mux[] = {
618 SDA1_MARK, SCL1_MARK,
619};
620
621/* - I2C2 ------------------------------------------------------------------- */
622static const unsigned int i2c2_pins[] = {
623 /* SDA2, SCL2 */
624 RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 4),
625};
626static const unsigned int i2c2_mux[] = {
627 SDA2_MARK, SCL2_MARK,
628};
629
630/* - I2C3 ------------------------------------------------------------------- */
631static const unsigned int i2c3_pins[] = {
632 /* SDA3, SCL3 */
633 RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6),
634};
635static const unsigned int i2c3_mux[] = {
636 SDA3_MARK, SCL3_MARK,
637};
638
639/* - I2C4 ------------------------------------------------------------------- */
640static const unsigned int i2c4_pins[] = {
641 /* SDA4, SCL4 */
642 RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 8),
643};
644static const unsigned int i2c4_mux[] = {
645 SDA4_MARK, SCL4_MARK,
646};
647
648/* - I2C5 ------------------------------------------------------------------- */
649static const unsigned int i2c5_pins[] = {
650 /* SDA5, SCL5 */
651 RCAR_GP_PIN(1, 11), RCAR_GP_PIN(1, 10),
652};
653static const unsigned int i2c5_mux[] = {
654 SDA5_MARK, SCL5_MARK,
655};
656
657
658/* - INTC-EX ---------------------------------------------------------------- */
659static const unsigned int intc_ex_irq0_pins[] = {
660 /* IRQ0 */
661 RCAR_GP_PIN(0, 17),
662};
663static const unsigned int intc_ex_irq0_mux[] = {
664 IRQ0_MARK,
665};
666static const unsigned int intc_ex_irq1_pins[] = {
667 /* IRQ1 */
668 RCAR_GP_PIN(0, 18),
669};
670static const unsigned int intc_ex_irq1_mux[] = {
671 IRQ1_MARK,
672};
673static const unsigned int intc_ex_irq2_pins[] = {
674 /* IRQ2 */
675 RCAR_GP_PIN(0, 19),
676};
677static const unsigned int intc_ex_irq2_mux[] = {
678 IRQ2_MARK,
679};
680static const unsigned int intc_ex_irq3_pins[] = {
681 /* IRQ3 */
682 RCAR_GP_PIN(0, 20),
683};
684static const unsigned int intc_ex_irq3_mux[] = {
685 IRQ3_MARK,
686};
687static const unsigned int intc_ex_irq4_pins[] = {
688 /* IRQ4 */
689 RCAR_GP_PIN(0, 11),
690};
691static const unsigned int intc_ex_irq4_mux[] = {
692 IRQ4_MARK,
693};
694static const unsigned int intc_ex_irq5_pins[] = {
695 /* IRQ5 */
696 RCAR_GP_PIN(0, 15),
697};
698static const unsigned int intc_ex_irq5_mux[] = {
699 IRQ5_MARK,
700};
701
702/* - MMC -------------------------------------------------------------------- */
703static const unsigned int mmc_data_pins[] = {
704 /* MMC_SD_D[0:3], MMC_D[4:7] */
705 RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
706 RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
707 RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 17),
708 RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 21),
709};
710static const unsigned int mmc_data_mux[] = {
711 MMC_SD_D0_MARK, MMC_SD_D1_MARK,
712 MMC_SD_D2_MARK, MMC_SD_D3_MARK,
713 MMC_D4_MARK, MMC_D5_MARK,
714 MMC_D6_MARK, MMC_D7_MARK,
715};
716static const unsigned int mmc_ctrl_pins[] = {
717 /* MMC_SD_CLK, MMC_SD_CMD */
718 RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 22),
719};
720static const unsigned int mmc_ctrl_mux[] = {
721 MMC_SD_CLK_MARK, MMC_SD_CMD_MARK,
722};
723static const unsigned int mmc_cd_pins[] = {
724 /* SD_CD */
725 RCAR_GP_PIN(1, 23),
726};
727static const unsigned int mmc_cd_mux[] = {
728 SD_CD_MARK,
729};
730static const unsigned int mmc_wp_pins[] = {
731 /* SD_WP */
732 RCAR_GP_PIN(1, 24),
733};
734static const unsigned int mmc_wp_mux[] = {
735 SD_WP_MARK,
736};
737static const unsigned int mmc_ds_pins[] = {
738 /* MMC_DS */
739 RCAR_GP_PIN(1, 20),
740};
741static const unsigned int mmc_ds_mux[] = {
742 MMC_DS_MARK,
743};
744
745/* - MSIOF0 ----------------------------------------------------------------- */
746static const unsigned int msiof0_clk_pins[] = {
747 /* MSIOF0_SCK */
748 RCAR_GP_PIN(0, 14),
749};
750static const unsigned int msiof0_clk_mux[] = {
751 MSIOF0_SCK_MARK,
752};
753static const unsigned int msiof0_sync_pins[] = {
754 /* MSIOF0_SYNC */
755 RCAR_GP_PIN(0, 11),
756};
757static const unsigned int msiof0_sync_mux[] = {
758 MSIOF0_SYNC_MARK,
759};
760static const unsigned int msiof0_ss1_pins[] = {
761 /* MSIOF0_SS1 */
762 RCAR_GP_PIN(0, 15),
763};
764static const unsigned int msiof0_ss1_mux[] = {
765 MSIOF0_SS1_MARK,
766};
767static const unsigned int msiof0_ss2_pins[] = {
768 /* MSIOF0_SS2 */
769 RCAR_GP_PIN(0, 16),
770};
771static const unsigned int msiof0_ss2_mux[] = {
772 MSIOF0_SS2_MARK,
773};
774static const unsigned int msiof0_txd_pins[] = {
775 /* MSIOF0_TXD */
776 RCAR_GP_PIN(0, 13),
777};
778static const unsigned int msiof0_txd_mux[] = {
779 MSIOF0_TXD_MARK,
780};
781static const unsigned int msiof0_rxd_pins[] = {
782 /* MSIOF0_RXD */
783 RCAR_GP_PIN(0, 12),
784};
785static const unsigned int msiof0_rxd_mux[] = {
786 MSIOF0_RXD_MARK,
787};
788
789/* - MSIOF1 ----------------------------------------------------------------- */
790static const unsigned int msiof1_clk_pins[] = {
791 /* MSIOF1_SCK */
792 RCAR_GP_PIN(0, 8),
793};
794static const unsigned int msiof1_clk_mux[] = {
795 MSIOF1_SCK_MARK,
796};
797static const unsigned int msiof1_sync_pins[] = {
798 /* MSIOF1_SYNC */
799 RCAR_GP_PIN(0, 10),
800};
801static const unsigned int msiof1_sync_mux[] = {
802 MSIOF1_SYNC_MARK,
803};
804static const unsigned int msiof1_ss1_pins[] = {
805 /* MSIOF1_SS1 */
806 RCAR_GP_PIN(0, 17),
807};
808static const unsigned int msiof1_ss1_mux[] = {
809 MSIOF1_SS1_MARK,
810};
811static const unsigned int msiof1_ss2_pins[] = {
812 /* MSIOF1_SS2 */
813 RCAR_GP_PIN(0, 18),
814};
815static const unsigned int msiof1_ss2_mux[] = {
816 MSIOF1_SS2_MARK,
817};
818static const unsigned int msiof1_txd_pins[] = {
819 /* MSIOF1_TXD */
820 RCAR_GP_PIN(0, 7),
821};
822static const unsigned int msiof1_txd_mux[] = {
823 MSIOF1_TXD_MARK,
824};
825static const unsigned int msiof1_rxd_pins[] = {
826 /* MSIOF1_RXD */
827 RCAR_GP_PIN(0, 6),
828};
829static const unsigned int msiof1_rxd_mux[] = {
830 MSIOF1_RXD_MARK,
831};
832
833/* - MSIOF2 ----------------------------------------------------------------- */
834static const unsigned int msiof2_clk_pins[] = {
835 /* MSIOF2_SCK */
836 RCAR_GP_PIN(1, 5),
837};
838static const unsigned int msiof2_clk_mux[] = {
839 MSIOF2_SCK_MARK,
840};
841static const unsigned int msiof2_sync_pins[] = {
842 /* MSIOF2_SYNC */
843 RCAR_GP_PIN(1, 4),
844};
845static const unsigned int msiof2_sync_mux[] = {
846 MSIOF2_SYNC_MARK,
847};
848static const unsigned int msiof2_ss1_pins[] = {
849 /* MSIOF2_SS1 */
850 RCAR_GP_PIN(1, 2),
851};
852static const unsigned int msiof2_ss1_mux[] = {
853 MSIOF2_SS1_MARK,
854};
855static const unsigned int msiof2_ss2_pins[] = {
856 /* MSIOF2_SS2 */
857 RCAR_GP_PIN(1, 3),
858};
859static const unsigned int msiof2_ss2_mux[] = {
860 MSIOF2_SS2_MARK,
861};
862static const unsigned int msiof2_txd_pins[] = {
863 /* MSIOF2_TXD */
864 RCAR_GP_PIN(1, 7),
865};
866static const unsigned int msiof2_txd_mux[] = {
867 MSIOF2_TXD_MARK,
868};
869static const unsigned int msiof2_rxd_pins[] = {
870 /* MSIOF2_RXD */
871 RCAR_GP_PIN(1, 6),
872};
873static const unsigned int msiof2_rxd_mux[] = {
874 MSIOF2_RXD_MARK,
875};
876
877/* - MSIOF3 ----------------------------------------------------------------- */
878static const unsigned int msiof3_clk_pins[] = {
879 /* MSIOF3_SCK */
880 RCAR_GP_PIN(0, 1),
881};
882static const unsigned int msiof3_clk_mux[] = {
883 MSIOF3_SCK_MARK,
884};
885static const unsigned int msiof3_sync_pins[] = {
886 /* MSIOF3_SYNC */
887 RCAR_GP_PIN(0, 9),
888};
889static const unsigned int msiof3_sync_mux[] = {
890 MSIOF3_SYNC_MARK,
891};
892static const unsigned int msiof3_ss1_pins[] = {
893 /* MSIOF3_SS1 */
894 RCAR_GP_PIN(0, 4),
895};
896static const unsigned int msiof3_ss1_mux[] = {
897 MSIOF3_SS1_MARK,
898};
899static const unsigned int msiof3_ss2_pins[] = {
900 /* MSIOF3_SS2 */
901 RCAR_GP_PIN(0, 5),
902};
903static const unsigned int msiof3_ss2_mux[] = {
904 MSIOF3_SS2_MARK,
905};
906static const unsigned int msiof3_txd_pins[] = {
907 /* MSIOF3_TXD */
908 RCAR_GP_PIN(0, 3),
909};
910static const unsigned int msiof3_txd_mux[] = {
911 MSIOF3_TXD_MARK,
912};
913static const unsigned int msiof3_rxd_pins[] = {
914 /* MSIOF3_RXD */
915 RCAR_GP_PIN(0, 2),
916};
917static const unsigned int msiof3_rxd_mux[] = {
918 MSIOF3_RXD_MARK,
919};
920
921/* - PCIE ------------------------------------------------------------------- */
922static const unsigned int pcie0_clkreq_n_pins[] = {
923 /* PCIE0_CLKREQ# */
924 RCAR_GP_PIN(2, 15),
925};
926
927static const unsigned int pcie0_clkreq_n_mux[] = {
928 PCIE0_CLKREQ_N_MARK,
929};
930
931static const unsigned int pcie1_clkreq_n_pins[] = {
932 /* PCIE1_CLKREQ# */
933 RCAR_GP_PIN(2, 16),
934};
935
936static const unsigned int pcie1_clkreq_n_mux[] = {
937 PCIE1_CLKREQ_N_MARK,
938};
939
940/* - QSPI0 ------------------------------------------------------------------ */
941static const unsigned int qspi0_ctrl_pins[] = {
942 /* SPCLK, SSL */
943 RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 13),
944};
945static const unsigned int qspi0_ctrl_mux[] = {
946 QSPI0_SPCLK_MARK, QSPI0_SSL_MARK,
947};
948static const unsigned int qspi0_data_pins[] = {
949 /* MOSI_IO0, MISO_IO1, IO2, IO3 */
950 RCAR_GP_PIN(2, 9), RCAR_GP_PIN(2, 12),
951 RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 14),
952};
953static const unsigned int qspi0_data_mux[] = {
954 QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
955 QSPI0_IO2_MARK, QSPI0_IO3_MARK
956};
957
958/* - QSPI1 ------------------------------------------------------------------ */
959static const unsigned int qspi1_ctrl_pins[] = {
960 /* SPCLK, SSL */
961 RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 3),
962};
963static const unsigned int qspi1_ctrl_mux[] = {
964 QSPI1_SPCLK_MARK, QSPI1_SSL_MARK,
965};
966static const unsigned int qspi1_data_pins[] = {
967 /* MOSI_IO0, MISO_IO1, IO2, IO3 */
968 RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 5),
969 RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 4),
970};
971static const unsigned int qspi1_data_mux[] = {
972 QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
973 QSPI1_IO2_MARK, QSPI1_IO3_MARK
974};
975
976/* - SCIF0 ------------------------------------------------------------------ */
977static const unsigned int scif0_data_pins[] = {
978 /* RX0, TX0 */
979 RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
980};
981static const unsigned int scif0_data_mux[] = {
982 RX0_MARK, TX0_MARK,
983};
984static const unsigned int scif0_clk_pins[] = {
985 /* SCK0 */
986 RCAR_GP_PIN(0, 8),
987};
988static const unsigned int scif0_clk_mux[] = {
989 SCK0_MARK,
990};
991static const unsigned int scif0_ctrl_pins[] = {
992 /* RTS0#, CTS0# */
993 RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 10),
994};
995static const unsigned int scif0_ctrl_mux[] = {
996 RTS0_N_MARK, CTS0_N_MARK,
997};
998
999/* - SCIF1 ------------------------------------------------------------------ */
1000static const unsigned int scif1_data_pins[] = {
1001 /* RX1, TX1 */
1002 RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
1003};
1004static const unsigned int scif1_data_mux[] = {
1005 RX1_MARK, TX1_MARK,
1006};
1007static const unsigned int scif1_clk_pins[] = {
1008 /* SCK1 */
1009 RCAR_GP_PIN(0, 14),
1010};
1011static const unsigned int scif1_clk_mux[] = {
1012 SCK1_MARK,
1013};
1014static const unsigned int scif1_ctrl_pins[] = {
1015 /* RTS1#, CTS1# */
1016 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 11),
1017};
1018static const unsigned int scif1_ctrl_mux[] = {
1019 RTS1_N_MARK, CTS1_N_MARK,
1020};
1021
1022/* - SCIF3 ------------------------------------------------------------------ */
1023static const unsigned int scif3_data_pins[] = {
1024 /* RX3, TX3 */
1025 RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
1026};
1027static const unsigned int scif3_data_mux[] = {
1028 RX3_MARK, TX3_MARK,
1029};
1030static const unsigned int scif3_clk_pins[] = {
1031 /* SCK3 */
1032 RCAR_GP_PIN(0, 1),
1033};
1034static const unsigned int scif3_clk_mux[] = {
1035 SCK3_MARK,
1036};
1037static const unsigned int scif3_ctrl_pins[] = {
1038 /* RTS3#, CTS3# */
1039 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 4),
1040};
1041static const unsigned int scif3_ctrl_mux[] = {
1042 RTS3_N_MARK, CTS3_N_MARK,
1043};
1044
1045/* - SCIF4 ------------------------------------------------------------------ */
1046static const unsigned int scif4_data_pins[] = {
1047 /* RX4, TX4 */
1048 RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
1049};
1050static const unsigned int scif4_data_mux[] = {
1051 RX4_MARK, TX4_MARK,
1052};
1053static const unsigned int scif4_clk_pins[] = {
1054 /* SCK4 */
1055 RCAR_GP_PIN(1, 5),
1056};
1057static const unsigned int scif4_clk_mux[] = {
1058 SCK4_MARK,
1059};
1060static const unsigned int scif4_ctrl_pins[] = {
1061 /* RTS4#, CTS4# */
1062 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3),
1063};
1064static const unsigned int scif4_ctrl_mux[] = {
1065 RTS4_N_MARK, CTS4_N_MARK,
1066};
1067
1068/* - SCIF Clock ------------------------------------------------------------- */
1069static const unsigned int scif_clk_pins[] = {
1070 /* SCIF_CLK */
1071 RCAR_GP_PIN(0, 0),
1072};
1073static const unsigned int scif_clk_mux[] = {
1074 SCIF_CLK_MARK,
1075};
1076
1077/* - TSN0 ------------------------------------------------ */
1078static const unsigned int tsn0_link_a_pins[] = {
1079 /* TSN0_LINK_A */
1080 RCAR_GP_PIN(0, 11),
1081};
1082static const unsigned int tsn0_link_a_mux[] = {
1083 TSN0_LINK_A_MARK,
1084};
1085static const unsigned int tsn0_magic_a_pins[] = {
1086 /* TSN0_MAGIC_A */
1087 RCAR_GP_PIN(0, 17),
1088};
1089static const unsigned int tsn0_magic_a_mux[] = {
1090 TSN0_MAGIC_A_MARK,
1091};
1092static const unsigned int tsn0_phy_int_a_pins[] = {
1093 /* TSN0_PHY_INT_A */
1094 RCAR_GP_PIN(0, 18),
1095};
1096static const unsigned int tsn0_phy_int_a_mux[] = {
1097 TSN0_PHY_INT_A_MARK,
1098};
1099static const unsigned int tsn0_mdio_a_pins[] = {
1100 /* TSN0_MDC_A, TSN0_MDIO_A */
1101 RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
1102};
1103static const unsigned int tsn0_mdio_a_mux[] = {
1104 TSN0_MDC_A_MARK, TSN0_MDIO_A_MARK,
1105};
1106static const unsigned int tsn0_link_b_pins[] = {
1107 /* TSN0_LINK_B */
1108 RCAR_GP_PIN(3, 8),
1109};
1110static const unsigned int tsn0_link_b_mux[] = {
1111 TSN0_LINK_B_MARK,
1112};
1113static const unsigned int tsn0_magic_b_pins[] = {
1114 /* TSN0_MAGIC_B */
1115 RCAR_GP_PIN(3, 12),
1116};
1117static const unsigned int tsn0_magic_b_mux[] = {
1118 TSN0_MAGIC_B_MARK,
1119};
1120static const unsigned int tsn0_phy_int_b_pins[] = {
1121 /* TSN0_PHY_INT_B */
1122 RCAR_GP_PIN(3, 10),
1123};
1124static const unsigned int tsn0_phy_int_b_mux[] = {
1125 TSN0_PHY_INT_B_MARK,
1126};
1127static const unsigned int tsn0_mdio_b_pins[] = {
1128 /* TSN0_MDC_B, TSN0_MDIO_B */
1129 RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 2),
1130};
1131static const unsigned int tsn0_mdio_b_mux[] = {
1132 TSN0_MDC_B_MARK, TSN0_MDIO_B_MARK,
1133};
1134static const unsigned int tsn0_avtp_pps_pins[] = {
1135 /* TSN0_AVTP_PPS */
1136 RCAR_GP_PIN(3, 16),
1137};
1138static const unsigned int tsn0_avtp_pps_mux[] = {
1139 TSN0_AVTP_PPS_MARK,
1140};
1141static const unsigned int tsn0_avtp_capture_a_pins[] = {
1142 /* TSN0_AVTP_CAPTURE_A */
1143 RCAR_GP_PIN(0, 1),
1144};
1145static const unsigned int tsn0_avtp_capture_a_mux[] = {
1146 TSN0_AVTP_CAPTURE_A_MARK,
1147};
1148static const unsigned int tsn0_avtp_match_a_pins[] = {
1149 /* TSN0_AVTP_MATCH_A */
1150 RCAR_GP_PIN(0, 2),
1151};
1152static const unsigned int tsn0_avtp_match_a_mux[] = {
1153 TSN0_AVTP_MATCH_A_MARK,
1154};
1155static const unsigned int tsn0_avtp_capture_b_pins[] = {
1156 /* TSN0_AVTP_CAPTURE_B */
1157 RCAR_GP_PIN(3, 18),
1158};
1159static const unsigned int tsn0_avtp_capture_b_mux[] = {
1160 TSN0_AVTP_CAPTURE_B_MARK,
1161};
1162static const unsigned int tsn0_avtp_match_b_pins[] = {
1163 /* TSN0_AVTP_MATCH_B */
1164 RCAR_GP_PIN(3, 17),
1165};
1166static const unsigned int tsn0_avtp_match_b_mux[] = {
1167 TSN0_AVTP_MATCH_B_MARK,
1168};
1169
1170/* - TSN1 ------------------------------------------------ */
1171static const unsigned int tsn1_link_a_pins[] = {
1172 /* TSN1_LINK_A */
1173 RCAR_GP_PIN(0, 15),
1174};
1175static const unsigned int tsn1_link_a_mux[] = {
1176 TSN1_LINK_A_MARK,
1177};
1178static const unsigned int tsn1_phy_int_a_pins[] = {
1179 /* TSN1_PHY_INT_A */
1180 RCAR_GP_PIN(0, 19),
1181};
1182static const unsigned int tsn1_phy_int_a_mux[] = {
1183 TSN1_PHY_INT_A_MARK,
1184};
1185static const unsigned int tsn1_mdio_a_pins[] = {
1186 /* TSN1_MDC_A, TSN1_MDIO_A */
1187 RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 9),
1188};
1189static const unsigned int tsn1_mdio_a_mux[] = {
1190 TSN1_MDC_A_MARK, TSN1_MDIO_A_MARK,
1191};
1192static const unsigned int tsn1_link_b_pins[] = {
1193 /* TSN1_LINK_B */
1194 RCAR_GP_PIN(3, 6),
1195};
1196static const unsigned int tsn1_link_b_mux[] = {
1197 TSN1_LINK_B_MARK,
1198};
1199static const unsigned int tsn1_phy_int_b_pins[] = {
1200 /* TSN1_PHY_INT_B */
1201 RCAR_GP_PIN(3, 11),
1202};
1203static const unsigned int tsn1_phy_int_b_mux[] = {
1204 TSN1_PHY_INT_B_MARK,
1205};
1206static const unsigned int tsn1_mdio_b_pins[] = {
1207 /* TSN1_MDC_B, TSN1_MDIO_B */
1208 RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 0),
1209};
1210static const unsigned int tsn1_mdio_b_mux[] = {
1211 TSN1_MDC_B_MARK, TSN1_MDIO_B_MARK,
1212};
1213static const unsigned int tsn1_avtp_pps_pins[] = {
1214 /* TSN1_AVTP_PPS */
1215 RCAR_GP_PIN(3, 13),
1216};
1217static const unsigned int tsn1_avtp_pps_mux[] = {
Marek Vasut86fc8172023-09-17 16:08:48 +02001218 TSN1_AVTP_PPS_MARK,
LUU HOAI9b68f5d2023-02-28 22:34:40 +01001219};
1220static const unsigned int tsn1_avtp_capture_a_pins[] = {
1221 /* TSN1_AVTP_CAPTURE_A */
1222 RCAR_GP_PIN(0, 7),
1223};
1224static const unsigned int tsn1_avtp_capture_a_mux[] = {
1225 TSN1_AVTP_CAPTURE_A_MARK,
1226};
1227static const unsigned int tsn1_avtp_match_a_pins[] = {
1228 /* TSN1_AVTP_MATCH_A */
1229 RCAR_GP_PIN(0, 6),
1230};
1231static const unsigned int tsn1_avtp_match_a_mux[] = {
1232 TSN1_AVTP_MATCH_A_MARK,
1233};
1234static const unsigned int tsn1_avtp_capture_b_pins[] = {
1235 /* TSN1_AVTP_CAPTURE_B */
1236 RCAR_GP_PIN(3, 15),
1237};
1238static const unsigned int tsn1_avtp_capture_b_mux[] = {
1239 TSN1_AVTP_CAPTURE_B_MARK,
1240};
1241static const unsigned int tsn1_avtp_match_b_pins[] = {
1242 /* TSN1_AVTP_MATCH_B */
1243 RCAR_GP_PIN(3, 14),
1244};
1245static const unsigned int tsn1_avtp_match_b_mux[] = {
1246 TSN1_AVTP_MATCH_B_MARK,
1247};
1248
1249/* - TSN2 ------------------------------------------------ */
1250static const unsigned int tsn2_link_a_pins[] = {
1251 /* TSN2_LINK_A */
1252 RCAR_GP_PIN(0, 16),
1253};
1254static const unsigned int tsn2_link_a_mux[] = {
1255 TSN2_LINK_A_MARK,
1256};
1257static const unsigned int tsn2_phy_int_a_pins[] = {
1258 /* TSN2_PHY_INT_A */
1259 RCAR_GP_PIN(0, 20),
1260};
1261static const unsigned int tsn2_phy_int_a_mux[] = {
1262 TSN2_PHY_INT_A_MARK,
1263};
1264static const unsigned int tsn2_mdio_a_pins[] = {
1265 /* TSN2_MDC_A, TSN2_MDIO_A */
1266 RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
1267};
1268static const unsigned int tsn2_mdio_a_mux[] = {
1269 TSN2_MDC_A_MARK, TSN2_MDIO_A_MARK,
1270};
1271static const unsigned int tsn2_link_b_pins[] = {
1272 /* TSN2_LINK_B */
1273 RCAR_GP_PIN(3, 7),
1274};
1275static const unsigned int tsn2_link_b_mux[] = {
1276 TSN2_LINK_B_MARK,
1277};
1278static const unsigned int tsn2_phy_int_b_pins[] = {
1279 /* TSN2_PHY_INT_B */
1280 RCAR_GP_PIN(3, 9),
1281};
1282static const unsigned int tsn2_phy_int_b_mux[] = {
1283 TSN2_PHY_INT_B_MARK,
1284};
1285static const unsigned int tsn2_mdio_b_pins[] = {
1286 /* TSN2_MDC_B, TSN2_MDIO_B */
1287 RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 1),
1288};
1289static const unsigned int tsn2_mdio_b_mux[] = {
1290 TSN2_MDC_B_MARK, TSN2_MDIO_B_MARK,
1291};
1292
1293static const struct sh_pfc_pin_group pinmux_groups[] = {
1294 SH_PFC_PIN_GROUP(hscif0_data),
1295 SH_PFC_PIN_GROUP(hscif0_clk),
1296 SH_PFC_PIN_GROUP(hscif0_ctrl),
1297 SH_PFC_PIN_GROUP(hscif1_data),
1298 SH_PFC_PIN_GROUP(hscif1_clk),
1299 SH_PFC_PIN_GROUP(hscif1_ctrl),
1300 SH_PFC_PIN_GROUP(hscif2_data),
1301 SH_PFC_PIN_GROUP(hscif2_clk),
1302 SH_PFC_PIN_GROUP(hscif2_ctrl),
1303 SH_PFC_PIN_GROUP(hscif3_data),
1304 SH_PFC_PIN_GROUP(hscif3_clk),
1305 SH_PFC_PIN_GROUP(hscif3_ctrl),
1306 SH_PFC_PIN_GROUP(i2c0),
1307 SH_PFC_PIN_GROUP(i2c1),
1308 SH_PFC_PIN_GROUP(i2c2),
1309 SH_PFC_PIN_GROUP(i2c3),
1310 SH_PFC_PIN_GROUP(i2c4),
1311 SH_PFC_PIN_GROUP(i2c5),
1312 SH_PFC_PIN_GROUP(intc_ex_irq0),
1313 SH_PFC_PIN_GROUP(intc_ex_irq1),
1314 SH_PFC_PIN_GROUP(intc_ex_irq2),
1315 SH_PFC_PIN_GROUP(intc_ex_irq3),
1316 SH_PFC_PIN_GROUP(intc_ex_irq4),
1317 SH_PFC_PIN_GROUP(intc_ex_irq5),
1318 BUS_DATA_PIN_GROUP(mmc_data, 1),
1319 BUS_DATA_PIN_GROUP(mmc_data, 4),
1320 BUS_DATA_PIN_GROUP(mmc_data, 8),
1321 SH_PFC_PIN_GROUP(mmc_ctrl),
1322 SH_PFC_PIN_GROUP(mmc_cd),
1323 SH_PFC_PIN_GROUP(mmc_wp),
1324 SH_PFC_PIN_GROUP(mmc_ds),
1325 SH_PFC_PIN_GROUP(msiof0_clk),
1326 SH_PFC_PIN_GROUP(msiof0_sync),
1327 SH_PFC_PIN_GROUP(msiof0_ss1),
1328 SH_PFC_PIN_GROUP(msiof0_ss2),
1329 SH_PFC_PIN_GROUP(msiof0_txd),
1330 SH_PFC_PIN_GROUP(msiof0_rxd),
1331 SH_PFC_PIN_GROUP(msiof1_clk),
1332 SH_PFC_PIN_GROUP(msiof1_sync),
1333 SH_PFC_PIN_GROUP(msiof1_ss1),
1334 SH_PFC_PIN_GROUP(msiof1_ss2),
1335 SH_PFC_PIN_GROUP(msiof1_txd),
1336 SH_PFC_PIN_GROUP(msiof1_rxd),
1337 SH_PFC_PIN_GROUP(msiof2_clk),
1338 SH_PFC_PIN_GROUP(msiof2_sync),
1339 SH_PFC_PIN_GROUP(msiof2_ss1),
1340 SH_PFC_PIN_GROUP(msiof2_ss2),
1341 SH_PFC_PIN_GROUP(msiof2_txd),
1342 SH_PFC_PIN_GROUP(msiof2_rxd),
1343 SH_PFC_PIN_GROUP(msiof3_clk),
1344 SH_PFC_PIN_GROUP(msiof3_sync),
1345 SH_PFC_PIN_GROUP(msiof3_ss1),
1346 SH_PFC_PIN_GROUP(msiof3_ss2),
1347 SH_PFC_PIN_GROUP(msiof3_txd),
1348 SH_PFC_PIN_GROUP(msiof3_rxd),
1349 SH_PFC_PIN_GROUP(pcie0_clkreq_n),
1350 SH_PFC_PIN_GROUP(pcie1_clkreq_n),
1351 SH_PFC_PIN_GROUP(qspi0_ctrl),
1352 BUS_DATA_PIN_GROUP(qspi0_data, 2),
1353 BUS_DATA_PIN_GROUP(qspi0_data, 4),
1354 SH_PFC_PIN_GROUP(qspi1_ctrl),
1355 BUS_DATA_PIN_GROUP(qspi1_data, 2),
1356 BUS_DATA_PIN_GROUP(qspi1_data, 4),
1357 SH_PFC_PIN_GROUP(scif0_data),
1358 SH_PFC_PIN_GROUP(scif0_clk),
1359 SH_PFC_PIN_GROUP(scif0_ctrl),
1360 SH_PFC_PIN_GROUP(scif1_data),
1361 SH_PFC_PIN_GROUP(scif1_clk),
1362 SH_PFC_PIN_GROUP(scif1_ctrl),
1363 SH_PFC_PIN_GROUP(scif3_data),
1364 SH_PFC_PIN_GROUP(scif3_clk),
1365 SH_PFC_PIN_GROUP(scif3_ctrl),
1366 SH_PFC_PIN_GROUP(scif4_data),
1367 SH_PFC_PIN_GROUP(scif4_clk),
1368 SH_PFC_PIN_GROUP(scif4_ctrl),
1369 SH_PFC_PIN_GROUP(scif_clk),
1370 SH_PFC_PIN_GROUP(tsn0_link_a),
1371 SH_PFC_PIN_GROUP(tsn0_magic_a),
1372 SH_PFC_PIN_GROUP(tsn0_phy_int_a),
1373 SH_PFC_PIN_GROUP(tsn0_mdio_a),
1374 SH_PFC_PIN_GROUP(tsn0_link_b),
1375 SH_PFC_PIN_GROUP(tsn0_magic_b),
1376 SH_PFC_PIN_GROUP(tsn0_phy_int_b),
1377 SH_PFC_PIN_GROUP(tsn0_mdio_b),
1378 SH_PFC_PIN_GROUP(tsn0_avtp_pps),
1379 SH_PFC_PIN_GROUP(tsn0_avtp_capture_a),
1380 SH_PFC_PIN_GROUP(tsn0_avtp_match_a),
1381 SH_PFC_PIN_GROUP(tsn0_avtp_capture_b),
1382 SH_PFC_PIN_GROUP(tsn0_avtp_match_b),
1383 SH_PFC_PIN_GROUP(tsn1_link_a),
1384 SH_PFC_PIN_GROUP(tsn1_phy_int_a),
1385 SH_PFC_PIN_GROUP(tsn1_mdio_a),
1386 SH_PFC_PIN_GROUP(tsn1_link_b),
1387 SH_PFC_PIN_GROUP(tsn1_phy_int_b),
1388 SH_PFC_PIN_GROUP(tsn1_mdio_b),
1389 SH_PFC_PIN_GROUP(tsn1_avtp_pps),
1390 SH_PFC_PIN_GROUP(tsn1_avtp_capture_a),
1391 SH_PFC_PIN_GROUP(tsn1_avtp_match_a),
1392 SH_PFC_PIN_GROUP(tsn1_avtp_capture_b),
1393 SH_PFC_PIN_GROUP(tsn1_avtp_match_b),
1394 SH_PFC_PIN_GROUP(tsn2_link_a),
1395 SH_PFC_PIN_GROUP(tsn2_phy_int_a),
1396 SH_PFC_PIN_GROUP(tsn2_mdio_a),
1397 SH_PFC_PIN_GROUP(tsn2_link_b),
1398 SH_PFC_PIN_GROUP(tsn2_phy_int_b),
1399 SH_PFC_PIN_GROUP(tsn2_mdio_b),
1400};
1401
1402static const char * const hscif0_groups[] = {
1403 "hscif0_data",
1404 "hscif0_clk",
1405 "hscif0_ctrl",
1406};
1407
1408static const char * const hscif1_groups[] = {
1409 "hscif1_data",
1410 "hscif1_clk",
1411 "hscif1_ctrl",
1412};
1413
1414static const char * const hscif2_groups[] = {
1415 "hscif2_data",
1416 "hscif2_clk",
1417 "hscif2_ctrl",
1418};
1419
1420static const char * const hscif3_groups[] = {
1421 "hscif3_data",
1422 "hscif3_clk",
1423 "hscif3_ctrl",
1424};
1425
1426static const char * const i2c0_groups[] = {
1427 "i2c0",
1428};
1429
1430static const char * const i2c1_groups[] = {
1431 "i2c1",
1432};
1433
1434static const char * const i2c2_groups[] = {
1435 "i2c2",
1436};
1437
1438static const char * const i2c3_groups[] = {
1439 "i2c3",
1440};
1441
1442static const char * const i2c4_groups[] = {
1443 "i2c4",
1444};
1445
1446static const char * const i2c5_groups[] = {
1447 "i2c5",
1448};
1449
1450static const char * const intc_ex_groups[] = {
1451 "intc_ex_irq0",
1452 "intc_ex_irq1",
1453 "intc_ex_irq2",
1454 "intc_ex_irq3",
1455 "intc_ex_irq4",
1456 "intc_ex_irq5",
1457};
1458
1459static const char * const mmc_groups[] = {
1460 "mmc_data1",
1461 "mmc_data4",
1462 "mmc_data8",
1463 "mmc_ctrl",
1464 "mmc_cd",
1465 "mmc_wp",
1466 "mmc_ds",
1467};
1468
1469static const char * const msiof0_groups[] = {
1470 "msiof0_clk",
1471 "msiof0_sync",
1472 "msiof0_ss1",
1473 "msiof0_ss2",
1474 "msiof0_txd",
1475 "msiof0_rxd",
1476};
1477
1478static const char * const msiof1_groups[] = {
1479 "msiof1_clk",
1480 "msiof1_sync",
1481 "msiof1_ss1",
1482 "msiof1_ss2",
1483 "msiof1_txd",
1484 "msiof1_rxd",
1485};
1486
1487static const char * const msiof2_groups[] = {
1488 "msiof2_clk",
1489 "msiof2_sync",
1490 "msiof2_ss1",
1491 "msiof2_ss2",
1492 "msiof2_txd",
1493 "msiof2_rxd",
1494};
1495
1496static const char * const msiof3_groups[] = {
1497 "msiof3_clk",
1498 "msiof3_sync",
1499 "msiof3_ss1",
1500 "msiof3_ss2",
1501 "msiof3_txd",
1502 "msiof3_rxd",
1503};
1504
1505static const char * const pcie_groups[] = {
1506 "pcie0_clkreq_n",
1507 "pcie1_clkreq_n",
1508};
1509
1510static const char * const qspi0_groups[] = {
1511 "qspi0_ctrl",
1512 "qspi0_data2",
1513 "qspi0_data4",
1514};
1515
1516static const char * const qspi1_groups[] = {
1517 "qspi1_ctrl",
1518 "qspi1_data2",
1519 "qspi1_data4",
1520};
1521
1522static const char * const scif0_groups[] = {
1523 "scif0_data",
1524 "scif0_clk",
1525 "scif0_ctrl",
1526};
1527
1528static const char * const scif1_groups[] = {
1529 "scif1_data",
1530 "scif1_clk",
1531 "scif1_ctrl",
1532};
1533
1534static const char * const scif3_groups[] = {
1535 "scif3_data",
1536 "scif3_clk",
1537 "scif3_ctrl",
1538};
1539
1540static const char * const scif4_groups[] = {
1541 "scif4_data",
1542 "scif4_clk",
1543 "scif4_ctrl",
1544};
1545
1546static const char * const scif_clk_groups[] = {
1547 "scif_clk",
1548};
1549
1550static const char * const tsn0_groups[] = {
1551 "tsn0_link_a",
1552 "tsn0_magic_a",
1553 "tsn0_phy_int_a",
1554 "tsn0_mdio_a",
1555 "tsn0_link_b",
1556 "tsn0_magic_b",
1557 "tsn0_phy_int_b",
1558 "tsn0_mdio_b",
1559 "tsn0_avtp_pps",
1560 "tsn0_avtp_capture_a",
1561 "tsn0_avtp_match_a",
1562 "tsn0_avtp_capture_b",
1563 "tsn0_avtp_match_b",
1564};
1565
1566static const char * const tsn1_groups[] = {
1567 "tsn1_link_a",
1568 "tsn1_phy_int_a",
1569 "tsn1_mdio_a",
1570 "tsn1_link_b",
1571 "tsn1_phy_int_b",
1572 "tsn1_mdio_b",
1573 "tsn1_avtp_pps",
1574 "tsn1_avtp_capture_a",
1575 "tsn1_avtp_match_a",
1576 "tsn1_avtp_capture_b",
1577 "tsn1_avtp_match_b",
1578};
1579
1580static const char * const tsn2_groups[] = {
1581 "tsn2_link_a",
1582 "tsn2_phy_int_a",
1583 "tsn2_mdio_a",
1584 "tsn2_link_b",
1585 "tsn2_phy_int_b",
1586 "tsn2_mdio_b",
1587};
1588
1589static const struct sh_pfc_function pinmux_functions[] = {
1590 SH_PFC_FUNCTION(hscif0),
1591 SH_PFC_FUNCTION(hscif1),
1592 SH_PFC_FUNCTION(hscif2),
1593 SH_PFC_FUNCTION(hscif3),
1594 SH_PFC_FUNCTION(i2c0),
1595 SH_PFC_FUNCTION(i2c1),
1596 SH_PFC_FUNCTION(i2c2),
1597 SH_PFC_FUNCTION(i2c3),
1598 SH_PFC_FUNCTION(i2c4),
1599 SH_PFC_FUNCTION(i2c5),
1600 SH_PFC_FUNCTION(intc_ex),
1601 SH_PFC_FUNCTION(mmc),
1602 SH_PFC_FUNCTION(msiof0),
1603 SH_PFC_FUNCTION(msiof1),
1604 SH_PFC_FUNCTION(msiof2),
1605 SH_PFC_FUNCTION(msiof3),
1606 SH_PFC_FUNCTION(pcie),
1607 SH_PFC_FUNCTION(qspi0),
1608 SH_PFC_FUNCTION(qspi1),
1609 SH_PFC_FUNCTION(scif0),
1610 SH_PFC_FUNCTION(scif1),
1611 SH_PFC_FUNCTION(scif3),
1612 SH_PFC_FUNCTION(scif4),
1613 SH_PFC_FUNCTION(scif_clk),
1614 SH_PFC_FUNCTION(tsn0),
1615 SH_PFC_FUNCTION(tsn1),
1616 SH_PFC_FUNCTION(tsn2),
1617};
1618
1619static const struct pinmux_cfg_reg pinmux_config_regs[] = {
1620#define F_(x, y) FN_##y
1621#define FM(x) FN_##x
1622 { PINMUX_CFG_REG_VAR("GPSR0", 0xe6050040, 32,
1623 GROUP(-11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
1625 GROUP(
1626 /* GP0_31_21 RESERVED */
1627 GP_0_20_FN, GPSR0_20,
1628 GP_0_19_FN, GPSR0_19,
1629 GP_0_18_FN, GPSR0_18,
1630 GP_0_17_FN, GPSR0_17,
1631 GP_0_16_FN, GPSR0_16,
1632 GP_0_15_FN, GPSR0_15,
1633 GP_0_14_FN, GPSR0_14,
1634 GP_0_13_FN, GPSR0_13,
1635 GP_0_12_FN, GPSR0_12,
1636 GP_0_11_FN, GPSR0_11,
1637 GP_0_10_FN, GPSR0_10,
1638 GP_0_9_FN, GPSR0_9,
1639 GP_0_8_FN, GPSR0_8,
1640 GP_0_7_FN, GPSR0_7,
1641 GP_0_6_FN, GPSR0_6,
1642 GP_0_5_FN, GPSR0_5,
1643 GP_0_4_FN, GPSR0_4,
1644 GP_0_3_FN, GPSR0_3,
1645 GP_0_2_FN, GPSR0_2,
1646 GP_0_1_FN, GPSR0_1,
1647 GP_0_0_FN, GPSR0_0, ))
1648 },
1649 { PINMUX_CFG_REG_VAR("GPSR1", 0xe6050840, 32,
1650 GROUP(-7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1651 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
1652 GROUP(
1653 /* GP1_31_25 RESERVED */
1654 GP_1_24_FN, GPSR1_24,
1655 GP_1_23_FN, GPSR1_23,
1656 GP_1_22_FN, GPSR1_22,
1657 GP_1_21_FN, GPSR1_21,
1658 GP_1_20_FN, GPSR1_20,
1659 GP_1_19_FN, GPSR1_19,
1660 GP_1_18_FN, GPSR1_18,
1661 GP_1_17_FN, GPSR1_17,
1662 GP_1_16_FN, GPSR1_16,
1663 GP_1_15_FN, GPSR1_15,
1664 GP_1_14_FN, GPSR1_14,
1665 GP_1_13_FN, GPSR1_13,
1666 GP_1_12_FN, GPSR1_12,
1667 GP_1_11_FN, GPSR1_11,
1668 GP_1_10_FN, GPSR1_10,
1669 GP_1_9_FN, GPSR1_9,
1670 GP_1_8_FN, GPSR1_8,
1671 GP_1_7_FN, GPSR1_7,
1672 GP_1_6_FN, GPSR1_6,
1673 GP_1_5_FN, GPSR1_5,
1674 GP_1_4_FN, GPSR1_4,
1675 GP_1_3_FN, GPSR1_3,
1676 GP_1_2_FN, GPSR1_2,
1677 GP_1_1_FN, GPSR1_1,
1678 GP_1_0_FN, GPSR1_0, ))
1679 },
1680 { PINMUX_CFG_REG_VAR("GPSR2", 0xe6051040, 32,
1681 GROUP(-15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1682 1, 1, 1, 1, 1, 1),
1683 GROUP(
1684 /* GP2_31_17 RESERVED */
1685 GP_2_16_FN, GPSR2_16,
1686 GP_2_15_FN, GPSR2_15,
1687 GP_2_14_FN, GPSR2_14,
1688 GP_2_13_FN, GPSR2_13,
1689 GP_2_12_FN, GPSR2_12,
1690 GP_2_11_FN, GPSR2_11,
1691 GP_2_10_FN, GPSR2_10,
1692 GP_2_9_FN, GPSR2_9,
1693 GP_2_8_FN, GPSR2_8,
1694 GP_2_7_FN, GPSR2_7,
1695 GP_2_6_FN, GPSR2_6,
1696 GP_2_5_FN, GPSR2_5,
1697 GP_2_4_FN, GPSR2_4,
1698 GP_2_3_FN, GPSR2_3,
1699 GP_2_2_FN, GPSR2_2,
1700 GP_2_1_FN, GPSR2_1,
1701 GP_2_0_FN, GPSR2_0, ))
1702 },
1703 { PINMUX_CFG_REG_VAR("GPSR3", 0xe6051840, 32,
1704 GROUP(-13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1705 1, 1, 1, 1, 1, 1, 1, 1),
1706 GROUP(
1707 /* GP3_31_19 RESERVED */
1708 GP_3_18_FN, GPSR3_18,
1709 GP_3_17_FN, GPSR3_17,
1710 GP_3_16_FN, GPSR3_16,
1711 GP_3_15_FN, GPSR3_15,
1712 GP_3_14_FN, GPSR3_14,
1713 GP_3_13_FN, GPSR3_13,
1714 GP_3_12_FN, GPSR3_12,
1715 GP_3_11_FN, GPSR3_11,
1716 GP_3_10_FN, GPSR3_10,
1717 GP_3_9_FN, GPSR3_9,
1718 GP_3_8_FN, GPSR3_8,
1719 GP_3_7_FN, GPSR3_7,
1720 GP_3_6_FN, GPSR3_6,
1721 GP_3_5_FN, GPSR3_5,
1722 GP_3_4_FN, GPSR3_4,
1723 GP_3_3_FN, GPSR3_3,
1724 GP_3_2_FN, GPSR3_2,
1725 GP_3_1_FN, GPSR3_1,
1726 GP_3_0_FN, GPSR3_0, ))
1727 },
1728#undef F_
1729#undef FM
1730
1731#define F_(x, y) x,
1732#define FM(x) FN_##x,
1733 { PINMUX_CFG_REG("IP0SR0", 0xe6050060, 32, 4, GROUP(
1734 IP0SR0_31_28
1735 IP0SR0_27_24
1736 IP0SR0_23_20
1737 IP0SR0_19_16
1738 IP0SR0_15_12
1739 IP0SR0_11_8
1740 IP0SR0_7_4
1741 IP0SR0_3_0))
1742 },
1743 { PINMUX_CFG_REG("IP1SR0", 0xe6050064, 32, 4, GROUP(
1744 IP1SR0_31_28
1745 IP1SR0_27_24
1746 IP1SR0_23_20
1747 IP1SR0_19_16
1748 IP1SR0_15_12
1749 IP1SR0_11_8
1750 IP1SR0_7_4
1751 IP1SR0_3_0))
1752 },
1753 { PINMUX_CFG_REG_VAR("IP2SR0", 0xe6050068, 32,
1754 GROUP(-12, 4, 4, 4, 4, 4),
1755 GROUP(
1756 /* IP2SR0_31_20 RESERVED */
1757 IP2SR0_19_16
1758 IP2SR0_15_12
1759 IP2SR0_11_8
1760 IP2SR0_7_4
1761 IP2SR0_3_0))
1762 },
1763 { PINMUX_CFG_REG("IP0SR1", 0xe6050860, 32, 4, GROUP(
1764 IP0SR1_31_28
1765 IP0SR1_27_24
1766 IP0SR1_23_20
1767 IP0SR1_19_16
1768 IP0SR1_15_12
1769 IP0SR1_11_8
1770 IP0SR1_7_4
1771 IP0SR1_3_0))
1772 },
1773#undef F_
1774#undef FM
1775
1776#define F_(x, y) x,
1777#define FM(x) FN_##x,
1778 { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6050900, 32,
1779 GROUP(-20, 2, 2, 2, 2, 2, 2),
1780 GROUP(
1781 /* RESERVED 31-12 */
1782 MOD_SEL1_11_10
1783 MOD_SEL1_9_8
1784 MOD_SEL1_7_6
1785 MOD_SEL1_5_4
1786 MOD_SEL1_3_2
1787 MOD_SEL1_1_0))
1788 },
Marek Vasut86fc8172023-09-17 16:08:48 +02001789 { /* sentinel */ }
LUU HOAI9b68f5d2023-02-28 22:34:40 +01001790};
1791
1792static const struct pinmux_drive_reg pinmux_drive_regs[] = {
1793 { PINMUX_DRIVE_REG("DRV0CTRL0", 0xe6050080) {
1794 { RCAR_GP_PIN(0, 7), 28, 3 }, /* TX0 */
1795 { RCAR_GP_PIN(0, 6), 24, 3 }, /* RX0 */
1796 { RCAR_GP_PIN(0, 5), 20, 3 }, /* HRTS0_N */
1797 { RCAR_GP_PIN(0, 4), 16, 3 }, /* HCTS0_N */
1798 { RCAR_GP_PIN(0, 3), 12, 3 }, /* HTX0 */
1799 { RCAR_GP_PIN(0, 2), 8, 3 }, /* HRX0 */
1800 { RCAR_GP_PIN(0, 1), 4, 3 }, /* HSCK0 */
1801 { RCAR_GP_PIN(0, 0), 0, 3 }, /* SCIF_CLK */
1802 } },
1803 { PINMUX_DRIVE_REG("DRV1CTRL0", 0xe6050084) {
1804 { RCAR_GP_PIN(0, 15), 28, 3 }, /* MSIOF0_SS1 */
1805 { RCAR_GP_PIN(0, 14), 24, 3 }, /* MSIOF0_SCK */
1806 { RCAR_GP_PIN(0, 13), 20, 3 }, /* MSIOF0_TXD */
1807 { RCAR_GP_PIN(0, 12), 16, 3 }, /* MSIOF0_RXD */
1808 { RCAR_GP_PIN(0, 11), 12, 3 }, /* MSIOF0_SYNC */
1809 { RCAR_GP_PIN(0, 10), 8, 3 }, /* CTS0_N */
1810 { RCAR_GP_PIN(0, 9), 4, 3 }, /* RTS0_N */
1811 { RCAR_GP_PIN(0, 8), 0, 3 }, /* SCK0 */
1812 } },
1813 { PINMUX_DRIVE_REG("DRV2CTRL0", 0xe6050088) {
1814 { RCAR_GP_PIN(0, 20), 16, 3 }, /* IRQ3 */
1815 { RCAR_GP_PIN(0, 19), 12, 3 }, /* IRQ2 */
1816 { RCAR_GP_PIN(0, 18), 8, 3 }, /* IRQ1 */
1817 { RCAR_GP_PIN(0, 17), 4, 3 }, /* IRQ0 */
1818 { RCAR_GP_PIN(0, 16), 0, 3 }, /* MSIOF0_SS2 */
1819 } },
1820 { PINMUX_DRIVE_REG("DRV0CTRL1", 0xe6050880) {
1821 { RCAR_GP_PIN(1, 7), 28, 3 }, /* GP1_07 */
1822 { RCAR_GP_PIN(1, 6), 24, 3 }, /* GP1_06 */
1823 { RCAR_GP_PIN(1, 5), 20, 3 }, /* GP1_05 */
1824 { RCAR_GP_PIN(1, 4), 16, 3 }, /* GP1_04 */
1825 { RCAR_GP_PIN(1, 3), 12, 3 }, /* GP1_03 */
1826 { RCAR_GP_PIN(1, 2), 8, 3 }, /* GP1_02 */
1827 { RCAR_GP_PIN(1, 1), 4, 3 }, /* GP1_01 */
1828 { RCAR_GP_PIN(1, 0), 0, 3 }, /* GP1_00 */
1829 } },
1830 { PINMUX_DRIVE_REG("DRV1CTRL1", 0xe6050884) {
1831 { RCAR_GP_PIN(1, 15), 28, 3 }, /* MMC_SD_D2 */
1832 { RCAR_GP_PIN(1, 14), 24, 3 }, /* MMC_SD_D1 */
1833 { RCAR_GP_PIN(1, 13), 20, 3 }, /* MMC_SD_D0 */
1834 { RCAR_GP_PIN(1, 12), 16, 3 }, /* MMC_SD_CLK */
1835 { RCAR_GP_PIN(1, 11), 12, 3 }, /* GP1_11 */
1836 { RCAR_GP_PIN(1, 10), 8, 3 }, /* GP1_10 */
1837 { RCAR_GP_PIN(1, 9), 4, 3 }, /* GP1_09 */
1838 { RCAR_GP_PIN(1, 8), 0, 3 }, /* GP1_08 */
1839 } },
1840 { PINMUX_DRIVE_REG("DRV2CTRL1", 0xe6050888) {
1841 { RCAR_GP_PIN(1, 23), 28, 3 }, /* SD_CD */
1842 { RCAR_GP_PIN(1, 22), 24, 3 }, /* MMC_SD_CMD */
1843 { RCAR_GP_PIN(1, 21), 20, 3 }, /* MMC_D7 */
1844 { RCAR_GP_PIN(1, 20), 16, 3 }, /* MMC_DS */
1845 { RCAR_GP_PIN(1, 19), 12, 3 }, /* MMC_D6 */
1846 { RCAR_GP_PIN(1, 18), 8, 3 }, /* MMC_D4 */
1847 { RCAR_GP_PIN(1, 17), 4, 3 }, /* MMC_D5 */
1848 { RCAR_GP_PIN(1, 16), 0, 3 }, /* MMC_SD_D3 */
1849 } },
1850 { PINMUX_DRIVE_REG("DRV3CTRL1", 0xe605088c) {
1851 { RCAR_GP_PIN(1, 24), 0, 3 }, /* SD_WP */
1852 } },
1853 { PINMUX_DRIVE_REG("DRV0CTRL2", 0xe6051080) {
1854 { RCAR_GP_PIN(2, 7), 28, 2 }, /* QSPI1_MOSI_IO0 */
1855 { RCAR_GP_PIN(2, 6), 24, 2 }, /* QSPI1_IO2 */
1856 { RCAR_GP_PIN(2, 5), 20, 2 }, /* QSPI1_MISO_IO1 */
1857 { RCAR_GP_PIN(2, 4), 16, 2 }, /* QSPI1_IO3 */
1858 { RCAR_GP_PIN(2, 3), 12, 2 }, /* QSPI1_SSL */
1859 { RCAR_GP_PIN(2, 2), 8, 2 }, /* RPC_RESET_N */
1860 { RCAR_GP_PIN(2, 1), 4, 2 }, /* RPC_WP_N */
1861 { RCAR_GP_PIN(2, 0), 0, 2 }, /* RPC_INT_N */
1862 } },
1863 { PINMUX_DRIVE_REG("DRV1CTRL2", 0xe6051084) {
1864 { RCAR_GP_PIN(2, 15), 28, 3 }, /* PCIE0_CLKREQ_N */
1865 { RCAR_GP_PIN(2, 14), 24, 2 }, /* QSPI0_IO3 */
1866 { RCAR_GP_PIN(2, 13), 20, 2 }, /* QSPI0_SSL */
1867 { RCAR_GP_PIN(2, 12), 16, 2 }, /* QSPI0_MISO_IO1 */
1868 { RCAR_GP_PIN(2, 11), 12, 2 }, /* QSPI0_IO2 */
1869 { RCAR_GP_PIN(2, 10), 8, 2 }, /* QSPI0_SPCLK */
1870 { RCAR_GP_PIN(2, 9), 4, 2 }, /* QSPI0_MOSI_IO0 */
1871 { RCAR_GP_PIN(2, 8), 0, 2 }, /* QSPI1_SPCLK */
1872 } },
1873 { PINMUX_DRIVE_REG("DRV2CTRL2", 0xe6051088) {
1874 { RCAR_GP_PIN(2, 16), 0, 3 }, /* PCIE1_CLKREQ_N */
1875 } },
1876 { PINMUX_DRIVE_REG("DRV0CTRL3", 0xe6051880) {
1877 { RCAR_GP_PIN(3, 7), 28, 3 }, /* TSN2_LINK_B */
1878 { RCAR_GP_PIN(3, 6), 24, 3 }, /* TSN1_LINK_B */
1879 { RCAR_GP_PIN(3, 5), 20, 3 }, /* TSN1_MDC_B */
1880 { RCAR_GP_PIN(3, 4), 16, 3 }, /* TSN0_MDC_B */
1881 { RCAR_GP_PIN(3, 3), 12, 3 }, /* TSN2_MDC_B */
1882 { RCAR_GP_PIN(3, 2), 8, 3 }, /* TSN0_MDIO_B */
1883 { RCAR_GP_PIN(3, 1), 4, 3 }, /* TSN2_MDIO_B */
1884 { RCAR_GP_PIN(3, 0), 0, 3 }, /* TSN1_MDIO_B */
1885 } },
1886 { PINMUX_DRIVE_REG("DRV1CTRL3", 0xe6051884) {
1887 { RCAR_GP_PIN(3, 15), 28, 3 }, /* TSN1_AVTP_CAPTURE_B */
1888 { RCAR_GP_PIN(3, 14), 24, 3 }, /* TSN1_AVTP_MATCH_B */
1889 { RCAR_GP_PIN(3, 13), 20, 3 }, /* TSN1_AVTP_PPS */
1890 { RCAR_GP_PIN(3, 12), 16, 3 }, /* TSN0_MAGIC_B */
1891 { RCAR_GP_PIN(3, 11), 12, 3 }, /* TSN1_PHY_INT_B */
1892 { RCAR_GP_PIN(3, 10), 8, 3 }, /* TSN0_PHY_INT_B */
1893 { RCAR_GP_PIN(3, 9), 4, 3 }, /* TSN2_PHY_INT_B */
1894 { RCAR_GP_PIN(3, 8), 0, 3 }, /* TSN0_LINK_B */
1895 } },
1896 { PINMUX_DRIVE_REG("DRV2CTRL3", 0xe6051888) {
1897 { RCAR_GP_PIN(3, 18), 8, 3 }, /* TSN0_AVTP_CAPTURE_B */
1898 { RCAR_GP_PIN(3, 17), 4, 3 }, /* TSN0_AVTP_MATCH_B */
1899 { RCAR_GP_PIN(3, 16), 0, 3 }, /* TSN0_AVTP_PPS */
1900 } },
Marek Vasut86fc8172023-09-17 16:08:48 +02001901 { /* sentinel */ }
LUU HOAI9b68f5d2023-02-28 22:34:40 +01001902};
1903
1904enum ioctrl_regs {
1905 POC0,
1906 POC1,
1907 POC3,
1908 TD0SEL1,
1909};
1910
1911static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
1912 [POC0] = { 0xe60500a0, },
1913 [POC1] = { 0xe60508a0, },
1914 [POC3] = { 0xe60518a0, },
1915 [TD0SEL1] = { 0xe6050920, },
Marek Vasut86fc8172023-09-17 16:08:48 +02001916 { /* sentinel */ }
LUU HOAI9b68f5d2023-02-28 22:34:40 +01001917};
1918
1919static int r8a779f0_pin_to_pocctrl(unsigned int pin, u32 *pocctrl)
1920{
1921 int bit = pin & 0x1f;
1922
1923 *pocctrl = pinmux_ioctrl_regs[POC0].reg;
1924 if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 20))
1925 return bit;
1926
1927 *pocctrl = pinmux_ioctrl_regs[POC1].reg;
1928 if (pin >= RCAR_GP_PIN(1, 0) && pin <= RCAR_GP_PIN(1, 24))
1929 return bit;
1930
1931 *pocctrl = pinmux_ioctrl_regs[POC3].reg;
1932 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 18))
1933 return bit;
1934
1935 return -EINVAL;
1936}
1937
1938static const struct pinmux_bias_reg pinmux_bias_regs[] = {
1939 { PINMUX_BIAS_REG("PUEN0", 0xe60500c0, "PUD0", 0xe60500e0) {
1940 [ 0] = RCAR_GP_PIN(0, 0), /* SCIF_CLK */
1941 [ 1] = RCAR_GP_PIN(0, 1), /* HSCK0 */
1942 [ 2] = RCAR_GP_PIN(0, 2), /* HRX0 */
1943 [ 3] = RCAR_GP_PIN(0, 3), /* HTX0 */
1944 [ 4] = RCAR_GP_PIN(0, 4), /* HCTS0_N */
1945 [ 5] = RCAR_GP_PIN(0, 5), /* HRTS0_N */
1946 [ 6] = RCAR_GP_PIN(0, 6), /* RX0 */
1947 [ 7] = RCAR_GP_PIN(0, 7), /* TX0 */
1948 [ 8] = RCAR_GP_PIN(0, 8), /* SCK0 */
1949 [ 9] = RCAR_GP_PIN(0, 9), /* RTS0_N */
1950 [10] = RCAR_GP_PIN(0, 10), /* CTS0_N */
1951 [11] = RCAR_GP_PIN(0, 11), /* MSIOF0_SYNC */
1952 [12] = RCAR_GP_PIN(0, 12), /* MSIOF0_RXD */
1953 [13] = RCAR_GP_PIN(0, 13), /* MSIOF0_TXD */
1954 [14] = RCAR_GP_PIN(0, 14), /* MSIOF0_SCK */
1955 [15] = RCAR_GP_PIN(0, 15), /* MSIOF0_SS1 */
1956 [16] = RCAR_GP_PIN(0, 16), /* MSIOF0_SS2 */
1957 [17] = RCAR_GP_PIN(0, 17), /* IRQ0 */
1958 [18] = RCAR_GP_PIN(0, 18), /* IRQ1 */
1959 [19] = RCAR_GP_PIN(0, 19), /* IRQ2 */
1960 [20] = RCAR_GP_PIN(0, 20), /* IRQ3 */
1961 [21] = SH_PFC_PIN_NONE,
1962 [22] = SH_PFC_PIN_NONE,
1963 [23] = SH_PFC_PIN_NONE,
1964 [24] = SH_PFC_PIN_NONE,
1965 [25] = SH_PFC_PIN_NONE,
1966 [26] = SH_PFC_PIN_NONE,
1967 [27] = SH_PFC_PIN_NONE,
1968 [28] = SH_PFC_PIN_NONE,
1969 [29] = SH_PFC_PIN_NONE,
1970 [30] = SH_PFC_PIN_NONE,
1971 [31] = SH_PFC_PIN_NONE,
1972 } },
1973 { PINMUX_BIAS_REG("PUEN1", 0xe60508c0, "PUD1", 0xe60508e0) {
1974 [ 0] = RCAR_GP_PIN(1, 0), /* GP1_00 */
1975 [ 1] = RCAR_GP_PIN(1, 1), /* GP1_01 */
1976 [ 2] = RCAR_GP_PIN(1, 2), /* GP1_02 */
1977 [ 3] = RCAR_GP_PIN(1, 3), /* GP1_03 */
1978 [ 4] = RCAR_GP_PIN(1, 4), /* GP1_04 */
1979 [ 5] = RCAR_GP_PIN(1, 5), /* GP1_05 */
1980 [ 6] = RCAR_GP_PIN(1, 6), /* GP1_06 */
1981 [ 7] = RCAR_GP_PIN(1, 7), /* GP1_07 */
1982 [ 8] = RCAR_GP_PIN(1, 8), /* GP1_08 */
1983 [ 9] = RCAR_GP_PIN(1, 9), /* GP1_09 */
1984 [10] = RCAR_GP_PIN(1, 10), /* GP1_10 */
1985 [11] = RCAR_GP_PIN(1, 11), /* GP1_11 */
1986 [12] = RCAR_GP_PIN(1, 12), /* MMC_SD_CLK */
1987 [13] = RCAR_GP_PIN(1, 13), /* MMC_SD_D0 */
1988 [14] = RCAR_GP_PIN(1, 14), /* MMC_SD_D1 */
1989 [15] = RCAR_GP_PIN(1, 15), /* MMC_SD_D2 */
1990 [16] = RCAR_GP_PIN(1, 16), /* MMC_SD_D3 */
1991 [17] = RCAR_GP_PIN(1, 17), /* MMC_D5 */
1992 [18] = RCAR_GP_PIN(1, 18), /* MMC_D4 */
1993 [19] = RCAR_GP_PIN(1, 19), /* MMC_D6 */
1994 [20] = RCAR_GP_PIN(1, 20), /* MMC_DS */
1995 [21] = RCAR_GP_PIN(1, 21), /* MMC_D7 */
1996 [22] = RCAR_GP_PIN(1, 22), /* MMC_SD_CMD */
1997 [23] = RCAR_GP_PIN(1, 23), /* SD_CD */
1998 [24] = RCAR_GP_PIN(1, 24), /* SD_WP */
1999 [25] = SH_PFC_PIN_NONE,
2000 [26] = SH_PFC_PIN_NONE,
2001 [27] = SH_PFC_PIN_NONE,
2002 [28] = SH_PFC_PIN_NONE,
2003 [29] = SH_PFC_PIN_NONE,
2004 [30] = SH_PFC_PIN_NONE,
2005 [31] = SH_PFC_PIN_NONE,
2006 } },
2007 { PINMUX_BIAS_REG("PUEN2", 0xe60510c0, "PUD2", 0xe60510e0) {
2008 [ 0] = RCAR_GP_PIN(2, 0), /* RPC_INT_N */
2009 [ 1] = RCAR_GP_PIN(2, 1), /* RPC_WP_N */
2010 [ 2] = RCAR_GP_PIN(2, 2), /* RPC_RESET_N */
2011 [ 3] = RCAR_GP_PIN(2, 3), /* QSPI1_SSL */
2012 [ 4] = RCAR_GP_PIN(2, 4), /* QSPI1_IO3 */
2013 [ 5] = RCAR_GP_PIN(2, 5), /* QSPI1_MISO_IO1 */
2014 [ 6] = RCAR_GP_PIN(2, 6), /* QSPI1_IO2 */
2015 [ 7] = RCAR_GP_PIN(2, 7), /* QSPI1_MOSI_IO0 */
2016 [ 8] = RCAR_GP_PIN(2, 8), /* QSPI1_SPCLK */
2017 [ 9] = RCAR_GP_PIN(2, 9), /* QSPI0_MOSI_IO0 */
2018 [10] = RCAR_GP_PIN(2, 10), /* QSPI0_SPCLK */
2019 [11] = RCAR_GP_PIN(2, 11), /* QSPI0_IO2 */
2020 [12] = RCAR_GP_PIN(2, 12), /* QSPI0_MISO_IO1 */
2021 [13] = RCAR_GP_PIN(2, 13), /* QSPI0_SSL */
2022 [14] = RCAR_GP_PIN(2, 14), /* QSPI0_IO3 */
2023 [15] = RCAR_GP_PIN(2, 15), /* PCIE0_CLKREQ_N */
2024 [16] = RCAR_GP_PIN(2, 16), /* PCIE1_CLKREQ_N */
2025 [17] = SH_PFC_PIN_NONE,
2026 [18] = SH_PFC_PIN_NONE,
2027 [19] = SH_PFC_PIN_NONE,
2028 [20] = SH_PFC_PIN_NONE,
2029 [21] = SH_PFC_PIN_NONE,
2030 [22] = SH_PFC_PIN_NONE,
2031 [23] = SH_PFC_PIN_NONE,
2032 [24] = SH_PFC_PIN_NONE,
2033 [25] = SH_PFC_PIN_NONE,
2034 [26] = SH_PFC_PIN_NONE,
2035 [27] = SH_PFC_PIN_NONE,
2036 [28] = SH_PFC_PIN_NONE,
2037 [29] = SH_PFC_PIN_NONE,
2038 [30] = SH_PFC_PIN_NONE,
2039 [31] = SH_PFC_PIN_NONE,
2040 } },
2041 { PINMUX_BIAS_REG("PUEN3", 0xe60518c0, "PUD3", 0xe60518e0) {
2042 [ 0] = RCAR_GP_PIN(3, 0), /* TSN1_MDIO_B */
2043 [ 1] = RCAR_GP_PIN(3, 1), /* TSN2_MDIO_B */
2044 [ 2] = RCAR_GP_PIN(3, 2), /* TSN0_MDIO_B */
2045 [ 3] = RCAR_GP_PIN(3, 3), /* TSN2_MDC_B */
2046 [ 4] = RCAR_GP_PIN(3, 4), /* TSN0_MDC_B */
2047 [ 5] = RCAR_GP_PIN(3, 5), /* TSN1_MDC_B */
2048 [ 6] = RCAR_GP_PIN(3, 6), /* TSN1_LINK_B */
2049 [ 7] = RCAR_GP_PIN(3, 7), /* TSN2_LINK_B */
2050 [ 8] = RCAR_GP_PIN(3, 8), /* TSN0_LINK_B */
2051 [ 9] = RCAR_GP_PIN(3, 9), /* TSN2_PHY_INT_B */
2052 [10] = RCAR_GP_PIN(3, 10), /* TSN0_PHY_INT_B */
2053 [11] = RCAR_GP_PIN(3, 11), /* TSN1_PHY_INT_B */
2054 [12] = RCAR_GP_PIN(3, 12), /* TSN0_MAGIC_B */
2055 [13] = RCAR_GP_PIN(3, 13), /* TSN1_AVTP_PPS */
2056 [14] = RCAR_GP_PIN(3, 14), /* TSN1_AVTP_MATCH_B */
2057 [15] = RCAR_GP_PIN(3, 15), /* TSN1_AVTP_CAPTURE_B */
2058 [16] = RCAR_GP_PIN(3, 16), /* TSN0_AVTP_PPS */
2059 [17] = RCAR_GP_PIN(3, 17), /* TSN0_AVTP_MATCH_B */
2060 [18] = RCAR_GP_PIN(3, 18), /* TSN0_AVTP_CAPTURE_B */
2061 [19] = SH_PFC_PIN_NONE,
2062 [20] = SH_PFC_PIN_NONE,
2063 [21] = SH_PFC_PIN_NONE,
2064 [22] = SH_PFC_PIN_NONE,
2065 [23] = SH_PFC_PIN_NONE,
2066 [24] = SH_PFC_PIN_NONE,
2067 [25] = SH_PFC_PIN_NONE,
2068 [26] = SH_PFC_PIN_NONE,
2069 [27] = SH_PFC_PIN_NONE,
2070 [28] = SH_PFC_PIN_NONE,
2071 [29] = SH_PFC_PIN_NONE,
2072 [30] = SH_PFC_PIN_NONE,
2073 [31] = SH_PFC_PIN_NONE,
2074 } },
Marek Vasut86fc8172023-09-17 16:08:48 +02002075 { /* sentinel */ }
LUU HOAI9b68f5d2023-02-28 22:34:40 +01002076};
2077
2078static const struct sh_pfc_soc_operations r8a779f0_pfc_ops = {
2079 .pin_to_pocctrl = r8a779f0_pin_to_pocctrl,
2080 .get_bias = rcar_pinmux_get_bias,
2081 .set_bias = rcar_pinmux_set_bias,
2082};
2083
2084const struct sh_pfc_soc_info r8a779f0_pinmux_info = {
2085 .name = "r8a779f0_pfc",
2086 .ops = &r8a779f0_pfc_ops,
2087 .unlock_reg = 0x1ff, /* PMMRn mask */
2088
2089 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2090
2091 .pins = pinmux_pins,
2092 .nr_pins = ARRAY_SIZE(pinmux_pins),
2093 .groups = pinmux_groups,
2094 .nr_groups = ARRAY_SIZE(pinmux_groups),
2095 .functions = pinmux_functions,
2096 .nr_functions = ARRAY_SIZE(pinmux_functions),
2097
2098 .cfg_regs = pinmux_config_regs,
2099 .drive_regs = pinmux_drive_regs,
2100 .bias_regs = pinmux_bias_regs,
2101 .ioctrl_regs = pinmux_ioctrl_regs,
2102
2103 .pinmux_data = pinmux_data,
2104 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
2105};