blob: 5acbd298b3254f23f61f47bde8176d5b255d64ca [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001/*
2 * Copyright 2021 ASR Microelectronics (Shanghai) Co., Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __DTS_ASR18XX_PINFUNC_H
10#define __DTS_ASR18XX_PINFUNC_H
11
12/* drive-strength: value, mask */
13#define DS_SLOW0 pinctrl-single,drive-strength = <0x0000 0x1C08>
14#define DS_SLOW1 pinctrl-single,drive-strength = <0x0800 0x1C08>
15#define DS_MEDIUM pinctrl-single,drive-strength = <0x1000 0x1C08>
16#define DS_FAST pinctrl-single,drive-strength = <0x1800 0x1C08>
17#define DS_FAST0 pinctrl-single,drive-strength = <0x0400 0x1C08>
18#define DS_FAST1 pinctrl-single,drive-strength = <0x0C00 0x1C08>
19#define DS_FAST2 pinctrl-single,drive-strength = <0x1400 0x1C08>
20#define DS_FAST3 pinctrl-single,drive-strength = <0x1C00 0x1C08>
21#define DS_STRONG0 pinctrl-single,drive-strength = <0x1008 0x1C08>
22
23/* slow-rate: value, mask */
24#define SL_NORMAL pinctrl-single,slew-rate = <0x0000 0x0080>
25#define SL_LOW pinctrl-single,slew-rate = <0x0080 0x0080>
26
27/* input-schmitt: value, mask ; input-schmitt-enable: value, enable, disable, mask */
28#define EDGE_NONE pinctrl-single,input-schmitt = <0 0x330>; \
29 pinctrl-single,input-schmitt-enable = <0x40 0 0x40 0x40>
30#define EDGE_RISE pinctrl-single,input-schmitt = <0x10 0x330>; \
31 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
32#define EDGE_FALL pinctrl-single,input-schmitt = <0x20 0x330>; \
33 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
34#define EDGE_BOTH pinctrl-single,input-schmitt = <0x30 0x330>; \
35 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
36
37#define EDGE_RISE_HYST1 pinctrl-single,input-schmitt = <0x110 0x330>; \
38 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
39#define EDGE_FALL_HYST1 pinctrl-single,input-schmitt = <0x120 0x330>; \
40 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
41#define EDGE_BOTH_HYST1 pinctrl-single,input-schmitt = <0x130 0x330>; \
42 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
43
44#define EDGE_RISE_HYST2 pinctrl-single,input-schmitt = <0x210 0x330>; \
45 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
46#define EDGE_FALL_HYST2 pinctrl-single,input-schmitt = <0x220 0x330>; \
47 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
48#define EDGE_BOTH_HYST2 pinctrl-single,input-schmitt = <0x230 0x330>; \
49 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
50
51#define EDGE_RISE_HYST3 pinctrl-single,input-schmitt = <0x310 0x330>; \
52 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
53#define EDGE_FALL_HYST3 pinctrl-single,input-schmitt = <0x320 0x330>; \
54 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
55#define EDGE_BOTH_HYST3 pinctrl-single,input-schmitt = <0x330 0x330>; \
56 pinctrl-single,input-schmitt-enable = <0x0 0 0x40 0x40>
57
58
59/* bias-pullup/down: value, enable, disable, mask */
60#define PULL_NONE pinctrl-single,bias-pullup = <0x0000 0xc000 0 0xc000>; \
61 pinctrl-single,bias-pulldown = <0x0000 0xa000 0 0xa000>
62#define PULL_UP pinctrl-single,bias-pullup = <0xc000 0xc000 0 0xc000>; \
63 pinctrl-single,bias-pulldown = <0x8000 0xa000 0x8000 0xa000>
64#define PULL_DOWN pinctrl-single,bias-pullup = <0x8000 0xc000 0x8000 0xc000>; \
65 pinctrl-single,bias-pulldown = <0xa000 0xa000 0 0xa000>
66#define PULL_BOTH pinctrl-single,bias-pullup = <0xc000 0xc000 0x8000 0xc000>; \
67 pinctrl-single,bias-pulldown = <0xa000 0xa000 0x8000 0xa000>
68#define PULL_FLOAT pinctrl-single,bias-pullup = <0x8000 0x8000 0 0xc000>; \
69 pinctrl-single,bias-pulldown = <0x8000 0x8000 0 0xa000>
70
71
72#define MFP_DEFAULT DS_MEDIUM;PULL_NONE;EDGE_NONE;SL_NORMAL
73
74#define MFP_PULL_UP DS_MEDIUM;PULL_UP;EDGE_NONE;SL_NORMAL
75#define MFP_PULL_DOWN DS_MEDIUM;PULL_DOWN;EDGE_NONE;SL_NORMAL
76#define MFP_PULL_FLOAT DS_MEDIUM;PULL_FLOAT;EDGE_NONE;SL_NORMAL
77
78/*
79 * MFP alternative functions 0-7
80 */
81#define AF0 0x0
82#define AF1 0x1
83#define AF2 0x2
84#define AF3 0x3
85#define AF4 0x4
86#define AF5 0x5
87#define AF6 0x6
88#define AF7 0x7
89
90/*
91 * Pin names and MFPR addresses
92 */
93
94#define DF_IO0 0x0040
95#define DF_IO1 0x003c
96#define DF_IO2 0x0038
97#define DF_IO3 0x0034
98#define DF_IO4 0x0030
99#define DF_IO5 0x002c
100#define DF_IO6 0x0028
101#define DF_IO7 0x0024
102#define DF_IO8 0x0020
103#define DF_IO9 0x001c
104#define DF_IO10 0x0018
105#define DF_IO11 0x0014
106#define DF_IO12 0x0010
107#define DF_IO13 0x000c
108#define DF_IO14 0x0008
109#define DF_IO15 0x0004
110#define DF_nCS0 0x0044
111#define DF_nCS1 0x0048
112#define SM_nCS0 0x004c
113#define SM_nCS1 0x0050
114#define DF_WEn 0x0054
115#define DF_REn 0x0058
116#define DF_CLE_SM_OEn 0x005c
117#define DF_ALE_SM_WEn 0x0060
118#define DF_RDY0 0x0068
119#define DF_RDY1 0x0078
120
121#define SM_SCLK 0x0064
122#define SM_BE0 0x006c
123#define SM_BE1 0x0070
124#define SM_ADV 0x0074
125#define SM_ADVMUX 0x007c
126#define SM_RDY 0x0080
127
128#define MMC1_DAT7 0x0084
129#define MMC1_DAT6 0x0088
130#define MMC1_DAT5 0x008c
131#define MMC1_DAT4 0x0090
132#define MMC1_DAT3 0x0094
133#define MMC1_DAT2 0x0098
134#define MMC1_DAT1 0x009c
135#define MMC1_DAT0 0x00a0
136#define MMC1_CMD 0x00a4
137#define MMC1_CLK 0x00a8
138#define MMC1_CD 0x00ac
139#define MMC1_WP 0x00b0
140
141#define PRI_TDI 0xB4
142#define PRI_TMS 0xB8
143#define PRI_TCK 0xBC
144#define PRI_TDO 0xC0
145
146#define RF_CONF_4 0x0274
147#define VCXO_REQ 0xD4
148#define VCXO_OUT 0xD8
149#define VBUS_DRV 0xC8
150#define CLK_REQ 0x00cc
151
152#define ANT_SW4 0x26C
153#define PA_MODE 0x270
154
155#define TDS_DIO0 0x2B4
156#define TDS_DIO1 0x2B8
157#define TDS_DIO2 0x2BC
158#define TDS_DIO3 0x2C0
159#define TDS_DIO4 0x2C4
160#define TDS_DIO5 0x2C8
161#define TDS_DIO6 0x2CC
162#define TDS_DIO7 0x2D0
163#define TDS_CLK 0x2D4
164#define TDS_DIO8 0x2D8
165#define TDS_DIO9 0x2DC
166#define TDS_DIO10 0x2E0
167#define TDS_DIO11 0x2E4
168#define TDS_DIO12 0x2E8
169#define TDS_DIO13 0x2EC
170#define TDS_DIO14 0x2F0
171#define TDS_DIO15 0x2F4
172#define TDS_DIO16 0x2F8
173#define TDS_DIO17 0x2FC
174#define TDS_DIO18 0x300
175#define TDS_PAON 0x2E0
176#define TDS_PACTRL 0x2E4
177#define TDS_RXON 0x2E8
178#define TDS_TXON 0x2EC
179#define TDS_LNACTRL 0x2F0
180#define TDS_MIXCTRL 0x2F4
181#define TDS_TRXSW 0x2F8
182#define TDS_RXREV 0x2FC
183#define TDS_TXREV 0x300
184
185#define GPIO00 0x0DC
186#define GPIO01 0x0E0
187#define GPIO02 0x0E4
188#define GPIO03 0x0E8
189#define GPIO04 0x0EC
190#define GPIO05 0x0F0
191#define GPIO06 0x0F4
192#define GPIO07 0x0F8
193#define GPIO08 0x0FC
194#define GPIO09 0x100
195#define GPIO10 0x104
196#define GPIO11 0x108
197#define GPIO12 0x10C
198#define GPIO13 0x110
199#define GPIO14 0x114
200#define GPIO15 0x118
201#define GPIO16 0x11C
202#define GPIO17 0x120
203#define GPIO18 0x124
204#define GPIO19 0x128
205#define GPIO20 0x12C
206#define GPIO21 0x130
207#define GPIO22 0x134
208#define GPIO23 0x138
209#define GPIO24 0x13C
210
211#define GPIO25 0x140
212#define GPIO26 0x144
213#define GPIO27 0x148
214#define GPIO28 0x14c
215#define GPIO29 0x150
216#define GPIO30 0x154
217#define GPIO31 0x158
218#define GPIO32 0x15c
219#define GPIO33 0x160
220#define GPIO34 0x164
221#define GPIO35 0x168
222#define GPIO36 0x16c
223#define GPIO37 0x170
224#define GPIO38 0x174
225#define GPIO39 0x178
226#define GPIO40 0x17c
227#define GPIO41 0x180
228#define GPIO42 0x184
229#define GPIO43 0x188
230#define GPIO44 0x18c
231#define GPIO45 0x190
232#define GPIO46 0x194
233#define GPIO47 0x198
234#define GPIO48 0x19c
235#define GPIO49 0x1a0
236#define GPIO50 0x1a4
237#define GPIO51 0x1a8
238#define GPIO52 0x1ac
239#define GPIO53 0x1b0
240#define GPIO54 0x1b4
241#define GPIO55 0x1f4
242
243
244#define GPIO60 0x304
245#define GPIO61 0x308
246#define GPIO62 0x30C
247#define GPIO63 0x310
248#define GPIO64 0x314
249#define GPIO65 0x318
250#define GPIO66 0x31C
251#define GPIO69 0x2BC
252#define GPIO70 0x2C0
253#define GPIO71 0x1B8
254#define GPIO72 0x1BC
255#define GPIO79 0x2E4
256#define GPIO80 0x2E8
257#define GPIO81 0x280
258#define GPIO82 0x284
259#define GPIO83 0x288
260#define GPIO86 0x204
b.liub17525e2025-05-14 17:22:29 +0800261// Add by liubin
262#define GPIO117 0xB4
263#define GPIO118 0xB8
264#define GPIO119 0xBC
265#define GPIO120 0xC0
b.liue9582032025-04-17 19:18:16 +0800266#define GPIO123 0xCC
267#define GPIO124 0xD0
268#define GPIO126 0xD8
269#define USB_ID 0xb0
270
271#define ND_IO8 DF_IO8
272#define ND_IO9 DF_IO9
273#define ND_IO10 DF_IO10
274#define ND_IO11 DF_IO11
275#define ND_IO12 DF_IO12
276#define ND_IO13 DF_IO13
277#define ND_IO14 DF_IO14
278#define ND_IO15 DF_IO15
279#define ND_IO7 DF_IO7
280#define ND_IO6 DF_IO6
281#define ND_IO5 DF_IO5
282#define ND_IO4 DF_IO4
283#define ND_IO3 DF_IO3
284#define ND_IO2 DF_IO2
285#define ND_IO1 DF_IO1
286#define ND_IO0 DF_IO0
287
288#define ND_CLE_SM_OEN DF_CLE_SM_OEn
289
290#define SM_BEN0 SM_BE0
291
292#endif /* __DTS_ASR18XX_PINFUNC_H */