blob: d4e9b56292ead58c24af5bf9a76784a56afede78 [file] [log] [blame]
Joseph Chen72cd8792021-06-02 15:58:25 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2021 Rockchip Electronics Co., Ltd
4 */
5
6#ifndef __SOC_ROCKCHIP_RK3568_GRF_H__
7#define __SOC_ROCKCHIP_RK3568_GRF_H__
8
9struct rk3568_grf {
10 unsigned int gpio1a_iomux_l;
11 unsigned int gpio1a_iomux_h;
12 unsigned int gpio1b_iomux_l;
13 unsigned int gpio1b_iomux_h;
14 unsigned int gpio1c_iomux_l;
15 unsigned int gpio1c_iomux_h;
16 unsigned int gpio1d_iomux_l;
17 unsigned int gpio1d_iomux_h;
18 unsigned int gpio2a_iomux_l;
19 unsigned int gpio2a_iomux_h;
20 unsigned int gpio2b_iomux_l;
21 unsigned int gpio2b_iomux_h;
22 unsigned int gpio2c_iomux_l;
23 unsigned int gpio2c_iomux_h;
24 unsigned int gpio2d_iomux_l;
25 unsigned int gpio2d_iomux_h;
26 unsigned int gpio3a_iomux_l;
27 unsigned int gpio3a_iomux_h;
28 unsigned int gpio3b_iomux_l;
29 unsigned int gpio3b_iomux_h;
30 unsigned int gpio3c_iomux_l;
31 unsigned int gpio3c_iomux_h;
32 unsigned int gpio3d_iomux_l;
33 unsigned int gpio3d_iomux_h;
34 unsigned int gpio4a_iomux_l;
35 unsigned int gpio4a_iomux_h;
36 unsigned int gpio4b_iomux_l;
37 unsigned int gpio4b_iomux_h;
38 unsigned int gpio4c_iomux_l;
39 unsigned int gpio4c_iomux_h;
40 unsigned int gpio4d_iomux_l;
41 unsigned int reserved0[(0x0080 - 0x0078) / 4 - 1];
42 unsigned int gpio1a_p;
43 unsigned int gpio1b_p;
44 unsigned int gpio1c_p;
45 unsigned int gpio1d_p;
46 unsigned int gpio2a_p;
47 unsigned int gpio2b_p;
48 unsigned int gpio2c_p;
49 unsigned int gpio2d_p;
50 unsigned int gpio3a_p;
51 unsigned int gpio3b_p;
52 unsigned int gpio3c_p;
53 unsigned int gpio3d_p;
54 unsigned int gpio4a_p;
55 unsigned int gpio4b_p;
56 unsigned int gpio4c_p;
57 unsigned int gpio4d_p;
58 unsigned int gpio1a_ie;
59 unsigned int gpio1b_ie;
60 unsigned int gpio1c_ie;
61 unsigned int gpio1d_ie;
62 unsigned int gpio2a_ie;
63 unsigned int gpio2b_ie;
64 unsigned int gpio2c_ie;
65 unsigned int gpio2d_ie;
66 unsigned int gpio3a_ie;
67 unsigned int gpio3b_ie;
68 unsigned int gpio3c_ie;
69 unsigned int gpio3d_ie;
70 unsigned int gpio4a_ie;
71 unsigned int gpio4b_ie;
72 unsigned int gpio4c_ie;
73 unsigned int gpio4d_ie;
74 unsigned int gpio1a_opd;
75 unsigned int gpio1b_opd;
76 unsigned int gpio1c_opd;
77 unsigned int gpio1d_opd;
78 unsigned int gpio2a_opd;
79 unsigned int gpio2b_opd;
80 unsigned int gpio2c_opd;
81 unsigned int gpio2d_opd;
82 unsigned int gpio3a_opd;
83 unsigned int gpio3b_opd;
84 unsigned int gpio3c_opd;
85 unsigned int gpio3d_opd;
86 unsigned int gpio4a_opd;
87 unsigned int gpio4b_opd;
88 unsigned int gpio4c_opd;
89 unsigned int gpio4d_opd;
90 unsigned int gpio1a_sus;
91 unsigned int gpio1b_sus;
92 unsigned int gpio1c_sus;
93 unsigned int gpio1d_sus;
94 unsigned int gpio2a_sus;
95 unsigned int gpio2b_sus;
96 unsigned int gpio2c_sus;
97 unsigned int gpio2d_sus;
98 unsigned int gpio3a_sus;
99 unsigned int gpio3b_sus;
100 unsigned int gpio3c_sus;
101 unsigned int gpio3d_sus;
102 unsigned int gpio4a_sus;
103 unsigned int gpio4b_sus;
104 unsigned int gpio4c_sus;
105 unsigned int gpio4d_sus;
106 unsigned int gpio1a_sl;
107 unsigned int gpio1b_sl;
108 unsigned int gpio1c_sl;
109 unsigned int gpio1d_sl;
110 unsigned int gpio2a_sl;
111 unsigned int gpio2b_sl;
112 unsigned int gpio2c_sl;
113 unsigned int gpio2d_sl;
114 unsigned int gpio3a_sl;
115 unsigned int gpio3b_sl;
116 unsigned int gpio3c_sl;
117 unsigned int gpio3d_sl;
118 unsigned int gpio4a_sl;
119 unsigned int gpio4b_sl;
120 unsigned int gpio4c_sl;
121 unsigned int gpio4d_sl;
122 unsigned int reserved1[(0x0200 - 0x01bc) / 4 - 1];
123 unsigned int gpio1a_ds_0;
124 unsigned int gpio1a_ds_1;
125 unsigned int gpio1a_ds_2;
126 unsigned int gpio1a_ds_3;
127 unsigned int gpio1b_ds_0;
128 unsigned int gpio1b_ds_1;
129 unsigned int gpio1b_ds_2;
130 unsigned int gpio1b_ds_3;
131 unsigned int gpio1c_ds_0;
132 unsigned int gpio1c_ds_1;
133 unsigned int gpio1c_ds_2;
134 unsigned int gpio1c_ds_3;
135 unsigned int gpio1d_ds_0;
136 unsigned int gpio1d_ds_1;
137 unsigned int gpio1d_ds_2;
138 unsigned int gpio1d_ds_3;
139 unsigned int gpio2a_ds_0;
140 unsigned int gpio2a_ds_1;
141 unsigned int gpio2a_ds_2;
142 unsigned int gpio2a_ds_3;
143 unsigned int gpio2b_ds_0;
144 unsigned int gpio2b_ds_1;
145 unsigned int gpio2b_ds_2;
146 unsigned int gpio2b_ds_3;
147 unsigned int gpio2c_ds_0;
148 unsigned int gpio2c_ds_1;
149 unsigned int gpio2c_ds_2;
150 unsigned int gpio2c_ds_3;
151 unsigned int gpio2d_ds_0;
152 unsigned int gpio2d_ds_1;
153 unsigned int gpio2d_ds_2;
154 unsigned int gpio2d_ds_3;
155 unsigned int gpio3a_ds_0;
156 unsigned int gpio3a_ds_1;
157 unsigned int gpio3a_ds_2;
158 unsigned int gpio3a_ds_3;
159 unsigned int gpio3b_ds_0;
160 unsigned int gpio3b_ds_1;
161 unsigned int gpio3b_ds_2;
162 unsigned int gpio3b_ds_3;
163 unsigned int gpio3c_ds_0;
164 unsigned int gpio3c_ds_1;
165 unsigned int gpio3c_ds_2;
166 unsigned int gpio3c_ds_3;
167 unsigned int gpio3d_ds_0;
168 unsigned int gpio3d_ds_1;
169 unsigned int gpio3d_ds_2;
170 unsigned int gpio3d_ds_3;
171 unsigned int gpio4a_ds_0;
172 unsigned int gpio4a_ds_1;
173 unsigned int gpio4a_ds_2;
174 unsigned int gpio4a_ds_3;
175 unsigned int gpio4b_ds_0;
176 unsigned int gpio4b_ds_1;
177 unsigned int gpio4b_ds_2;
178 unsigned int gpio4b_ds_3;
179 unsigned int gpio4c_ds_0;
180 unsigned int gpio4c_ds_1;
181 unsigned int gpio4c_ds_2;
182 unsigned int gpio4c_ds_3;
183 unsigned int gpio4d_ds_0;
184 unsigned int gpio4d_ds_1;
185 unsigned int gpio4d_ds_2;
186 unsigned int gpio4d_ds_3;
187 unsigned int iofunc_sel0;
188 unsigned int iofunc_sel1;
189 unsigned int iofunc_sel2;
190 unsigned int iofunc_sel3;
191 unsigned int iofunc_sel4;
192 unsigned int iofunc_sel5;
193 unsigned int reserved2[(0x0340 - 0x0314) / 4 - 1];
194 unsigned int vi_con0;
195 unsigned int vi_con1;
196 unsigned int vi_status0;
197 unsigned int reserved3[(0x0360 - 0x0348) / 4 - 1];
198 unsigned int vo_con0;
199 unsigned int vo_con1;
200 unsigned int vo_con2;
201 unsigned int vo_con3;
202 unsigned int reserved4[(0x0380 - 0x036c) / 4 - 1];
203 unsigned int mac0_con0;
204 unsigned int mac0_con1;
205 unsigned int mac1_con0;
206 unsigned int mac1_con1;
207 unsigned int reserved5[(0x03a0 - 0x038c) / 4 - 1];
208 unsigned int biu_con0;
209 unsigned int biu_con1;
210 unsigned int biu_con2;
211 unsigned int reserved6[(0x03c0 - 0x03a8) / 4 - 1];
212 unsigned int gic_con0;
213 unsigned int gic_con1;
214 unsigned int gic_con2;
215 unsigned int reserved7[(0x03f0 - 0x03c8) / 4 - 1];
216 unsigned int gpu_con0;
217 unsigned int gpu_con1;
218 unsigned int reserved8[(0x0400 - 0x03f4) / 4 - 1];
219 unsigned int cpu_con0;
220 unsigned int reserved9[(0x0420 - 0x0400) / 4 - 1];
221 unsigned int cpu_status0;
222 unsigned int reserved10[(0x0500 - 0x0420) / 4 - 1];
223 unsigned int soc_con0;
224 unsigned int soc_con1;
225 unsigned int soc_con2;
226 unsigned int soc_con3;
227 unsigned int reserved11[(0x0514 - 0x050c) / 4 - 1];
228 unsigned int soc_con5;
229 unsigned int soc_con6;
230 unsigned int reserved12[(0x0580 - 0x0518) / 4 - 1];
231 unsigned int soc_status0;
232 unsigned int reserved13[(0x05c0 - 0x0580) / 4 - 1];
233 unsigned int ram_con;
234 unsigned int core_ram_con;
235 unsigned int reserved14[(0x0600 - 0x05c4) / 4 - 1];
236 unsigned int tsadc_con;
237 unsigned int reserved15[(0x0610 - 0x0600) / 4 - 1];
238 unsigned int saradc_con;
239 unsigned int reserved16[(0x0700 - 0x0610) / 4 - 1];
240 unsigned int gpupvtpll_con0;
241 unsigned int gpupvtpll_con1;
242 unsigned int gpupvtpll_con2;
243 unsigned int gpupvtpll_con3;
244 unsigned int reserved17[(0x0740 - 0x070c) / 4 - 1];
245 unsigned int npupvtpll_con0;
246 unsigned int npupvtpll_con1;
247 unsigned int npupvtpll_con2;
248 unsigned int npupvtpll_con3;
249 unsigned int reserved18[(0x0800 - 0x074c) / 4 - 1];
250 unsigned int chip_id;
251 unsigned int reserved19[(0x0840 - 0x0800) / 4 - 1];
252 unsigned int gpio1c5_ds;
253 unsigned int gpio2a2_ds;
254 unsigned int gpio2b0_ds;
255 unsigned int gpio3a0_ds;
256 unsigned int gpio3a6_ds;
257 unsigned int gpio4a0_ds;
258 unsigned int reserved20[(0x0900 - 0x0854) / 4 - 1];
259 unsigned int dmac0_con0;
260 unsigned int dmac0_con1;
261 unsigned int dmac0_con2;
262 unsigned int dmac0_con3;
263 unsigned int dmac0_con4;
264 unsigned int dmac0_con5;
265 unsigned int dmac0_con6;
266 unsigned int dmac0_con7;
267 unsigned int dmac0_con8;
268 unsigned int dmac0_con9;
269 unsigned int reserved21[(0x0940 - 0x0924) / 4 - 1];
270 unsigned int dmac1_con0;
271 unsigned int dmac1_con1;
272 unsigned int dmac1_con2;
273 unsigned int dmac1_con3;
274 unsigned int dmac1_con4;
275 unsigned int dmac1_con5;
276 unsigned int dmac1_con6;
277 unsigned int dmac1_con7;
278 unsigned int dmac1_con8;
279 unsigned int dmac1_con9;
280};
281
282check_member(rk3568_grf, dmac1_con9, 0x0964);
283
284struct rk3568_pmugrf {
285 unsigned int pmu_gpio0a_iomux_l;
286 unsigned int pmu_gpio0a_iomux_h;
287 unsigned int pmu_gpio0b_iomux_l;
288 unsigned int pmu_gpio0b_iomux_h;
289 unsigned int pmu_gpio0c_iomux_l;
290 unsigned int pmu_gpio0c_iomux_h;
291 unsigned int pmu_gpio0d_iomux_l;
292 unsigned int reserved0[(0x0020 - 0x0018) / 4 - 1];
293 unsigned int pmu_gpio0a_p;
294 unsigned int pmu_gpio0b_p;
295 unsigned int pmu_gpio0c_p;
296 unsigned int pmu_gpio0d_p;
297 unsigned int pmu_gpio0a_ie;
298 unsigned int pmu_gpio0b_ie;
299 unsigned int pmu_gpio0c_ie;
300 unsigned int pmu_gpio0d_ie;
301 unsigned int pmu_gpio0a_opd;
302 unsigned int pmu_gpio0b_opd;
303 unsigned int pmu_gpio0c_opd;
304 unsigned int pmu_gpio0d_opd;
305 unsigned int pmu_gpio0a_sus;
306 unsigned int pmu_gpio0b_sus;
307 unsigned int pmu_gpio0c_sus;
308 unsigned int pmu_gpio0d_sus;
309 unsigned int pmu_gpio0a_sl;
310 unsigned int pmu_gpio0b_sl;
311 unsigned int pmu_gpio0c_sl;
312 unsigned int pmu_gpio0d_sl;
313 unsigned int pmu_gpio0a_ds_0;
314 unsigned int pmu_gpio0a_ds_1;
315 unsigned int pmu_gpio0a_ds_2;
316 unsigned int pmu_gpio0a_ds_3;
317 unsigned int pmu_gpio0b_ds_0;
318 unsigned int pmu_gpio0b_ds_1;
319 unsigned int pmu_gpio0b_ds_2;
320 unsigned int pmu_gpio0b_ds_3;
321 unsigned int pmu_gpio0c_ds_0;
322 unsigned int pmu_gpio0c_ds_1;
323 unsigned int pmu_gpio0c_ds_2;
324 unsigned int pmu_gpio0c_ds_3;
325 unsigned int pmu_gpio0d_ds_0;
326 unsigned int pmu_gpio0d_ds_1;
327 unsigned int pmu_gpio0d_ds_2;
328 unsigned int pmu_gpio0d_ds_3;
329 unsigned int reserved1[(0x0100 - 0x00ac) / 4 - 1];
330 unsigned int pmu_soc_con0;
331 unsigned int pmu_soc_con1;
332 unsigned int pmu_soc_con2;
333 unsigned int pmu_soc_con3;
334 unsigned int pmu_soc_con4;
335 unsigned int pmu_soc_con5;
336 unsigned int reserved2[(0x0124 - 0x0114) / 4 - 1];
337 unsigned int pmu_io_vsel0;
338 unsigned int pmu_io_vsel1;
339 unsigned int pmu_io_vsel2;
340 unsigned int reserved3[(0x0180 - 0x012c) / 4 - 1];
341 unsigned int pmu_dll_con0;
342 unsigned int reserved4[(0x0200 - 0x0180) / 4 - 1];
343 unsigned int pmu_os_reg0;
344 unsigned int pmu_os_reg1;
345 unsigned int pmu_os_reg2;
346 unsigned int pmu_os_reg3;
347 unsigned int pmu_os_reg4;
348 unsigned int pmu_os_reg5;
349 unsigned int pmu_os_reg6;
350 unsigned int pmu_os_reg7;
351 unsigned int pmu_os_reg8;
352 unsigned int pmu_os_reg9;
353 unsigned int pmu_os_reg10;
354 unsigned int pmu_os_reg11;
355 unsigned int pmu_reset_function_status;
356 unsigned int pmu_reset_function_clr;
357 unsigned int reserved5[(0x0380 - 0x0234) / 4 - 1];
358 unsigned int pmu_sig_detect_con;
359 unsigned int reserved6[(0x0390 - 0x0380) / 4 - 1];
360 unsigned int pmu_sig_detect_status;
361 unsigned int reserved7[(0x03a0 - 0x0390) / 4 - 1];
362 unsigned int pmu_sig_detect_status_clear;
363 unsigned int reserved8[(0x03b0 - 0x03a0) / 4 - 1];
364 unsigned int pmu_sdmmc_det_counter;
365};
366
367check_member(rk3568_pmugrf, pmu_sdmmc_det_counter, 0x03b0);
368
369#endif