1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun *
3*4882a593Smuzhiyun * SH7786 Pinmux
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Copyright (C) 2008, 2009 Renesas Solutions Corp.
6*4882a593Smuzhiyun * Kuninori Morimoto <morimoto.kuninori@renesas.com>
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * Based on sh7785.h
9*4882a593Smuzhiyun */
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun #ifndef __CPU_SH7786_H__
12*4882a593Smuzhiyun #define __CPU_SH7786_H__
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun #include <linux/io.h>
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun enum {
17*4882a593Smuzhiyun /* PA */
18*4882a593Smuzhiyun GPIO_PA7, GPIO_PA6, GPIO_PA5, GPIO_PA4,
19*4882a593Smuzhiyun GPIO_PA3, GPIO_PA2, GPIO_PA1, GPIO_PA0,
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun /* PB */
22*4882a593Smuzhiyun GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4,
23*4882a593Smuzhiyun GPIO_PB3, GPIO_PB2, GPIO_PB1, GPIO_PB0,
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun /* PC */
26*4882a593Smuzhiyun GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4,
27*4882a593Smuzhiyun GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0,
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun /* PD */
30*4882a593Smuzhiyun GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4,
31*4882a593Smuzhiyun GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0,
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun /* PE */
34*4882a593Smuzhiyun GPIO_PE7, GPIO_PE6,
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun /* PF */
37*4882a593Smuzhiyun GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4,
38*4882a593Smuzhiyun GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0,
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun /* PG */
41*4882a593Smuzhiyun GPIO_PG7, GPIO_PG6, GPIO_PG5,
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun /* PH */
44*4882a593Smuzhiyun GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
45*4882a593Smuzhiyun GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun /* PJ */
48*4882a593Smuzhiyun GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4,
49*4882a593Smuzhiyun GPIO_PJ3, GPIO_PJ2, GPIO_PJ1,
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun /* DU */
52*4882a593Smuzhiyun GPIO_FN_DCLKIN, GPIO_FN_DCLKOUT, GPIO_FN_ODDF,
53*4882a593Smuzhiyun GPIO_FN_VSYNC, GPIO_FN_HSYNC, GPIO_FN_CDE, GPIO_FN_DISP,
54*4882a593Smuzhiyun GPIO_FN_DR0, GPIO_FN_DG0, GPIO_FN_DB0,
55*4882a593Smuzhiyun GPIO_FN_DR1, GPIO_FN_DG1, GPIO_FN_DB1,
56*4882a593Smuzhiyun GPIO_FN_DR2, GPIO_FN_DG2, GPIO_FN_DB2,
57*4882a593Smuzhiyun GPIO_FN_DR3, GPIO_FN_DG3, GPIO_FN_DB3,
58*4882a593Smuzhiyun GPIO_FN_DR4, GPIO_FN_DG4, GPIO_FN_DB4,
59*4882a593Smuzhiyun GPIO_FN_DR5, GPIO_FN_DG5, GPIO_FN_DB5,
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun /* Eth */
62*4882a593Smuzhiyun GPIO_FN_ETH_MAGIC, GPIO_FN_ETH_LINK, GPIO_FN_ETH_TX_ER,
63*4882a593Smuzhiyun GPIO_FN_ETH_TX_EN, GPIO_FN_ETH_MDIO, GPIO_FN_ETH_RX_CLK,
64*4882a593Smuzhiyun GPIO_FN_ETH_MDC, GPIO_FN_ETH_COL, GPIO_FN_ETH_TX_CLK,
65*4882a593Smuzhiyun GPIO_FN_ETH_CRS, GPIO_FN_ETH_RX_DV, GPIO_FN_ETH_RX_ER,
66*4882a593Smuzhiyun GPIO_FN_ETH_TXD3, GPIO_FN_ETH_TXD2, GPIO_FN_ETH_TXD1, GPIO_FN_ETH_TXD0,
67*4882a593Smuzhiyun GPIO_FN_ETH_RXD3, GPIO_FN_ETH_RXD2, GPIO_FN_ETH_RXD1, GPIO_FN_ETH_RXD0,
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun /* HSPI */
70*4882a593Smuzhiyun GPIO_FN_HSPI_CLK, GPIO_FN_HSPI_CS, GPIO_FN_HSPI_RX, GPIO_FN_HSPI_TX,
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun /* SCIF0 */
73*4882a593Smuzhiyun GPIO_FN_SCIF0_CTS, GPIO_FN_SCIF0_RTS, GPIO_FN_SCIF0_SCK,
74*4882a593Smuzhiyun GPIO_FN_SCIF0_RXD, GPIO_FN_SCIF0_TXD,
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun /* SCIF1 */
77*4882a593Smuzhiyun GPIO_FN_SCIF1_SCK, GPIO_FN_SCIF1_RXD, GPIO_FN_SCIF1_TXD,
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun /* SCIF3 */
80*4882a593Smuzhiyun GPIO_FN_SCIF3_SCK, GPIO_FN_SCIF3_RXD, GPIO_FN_SCIF3_TXD,
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun /* SCIF4 */
83*4882a593Smuzhiyun GPIO_FN_SCIF4_SCK, GPIO_FN_SCIF4_RXD, GPIO_FN_SCIF4_TXD,
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun /* SCIF5 */
86*4882a593Smuzhiyun GPIO_FN_SCIF5_SCK, GPIO_FN_SCIF5_RXD, GPIO_FN_SCIF5_TXD,
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun /* LBSC */
89*4882a593Smuzhiyun GPIO_FN_BREQ, GPIO_FN_IOIS16, GPIO_FN_CE2B, GPIO_FN_CE2A, GPIO_FN_BACK,
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun /* FLCTL */
92*4882a593Smuzhiyun GPIO_FN_FALE, GPIO_FN_FRB, GPIO_FN_FSTATUS,
93*4882a593Smuzhiyun GPIO_FN_FSE, GPIO_FN_FCLE,
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun /* DMAC */
96*4882a593Smuzhiyun GPIO_FN_DACK0, GPIO_FN_DREQ0, GPIO_FN_DRAK0,
97*4882a593Smuzhiyun GPIO_FN_DACK1, GPIO_FN_DREQ1, GPIO_FN_DRAK1,
98*4882a593Smuzhiyun GPIO_FN_DACK2, GPIO_FN_DREQ2, GPIO_FN_DRAK2,
99*4882a593Smuzhiyun GPIO_FN_DACK3, GPIO_FN_DREQ3, GPIO_FN_DRAK3,
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun /* USB */
102*4882a593Smuzhiyun GPIO_FN_USB_OVC0, GPIO_FN_USB_PENC0,
103*4882a593Smuzhiyun GPIO_FN_USB_OVC1, GPIO_FN_USB_PENC1,
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun /* HAC */
106*4882a593Smuzhiyun GPIO_FN_HAC_RES,
107*4882a593Smuzhiyun GPIO_FN_HAC0_SDOUT, GPIO_FN_HAC0_SDIN,
108*4882a593Smuzhiyun GPIO_FN_HAC0_SYNC, GPIO_FN_HAC0_BITCLK,
109*4882a593Smuzhiyun GPIO_FN_HAC1_SDOUT, GPIO_FN_HAC1_SDIN,
110*4882a593Smuzhiyun GPIO_FN_HAC1_SYNC, GPIO_FN_HAC1_BITCLK,
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun /* SSI */
113*4882a593Smuzhiyun GPIO_FN_SSI0_SDATA, GPIO_FN_SSI0_SCK, GPIO_FN_SSI0_WS, GPIO_FN_SSI0_CLK,
114*4882a593Smuzhiyun GPIO_FN_SSI1_SDATA, GPIO_FN_SSI1_SCK, GPIO_FN_SSI1_WS, GPIO_FN_SSI1_CLK,
115*4882a593Smuzhiyun GPIO_FN_SSI2_SDATA, GPIO_FN_SSI2_SCK, GPIO_FN_SSI2_WS,
116*4882a593Smuzhiyun GPIO_FN_SSI3_SDATA, GPIO_FN_SSI3_SCK, GPIO_FN_SSI3_WS,
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun /* SDIF1 */
119*4882a593Smuzhiyun GPIO_FN_SDIF1CMD, GPIO_FN_SDIF1CD, GPIO_FN_SDIF1WP, GPIO_FN_SDIF1CLK,
120*4882a593Smuzhiyun GPIO_FN_SDIF1D3, GPIO_FN_SDIF1D2, GPIO_FN_SDIF1D1, GPIO_FN_SDIF1D0,
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun /* SDIF0 */
123*4882a593Smuzhiyun GPIO_FN_SDIF0CMD, GPIO_FN_SDIF0CD, GPIO_FN_SDIF0WP, GPIO_FN_SDIF0CLK,
124*4882a593Smuzhiyun GPIO_FN_SDIF0D3, GPIO_FN_SDIF0D2, GPIO_FN_SDIF0D1, GPIO_FN_SDIF0D0,
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun /* TMU */
127*4882a593Smuzhiyun GPIO_FN_TCLK,
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun /* INTC */
130*4882a593Smuzhiyun GPIO_FN_IRL7, GPIO_FN_IRL6, GPIO_FN_IRL5, GPIO_FN_IRL4,
131*4882a593Smuzhiyun };
132*4882a593Smuzhiyun
sh7786_mm_sel(void)133*4882a593Smuzhiyun static inline u32 sh7786_mm_sel(void)
134*4882a593Smuzhiyun {
135*4882a593Smuzhiyun return __raw_readl((const volatile void __iomem *)0xFC400020) & 0x7;
136*4882a593Smuzhiyun }
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun #endif /* __CPU_SH7786_H__ */
139