blob: 96ebc5302a3d098ad6e9ec031f04c56f4b1488c5 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2* @file drvs_gpio.h
3* @brief Public APIs of gpio drivers
4*
5* Copyright (C) 2017 Sanechips Technology Co., Ltd.
6* @author Dongdong Zhang <Zhang.Dongdong@sanechips.com.cn>
7*
8* This program is free software; you can redistribute it and/or modify
9* it under the terms of the GNU General Public License version 2 as
10* published by the Free Software Foundation.
11*
12*/
13#ifndef _DRVS_GPIO_H
14#define _DRVS_GPIO_H
15
16#ifdef _OS_LINUX
17#include <linux/gpio.h>
18#else
19/*******************************************************************************
20* Include header files *
21******************************************************************************/
22
23/*******************************************************************************
24* Macro definitions *
25******************************************************************************/
26#define GPIO0 0
27#define GPIO1 1
28#define GPIO2 2
29#define GPIO3 3
30#define GPIO4 4
31#define GPIO5 5
32#define GPIO6 6
33#define GPIO7 7
34#define GPIO8 8
35#define GPIO9 9
36#define GPIO10 10
37#define GPIO11 11
38#define GPIO12 12
39#define GPIO13 13
40#define GPIO14 14
41#define GPIO15 15
42#define GPIO16 16
43#define GPIO17 17
44#define GPIO18 18
45#define GPIO19 19
46#define GPIO20 20
47#define GPIO21 21
48#define GPIO22 22
49#define GPIO23 23
50#define GPIO24 24
51#define GPIO25 25
52#define GPIO26 26
53#define GPIO27 27
54#define GPIO28 28
55#define GPIO29 29
56#define GPIO30 30
57#define GPIO31 31
58#define GPIO32 32
59#define GPIO33 33
60#define GPIO34 34
61#define GPIO35 35
62#define GPIO36 36
63#define GPIO37 37
64#define GPIO38 38
65#define GPIO39 39
66#define GPIO40 40
67#define GPIO41 41
68#define GPIO42 42
69#define GPIO43 43
70#define GPIO44 44
71#define GPIO45 45
72#define GPIO46 46
73#define GPIO47 47
74#define GPIO48 48
75#define GPIO49 49
76#define GPIO50 50
77#define GPIO51 51
78#define GPIO52 52
79#define GPIO53 53
80#define GPIO54 54
81#define GPIO55 55
82#define GPIO56 56
83#define GPIO57 57
84#define GPIO58 58
85#define GPIO59 59
86#define GPIO60 60
87#define GPIO61 61
88#define GPIO62 62
89#define GPIO63 63
90#define GPIO64 64
91#define GPIO65 65
92#define GPIO66 66
93#define GPIO67 67
94#define GPIO68 68
95#define GPIO69 69
96#define GPIO70 70
97#define GPIO71 71
98#define GPIO72 72
99#define GPIO73 73
100#define GPIO74 74
101#define GPIO75 75
102#define GPIO76 76
103#define GPIO77 77
104#define GPIO78 78
105#define GPIO79 79
106#define GPIO80 80
107#define GPIO81 81
108#define GPIO82 82
109#define GPIO83 83
110#define GPIO84 84
111#define GPIO85 85
112#define GPIO86 86
113#define GPIO87 87
114#define GPIO88 88
115#define GPIO89 89
116#define GPIO90 90
117#define GPIO91 91
118#define GPIO92 92
119#define GPIO93 93
120#define GPIO94 94
121#define GPIO95 95
122#define GPIO96 96
123#define GPIO97 97
124#define GPIO98 98
125#define GPIO99 99
126#define GPIO100 100
127#define GPIO101 101
128#define GPIO102 102
129#define GPIO103 103
130#define GPIO104 104
131#define GPIO105 105
132#define GPIO106 106
133#define GPIO107 107
134#define GPIO108 108
135#define GPIO109 109
136#define GPIO110 110
137#define GPIO111 111
138#define GPIO112 112
139#define GPIO113 113
140#define GPIO114 114
141#define GPIO115 115
142#define GPIO116 116
143#define GPIO117 117
144#define GPIO118 118
145#define GPIO119 119
146#define GPIO120 120
147#define GPIO121 121
148#define GPIO122 122
149#define GPIO123 123
150#define GPIO124 124
151#define GPIO125 125
152#define GPIO126 126
153#define GPIO127 127
154#define GPIO128 128
155#define GPIO129 129
156#define GPIO130 130
157#define GPIO131 131
158#define GPIO132 132
159#define GPIO133 133
160#define GPIO134 134
161#define GPIO135 135
162#define GPIO136 136
163#define GPIO137 137
164#define GPIO138 138
165#define GPIO139 139
166#define GPIO140 140
167#define GPIO141 141
168#define GPIO142 142
169#define GPIO143 143
170#define GPIO144 144
171#define GPIO145 145
172#define GPIO146 146
173#define GPIO147 147
174#define GPIO148 148
175#define GPIO149 149
176#define GPIO150 150
177#define GPIO151 151
178#define GPIO152 152
179#define GPIO153 153
180#define GPIO154 154
181#define GPIO155 155
182
183#if defined (_CHIP_ZX297520V3)
184#define MAX_GPIO_NUM GPIO135
185#elif defined (_CHIP_ZX297520V2)
186#define MAX_GPIO_NUM GPIO155
187#endif
188
189#define INVLID_GPIO 0xffff
190
191/*******************************************************************************
192* Type definitions *
193******************************************************************************/
194typedef enum{
195 GPIO_IN = 101,
196 GPIO_OUT = 102,
197}T_ZDrvGpio_IoDirection;
198
199typedef enum{
200 GPIO_LOW = 201,
201 GPIO_HIGH = 202,
202}T_ZDrvGpio_IoVal;
203
204typedef enum{
205 GPIO_PULL_DOWN = 0x1,
206 GPIO_NO_ACTION = 0x2,
207 GPIO_PULL_UP = 0x3,
208}T_ZDrvGpio_PullUp;
209
210#if defined (_CHIP_ZX297520V3)
211typedef enum
212{
213 /*[31:24]:gpio_id [23:12]:level1_sel [11:0]:level2_sel*/
214 GPIO0_GPIO0 = 0x00000000,
215 GPIO0_NAND_WE = 0x00001000,
216 GPIO0_LCD_OE_N = 0x00001001,
217 GPIO1_GPIO1 = 0x01000000,
218 GPIO1_NAND_CS0 = 0x01001000,
219 GPIO1_LCD_CS_N = 0x01001001,
220 GPIO2_GPIO2 = 0x02000000,
221 GPIO2_NAND_READY = 0x02001000,
222 GPIO2_LCD_RS = 0x02001001,
223 GPIO3_GPIO3 = 0x03000000,
224 GPIO3_NAND_CLE = 0x03001000,
225 GPIO3_LCD_RESET_N = 0x03001001,
226 GPIO4_GPIO4 = 0x04000000,
227 GPIO4_NAND_ALE = 0x04001000,
228 GPIO4_LCD_WE_N = 0x04001001,
229 GPIO5_GPIO5 = 0x05000000,
230 GPIO5_NAND_RE = 0x05001000,
231 GPIO5_LCD_TE = 0x05001001,
232 GPIO6_GPIO6 = 0x06000000,
233 GPIO6_NAND_WRITE_PROTECT = 0x06001000,
234 GPIO6_LCD_D0 = 0x06001001,
235 GPIO7_GPIO7 = 0x07000000,
236 GPIO7_NAND_DATA0 = 0x07001000,
237 GPIO7_LCD_D1 = 0x07001001,
238 GPIO8_GPIO8 = 0x08000000,
239 GPIO8_NAND_DATA1 = 0x08001000,
240 GPIO8_LCD_D2 = 0x08001001,
241 GPIO9_GPIO9 = 0x09000000,
242 GPIO9_NAND_DATA2 = 0x09001000,
243 GPIO9_LCD_D3 = 0x09001001,
244 GPIO10_GPIO10 = 0x0A000000,
245 GPIO10_NAND_DATA3 = 0x0A001000,
246 GPIO10_LCD_D4 = 0x0A001001,
247 GPIO11_GPIO11 = 0x0B000000,
248 GPIO11_NAND_DATA4 = 0x0B001000,
249 GPIO11_LCD_D5 = 0x0B001001,
250 GPIO12_GPIO12 = 0x0C000000,
251 GPIO12_NAND_DATA5 = 0x0C001000,
252 GPIO12_LCD_D6 = 0x0C001001,
253 GPIO13_GPIO13 = 0x0D000000,
254 GPIO13_NAND_DATA6 = 0x0D001000,
255 GPIO13_LCD_D7 = 0x0D001001,
256 GPIO14_GPIO14 = 0x0E000000,
257 GPIO14_NAND_DATA7 = 0x0E001000,
258 GPIO14_LCD_D8 = 0x0E001001,
259 GPIO15_CLK_OUT0 = 0x0F000000,
260 GPIO15_GPIO15 = 0x0F000001,
261 GPIO16_GPIO16 = 0x10000000,
262 GPIO16_CLK_OUT1 = 0x10000001,
263 GPIO17_GPIO17 = 0x11000000,
264 GPIO17_CLK_OUT2 = 0x11000001,
265 GPIO17_TEST_CLK_OUT = 0x11000002,
266 GPIO17_TDM_MCLK_OUT = 0x11001000,
267 GPIO17_I2S0_MCLK_OUT = 0x11001001,
268 GPIO17_I2S1_MCLK_OUT = 0x11001002,
269 GPIO18_GPIO18 = 0x12000000,
270 GPIO18_CLK_32K_OUT = 0x12000001,
271 GPIO19_GPIO19 = 0x13000000,
272 GPIO19_RMII_CLK_I = 0x13001000,
273 GPIO20_GPIO20 = 0x14000000,
274 GPIO20_RMII_CLK_O = 0x14001000,
275 GPIO21_CLK_REQ0 = 0x15000000,
276 GPIO21_GPIO21 = 0x15000001,
277 GPIO22_CLK_REQ1 = 0x16000000,
278 GPIO22_GPIO22 = 0x16000001,
279 GPIO23_PWRCTRL = 0x17000000,
280 GPIO23_GPIO23 = 0x17000001,
281 GPIO24_GPIO24 = 0x18000000,
282 GPIO25_GPIO25 = 0x19000000,
283 GPIO25_SSP0_CS = 0x19001000,
284 GPIO26_GPIO26 = 0x1A000000,
285 GPIO26_SSP0_CLK = 0x1A001000,
286 GPIO27_GPIO27 = 0x1B000000,
287 GPIO27_SSP0_RXD = 0x1B001000,
288 GPIO28_GPIO28 = 0x1C000000,
289 GPIO28_SSP0_TXD = 0x1C001000,
290 GPIO29_UART0_RXD = 0x1D000000,
291 GPIO29_GPIO29 = 0x1D000001,
292 GPIO29_UART0_TXD = 0x1D000002,
293 GPIO29_FRAME_SYNC = 0x1D001000,
294 GPIO29_TEST_PIN10 = 0x1D001001,
295 GPIO30_UART0_TXD = 0x1E000000,
296 GPIO30_GPIO30 = 0x1E000001,
297 GPIO30_UART0_RXD = 0x1E000002,
298 GPIO30_LTE_PRE_TX = 0x1E001000,
299 GPIO30_TEST_PIN11 = 0x1E001001,
300 GPIO31_UART0_CTS = 0x1F000000,
301 GPIO31_GPIO31 = 0x1F000001,
302 GPIO31_LTE_TPU_OUT3 = 0x1F001000,
303 GPIO31_UART1_TXD = 0x1F001001,
304 GPIO31_TEST_PIN12 = 0x1F001002,
305 GPIO32_UART0_RTS = 0x20000000,
306 GPIO32_GPIO32 = 0x20000001,
307 GPIO32_LTE_TPU_OUT4 = 0x20001000,
308 GPIO32_UART1_RXD = 0x20001001,
309 GPIO33_GPIO33 = 0x21000000,
310 GPIO33_UART1_RXD = 0x21001000,
311 GPIO33_UART2_TXD = 0x21001001,
312 GPIO33_UART2_RXD = 0x21001002,
313 GPIO34_GPIO34 = 0x22000000,
314 GPIO34_UART1_TXD = 0x22001000,
315 GPIO34_UART2_RXD = 0x22001001,
316 GPIO34_UART2_TXD = 0x22001002,
317 GPIO35_GPIO35 = 0x23000000,
318 GPIO35_I2S0_WS = 0x23001000,
319 GPIO35_TEST_PIN0 = 0x23001001,
320 GPIO35_TDM_FS = 0x23001002,
321 GPIO36_GPIO36 = 0x24000000,
322 GPIO36_I2S0_CLK = 0x24001000,
323 GPIO36_TEST_PIN1 = 0x24001001,
324 GPIO36_TDM_CLK = 0x24001002,
325 GPIO37_GPIO37 = 0x25000000,
326 GPIO37_I2S0_DIN = 0x25001000,
327 GPIO37_TEST_PIN2 = 0x25001001,
328 GPIO37_TDM_DATA_IN = 0x25001002,
329 GPIO38_GPIO38 = 0x26000000,
330 GPIO38_I2S0_DOUT = 0x26001000,
331 GPIO38_TEST_PIN3 = 0x26001001,
332 GPIO38_TDM_DATA_OUT = 0x26001002,
333 GPIO39_GPIO39 = 0x27000000,
334 GPIO39_I2S1_WS = 0x27001000,
335 GPIO39_TEST_PIN4 = 0x27001001,
336 GPIO39_TDM_FS = 0x27001002,
337 GPIO39_PWM0 = 0x27001003,
338 GPIO40_GPIO40 = 0x28000000,
339 GPIO40_I2S1_CLK = 0x28001000,
340 GPIO40_TEST_PIN5 = 0x28001001,
341 GPIO40_TDM_CLK = 0x28001002,
342 GPIO40_PWM1 = 0x28001003,
343 GPIO41_GPIO41 = 0x29000000,
344 GPIO41_I2S1_DIN = 0x29001000,
345 GPIO41_TEST_PIN6 = 0x29001001,
346 GPIO41_TDM_DATA_IN = 0x29001002,
347 GPIO42_GPIO42 = 0x2A000000,
348 GPIO42_I2S1_DOUT = 0x2A001000,
349 GPIO42_TEST_PIN7 = 0x2A001001,
350 GPIO42_TDM_DATA_OUT = 0x2A001002,
351 GPIO43_SCL0 = 0x2B000000,
352 GPIO43_GPIO43 = 0x2B000001,
353 GPIO44_SDA0 = 0x2C000000,
354 GPIO44_GPIO44 = 0x2C000001,
355 GPIO45_GPIO45 = 0x2D000000,
356 GPIO45_SCL1 = 0x2D001000,
357 GPIO46_GPIO46 = 0x2E000000,
358 GPIO46_SDA1 = 0x2E001000,
359 GPIO47_GPIO47 = 0x2F000000,
360 GPIO47_EXT_INT0 = 0x2F000001,
361 GPIO48_GPIO48 = 0x30000000,
362 GPIO48_EXT_INT1 = 0x30000001,
363 GPIO49_GPIO49 = 0x31000000,
364 GPIO49_EXT_INT2 = 0x31000001,
365 GPIO50_GPIO50 = 0x32000000,
366 GPIO50_EXT_INT3 = 0x32000001,
367 GPIO50_TEST_PIN8 = 0x32001000,
368 GPIO51_GPIO51 = 0x33000000,
369 GPIO51_EXT_INT4 = 0x33000001,
370 GPIO51_TEST_PIN9 = 0x33001000,
371 GPIO52_GPIO52 = 0x34000000,
372 GPIO52_EXT_INT5 = 0x34000001,
373 GPIO52_TEST_PIN13 = 0x34001000,
374 GPIO53_GPIO53 = 0x35000000,
375 GPIO53_EXT_INT6 = 0x35000001,
376 GPIO53_TEST_PIN14 = 0x35001000,
377 GPIO54_GPIO54 = 0x36000000,
378 GPIO54_EXT_INT7 = 0x36000001,
379 GPIO54_TEST_PIN15 = 0x36001000,
380 GPIO55_GPIO55 = 0x37000000,
381 GPIO55_RMII_TXEN = 0x37001000,
382 GPIO56_GPIO56 = 0x38000000,
383 GPIO56_RMII_RXEN = 0x38001000,
384 GPIO57_GPIO57 = 0x39000000,
385 GPIO57_RMII_RXD0 = 0x39001000,
386 GPIO58_GPIO58 = 0x3A000000,
387 GPIO58_RMII_RXD1 = 0x3A001000,
388 GPIO59_GPIO59 = 0x3B000000,
389 GPIO59_RMII_TXD0 = 0x3B001000,
390 GPIO60_GPIO60 = 0x3C000000,
391 GPIO60_RMII_TXD1 = 0x3C001000,
392 GPIO61_GPIO61 = 0x3D000000,
393 GPIO61_MDC_SCLK = 0x3D001000,
394 GPIO62_GPIO62 = 0x3E000000,
395 GPIO62_MDC_SDIO = 0x3E001000,
396 GPIO63_GPIO63 = 0x3F000000,
397 GPIO63_PHY_RST = 0x3F001000,
398 GPIO64_GPIO64 = 0x40000000,
399 GPIO64_PHY_INT = 0x40001000,
400 GPIO65_GPIO65 = 0x41000000,
401 GPIO66_GPIO66 = 0x42000000,
402 GPIO66_KEY_COL2 = 0x42000001,
403 GPIO66_EMMC_CLK = 0x42001000,
404 GPIO67_GPIO67 = 0x43000000,
405 GPIO67_KEY_COL3 = 0x43000001,
406 GPIO67_EMMC_CMD = 0x43001000,
407 GPIO68_GPIO68 = 0x44000000,
408 GPIO68_KEY_COL4 = 0x44000001,
409 GPIO68_EMMC_DATA0 = 0x44001000,
410 GPIO69_GPIO69 = 0x45000000,
411 GPIO69_KEY_ROW2 = 0x45000001,
412 GPIO69_EMMC_DATA1 = 0x45001000,
413 GPIO70_GPIO70 = 0x46000000,
414 GPIO70_KEY_ROW3 = 0x46000001,
415 GPIO70_EMMC_DATA2 = 0x46001000,
416
417 GPIO71_GPIO71 = 0x47000000,
418 GPIO71_KEY_ROW4 = 0x47000001,
419 GPIO71_EMMC_DATA3 = 0x47001000,
420 GPIO72_GPIO72 = 0x48000000,
421 GPIO72_SD1_HOST_SDCLK = 0x48001000,
422 GPIO73_GPIO73 = 0x49000000,
423 GPIO73_M_JTAG_TDO = 0x49000001,
424 GPIO73_SD1_CMD = 0x49001000,
425 GPIO73_PS_JTAG_TDO = 0x49001001,
426 GPIO73_PHY_JTAG_TDO = 0x49001002,
427 GPIO73_AP_JTAG_TDO = 0x49001003,
428 GPIO74_GPIO74 = 0x4A000000,
429 GPIO74_M_JTAG_TCK = 0x4A000001,
430 GPIO74_SD1_DATA0 = 0x4A001000,
431 GPIO74_PS_JTAG_TCK = 0x4A001001,
432 GPIO74_PHY_JTAG_TCK = 0x4A001002,
433 GPIO74_AP_JTAG_TCK = 0x4A001003,
434 GPIO75_GPIO75 = 0x4B000000,
435 GPIO75_M_JTAG_TRST = 0x4B000001,
436 GPIO75_SD1_DATA1 = 0x4B001000,
437 GPIO75_PS_JTAG_TRST = 0x4B001001,
438 GPIO75_PHY_JTAG_TRST = 0x4B001002,
439 GPIO75_AP_JTAG_TRST = 0x4B001003,
440 GPIO76_GPIO76 = 0x4C000000,
441 GPIO76_M_JTAG_TMS = 0x4C000001,
442 GPIO76_SD1_DATA2 = 0x4C001000,
443 GPIO76_PS_JTAG_TMS = 0x4C001001,
444 GPIO76_PHY_JTAG_TMS = 0x4C001002,
445 GPIO76_AP_JTAG_TMS = 0x4C001003,
446 GPIO77_GPIO77 = 0x4D000000,
447 GPIO77_M_JTAG_TDI = 0x4D000001,
448 GPIO77_SD1_DATA3 = 0x4D001000,
449 GPIO77_PS_JTAG_TDI = 0x4D001001,
450 GPIO77_PHY_JTAG_TDI = 0x4D001002,
451 GPIO77_AP_JTAG_TDI = 0x4D001003,
452 GPIO78_M_JTAG_TCK = 0x4E000000,
453 GPIO78_GPIO78 = 0x4E000001,
454 GPIO78_PS_JTAG_TCK = 0x4E001000,
455 GPIO78_PHY_JTAG_TCK = 0x4E001001,
456 GPIO78_AP_JTAG_TCK = 0x4E001002,
457 GPIO79_M_JTAG_TDI = 0x4F000000,
458 GPIO79_GPIO79 = 0x4F000001,
459 GPIO79_PS_JTAG_TDI = 0x4F001000,
460 GPIO79_PHY_JTAG_TDI = 0x4F001001,
461 GPIO79_AP_JTAG_TDI = 0x4F001002,
462 GPIO80_M_JTAG_TDO = 0x50000000,
463 GPIO80_GPIO80 = 0x50000001,
464 GPIO80_PS_JTAG_TDO = 0x50001000,
465 GPIO80_PHY_JTAG_TDO = 0x50001001,
466 GPIO80_AP_JTAG_TDO = 0x50001002,
467 GPIO81_M_JTAG_TMS = 0x51000000,
468 GPIO81_GPIO81 = 0x51000001,
469 GPIO81_PS_JTAG_TMS = 0x51001000,
470 GPIO81_PHY_JTAG_TMS = 0x51001001,
471 GPIO81_AP_JTAG_TMS = 0x51001002,
472 GPIO82_M_JTAG_TRST = 0x52000000,
473 GPIO82_GPIO82 = 0x52000001,
474 GPIO82_PS_JTAG_TRST = 0x52001000,
475 GPIO82_PHY_JTAG_TRST = 0x52001001,
476 GPIO82_AP_JTAG_TRST = 0x52001002,
477 GPIO83_KEY_COL0 = 0x53000000,
478 GPIO83_GPIO83 = 0x53000001,
479 GPIO84_KEY_COL1 = 0x54000000,
480 GPIO84_GPIO84 = 0x54000001,
481 GPIO85_KEY_ROW0 = 0x55000000,
482 GPIO85_GPIO85 = 0x55000001,
483 GPIO86_KEY_ROW1 = 0x56000000,
484 GPIO86_GPIO86 = 0x56000001,
485 GPIO87_GPIO87 = 0x57000000,
486 GPIO87_CAM_SPI_CS = 0x57001000,
487 GPIO88_GPIO88 = 0x58000000,
488 GPIO88_CAM_SPI_CLK = 0x58001000,
489 GPIO89_GPIO89 = 0x59000000,
490 GPIO89_CAM_SPI_DATA0 = 0x59001000,
491 GPIO90_GPIO90 = 0x5A000000,
492 GPIO90_CAM_SPI_DATA1 = 0x5A001000,
493 GPIO90_CAM_SPI_TXD = 0x5A001001,
494 GPIO91_GPIO91 = 0x5B000000,
495 GPIO91_CAM_SPI_DATA2 = 0x5B001000,
496 GPIO92_GPIO92 = 0x5C000000,
497 GPIO92_CAM_SPI_DATA3 = 0x5C001000,
498 GPIO93_GPIO93 = 0x5D000000,
499 GPIO93_SPIFC_CS = 0x5D001000,
500 GPIO94_GPIO94 = 0x5E000000,
501 GPIO94_SPIFC_CLK = 0x5E001000,
502 GPIO95_GPIO95 = 0x5F000000,
503 GPIO95_SPIFC_DATA0 = 0x5F001000,
504 GPIO96_GPIO96 = 0x60000000,
505 GPIO96_SPIFC_DATA1 = 0x60001000,
506 GPIO97_GPIO97 = 0x61000000,
507 GPIO97_SPIFC_DATA2 = 0x61001000,
508 GPIO98_GPIO98 = 0x62000000,
509 GPIO98_SPIFC_DATA3 = 0x62001000,
510 GPIO99_GPIO99 = 0x63000000,
511 GPIO100_GPIO100 = 0x64000000,
512 GPIO100_RF_SPI_STR = 0x64001000,
513 GPIO101_GPIO101 = 0x65000000,
514 GPIO101_RF_SPI_CLK = 0x65001000,
515 GPIO102_GPIO102 = 0x66000000,
516 GPIO102_RF_SPI_DATA = 0x66001000,
517 GPIO103_GPIO103 = 0x67000000,
518 GPIO104_GPIO104 = 0x68000000,
519 GPIO104_TD_G0_GPIO2 = 0x68001081,
520 GPIO104_LTE_TPU_OUT0_5 = 0x68001009,
521 GPIO104_W_G0_GPIO2 = 0x68001011,
522 GPIO104_GSM_T_OUT_O_0 = 0x68001021,
523 GPIO105_GPIO105 = 0x69000000,
524 GPIO105_TD_G0_GPIO3 = 0x69001081,
525 GPIO105_LTE_TPU_OUT0_6 = 0x69001009,
526 GPIO105_W_G0_GPIO3 = 0x69001011,
527 GPIO105_GSM_T_OUT_O_1 = 0x69001021,
528 GPIO106_GPIO106 = 0x6A000000,
529 GPIO106_TD_G0_GPIO4 = 0x6A001081,
530 GPIO106_LTE_TPU_OUT0_7 = 0x6A001009,
531 GPIO106_W_G0_GPIO4 = 0x6A001011,
532 GPIO106_GSM_T_OUT_O_2 = 0x6A001021,
533 GPIO107_GPIO107 = 0x6B000000,
534 GPIO107_TD_G0_GPIO5 = 0x6B001081,
535 GPIO107_LTE_TPU_OUT0_8 = 0x6B001009,
536 GPIO107_W_G0_GPIO5 = 0x6B001011,
537 GPIO107_GSM_T_OUT_O_3 = 0x6B001021,
538 GPIO108_GPIO108 = 0x6C000000,
539 GPIO108_TD_G0_GPIO6 = 0x6C001081,
540 GPIO108_LTE_TPU_OUT0_9 = 0x6C001009,
541 GPIO108_W_G0_GPIO6 = 0x6C001011,
542 GPIO108_GSM_T_OUT_O_4 = 0x6C001021,
543 GPIO109_GPIO109 = 0x6D000000,
544 GPIO109_TD_G0_GPIO7 = 0x6D001081,
545 GPIO109_LTE_TPU_OUT0_10 = 0x6D001009,
546 GPIO109_W_G0_GPIO7 = 0x6D001011,
547 GPIO109_GSM_T_OUT_O_5 = 0x6D001021,
548 GPIO110_GPIO110 = 0x6E000000,
549 GPIO110_TD_G0_GPIO8 = 0x6E001081,
550 GPIO110_LTE_TPU_OUT0_11 = 0x6E001009,
551 GPIO110_W_G0_GPIO8 = 0x6E001011,
552 GPIO110_GSM_T_OUT_O_6 = 0x6E001021,
553 GPIO111_GPIO111 = 0x6F000000,
554 GPIO111_TD_G0_GPIO9 = 0x6F001081,
555 GPIO111_LTE_TPU_OUT0_12 = 0x6F001009,
556 GPIO111_W_G0_GPIO9 = 0x6F001011,
557 GPIO111_GSM_T_OUT_O_7 = 0x6F001021,
558 GPIO112_GPIO112 = 0x70000000,
559 GPIO112_MIPI_RFFE_CLK0 = 0x70001006,
560 GPIO112_TD_G0_GPIO10 = 0x70001081,
561 GPIO112_LTE_TPU_OUT0_13 = 0x70001009,
562 GPIO112_W_G0_GPIO10 = 0x70001011,
563 GPIO112_GSM_T_OUT_O_8 = 0x70001021,
564 GPIO113_GPIO113 = 0x71000000,
565 GPIO113_MIPI_RFFE_DATA0 = 0x71001006,
566 GPIO113_TD_G0_GPIO11 = 0x71001081,
567 GPIO113_LTE_TPU_OUT0_14 = 0x71001009,
568 GPIO113_W_G0_GPIO11 = 0x71001011,
569 GPIO113_GSM_T_OUT_O_9 = 0x71001021,
570 GPIO114_GPIO114 = 0x72000000,
571 GPIO114_MIPI_RFFE_CLK1 = 0x72001006,
572 GPIO114_ABB_I2C_SEL_PINMUX = 0x72000001,
573 GPIO114_TD_G0_GPIO12 = 0x72001081,
574 GPIO114_LTE_TPU_OUT0_15 = 0x72001009,
575 GPIO114_W_G0_GPIO12 = 0x72001011,
576 GPIO114_GSM_T_OUT_O_10 = 0x72001021,
577 GPIO115_GPIO115 = 0x73000000,
578 GPIO115_ABB_I2C_SDA_PINMUX = 0x73000001,
579 GPIO115_MIPI_RFFE_DATA1 = 0x73001006,
580 GPIO115_TD_G1_GPIO0 = 0x73001081,
581 GPIO115_LTE_TPU_OUT1_0 = 0x73001009,
582 GPIO115_W_G1_GPIO0 = 0x73001011,
583 GPIO115_GSM_T_OUT_O_11 = 0x73001021,
584
585 GPIO133_GPIO133 = 0x85000000,
586 GPIO133_SIM1_RST = 0x85000001,
587 GPIO133_TD_G1_GPIO1 = 0x85001081,
588 GPIO133_LTE_TPU_OUT1_1 = 0x85001009,
589 GPIO133_W_G1_GPIO1 = 0x85001011,
590 GPIO133_GSM_T_OUT_O_12 = 0x85001021,
591 GPIO134_GPIO134 = 0x86000000,
592 GPIO134_SIM1_CLK = 0x86000001,
593 GPIO134_TD_G1_GPIO2 = 0x86001081,
594 GPIO134_LTE_TPU_OUT1_2 = 0x86001009,
595 GPIO134_W_G1_GPIO2 = 0x86001011,
596 GPIO134_GSM_T_OUT_O_13 = 0x86001021,
597 GPIO135_GPIO135 = 0x87000000,
598 GPIO135_SIM1_DATA = 0x87000001,
599 GPIO135_TD_G1_GPIO3 = 0x87001081,
600 GPIO135_LTE_TPU_OUT1_3 = 0x87001009,
601 GPIO135_W_G1_GPIO3 = 0x87001011,
602 GPIO135_GSM_T_OUT_O_14 = 0x87001021,
603
604 GPIO116_SIM_RST = 0x74000000,
605 GPIO116_GPIO116 = 0x74000001,
606 GPIO117_SIM_CLK = 0x75000000,
607 GPIO117_GPIO117 = 0x75000001,
608 GPIO118_SIM_DATA = 0x76000000,
609 GPIO118_GPIO118 = 0x76000001,
610 GPIO119_GPIO119 = 0x77000000,
611 GPIO119_EXT_INT8 = 0x77000001,
612 GPIO119_M_JTAG_TDO = 0x77000002,
613 GPIO119_URAT0_RTS = 0x77000003,
614 GPIO119_PSJTAG_TDO = 0x77001000,
615 GPIO119_PHYJTAG_TDO = 0x77001001,
616 GPIO119_APJTAG_TDO = 0x77001002,
617 GPIO119_PWM0 = 0x77001003,
618 GPIO120_GPIO120 = 0x78000000,
619 GPIO120_EXT_INT9 = 0x78000001,
620 GPIO120_M_JTAG_TCK = 0x78000002,
621 GPIO120_UART0_CTS = 0x78000003,
622 GPIO120_PSJTAG_TCK = 0x78001000,
623 GPIO120_PHYJTAG_TCK = 0x78001001,
624 GPIO120_APJTAG_TCK = 0x78001002,
625 GPIO120_PWM1 = 0x78001003,
626 GPIO121_GPIO121 = 0x79000000,
627 GPIO121_EXT_INT10 = 0x79000001,
628 GPIO121_M_JTAG_TRST = 0x79000002,
629 GPIO121_PSJTAG_TRST = 0x79001000,
630 GPIO121_PHYJTAG_TRST = 0x79001001,
631 GPIO121_APJTAG_TRST = 0x79001002,
632 GPIO121_UART2_RXD = 0x79001003,
633 GPIO122_GPIO122 = 0x7A000000,
634 GPIO122_EXT_INT11 = 0x7A000001,
635 GPIO122_M_JTAG_TMS = 0x7A000002,
636 GPIO122_PSJTAG_TMS = 0x7A001000,
637 GPIO122_PHYJTAG_TMS = 0x7A001001,
638 GPIO122_APJTAG_TMS = 0x7A001002,
639 GPIO122_UART2_TXD = 0x7A001003,
640 GPIO123_GPIO123 = 0x7B000000,
641 GPIO123_EXT_INT12 = 0x7B000001,
642 GPIO123_M_JTAG_TDI = 0x7B000002,
643 GPIO123_PSJTAG_TDI = 0x7B001000,
644 GPIO123_PHYJTAG_TDI = 0x7B001001,
645 GPIO123_APJTAG_TDI = 0x7B001002,
646 GPIO123_UART2_RTS = 0x7B001003,
647 GPIO124_GPIO124 = 0x7C000000,
648 GPIO124_EXT_INT13 = 0x7C000001,
649 GPIO124_UART2_CTS = 0x7C001000,
650 GPIO125_GPIO125 = 0x7D000000,
651 GPIO125_EXT_INT14 = 0x7D000001,
652 GPIO125_UART1_RTS = 0x7D001000,
653 GPIO126_GPIO126 = 0x7E000000,
654 GPIO126_EXT_INT15 = 0x7E000001,
655 GPIO126_KEY_COL2 = 0x7E000002,
656 GPIO126_UART1_CTS = 0x7E001000,
657 GPIO127_GPIO127 = 0x7F000000,
658 GPIO127_EXT_INT8 = 0x7F000001,
659 GPIO127_KEY_COL3 = 0x7F000002,
660 GPIO128_GPIO128 = 0x80000000,
661 GPIO128_EXT_INT9 = 0x80000001,
662 GPIO128_KEY_COL4 = 0x80000002,
663 GPIO129_GPIO129 = 0x81000000,
664 GPIO129_EXT_INT10 = 0x81000001,
665 GPIO129_KEY_COL5 = 0x81000002,
666 GPIO130_GPIO130 = 0x82000000,
667 GPIO130_EXT_INT11 = 0x82000001,
668 GPIO130_KEY_ROW2 = 0x82000002,
669 GPIO131_GPIO131 = 0x83000000,
670 GPIO131_EXT_INT12 = 0x83000001,
671 GPIO131_KEY_ROW3 = 0x83000002,
672 GPIO132_GPIO132 = 0x84000000,
673 GPIO132_EXT_INT13 = 0x84000001,
674 GPIO132_KEY_ROW4 = 0x84000002,
675
676
677}T_ZDrvGpio_FuncSel;
678#elif defined (_CHIP_ZX297520V2)
679typedef enum
680{
681 /*[31:24]:gpio_id [23:12]:level1_sel [11:0]:level2_sel*/
682 GPIO0_GPIO0 = 0x00000000,
683 GPIO0_NAND_WE = 0x00001000,
684 GPIO1_GPIO1 = 0x01000000,
685 GPIO1_NAND_CS0 = 0x01001000,
686 GPIO2_GPIO2 = 0x02000000,
687 GPIO2_NAND_READY = 0x02001000,
688 GPIO3_GPIO3 = 0x03000000,
689 GPIO3_NAND_CLE = 0x03001000,
690 GPIO3_SPIFC0_SCLK = 0x03001001,
691 GPIO4_GPIO4 = 0x04000000,
692 GPIO4_NAND_ALE = 0x04001000,
693 GPIO5_GPIO5 = 0x05000000,
694 GPIO5_NAND_RE = 0x05001000,
695 GPIO5_SPIFC0_CS = 0x05001001,
696 GPIO6_GPIO6 = 0x06000000,
697 GPIO6_NAND_WRITE_PROTECT = 0x06001000,
698 GPIO7_GPIO7 = 0x07000000,
699 GPIO7_NAND_DATA0 = 0x07001000,
700 GPIO7_SSP1_CS = 0x07001001,
701 GPIO8_GPIO8 = 0x08000000,
702 GPIO8_NAND_DATA1 = 0x08001000,
703 GPIO8_SSP1_CLK = 0x08001001,
704 GPIO9_GPIO9 = 0x09000000,
705 GPIO9_NAND_DATA2 = 0x09001000,
706 GPIO9_SPIFC0_DATA0 = 0x09001001,
707 GPIO10_GPIO10 = 0x0A000000,
708 GPIO10_NAND_DATA3 = 0x0A001000,
709 GPIO10_SPIFC0_DATA1 = 0x0A001001,
710 GPIO11_GPIO11 = 0x0B000000,
711 GPIO11_NAND_DATA4 = 0x0B001000,
712 GPIO11_SPIFC0_DATA2 = 0x0B001001,
713 GPIO12_GPIO12 = 0x0C000000,
714 GPIO12_NAND_DATA5 = 0x0C001000,
715 GPIO12_SPIFC0_DATA3 = 0x0C001001,
716 GPIO13_GPIO13 = 0x0D000000,
717 GPIO13_NAND_DATA6 = 0x0D001000,
718 GPIO13_SSP1_RXD = 0x0D001001,
719 GPIO14_GPIO14 = 0x0E000000,
720 GPIO14_NAND_DATA7 = 0x0E001000,
721 GPIO14_SSP1_TXD = 0x0E001001,
722 GPIO23_CLK_OUT0 = 0x17000000,
723 GPIO23_GPIO23 = 0x17000001,
724 GPIO24_GPIO24 = 0x18000000,
725 GPIO24_CLK_OUT1 = 0x18000001,
726 GPIO25_GPIO25 = 0x19000000,
727 GPIO25_CLK_OUT2 = 0x19000001,
728 GPIO25_TEST_CLK_OUT = 0x19000002,
729 GPIO26_GPIO26 = 0x1A000000,
730 GPIO26_CLK_32K_OUT = 0x1A000001,
731 GPIO27_CLK_REQ0 = 0x1B000000,
732 GPIO27_GPIO27 = 0x1B000001,
733 GPIO29_PWRCTRL1 = 0x1D000000,
734 GPIO29_GPIO29 = 0x1D000001,
735 GPIO30_GPIO30 = 0x1E000000,
736 GPIO30_SSP0_CS = 0x1E001000,
737 GPIO31_GPIO31 = 0x1F000000,
738 GPIO31_SSP0_CLK = 0x1F001000,
739 GPIO32_GPIO32 = 0x20000000,
740 GPIO32_SSP0_RXD = 0x20001000,
741 GPIO33_GPIO33 = 0x21000000,
742 GPIO33_SSP0_TXD = 0x21001000,
743 GPIO34_UART0_RXD = 0x22000000,
744 GPIO34_GPIO34 = 0x22000001,
745 GPIO34_UART0_TXD = 0x22000002,
746 GPIO34_FRAME_SYNC = 0x22001000,
747 GPIO34_TEST_PIN10 = 0x22001001,
748 GPIO35_UART0_TXD = 0x23000000,
749 GPIO35_GPIO35 = 0x23000001,
750 GPIO35_UART0_RXD = 0x23000002,
751 GPIO35_LTE_PRE_TX = 0x23001000,
752 GPIO35_TEST_PIN11 = 0x23001001,
753 GPIO36_UART0_CTS = 0x24000000,
754 GPIO36_GPIO36 = 0x24000001,
755 GPIO36_UART1_RXD = 0x24001000,
756 GPIO36_LTE_TPU_OUT3 = 0x24001001,
757 GPIO36_TEST_PIN12 = 0x24001002,
758 GPIO36_UART1_TXD = 0x24001003,
759 GPIO37_UART0_RTS = 0x25000000,
760 GPIO37_GPIO37 = 0x25000001,
761 GPIO37_UART1_TXD = 0x25001000,
762 GPIO37_LTE_TPU_OUT4 = 0x25001001,
763 GPIO37_UART1_RXD = 0x25001002,
764 GPIO38_GPIO38 = 0x26000000,
765 GPIO38_I2S0_WS = 0x26001000,
766 GPIO38_TEST_PIN0 = 0x26001001,
767 GPIO38_LTE_DATA_DONGLE_CLK = 0x26001002,
768 GPIO38_TDM_FS = 0x26001003,
769 GPIO39_GPIO39 = 0x27000000,
770 GPIO39_I2S0_CLK = 0x27001000,
771 GPIO39_TEST_PIN1 = 0x27001001,
772 GPIO39_LTE_DATA_DONGLE_CMD = 0x27001002,
773 GPIO39_TDM_CLK = 0x27001003,
774 GPIO40_GPIO40 = 0x28000000,
775 GPIO40_I2S0_DIN = 0x28001000,
776 GPIO40_TEST_PIN2 = 0x28001001,
777 GPIO40_LTE_DATA_DONGLE0 = 0x28001002,
778 GPIO40_TDM_DATA_IN = 0x28001003,
779 GPIO41_GPIO41 = 0x29000000,
780 GPIO41_I2S0_DOUT = 0x29001000,
781 GPIO41_TEST_PIN3 = 0x29001001,
782 GPIO41_LTE_DATA_DONGLE1 = 0x29001002,
783 GPIO41_TDM_DATA_OUT = 0x29001003,
784 GPIO42_GPIO42 = 0x2A000000,
785 GPIO42_I2S1_WS = 0x2A001000,
786 GPIO42_TEST_PIN4 = 0x2A001001,
787 GPIO42_LTE_DATA_DONGLE2 = 0x2A001002,
788 GPIO42_TDM_FS = 0x2A001003,
789 GPIO43_GPIO43 = 0x2B000000,
790 GPIO43_I2S1_CLK = 0x2B001000,
791 GPIO43_TEST_PIN5 = 0x2B001001,
792 GPIO43_LTE_DATA_DONGLE3 = 0x2B001002,
793 GPIO43_TDM_CLK = 0x2B001003,
794 GPIO44_GPIO44 = 0x2C000000,
795 GPIO44_I2S1_DIN = 0x2C001000,
796 GPIO44_TEST_PIN6 = 0x2C001001,
797 GPIO44_TDM_DATA_IN = 0x2C001002,
798 GPIO45_GPIO45 = 0x2D000000,
799 GPIO45_I2S1_DOUT = 0x2D001000,
800 GPIO45_TEST_PIN7 = 0x2D001001,
801 GPIO45_TDM_DATA_OUT = 0x2D001002,
802 GPIO46_SCL0 = 0x2E000000,
803 GPIO46_GPIO46 = 0x2E000001,
804 GPIO47_SDA0 = 0x2F000000,
805 GPIO47_GPIO47 = 0x2F000001,
806 GPIO48_GPIO48 = 0x30000000,
807 GPIO48_SCL1 = 0x30001000,
808 GPIO49_GPIO49 = 0x31000000,
809 GPIO49_SDA1 = 0x31001000,
810 GPIO50_GPIO50 = 0x32000000,
811 GPIO50_EXT_INT0 = 0x32000001,
812 GPIO51_GPIO51 = 0x33000000,
813 GPIO51_EXT_INT1 = 0x33000001,
814 GPIO52_GPIO52 = 0x34000000,
815 GPIO52_EXT_INT2 = 0x34000001,
816 GPIO53_GPIO53 = 0x35000000,
817 GPIO53_EXT_INT3 = 0x35000001,
818 GPIO53_TEST_PIN8 = 0x35001000,
819 GPIO54_GPIO54 = 0x36000000,
820 GPIO54_EXT_INT4 = 0x36000001,
821 GPIO54_TEST_PIN9 = 0x36001000,
822 GPIO55_GPIO55 = 0x37000000,
823 GPIO55_EXT_INT5 = 0x37000001,
824 GPIO55_TEST_PIN13 = 0x37001000,
825 GPIO56_GPIO56 = 0x38000000,
826 GPIO56_EXT_INT6 = 0x38000001,
827 GPIO56_CLK_REQ1 = 0x38000002,
828 GPIO56_TEST_PIN14 = 0x38001000,
829 GPIO57_GPIO57 = 0x39000000,
830 GPIO57_EXT_INT7 = 0x39000001,
831 GPIO57_TEST_PIN15 = 0x39001000,
832 GPIO58_GPIO58 = 0x3A000000,
833 GPIO58_SD1_HOST_SDCLK = 0x3A001000,
834 GPIO59_GPIO59 = 0x3B000000,
835 GPIO59_M_JTAG_TDO = 0x3B000001,
836 GPIO59_SD1_CMD = 0x3B001000,
837 GPIO59_PS_JTAG_TDO = 0x3B001001,
838 GPIO59_PHY_JTAG_TDO = 0x3B001002,
839 GPIO59_AP_JTAG_TDO = 0x3B001003,
840 GPIO60_GPIO60 = 0x3C000000,
841 GPIO60_M_JTAG_TCK = 0x3C000001,
842 GPIO60_SD1_DATA0 = 0x3C001000,
843 GPIO60_PS_JTAG_TCK = 0x3C001001,
844 GPIO60_PHY_JTAG_TCK = 0x3C001002,
845 GPIO60_AP_JTAG_TCK = 0x3C001003,
846 GPIO61_GPIO61 = 0x3D000000,
847 GPIO61_M_JTAG_TRST = 0x3D000001,
848 GPIO61_SD1_DATA1 = 0x3D001000,
849 GPIO61_PS_JTAG_TRST = 0x3D001001,
850 GPIO61_PHY_JTAG_TRST = 0x3D001002,
851 GPIO61_AP_JTAG_TRST = 0x3D001003,
852 GPIO62_GPIO62 = 0x3E000000,
853 GPIO62_M_JTAG_TMS = 0x3E000001,
854 GPIO62_SD1_DATA2 = 0x3E001000,
855 GPIO62_PS_JTAG_TMS = 0x3E001001,
856 GPIO62_PHY_JTAG_TMS = 0x3E001002,
857 GPIO62_AP_JTAG_TMS = 0x3E001003,
858 GPIO63_GPIO63 = 0x3F000000,
859 GPIO63_M_JTAG_TDI = 0x3F000001,
860 GPIO63_SD1_DATA3 = 0x3F001000,
861 GPIO63_PS_JTAG_TDI = 0x3F001001,
862 GPIO63_PHY_JTAG_TDI = 0x3F001002,
863 GPIO63_AP_JTAG_TDI = 0x3F001003,
864 GPIO64_M_JTAG_TCK = 0x40000000,
865 GPIO64_GPIO64 = 0x40000001,
866 GPIO64_PS_JTAG_TCK = 0x40001000,
867 GPIO64_PHY_JTAG_TCK = 0x40001001,
868 GPIO64_AP_JTAG_TCK = 0x40001002,
869 GPIO66_M_JTAG_TDI = 0x42000000,
870 GPIO66_GPIO66 = 0x42000001,
871 GPIO66_PS_JTAG_TDI = 0x42001000,
872 GPIO66_PHY_JTAG_TDI = 0x42001001,
873 GPIO66_AP_JTAG_TDI = 0x42001002,
874 GPIO67_M_JTAG_TDO = 0x43000000,
875 GPIO67_GPIO67 = 0x43000001,
876 GPIO67_PS_JTAG_TDO = 0x43001000,
877 GPIO67_PHY_JTAG_TDO = 0x43001001,
878 GPIO67_AP_JTAG_TDO = 0x43001002,
879 GPIO68_M_JTAG_TMS = 0x44000000,
880 GPIO68_GPIO68 = 0x44000001,
881 GPIO68_PS_JTAG_TMS = 0x44001000,
882 GPIO68_PHY_JTAG_TMS = 0x44001001,
883 GPIO68_AP_JTAG_TMS = 0x44001002,
884 GPIO69_M_JTAG_TRST = 0x45000000,
885 GPIO69_GPIO69 = 0x45000001,
886 GPIO69_PS_JTAG_TRST = 0x45001000,
887 GPIO69_PHY_JTAG_TRST = 0x45001001,
888 GPIO69_AP_JTAG_TRST = 0x45001002,
889 GPIO70_KEY_COL0 = 0x46000000,
890 GPIO70_GPIO70 = 0x46000001,
891 GPIO70_EXT_INT8 = 0x46000002,
892 GPIO70_M_JTAG_TDO = 0x46000003,
893 GPIO70_PS_JTAG_TDO = 0x46001000,
894 GPIO70_PHY_JTAG_TDO = 0x46001001,
895 GPIO70_AP_JTAG_TDO = 0x46001002,
896 GPIO70_LTE_DATA_DONGLE4 = 0x46001003,
897 GPIO71_KEY_COL1 = 0x47000000,
898 GPIO71_GPIO71 = 0x47000001,
899 GPIO71_EXT_INT9 = 0x47000002,
900 GPIO71_LTE_DATA_DONGLE5 = 0x47001000,
901 GPIO72_KEY_COL2 = 0x48000000,
902 GPIO72_GPIO72 = 0x48000001,
903 GPIO72_EXT_INT10 = 0x48000002,
904 GPIO72_M_JTAG_TCK = 0x48000003,
905 GPIO72_PS_JTAG_TCK = 0x48001000,
906 GPIO72_PHY_JTAG_TCK = 0x48001001,
907 GPIO72_AP_JTAG_TCK = 0x48001002,
908 GPIO72_LTE_DATA_DONGLE6 = 0x48001003,
909 GPIO73_KEY_COL3 = 0x49000000,
910 GPIO73_GPIO73 = 0x49000001,
911 GPIO73_EXT_INT11 = 0x49000002,
912 GPIO73_LTE_DATA_DONGLE7 = 0x49001000,
913 GPIO74_KEY_ROW0 = 0x4A000000,
914 GPIO74_GPIO74 = 0x4A000001,
915 GPIO74_EXT_INT12 = 0x4A000002,
916 GPIO74_M_JTAG_TRST = 0x4A000003,
917 GPIO74_PS_JTAG_TRST = 0x4A001000,
918 GPIO74_PHY_JTAG_TRST = 0x4A001001,
919 GPIO74_AP_JTAG_TRST = 0x4A001002,
920 GPIO74_LTE_DATA_DONGLE8 = 0x4A001003,
921 GPIO75_KEY_ROW1 = 0x4B000000,
922 GPIO75_GPIO75 = 0x4B000001,
923 GPIO75_EXT_INT13 = 0x4B000002,
924 GPIO75_M_JTAG_TMS = 0x4B000003,
925 GPIO75_PS_JTAG_TMS = 0x4B001000,
926 GPIO75_PHY_JTAG_TMS = 0x4B001001,
927 GPIO75_AP_JTAG_TMS = 0x4B001002,
928 GPIO75_LTE_DATA_DONGLE9 = 0x4B001003,
929 GPIO76_KEY_ROW2 = 0x4C000000,
930 GPIO76_GPIO76 = 0x4C000001,
931 GPIO76_EXT_INT14 = 0x4C000002,
932 GPIO76_M_JTAG_TDI = 0x4C000003,
933 GPIO76_PS_JTAG_TDI = 0x4C001000,
934 GPIO76_PHY_JTAG_TDI = 0x4C001001,
935 GPIO76_AP_JTAG_TDI = 0x4C001002,
936 GPIO76_UART2_RXD = 0x4C001003,
937 GPIO77_KEY_ROW3 = 0x4D000000,
938 GPIO77_GPIO77 = 0x4D000001,
939 GPIO77_EXT_INT15 = 0x4D000002,
940 GPIO77_UART2_TXD = 0x4D001000,
941 GPIO78_GPIO78 = 0x4E000000,
942 GPIO78_MODEM_TXRX_DATA0 = 0x4E001000,
943 GPIO79_GPIO79 = 0x4F000000,
944 GPIO79_MODEM_TXRX_DATA1 = 0x4F001000,
945 GPIO80_GPIO80 = 0x50000000,
946 GPIO80_MODEM_TXRX_DATA2 = 0x50001000,
947 GPIO81_GPIO81 = 0x51000000,
948 GPIO81_MODEM_TXRX_DATA3 = 0x51001000,
949 GPIO82_GPIO82 = 0x52000000,
950 GPIO82_MODEM_TXRX_DATA4 = 0x52001000,
951 GPIO83_GPIO83 = 0x53000000,
952 GPIO83_MODEM_TXRX_DATA5 = 0x53001000,
953 GPIO84_GPIO84 = 0x54000000,
954 GPIO84_MODEM_TXRX_DATA6 = 0x54001000,
955 GPIO85_GPIO85 = 0x55000000,
956 GPIO85_MODEM_TXRX_DATA7 = 0x55001000,
957 GPIO86_GPIO86 = 0x56000000,
958 GPIO86_MODEM_TXRX_DATA8 = 0x56001000,
959 GPIO87_GPIO87 = 0x57000000,
960 GPIO87_MODEM_TXRX_DATA9 = 0x57001000,
961 GPIO88_GPIO88 = 0x58000000,
962 GPIO88_MODEM_TXRX_DATA10 = 0x58001000,
963 GPIO89_GPIO89 = 0x59000000,
964 GPIO89_MODEM_TXRX_DATA11 = 0x59001000,
965 GPIO90_GPIO90 = 0x5A000000,
966 GPIO90_MODEM_RX_DATA0 = 0x5A001000,
967 GPIO91_GPIO91 = 0x5B000000,
968 GPIO91_MODEM_RX_DATA1 = 0x5B001000,
969 GPIO92_GPIO92 = 0x5C000000,
970 GPIO92_MODEM_RX_DATA2 = 0x5C001000,
971 GPIO93_GPIO93 = 0x5D000000,
972 GPIO93_MODEM_RX_DATA3 = 0x5D001000,
973 GPIO94_GPIO94 = 0x5E000000,
974 GPIO94_MODEM_RX_DATA4 = 0x5E001000,
975 GPIO95_GPIO95 = 0x5F000000,
976 GPIO95_MODEM_RX_DATA5 = 0x5F001000,
977 GPIO96_GPIO96 = 0x60000000,
978 GPIO96_MODEM_RX_DATA6 = 0x60001000,
979 GPIO97_GPIO97 = 0x61000000,
980 GPIO97_MODEM_RX_DATA7 = 0x61001000,
981 GPIO98_GPIO98 = 0x62000000,
982 GPIO98_MODEM_RX_DATA8 = 0x62001000,
983 GPIO99_GPIO99 = 0x63000000,
984 GPIO99_MODEM_RX_DATA9 = 0x63001000,
985 GPIO100_GPIO100 = 0x64000000,
986 GPIO100_MODEM_RX_DATA10 = 0x64001000,
987 GPIO101_GPIO101 = 0x65000000,
988 GPIO101_MODEM_RX_DATA11 = 0x65001000,
989 GPIO102_GPIO102 = 0x66000000,
990 GPIO102_MODEM_FCLK_O = 0x66001000,
991 GPIO103_GPIO103 = 0x67000000,
992 GPIO103_MODEM_FRAME_TX_O = 0x67001000,
993 GPIO104_GPIO104 = 0x68000000,
994 GPIO104_MODEM_FRAME_RX_I = 0x68001000,
995 GPIO105_GPIO105 = 0x69000000,
996 GPIO105_MODEM_MCLK_I = 0x69001000,
997 GPIO106_GPIO106 = 0x6A000000,
998 GPIO106_LTE_REF_CLK = 0x6A001000,
999 /*GPIO107 GPIO108*/
1000 GPIO109_GPIO109 = 0x6D000000,
1001 GPIO110_GPIO110 = 0x6E000000,
1002 GPIO110_GSM_OUT_OLD_O_12 = 0x6E000001,
1003 GPIO111_PWRCTRL2 = 0x6F000000,
1004 GPIO111_GPIO111 = 0x6F000001,
1005 GPIO112_GPIO112 = 0x70000000,
1006 GPIO112_RF_SPI0_STR0 = 0x70001000,
1007 GPIO113_GPIO113 = 0x71000000,
1008 GPIO113_RF_SPI0_STR1 = 0x71001000,
1009 GPIO114_GPIO114 = 0x72000000,
1010 GPIO114_RF_SPI0_CLK = 0x72001000,
1011 GPIO115_GPIO115 = 0x73000000,
1012 GPIO115_RF_SPI0_DIN = 0x73001000,
1013 GPIO116_GPIO116 = 0x74000000,
1014 GPIO116_RF_SPI0_DATA = 0x74001000,
1015 GPIO117_GPIO117 = 0x75000000,
1016 GPIO117_RF_SPI1_STR0 = 0x75001000,
1017 GPIO118_GPIO118 = 0x76000000,
1018 GPIO118_RF_SPI1_CLK = 0x76001000,
1019 GPIO119_GPIO119 = 0x77000000,
1020 GPIO119_RF_SPI1_DIN = 0x77001000,
1021 GPIO120_GPIO120 = 0x78000000,
1022 GPIO120_RF_SPI1_DATA = 0x78001000,
1023 /*GPIO121 --GPIO144*/
1024 GPIO145_GPIO145 = 0x91000000,
1025 GPIO145_RMII_TXEN = 0x91001000,
1026 GPIO146_GPIO146 = 0x92000000,
1027 GPIO146_RMII_RXEN = 0x92001000,
1028 GPIO147_GPIO147 = 0x93000000,
1029 GPIO147_RMII_RXD0 = 0x93001000,
1030 GPIO148_GPIO148 = 0x94000000,
1031 GPIO148_RMII_RXD1 = 0x94001000,
1032 GPIO149_GPIO149 = 0x95000000,
1033 GPIO149_RMII_TXD0 = 0x95001000,
1034 GPIO150_GPIO150 = 0x96000000,
1035 GPIO150_RMII_TXD1 = 0x96001000,
1036 GPIO151_GPIO151 = 0x97000000,
1037 GPIO151_MDC_SCLK = 0x97001000,
1038 GPIO152_GPIO152 = 0x98000000,
1039 GPIO152_MDC_SDIO = 0x98001000,
1040 GPIO153_GPIO153 = 0x99000000,
1041 GPIO153_PHY_RST = 0x99001000,
1042 GPIO154_GPIO154 = 0x9A000000,
1043 GPIO154_RMII_CLK_O = 0x9A001000,
1044 GPIO155_GPIO155 = 0x9B000000,
1045 GPIO155_RMII_CLK_I = 0x9B001000,
1046
1047}T_ZDrvGpio_FuncSel;
1048#endif
1049/*******************************************************************************
1050 * Global function declarations *
1051 ******************************************************************************/
1052/**
1053*@brief This function is used to get descriptor of pin.
1054*@param name the name used to distinguish gpio, must added in g_GpioConfig[](in gpio_ref.c)
1055*
1056*@return pointer of gpio descriptor if success, errcode otherwise
1057*/
1058UINT32 zDrvGpio_Request(CHAR *name);
1059
1060/**
1061 *@brief This function is used to free this gpio, so others can request it
1062 *@param gpio_id pointer of gpio descriptor
1063 *
1064 *@return 0 if success, errcode otherwise.
1065 */
1066SINT32 zDrvGpio_Free(UINT32 gpio_id);
1067
1068/**
1069 *@brief This function is used to set the pin use ,used as GPIO or other function
1070 *@param gpio_id gpio id
1071 *@param func_sel gpio function sel
1072 *
1073 *@return 0 if success, errcode otherwise.
1074 */
1075SINT32 zDrvGpio_SetFunc(UINT32 gpio_id, T_ZDrvGpio_FuncSel func_sel);
1076
1077/**
1078 *@brief This function is used to set gpio internal pull up or pull down or none
1079 *@param gpio_id gpio id
1080 *@param val pull function sel
1081 *
1082 *@return 0 if success, errcode otherwise.
1083 */
1084SINT32 zDrvGpio_PullUpDown(UINT32 gpio_id, T_ZDrvGpio_PullUp val);
1085
1086/**
1087 *@brief This function is used to set direction of gpio, in or out
1088 *@param gpio_id gpio id
1089 *@param value gpio direction sel
1090 *
1091 *@return none.
1092 */
1093VOID zDrvGpio_SetDirection(UINT32 gpio_id, T_ZDrvGpio_IoDirection value);
1094
1095/**
1096 *@brief This function is used to get direction of gpio
1097 *@param gpio_id gpio id
1098 *
1099 *@return gpio direction.
1100 */
1101T_ZDrvGpio_IoDirection zDrvGpio_GetDirection(UINT32 gpio_id);
1102
1103/**
1104 *@brief This function is used to set output value
1105 *@param gpio_id gpio id
1106 *@param value gpio output val sel
1107 *
1108 *@return none.
1109 */
1110VOID zDrvGpio_SetOutputValue(UINT32 gpio_id, T_ZDrvGpio_IoVal value);
1111
1112/**
1113 *@brief This function is used to get output value
1114 *@param gpio_id gpio id
1115 *
1116 *@return output value(high or low).
1117 */
1118T_ZDrvGpio_IoVal zDrvGpio_GetOutputValue(UINT32 gpio_id);
1119
1120/**
1121 *@brief This function is used to get input value
1122 *@param gpio_id gpio id
1123 *
1124 *@return input value(high or low).
1125 */
1126T_ZDrvGpio_IoVal zDrvGpio_GetInputValue(UINT32 gpio_id);
1127
1128/**
1129 *@brief This function is used to set gpio pin for jtag
1130 *@param jtagNum jtag id 0/1/2
1131 *@param function sel jtag connect to which core(0:m0jtag, 1:psjtag, 2:phyjtag, 3:apjtag)
1132 *
1133 *@return none.
1134 */
1135VOID zDrvGpio_JtagConfig(UINT32 jtagNum, UINT32 function);
1136#endif
1137#endif