]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/arm/mach-shmobile/include/mach/r8a7740.h
bb207d803b469bddf918398ce566f97fc549186a
[karo-tx-linux.git] / arch / arm / mach-shmobile / include / mach / r8a7740.h
1 /*
2  * Copyright (C) 2011  Renesas Solutions Corp.
3  * Copyright (C) 2011  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; version 2 of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #ifndef __ASM_R8A7740_H__
20 #define __ASM_R8A7740_H__
21
22 #include <mach/pm-rmobile.h>
23
24 /*
25  * MD_CKx pin
26  */
27 #define MD_CK2  (1 << 2)
28 #define MD_CK1  (1 << 1)
29 #define MD_CK0  (1 << 0)
30
31 /*
32  * Pin Function Controller:
33  *      GPIO_FN_xx - GPIO used to select pin function
34  *      GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
35  */
36 enum {
37         /* PORT */
38         GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
39         GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
40
41         GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
42         GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
43
44         GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
45         GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
46
47         GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
48         GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
49
50         GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
51         GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
52
53         GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
54         GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
55
56         GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
57         GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
58
59         GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
60         GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
61
62         GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
63         GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
64
65         GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
66         GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
67
68         GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
69         GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
70
71         GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
72         GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
73
74         GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
75         GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
76
77         GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
78         GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
79
80         GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
81         GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
82
83         GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
84         GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
85
86         GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
87         GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
88
89         GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
90         GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
91
92         GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
93         GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
94
95         GPIO_PORT190, GPIO_PORT191, GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
96         GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
97
98         GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
99         GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
100
101         GPIO_PORT210, GPIO_PORT211,
102
103         /* IRQ */
104         GPIO_FN_IRQ0_PORT2,     GPIO_FN_IRQ0_PORT13,
105         GPIO_FN_IRQ1,
106         GPIO_FN_IRQ2_PORT11,    GPIO_FN_IRQ2_PORT12,
107         GPIO_FN_IRQ3_PORT10,    GPIO_FN_IRQ3_PORT14,
108         GPIO_FN_IRQ4_PORT15,    GPIO_FN_IRQ4_PORT172,
109         GPIO_FN_IRQ5_PORT0,     GPIO_FN_IRQ5_PORT1,
110         GPIO_FN_IRQ6_PORT121,   GPIO_FN_IRQ6_PORT173,
111         GPIO_FN_IRQ7_PORT120,   GPIO_FN_IRQ7_PORT209,
112         GPIO_FN_IRQ8,
113         GPIO_FN_IRQ9_PORT118,   GPIO_FN_IRQ9_PORT210,
114         GPIO_FN_IRQ10,
115         GPIO_FN_IRQ11,
116         GPIO_FN_IRQ12_PORT42,   GPIO_FN_IRQ12_PORT97,
117         GPIO_FN_IRQ13_PORT64,   GPIO_FN_IRQ13_PORT98,
118         GPIO_FN_IRQ14_PORT63,   GPIO_FN_IRQ14_PORT99,
119         GPIO_FN_IRQ15_PORT62,   GPIO_FN_IRQ15_PORT100,
120         GPIO_FN_IRQ16_PORT68,   GPIO_FN_IRQ16_PORT211,
121         GPIO_FN_IRQ17,
122         GPIO_FN_IRQ18,
123         GPIO_FN_IRQ19,
124         GPIO_FN_IRQ20,
125         GPIO_FN_IRQ21,
126         GPIO_FN_IRQ22,
127         GPIO_FN_IRQ23,
128         GPIO_FN_IRQ24,
129         GPIO_FN_IRQ25,
130         GPIO_FN_IRQ26_PORT58,   GPIO_FN_IRQ26_PORT81,
131         GPIO_FN_IRQ27_PORT57,   GPIO_FN_IRQ27_PORT168,
132         GPIO_FN_IRQ28_PORT56,   GPIO_FN_IRQ28_PORT169,
133         GPIO_FN_IRQ29_PORT50,   GPIO_FN_IRQ29_PORT170,
134         GPIO_FN_IRQ30_PORT49,   GPIO_FN_IRQ30_PORT171,
135         GPIO_FN_IRQ31_PORT41,   GPIO_FN_IRQ31_PORT167,
136
137         /* Function */
138
139         /* DBGT */
140         GPIO_FN_DBGMDT2,        GPIO_FN_DBGMDT1,        GPIO_FN_DBGMDT0,
141         GPIO_FN_DBGMD10,        GPIO_FN_DBGMD11,        GPIO_FN_DBGMD20,
142         GPIO_FN_DBGMD21,
143
144         /* FSI-A */
145         GPIO_FN_FSIAISLD_PORT0,         /* FSIAISLD Port 0/5 */
146         GPIO_FN_FSIAISLD_PORT5,
147         GPIO_FN_FSIASPDIF_PORT9,        /* FSIASPDIF Port 9/18 */
148         GPIO_FN_FSIASPDIF_PORT18,
149         GPIO_FN_FSIAOSLD1,      GPIO_FN_FSIAOSLD2,
150         GPIO_FN_FSIAOLR,        GPIO_FN_FSIAOBT,
151         GPIO_FN_FSIAOSLD,       GPIO_FN_FSIAOMC,
152         GPIO_FN_FSIACK,         GPIO_FN_FSIAILR,
153         GPIO_FN_FSIAIBT,
154
155         /* FSI-B */
156         GPIO_FN_FSIBCK,
157
158         /* FMSI */
159         GPIO_FN_FMSISLD_PORT1, /* FMSISLD Port 1/6 */
160         GPIO_FN_FMSISLD_PORT6,
161         GPIO_FN_FMSIILR,        GPIO_FN_FMSIIBT,
162         GPIO_FN_FMSIOLR,        GPIO_FN_FMSIOBT,
163         GPIO_FN_FMSICK,         GPIO_FN_FMSOILR,
164         GPIO_FN_FMSOIBT,        GPIO_FN_FMSOOLR,
165         GPIO_FN_FMSOOBT,        GPIO_FN_FMSOSLD,
166         GPIO_FN_FMSOCK,
167
168         /* LCD0 */
169         GPIO_FN_LCDC0_SELECT,
170
171         /* LCD1 */
172         GPIO_FN_LCDC1_SELECT,
173
174         /* RSPI */
175         GPIO_FN_RSPI_SSL0_A,    GPIO_FN_RSPI_SSL1_A,
176         GPIO_FN_RSPI_SSL2_A,    GPIO_FN_RSPI_SSL3_A,
177         GPIO_FN_RSPI_MOSI_A,    GPIO_FN_RSPI_MISO_A,
178         GPIO_FN_RSPI_CK_A,
179
180         /* VIO CKO */
181         GPIO_FN_VIO_CKO1,
182         GPIO_FN_VIO_CKO2,
183         GPIO_FN_VIO_CKO_1,
184         GPIO_FN_VIO_CKO,
185
186         /* VIO0 */
187         GPIO_FN_VIO0_D0,        GPIO_FN_VIO0_D1,        GPIO_FN_VIO0_D2,
188         GPIO_FN_VIO0_D3,        GPIO_FN_VIO0_D4,        GPIO_FN_VIO0_D5,
189         GPIO_FN_VIO0_D6,        GPIO_FN_VIO0_D7,        GPIO_FN_VIO0_D8,
190         GPIO_FN_VIO0_D9,        GPIO_FN_VIO0_D10,       GPIO_FN_VIO0_D11,
191         GPIO_FN_VIO0_D12,       GPIO_FN_VIO0_VD,        GPIO_FN_VIO0_HD,
192         GPIO_FN_VIO0_CLK,       GPIO_FN_VIO0_FIELD,
193
194         GPIO_FN_VIO0_D13_PORT26, /* MSEL5CR_27_0 */
195         GPIO_FN_VIO0_D14_PORT25,
196         GPIO_FN_VIO0_D15_PORT24,
197
198         GPIO_FN_VIO0_D13_PORT22, /* MSEL5CR_27_1 */
199         GPIO_FN_VIO0_D14_PORT95,
200         GPIO_FN_VIO0_D15_PORT96,
201
202         /* VIO1 */
203         GPIO_FN_VIO1_D0,        GPIO_FN_VIO1_D1,        GPIO_FN_VIO1_D2,
204         GPIO_FN_VIO1_D3,        GPIO_FN_VIO1_D4,        GPIO_FN_VIO1_D5,
205         GPIO_FN_VIO1_D6,        GPIO_FN_VIO1_D7,        GPIO_FN_VIO1_VD,
206         GPIO_FN_VIO1_HD,        GPIO_FN_VIO1_CLK,       GPIO_FN_VIO1_FIELD,
207
208         /* TPU0 */
209         GPIO_FN_TPU0TO0,        GPIO_FN_TPU0TO1,
210         GPIO_FN_TPU0TO3,
211         GPIO_FN_TPU0TO2_PORT66, /* TPU0TO2 Port 66/202 */
212         GPIO_FN_TPU0TO2_PORT202,
213
214         /* SSP1 0 */
215         GPIO_FN_STP0_IPD0,      GPIO_FN_STP0_IPD1,      GPIO_FN_STP0_IPD2,
216         GPIO_FN_STP0_IPD3,      GPIO_FN_STP0_IPD4,      GPIO_FN_STP0_IPD5,
217         GPIO_FN_STP0_IPD6,      GPIO_FN_STP0_IPD7,      GPIO_FN_STP0_IPEN,
218         GPIO_FN_STP0_IPCLK,     GPIO_FN_STP0_IPSYNC,
219
220         /* SSP1 1 */
221         GPIO_FN_STP1_IPD1,      GPIO_FN_STP1_IPD2,      GPIO_FN_STP1_IPD3,
222         GPIO_FN_STP1_IPD4,      GPIO_FN_STP1_IPD5,      GPIO_FN_STP1_IPD6,
223         GPIO_FN_STP1_IPD7,      GPIO_FN_STP1_IPCLK,     GPIO_FN_STP1_IPSYNC,
224
225         GPIO_FN_STP1_IPD0_PORT186, /* MSEL5CR_23_0 */
226         GPIO_FN_STP1_IPEN_PORT187,
227
228         GPIO_FN_STP1_IPD0_PORT194, /* MSEL5CR_23_1 */
229         GPIO_FN_STP1_IPEN_PORT193,
230
231         /* SIM */
232         GPIO_FN_SIM_RST,        GPIO_FN_SIM_CLK,
233         GPIO_FN_SIM_D_PORT22, /* SIM_D  Port 22/199 */
234         GPIO_FN_SIM_D_PORT199,
235
236         /* MSIOF2 */
237         GPIO_FN_MSIOF2_TXD,     GPIO_FN_MSIOF2_RXD,     GPIO_FN_MSIOF2_TSCK,
238         GPIO_FN_MSIOF2_SS2,     GPIO_FN_MSIOF2_TSYNC,   GPIO_FN_MSIOF2_SS1,
239         GPIO_FN_MSIOF2_MCK1,    GPIO_FN_MSIOF2_MCK0,    GPIO_FN_MSIOF2_RSYNC,
240         GPIO_FN_MSIOF2_RSCK,
241
242         /* KEYSC */
243         GPIO_FN_KEYIN4,         GPIO_FN_KEYIN5,
244         GPIO_FN_KEYIN6,         GPIO_FN_KEYIN7,
245         GPIO_FN_KEYOUT0,        GPIO_FN_KEYOUT1,        GPIO_FN_KEYOUT2,
246         GPIO_FN_KEYOUT3,        GPIO_FN_KEYOUT4,        GPIO_FN_KEYOUT5,
247         GPIO_FN_KEYOUT6,        GPIO_FN_KEYOUT7,
248
249         GPIO_FN_KEYIN0_PORT43, /* MSEL4CR_18_0 */
250         GPIO_FN_KEYIN1_PORT44,
251         GPIO_FN_KEYIN2_PORT45,
252         GPIO_FN_KEYIN3_PORT46,
253
254         GPIO_FN_KEYIN0_PORT58, /* MSEL4CR_18_1 */
255         GPIO_FN_KEYIN1_PORT57,
256         GPIO_FN_KEYIN2_PORT56,
257         GPIO_FN_KEYIN3_PORT55,
258
259         /* VOU */
260         GPIO_FN_DV_D0,  GPIO_FN_DV_D1,  GPIO_FN_DV_D2,  GPIO_FN_DV_D3,
261         GPIO_FN_DV_D4,  GPIO_FN_DV_D5,  GPIO_FN_DV_D6,  GPIO_FN_DV_D7,
262         GPIO_FN_DV_D8,  GPIO_FN_DV_D9,  GPIO_FN_DV_D10, GPIO_FN_DV_D11,
263         GPIO_FN_DV_D12, GPIO_FN_DV_D13, GPIO_FN_DV_D14, GPIO_FN_DV_D15,
264         GPIO_FN_DV_CLK,
265         GPIO_FN_DV_VSYNC,
266         GPIO_FN_DV_HSYNC,
267
268         /* MEMC */
269         GPIO_FN_MEMC_AD0,       GPIO_FN_MEMC_AD1,       GPIO_FN_MEMC_AD2,
270         GPIO_FN_MEMC_AD3,       GPIO_FN_MEMC_AD4,       GPIO_FN_MEMC_AD5,
271         GPIO_FN_MEMC_AD6,       GPIO_FN_MEMC_AD7,       GPIO_FN_MEMC_AD8,
272         GPIO_FN_MEMC_AD9,       GPIO_FN_MEMC_AD10,      GPIO_FN_MEMC_AD11,
273         GPIO_FN_MEMC_AD12,      GPIO_FN_MEMC_AD13,      GPIO_FN_MEMC_AD14,
274         GPIO_FN_MEMC_AD15,      GPIO_FN_MEMC_CS0,       GPIO_FN_MEMC_INT,
275         GPIO_FN_MEMC_NWE,       GPIO_FN_MEMC_NOE,
276
277         GPIO_FN_MEMC_CS1, /* MSEL4CR_6_0 */
278         GPIO_FN_MEMC_ADV,
279         GPIO_FN_MEMC_WAIT,
280         GPIO_FN_MEMC_BUSCLK,
281
282         GPIO_FN_MEMC_A1, /* MSEL4CR_6_1 */
283         GPIO_FN_MEMC_DREQ0,
284         GPIO_FN_MEMC_DREQ1,
285         GPIO_FN_MEMC_A0,
286
287         /* MSIOF0 */
288         GPIO_FN_MSIOF0_SS1,     GPIO_FN_MSIOF0_SS2,
289         GPIO_FN_MSIOF0_RXD,     GPIO_FN_MSIOF0_TXD,
290         GPIO_FN_MSIOF0_MCK0,    GPIO_FN_MSIOF0_MCK1,
291         GPIO_FN_MSIOF0_RSYNC,   GPIO_FN_MSIOF0_RSCK,
292         GPIO_FN_MSIOF0_TSCK,    GPIO_FN_MSIOF0_TSYNC,
293
294         /* MSIOF1 */
295         GPIO_FN_MSIOF1_RSCK,    GPIO_FN_MSIOF1_RSYNC,
296         GPIO_FN_MSIOF1_MCK0,    GPIO_FN_MSIOF1_MCK1,
297
298         GPIO_FN_MSIOF1_SS2_PORT116,     GPIO_FN_MSIOF1_SS1_PORT117,
299         GPIO_FN_MSIOF1_RXD_PORT118,     GPIO_FN_MSIOF1_TXD_PORT119,
300         GPIO_FN_MSIOF1_TSYNC_PORT120,
301         GPIO_FN_MSIOF1_TSCK_PORT121,    /* MSEL4CR_10_0 */
302
303         GPIO_FN_MSIOF1_SS1_PORT67,      GPIO_FN_MSIOF1_TSCK_PORT72,
304         GPIO_FN_MSIOF1_TSYNC_PORT73,    GPIO_FN_MSIOF1_TXD_PORT74,
305         GPIO_FN_MSIOF1_RXD_PORT75,
306         GPIO_FN_MSIOF1_SS2_PORT202,     /* MSEL4CR_10_1 */
307
308         /* GPIO */
309         GPIO_FN_GPO0,   GPIO_FN_GPI0,
310         GPIO_FN_GPO1,   GPIO_FN_GPI1,
311
312         /* USB0 */
313         GPIO_FN_USB0_OCI,       GPIO_FN_USB0_PPON,      GPIO_FN_VBUS,
314
315         /* USB1 */
316         GPIO_FN_USB1_OCI,       GPIO_FN_USB1_PPON,
317
318         /* BBIF1 */
319         GPIO_FN_BBIF1_RXD,      GPIO_FN_BBIF1_TXD,      GPIO_FN_BBIF1_TSYNC,
320         GPIO_FN_BBIF1_TSCK,     GPIO_FN_BBIF1_RSCK,     GPIO_FN_BBIF1_RSYNC,
321         GPIO_FN_BBIF1_FLOW,     GPIO_FN_BBIF1_RX_FLOW_N,
322
323         /* BBIF2 */
324         GPIO_FN_BBIF2_TXD2_PORT5, /* MSEL5CR_0_0 */
325         GPIO_FN_BBIF2_RXD2_PORT60,
326         GPIO_FN_BBIF2_TSYNC2_PORT6,
327         GPIO_FN_BBIF2_TSCK2_PORT59,
328
329         GPIO_FN_BBIF2_RXD2_PORT90, /* MSEL5CR_0_1 */
330         GPIO_FN_BBIF2_TXD2_PORT183,
331         GPIO_FN_BBIF2_TSCK2_PORT89,
332         GPIO_FN_BBIF2_TSYNC2_PORT184,
333
334         /* BSC / FLCTL / PCMCIA */
335         GPIO_FN_CS0,    GPIO_FN_CS2,    GPIO_FN_CS4,
336         GPIO_FN_CS5B,   GPIO_FN_CS6A,
337         GPIO_FN_CS5A_PORT105, /* CS5A PORT 19/105 */
338         GPIO_FN_CS5A_PORT19,
339         GPIO_FN_IOIS16, /* ? */
340
341         GPIO_FN_A0,     GPIO_FN_A1,     GPIO_FN_A2,     GPIO_FN_A3,
342         GPIO_FN_A4_FOE,         /* share with FLCTL */
343         GPIO_FN_A5_FCDE,        /* share with FLCTL */
344         GPIO_FN_A6,     GPIO_FN_A7,     GPIO_FN_A8,     GPIO_FN_A9,
345         GPIO_FN_A10,    GPIO_FN_A11,    GPIO_FN_A12,    GPIO_FN_A13,
346         GPIO_FN_A14,    GPIO_FN_A15,    GPIO_FN_A16,    GPIO_FN_A17,
347         GPIO_FN_A18,    GPIO_FN_A19,    GPIO_FN_A20,    GPIO_FN_A21,
348         GPIO_FN_A22,    GPIO_FN_A23,    GPIO_FN_A24,    GPIO_FN_A25,
349         GPIO_FN_A26,
350
351         GPIO_FN_D0_NAF0,        GPIO_FN_D1_NAF1,        /* share with FLCTL */
352         GPIO_FN_D2_NAF2,        GPIO_FN_D3_NAF3,        /* share with FLCTL */
353         GPIO_FN_D4_NAF4,        GPIO_FN_D5_NAF5,        /* share with FLCTL */
354         GPIO_FN_D6_NAF6,        GPIO_FN_D7_NAF7,        /* share with FLCTL */
355         GPIO_FN_D8_NAF8,        GPIO_FN_D9_NAF9,        /* share with FLCTL */
356         GPIO_FN_D10_NAF10,      GPIO_FN_D11_NAF11,      /* share with FLCTL */
357         GPIO_FN_D12_NAF12,      GPIO_FN_D13_NAF13,      /* share with FLCTL */
358         GPIO_FN_D14_NAF14,      GPIO_FN_D15_NAF15,      /* share with FLCTL */
359
360         GPIO_FN_D16,    GPIO_FN_D17,    GPIO_FN_D18,    GPIO_FN_D19,
361         GPIO_FN_D20,    GPIO_FN_D21,    GPIO_FN_D22,    GPIO_FN_D23,
362         GPIO_FN_D24,    GPIO_FN_D25,    GPIO_FN_D26,    GPIO_FN_D27,
363         GPIO_FN_D28,    GPIO_FN_D29,    GPIO_FN_D30,    GPIO_FN_D31,
364
365         GPIO_FN_WE0_FWE,        /* share with FLCTL */
366         GPIO_FN_WE1,
367         GPIO_FN_WE2_ICIORD,     /* share with PCMCIA */
368         GPIO_FN_WE3_ICIOWR,     /* share with PCMCIA */
369         GPIO_FN_CKO,    GPIO_FN_BS,     GPIO_FN_RDWR,
370         GPIO_FN_RD_FSC,         /* share with FLCTL */
371         GPIO_FN_WAIT_PORT177,   /* WAIT Port 90/177 */
372         GPIO_FN_WAIT_PORT90,
373
374         GPIO_FN_FCE0,   GPIO_FN_FCE1,   GPIO_FN_FRB, /* FLCTL */
375
376         /* IRDA */
377         GPIO_FN_IRDA_FIRSEL,    GPIO_FN_IRDA_IN,        GPIO_FN_IRDA_OUT,
378
379         /* ATAPI */
380         GPIO_FN_IDE_D0,         GPIO_FN_IDE_D1,         GPIO_FN_IDE_D2,
381         GPIO_FN_IDE_D3,         GPIO_FN_IDE_D4,         GPIO_FN_IDE_D5,
382         GPIO_FN_IDE_D6,         GPIO_FN_IDE_D7,         GPIO_FN_IDE_D8,
383         GPIO_FN_IDE_D9,         GPIO_FN_IDE_D10,        GPIO_FN_IDE_D11,
384         GPIO_FN_IDE_D12,        GPIO_FN_IDE_D13,        GPIO_FN_IDE_D14,
385         GPIO_FN_IDE_D15,        GPIO_FN_IDE_A0,         GPIO_FN_IDE_A1,
386         GPIO_FN_IDE_A2,         GPIO_FN_IDE_CS0,        GPIO_FN_IDE_CS1,
387         GPIO_FN_IDE_IOWR,       GPIO_FN_IDE_IORD,       GPIO_FN_IDE_IORDY,
388         GPIO_FN_IDE_INT,        GPIO_FN_IDE_RST,        GPIO_FN_IDE_DIRECTION,
389         GPIO_FN_IDE_EXBUF_ENB,  GPIO_FN_IDE_IODACK,     GPIO_FN_IDE_IODREQ,
390
391         /* RMII */
392         GPIO_FN_RMII_CRS_DV,    GPIO_FN_RMII_RX_ER,     GPIO_FN_RMII_RXD0,
393         GPIO_FN_RMII_RXD1,      GPIO_FN_RMII_TX_EN,     GPIO_FN_RMII_TXD0,
394         GPIO_FN_RMII_MDC,       GPIO_FN_RMII_TXD1,      GPIO_FN_RMII_MDIO,
395         GPIO_FN_RMII_REF50CK,   /* for RMII */
396         GPIO_FN_RMII_REF125CK,  /* for GMII */
397
398         /* GEther */
399         GPIO_FN_ET_TX_CLK,      GPIO_FN_ET_TX_EN,       GPIO_FN_ET_ETXD0,
400         GPIO_FN_ET_ETXD1,       GPIO_FN_ET_ETXD2,       GPIO_FN_ET_ETXD3,
401         GPIO_FN_ET_ETXD4,       GPIO_FN_ET_ETXD5, /* for GEther */
402         GPIO_FN_ET_ETXD6,       GPIO_FN_ET_ETXD7, /* for GEther */
403         GPIO_FN_ET_COL,         GPIO_FN_ET_TX_ER,
404         GPIO_FN_ET_RX_CLK,      GPIO_FN_ET_RX_DV,
405         GPIO_FN_ET_ERXD0,       GPIO_FN_ET_ERXD1,
406         GPIO_FN_ET_ERXD2,       GPIO_FN_ET_ERXD3,
407         GPIO_FN_ET_ERXD4,       GPIO_FN_ET_ERXD5, /* for GEther */
408         GPIO_FN_ET_ERXD6,       GPIO_FN_ET_ERXD7, /* for GEther */
409         GPIO_FN_ET_RX_ER,       GPIO_FN_ET_CRS,
410         GPIO_FN_ET_MDC,         GPIO_FN_ET_MDIO,
411         GPIO_FN_ET_LINK,        GPIO_FN_ET_PHY_INT,
412         GPIO_FN_ET_WOL,         GPIO_FN_ET_GTX_CLK,
413
414         /* DMA0 */
415         GPIO_FN_DREQ0,          GPIO_FN_DACK0,
416
417         /* DMA1 */
418         GPIO_FN_DREQ1,          GPIO_FN_DACK1,
419
420         /* SYSC */
421         GPIO_FN_RESETOUTS,
422         GPIO_FN_RESETP_PULLUP,
423         GPIO_FN_RESETP_PLAIN,
424
425         /* HDMI */
426         GPIO_FN_HDMI_HPD,
427         GPIO_FN_HDMI_CEC,
428
429         /* SDENC */
430         GPIO_FN_SDENC_CPG,
431         GPIO_FN_SDENC_DV_CLKI,
432
433         /* IRREM */
434         GPIO_FN_IROUT,
435
436         /* DEBUG */
437         GPIO_FN_EDEBGREQ_PULLDOWN,
438         GPIO_FN_EDEBGREQ_PULLUP,
439
440         GPIO_FN_TRACEAUD_FROM_VIO,
441         GPIO_FN_TRACEAUD_FROM_LCDC0,
442         GPIO_FN_TRACEAUD_FROM_MEMC,
443 };
444
445 /* DMA slave IDs */
446 enum {
447         SHDMA_SLAVE_INVALID,
448         SHDMA_SLAVE_SDHI0_RX,
449         SHDMA_SLAVE_SDHI0_TX,
450         SHDMA_SLAVE_SDHI1_RX,
451         SHDMA_SLAVE_SDHI1_TX,
452         SHDMA_SLAVE_SDHI2_RX,
453         SHDMA_SLAVE_SDHI2_TX,
454         SHDMA_SLAVE_FSIA_RX,
455         SHDMA_SLAVE_FSIA_TX,
456         SHDMA_SLAVE_FSIB_TX,
457         SHDMA_SLAVE_USBHS_TX,
458         SHDMA_SLAVE_USBHS_RX,
459 };
460
461 extern void r8a7740_meram_workaround(void);
462 extern void r8a7740_init_irq(void);
463 extern void r8a7740_map_io(void);
464 extern void r8a7740_add_early_devices(void);
465 extern void r8a7740_add_standard_devices(void);
466 extern void r8a7740_clock_init(u8 md_ck);
467 extern void r8a7740_pinmux_init(void);
468 extern void r8a7740_pm_init(void);
469
470 #ifdef CONFIG_PM
471 extern void __init r8a7740_init_pm_domains(void);
472 #else
473 static inline void r8a7740_init_pm_domains(void) {}
474 #endif /* CONFIG_PM */
475
476 #endif /* __ASM_R8A7740_H__ */