diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 17:33:32 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-06 17:33:32 -0500 |
commit | 404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (patch) | |
tree | 99119edc53fdca73ed7586829b8ee736e09440b3 /arch/arm/mach-mxs | |
parent | 28cdac6690cb113856293bf79b40de33dbd8f974 (diff) | |
parent | 1051b9f0f9eab8091fe3bf98320741adf36b4cfa (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.h
Diffstat (limited to 'arch/arm/mach-mxs')
46 files changed, 6108 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig new file mode 100644 index 000000000000..c4ac7b415195 --- /dev/null +++ b/arch/arm/mach-mxs/Kconfig | |||
@@ -0,0 +1,34 @@ | |||
1 | if ARCH_MXS | ||
2 | |||
3 | source "arch/arm/mach-mxs/devices/Kconfig" | ||
4 | |||
5 | config SOC_IMX23 | ||
6 | bool | ||
7 | select CPU_ARM926T | ||
8 | |||
9 | config SOC_IMX28 | ||
10 | bool | ||
11 | select CPU_ARM926T | ||
12 | |||
13 | comment "MXS platforms:" | ||
14 | |||
15 | config MACH_MX23EVK | ||
16 | bool "Support MX23EVK Platform" | ||
17 | select SOC_IMX23 | ||
18 | select MXS_HAVE_PLATFORM_DUART | ||
19 | default y | ||
20 | help | ||
21 | Include support for MX23EVK platform. This includes specific | ||
22 | configurations for the board and its peripherals. | ||
23 | |||
24 | config MACH_MX28EVK | ||
25 | bool "Support MX28EVK Platform" | ||
26 | select SOC_IMX28 | ||
27 | select MXS_HAVE_PLATFORM_DUART | ||
28 | select MXS_HAVE_PLATFORM_FEC | ||
29 | default y | ||
30 | help | ||
31 | Include support for MX28EVK platform. This includes specific | ||
32 | configurations for the board and its peripherals. | ||
33 | |||
34 | endif | ||
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile new file mode 100644 index 000000000000..39d3f9c2a841 --- /dev/null +++ b/arch/arm/mach-mxs/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # Common support | ||
2 | obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o | ||
3 | |||
4 | obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o | ||
5 | obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o | ||
6 | |||
7 | obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o | ||
8 | obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o | ||
9 | |||
10 | obj-y += devices/ | ||
diff --git a/arch/arm/mach-mxs/Makefile.boot b/arch/arm/mach-mxs/Makefile.boot new file mode 100644 index 000000000000..eb541e0291da --- /dev/null +++ b/arch/arm/mach-mxs/Makefile.boot | |||
@@ -0,0 +1 @@ | |||
zreladdr-y := 0x40008000 | |||
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c new file mode 100644 index 000000000000..8f5a19ab558c --- /dev/null +++ b/arch/arm/mach-mxs/clock-mx23.c | |||
@@ -0,0 +1,526 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/mm.h> | ||
20 | #include <linux/delay.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/jiffies.h> | ||
24 | |||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | ||
27 | |||
28 | #include <mach/mx23.h> | ||
29 | #include <mach/common.h> | ||
30 | #include <mach/clock.h> | ||
31 | |||
32 | #include "regs-clkctrl-mx23.h" | ||
33 | |||
34 | #define CLKCTRL_BASE_ADDR MX23_IO_ADDRESS(MX23_CLKCTRL_BASE_ADDR) | ||
35 | #define DIGCTRL_BASE_ADDR MX23_IO_ADDRESS(MX23_DIGCTL_BASE_ADDR) | ||
36 | |||
37 | #define PARENT_RATE_SHIFT 8 | ||
38 | |||
39 | static int _raw_clk_enable(struct clk *clk) | ||
40 | { | ||
41 | u32 reg; | ||
42 | |||
43 | if (clk->enable_reg) { | ||
44 | reg = __raw_readl(clk->enable_reg); | ||
45 | reg &= ~(1 << clk->enable_shift); | ||
46 | __raw_writel(reg, clk->enable_reg); | ||
47 | } | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static void _raw_clk_disable(struct clk *clk) | ||
53 | { | ||
54 | u32 reg; | ||
55 | |||
56 | if (clk->enable_reg) { | ||
57 | reg = __raw_readl(clk->enable_reg); | ||
58 | reg |= 1 << clk->enable_shift; | ||
59 | __raw_writel(reg, clk->enable_reg); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * ref_xtal_clk | ||
65 | */ | ||
66 | static unsigned long ref_xtal_clk_get_rate(struct clk *clk) | ||
67 | { | ||
68 | return 24000000; | ||
69 | } | ||
70 | |||
71 | static struct clk ref_xtal_clk = { | ||
72 | .get_rate = ref_xtal_clk_get_rate, | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * pll_clk | ||
77 | */ | ||
78 | static unsigned long pll_clk_get_rate(struct clk *clk) | ||
79 | { | ||
80 | return 480000000; | ||
81 | } | ||
82 | |||
83 | static int pll_clk_enable(struct clk *clk) | ||
84 | { | ||
85 | __raw_writel(BM_CLKCTRL_PLLCTRL0_POWER | | ||
86 | BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS, | ||
87 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLLCTRL0_SET); | ||
88 | |||
89 | /* Only a 10us delay is need. PLLCTRL1 LOCK bitfied is only a timer | ||
90 | * and is incorrect (excessive). Per definition of the PLLCTRL0 | ||
91 | * POWER field, waiting at least 10us. | ||
92 | */ | ||
93 | udelay(10); | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | static void pll_clk_disable(struct clk *clk) | ||
99 | { | ||
100 | __raw_writel(BM_CLKCTRL_PLLCTRL0_POWER | | ||
101 | BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS, | ||
102 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLLCTRL0_CLR); | ||
103 | } | ||
104 | |||
105 | static struct clk pll_clk = { | ||
106 | .get_rate = pll_clk_get_rate, | ||
107 | .enable = pll_clk_enable, | ||
108 | .disable = pll_clk_disable, | ||
109 | .parent = &ref_xtal_clk, | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * ref_clk | ||
114 | */ | ||
115 | #define _CLK_GET_RATE_REF(name, sr, ss) \ | ||
116 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
117 | { \ | ||
118 | unsigned long parent_rate; \ | ||
119 | u32 reg, div; \ | ||
120 | \ | ||
121 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##sr); \ | ||
122 | div = (reg >> BP_CLKCTRL_##sr##_##ss##FRAC) & 0x3f; \ | ||
123 | parent_rate = clk_get_rate(clk->parent); \ | ||
124 | \ | ||
125 | return SH_DIV((parent_rate >> PARENT_RATE_SHIFT) * 18, \ | ||
126 | div, PARENT_RATE_SHIFT); \ | ||
127 | } | ||
128 | |||
129 | _CLK_GET_RATE_REF(ref_cpu_clk, FRAC, CPU) | ||
130 | _CLK_GET_RATE_REF(ref_emi_clk, FRAC, EMI) | ||
131 | _CLK_GET_RATE_REF(ref_pix_clk, FRAC, PIX) | ||
132 | _CLK_GET_RATE_REF(ref_io_clk, FRAC, IO) | ||
133 | |||
134 | #define _DEFINE_CLOCK_REF(name, er, es) \ | ||
135 | static struct clk name = { \ | ||
136 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
137 | .enable_shift = BP_CLKCTRL_##er##_CLKGATE##es, \ | ||
138 | .get_rate = name##_get_rate, \ | ||
139 | .enable = _raw_clk_enable, \ | ||
140 | .disable = _raw_clk_disable, \ | ||
141 | .parent = &pll_clk, \ | ||
142 | } | ||
143 | |||
144 | _DEFINE_CLOCK_REF(ref_cpu_clk, FRAC, CPU); | ||
145 | _DEFINE_CLOCK_REF(ref_emi_clk, FRAC, EMI); | ||
146 | _DEFINE_CLOCK_REF(ref_pix_clk, FRAC, PIX); | ||
147 | _DEFINE_CLOCK_REF(ref_io_clk, FRAC, IO); | ||
148 | |||
149 | /* | ||
150 | * General clocks | ||
151 | * | ||
152 | * clk_get_rate | ||
153 | */ | ||
154 | static unsigned long rtc_clk_get_rate(struct clk *clk) | ||
155 | { | ||
156 | /* ref_xtal_clk is implemented as the only parent */ | ||
157 | return clk_get_rate(clk->parent) / 768; | ||
158 | } | ||
159 | |||
160 | static unsigned long clk32k_clk_get_rate(struct clk *clk) | ||
161 | { | ||
162 | return clk->parent->get_rate(clk->parent) / 750; | ||
163 | } | ||
164 | |||
165 | #define _CLK_GET_RATE(name, rs) \ | ||
166 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
167 | { \ | ||
168 | u32 reg, div; \ | ||
169 | \ | ||
170 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
171 | \ | ||
172 | if (clk->parent == &ref_xtal_clk) \ | ||
173 | div = (reg & BM_CLKCTRL_##rs##_DIV_XTAL) >> \ | ||
174 | BP_CLKCTRL_##rs##_DIV_XTAL; \ | ||
175 | else \ | ||
176 | div = (reg & BM_CLKCTRL_##rs##_DIV_##rs) >> \ | ||
177 | BP_CLKCTRL_##rs##_DIV_##rs; \ | ||
178 | \ | ||
179 | if (!div) \ | ||
180 | return -EINVAL; \ | ||
181 | \ | ||
182 | return clk_get_rate(clk->parent) / div; \ | ||
183 | } | ||
184 | |||
185 | _CLK_GET_RATE(cpu_clk, CPU) | ||
186 | _CLK_GET_RATE(emi_clk, EMI) | ||
187 | |||
188 | #define _CLK_GET_RATE1(name, rs) \ | ||
189 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
190 | { \ | ||
191 | u32 reg, div; \ | ||
192 | \ | ||
193 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
194 | div = (reg & BM_CLKCTRL_##rs##_DIV) >> BP_CLKCTRL_##rs##_DIV; \ | ||
195 | \ | ||
196 | if (!div) \ | ||
197 | return -EINVAL; \ | ||
198 | \ | ||
199 | return clk_get_rate(clk->parent) / div; \ | ||
200 | } | ||
201 | |||
202 | _CLK_GET_RATE1(hbus_clk, HBUS) | ||
203 | _CLK_GET_RATE1(xbus_clk, XBUS) | ||
204 | _CLK_GET_RATE1(ssp_clk, SSP) | ||
205 | _CLK_GET_RATE1(gpmi_clk, GPMI) | ||
206 | _CLK_GET_RATE1(lcdif_clk, PIX) | ||
207 | |||
208 | #define _CLK_GET_RATE_STUB(name) \ | ||
209 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
210 | { \ | ||
211 | return clk_get_rate(clk->parent); \ | ||
212 | } | ||
213 | |||
214 | _CLK_GET_RATE_STUB(uart_clk) | ||
215 | _CLK_GET_RATE_STUB(audio_clk) | ||
216 | _CLK_GET_RATE_STUB(pwm_clk) | ||
217 | |||
218 | /* | ||
219 | * clk_set_rate | ||
220 | */ | ||
221 | static int cpu_clk_set_rate(struct clk *clk, unsigned long rate) | ||
222 | { | ||
223 | u32 reg, bm_busy, div_max, d, f, div, frac; | ||
224 | unsigned long diff, parent_rate, calc_rate; | ||
225 | int i; | ||
226 | |||
227 | parent_rate = clk_get_rate(clk->parent); | ||
228 | |||
229 | if (clk->parent == &ref_xtal_clk) { | ||
230 | div_max = BM_CLKCTRL_CPU_DIV_XTAL >> BP_CLKCTRL_CPU_DIV_XTAL; | ||
231 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_XTAL; | ||
232 | div = DIV_ROUND_UP(parent_rate, rate); | ||
233 | if (div == 0 || div > div_max) | ||
234 | return -EINVAL; | ||
235 | } else { | ||
236 | div_max = BM_CLKCTRL_CPU_DIV_CPU >> BP_CLKCTRL_CPU_DIV_CPU; | ||
237 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_CPU; | ||
238 | rate >>= PARENT_RATE_SHIFT; | ||
239 | parent_rate >>= PARENT_RATE_SHIFT; | ||
240 | diff = parent_rate; | ||
241 | div = frac = 1; | ||
242 | for (d = 1; d <= div_max; d++) { | ||
243 | f = parent_rate * 18 / d / rate; | ||
244 | if ((parent_rate * 18 / d) % rate) | ||
245 | f++; | ||
246 | if (f < 18 || f > 35) | ||
247 | continue; | ||
248 | |||
249 | calc_rate = parent_rate * 18 / f / d; | ||
250 | if (calc_rate > rate) | ||
251 | continue; | ||
252 | |||
253 | if (rate - calc_rate < diff) { | ||
254 | frac = f; | ||
255 | div = d; | ||
256 | diff = rate - calc_rate; | ||
257 | } | ||
258 | |||
259 | if (diff == 0) | ||
260 | break; | ||
261 | } | ||
262 | |||
263 | if (diff == parent_rate) | ||
264 | return -EINVAL; | ||
265 | |||
266 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_FRAC); | ||
267 | reg &= ~BM_CLKCTRL_FRAC_CPUFRAC; | ||
268 | reg |= frac; | ||
269 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_FRAC); | ||
270 | } | ||
271 | |||
272 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); | ||
273 | reg &= ~BM_CLKCTRL_CPU_DIV_CPU; | ||
274 | reg |= div << BP_CLKCTRL_CPU_DIV_CPU; | ||
275 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); | ||
276 | |||
277 | for (i = 10000; i; i--) | ||
278 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
279 | HW_CLKCTRL_CPU) & bm_busy)) | ||
280 | break; | ||
281 | if (!i) { | ||
282 | pr_err("%s: divider writing timeout\n", __func__); | ||
283 | return -ETIMEDOUT; | ||
284 | } | ||
285 | |||
286 | return 0; | ||
287 | } | ||
288 | |||
289 | #define _CLK_SET_RATE(name, dr) \ | ||
290 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
291 | { \ | ||
292 | u32 reg, div_max, div; \ | ||
293 | unsigned long parent_rate; \ | ||
294 | int i; \ | ||
295 | \ | ||
296 | parent_rate = clk_get_rate(clk->parent); \ | ||
297 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
298 | \ | ||
299 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
300 | if (div == 0 || div > div_max) \ | ||
301 | return -EINVAL; \ | ||
302 | \ | ||
303 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
304 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
305 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
306 | if (reg | (1 << clk->enable_shift)) { \ | ||
307 | pr_err("%s: clock is gated\n", __func__); \ | ||
308 | return -EINVAL; \ | ||
309 | } \ | ||
310 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
311 | \ | ||
312 | for (i = 10000; i; i--) \ | ||
313 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
314 | HW_CLKCTRL_##dr) & BM_CLKCTRL_##dr##_BUSY)) \ | ||
315 | break; \ | ||
316 | if (!i) { \ | ||
317 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
318 | return -ETIMEDOUT; \ | ||
319 | } \ | ||
320 | \ | ||
321 | return 0; \ | ||
322 | } | ||
323 | |||
324 | _CLK_SET_RATE(xbus_clk, XBUS) | ||
325 | _CLK_SET_RATE(ssp_clk, SSP) | ||
326 | _CLK_SET_RATE(gpmi_clk, GPMI) | ||
327 | _CLK_SET_RATE(lcdif_clk, PIX) | ||
328 | |||
329 | #define _CLK_SET_RATE_STUB(name) \ | ||
330 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
331 | { \ | ||
332 | return -EINVAL; \ | ||
333 | } | ||
334 | |||
335 | _CLK_SET_RATE_STUB(emi_clk) | ||
336 | _CLK_SET_RATE_STUB(uart_clk) | ||
337 | _CLK_SET_RATE_STUB(audio_clk) | ||
338 | _CLK_SET_RATE_STUB(pwm_clk) | ||
339 | _CLK_SET_RATE_STUB(clk32k_clk) | ||
340 | |||
341 | /* | ||
342 | * clk_set_parent | ||
343 | */ | ||
344 | #define _CLK_SET_PARENT(name, bit) \ | ||
345 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
346 | { \ | ||
347 | if (parent != clk->parent) { \ | ||
348 | __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ | ||
349 | HW_CLKCTRL_CLKSEQ_TOG); \ | ||
350 | clk->parent = parent; \ | ||
351 | } \ | ||
352 | \ | ||
353 | return 0; \ | ||
354 | } | ||
355 | |||
356 | _CLK_SET_PARENT(cpu_clk, CPU) | ||
357 | _CLK_SET_PARENT(emi_clk, EMI) | ||
358 | _CLK_SET_PARENT(ssp_clk, SSP) | ||
359 | _CLK_SET_PARENT(gpmi_clk, GPMI) | ||
360 | _CLK_SET_PARENT(lcdif_clk, PIX) | ||
361 | |||
362 | #define _CLK_SET_PARENT_STUB(name) \ | ||
363 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
364 | { \ | ||
365 | if (parent != clk->parent) \ | ||
366 | return -EINVAL; \ | ||
367 | else \ | ||
368 | return 0; \ | ||
369 | } | ||
370 | |||
371 | _CLK_SET_PARENT_STUB(uart_clk) | ||
372 | _CLK_SET_PARENT_STUB(audio_clk) | ||
373 | _CLK_SET_PARENT_STUB(pwm_clk) | ||
374 | _CLK_SET_PARENT_STUB(clk32k_clk) | ||
375 | |||
376 | /* | ||
377 | * clk definition | ||
378 | */ | ||
379 | static struct clk cpu_clk = { | ||
380 | .get_rate = cpu_clk_get_rate, | ||
381 | .set_rate = cpu_clk_set_rate, | ||
382 | .set_parent = cpu_clk_set_parent, | ||
383 | .parent = &ref_cpu_clk, | ||
384 | }; | ||
385 | |||
386 | static struct clk hbus_clk = { | ||
387 | .get_rate = hbus_clk_get_rate, | ||
388 | .parent = &cpu_clk, | ||
389 | }; | ||
390 | |||
391 | static struct clk xbus_clk = { | ||
392 | .get_rate = xbus_clk_get_rate, | ||
393 | .set_rate = xbus_clk_set_rate, | ||
394 | .parent = &ref_xtal_clk, | ||
395 | }; | ||
396 | |||
397 | static struct clk rtc_clk = { | ||
398 | .get_rate = rtc_clk_get_rate, | ||
399 | .parent = &ref_xtal_clk, | ||
400 | }; | ||
401 | |||
402 | /* usb_clk gate is controlled in DIGCTRL other than CLKCTRL */ | ||
403 | static struct clk usb_clk = { | ||
404 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
405 | .enable_shift = 2, | ||
406 | .enable = _raw_clk_enable, | ||
407 | .disable = _raw_clk_disable, | ||
408 | .parent = &pll_clk, | ||
409 | }; | ||
410 | |||
411 | #define _DEFINE_CLOCK(name, er, es, p) \ | ||
412 | static struct clk name = { \ | ||
413 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
414 | .enable_shift = BP_CLKCTRL_##er##_##es, \ | ||
415 | .get_rate = name##_get_rate, \ | ||
416 | .set_rate = name##_set_rate, \ | ||
417 | .set_parent = name##_set_parent, \ | ||
418 | .enable = _raw_clk_enable, \ | ||
419 | .disable = _raw_clk_disable, \ | ||
420 | .parent = p, \ | ||
421 | } | ||
422 | |||
423 | _DEFINE_CLOCK(emi_clk, EMI, CLKGATE, &ref_xtal_clk); | ||
424 | _DEFINE_CLOCK(ssp_clk, SSP, CLKGATE, &ref_xtal_clk); | ||
425 | _DEFINE_CLOCK(gpmi_clk, GPMI, CLKGATE, &ref_xtal_clk); | ||
426 | _DEFINE_CLOCK(lcdif_clk, PIX, CLKGATE, &ref_xtal_clk); | ||
427 | _DEFINE_CLOCK(uart_clk, XTAL, UART_CLK_GATE, &ref_xtal_clk); | ||
428 | _DEFINE_CLOCK(audio_clk, XTAL, FILT_CLK24M_GATE, &ref_xtal_clk); | ||
429 | _DEFINE_CLOCK(pwm_clk, XTAL, PWM_CLK24M_GATE, &ref_xtal_clk); | ||
430 | _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); | ||
431 | |||
432 | #define _REGISTER_CLOCK(d, n, c) \ | ||
433 | { \ | ||
434 | .dev_id = d, \ | ||
435 | .con_id = n, \ | ||
436 | .clk = &c, \ | ||
437 | }, | ||
438 | |||
439 | static struct clk_lookup lookups[] = { | ||
440 | _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) | ||
441 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) | ||
442 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) | ||
443 | _REGISTER_CLOCK(NULL, "xclk", xbus_clk) | ||
444 | _REGISTER_CLOCK(NULL, "usb", usb_clk) | ||
445 | _REGISTER_CLOCK(NULL, "audio", audio_clk) | ||
446 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
447 | }; | ||
448 | |||
449 | static int clk_misc_init(void) | ||
450 | { | ||
451 | u32 reg; | ||
452 | int i; | ||
453 | |||
454 | /* Fix up parent per register setting */ | ||
455 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ); | ||
456 | cpu_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_CPU) ? | ||
457 | &ref_xtal_clk : &ref_cpu_clk; | ||
458 | emi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_EMI) ? | ||
459 | &ref_xtal_clk : &ref_emi_clk; | ||
460 | ssp_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP) ? | ||
461 | &ref_xtal_clk : &ref_io_clk; | ||
462 | gpmi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_GPMI) ? | ||
463 | &ref_xtal_clk : &ref_io_clk; | ||
464 | lcdif_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_PIX) ? | ||
465 | &ref_xtal_clk : &ref_pix_clk; | ||
466 | |||
467 | /* Use int div over frac when both are available */ | ||
468 | __raw_writel(BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN, | ||
469 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
470 | __raw_writel(BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN, | ||
471 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
472 | __raw_writel(BM_CLKCTRL_HBUS_DIV_FRAC_EN, | ||
473 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS_CLR); | ||
474 | |||
475 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
476 | reg &= ~BM_CLKCTRL_XBUS_DIV_FRAC_EN; | ||
477 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
478 | |||
479 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP); | ||
480 | reg &= ~BM_CLKCTRL_SSP_DIV_FRAC_EN; | ||
481 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP); | ||
482 | |||
483 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
484 | reg &= ~BM_CLKCTRL_GPMI_DIV_FRAC_EN; | ||
485 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
486 | |||
487 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_PIX); | ||
488 | reg &= ~BM_CLKCTRL_PIX_DIV_FRAC_EN; | ||
489 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_PIX); | ||
490 | |||
491 | /* | ||
492 | * Set safe hbus clock divider. A divider of 3 ensure that | ||
493 | * the Vddd voltage required for the cpu clock is sufficiently | ||
494 | * high for the hbus clock. | ||
495 | */ | ||
496 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
497 | reg &= BM_CLKCTRL_HBUS_DIV; | ||
498 | reg |= 3 << BP_CLKCTRL_HBUS_DIV; | ||
499 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
500 | |||
501 | for (i = 10000; i; i--) | ||
502 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
503 | HW_CLKCTRL_HBUS) & BM_CLKCTRL_HBUS_BUSY)) | ||
504 | break; | ||
505 | if (!i) { | ||
506 | pr_err("%s: divider writing timeout\n", __func__); | ||
507 | return -ETIMEDOUT; | ||
508 | } | ||
509 | |||
510 | /* Gate off cpu clock in WFI for power saving */ | ||
511 | __raw_writel(BM_CLKCTRL_CPU_INTERRUPT_WAIT, | ||
512 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_SET); | ||
513 | |||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | int __init mx23_clocks_init(void) | ||
518 | { | ||
519 | clk_misc_init(); | ||
520 | |||
521 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
522 | |||
523 | mxs_timer_init(&clk32k_clk, MX23_INT_TIMER0); | ||
524 | |||
525 | return 0; | ||
526 | } | ||
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c new file mode 100644 index 000000000000..74e2103c6011 --- /dev/null +++ b/arch/arm/mach-mxs/clock-mx28.c | |||
@@ -0,0 +1,734 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/mm.h> | ||
20 | #include <linux/delay.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/jiffies.h> | ||
24 | |||
25 | #include <asm/clkdev.h> | ||
26 | #include <asm/div64.h> | ||
27 | |||
28 | #include <mach/mx28.h> | ||
29 | #include <mach/common.h> | ||
30 | #include <mach/clock.h> | ||
31 | |||
32 | #include "regs-clkctrl-mx28.h" | ||
33 | |||
34 | #define CLKCTRL_BASE_ADDR MX28_IO_ADDRESS(MX28_CLKCTRL_BASE_ADDR) | ||
35 | #define DIGCTRL_BASE_ADDR MX28_IO_ADDRESS(MX28_DIGCTL_BASE_ADDR) | ||
36 | |||
37 | #define PARENT_RATE_SHIFT 8 | ||
38 | |||
39 | static struct clk pll2_clk; | ||
40 | static struct clk cpu_clk; | ||
41 | static struct clk emi_clk; | ||
42 | static struct clk saif0_clk; | ||
43 | static struct clk saif1_clk; | ||
44 | static struct clk clk32k_clk; | ||
45 | |||
46 | static int _raw_clk_enable(struct clk *clk) | ||
47 | { | ||
48 | u32 reg; | ||
49 | |||
50 | if (clk->enable_reg) { | ||
51 | reg = __raw_readl(clk->enable_reg); | ||
52 | reg &= ~(1 << clk->enable_shift); | ||
53 | __raw_writel(reg, clk->enable_reg); | ||
54 | } | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static void _raw_clk_disable(struct clk *clk) | ||
60 | { | ||
61 | u32 reg; | ||
62 | |||
63 | if (clk->enable_reg) { | ||
64 | reg = __raw_readl(clk->enable_reg); | ||
65 | reg |= 1 << clk->enable_shift; | ||
66 | __raw_writel(reg, clk->enable_reg); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* | ||
71 | * ref_xtal_clk | ||
72 | */ | ||
73 | static unsigned long ref_xtal_clk_get_rate(struct clk *clk) | ||
74 | { | ||
75 | return 24000000; | ||
76 | } | ||
77 | |||
78 | static struct clk ref_xtal_clk = { | ||
79 | .get_rate = ref_xtal_clk_get_rate, | ||
80 | }; | ||
81 | |||
82 | /* | ||
83 | * pll_clk | ||
84 | */ | ||
85 | static unsigned long pll0_clk_get_rate(struct clk *clk) | ||
86 | { | ||
87 | return 480000000; | ||
88 | } | ||
89 | |||
90 | static unsigned long pll1_clk_get_rate(struct clk *clk) | ||
91 | { | ||
92 | return 480000000; | ||
93 | } | ||
94 | |||
95 | static unsigned long pll2_clk_get_rate(struct clk *clk) | ||
96 | { | ||
97 | return 50000000; | ||
98 | } | ||
99 | |||
100 | #define _CLK_ENABLE_PLL(name, r, g) \ | ||
101 | static int name##_enable(struct clk *clk) \ | ||
102 | { \ | ||
103 | __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ | ||
104 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
105 | udelay(10); \ | ||
106 | \ | ||
107 | if (clk == &pll2_clk) \ | ||
108 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
109 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
110 | else \ | ||
111 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
112 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
113 | \ | ||
114 | return 0; \ | ||
115 | } | ||
116 | |||
117 | _CLK_ENABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) | ||
118 | _CLK_ENABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) | ||
119 | _CLK_ENABLE_PLL(pll2_clk, PLL2, CLKGATE) | ||
120 | |||
121 | #define _CLK_DISABLE_PLL(name, r, g) \ | ||
122 | static void name##_disable(struct clk *clk) \ | ||
123 | { \ | ||
124 | __raw_writel(BM_CLKCTRL_##r##CTRL0_POWER, \ | ||
125 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
126 | \ | ||
127 | if (clk == &pll2_clk) \ | ||
128 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
129 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_SET); \ | ||
130 | else \ | ||
131 | __raw_writel(BM_CLKCTRL_##r##CTRL0_##g, \ | ||
132 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_##r##CTRL0_CLR); \ | ||
133 | \ | ||
134 | } | ||
135 | |||
136 | _CLK_DISABLE_PLL(pll0_clk, PLL0, EN_USB_CLKS) | ||
137 | _CLK_DISABLE_PLL(pll1_clk, PLL1, EN_USB_CLKS) | ||
138 | _CLK_DISABLE_PLL(pll2_clk, PLL2, CLKGATE) | ||
139 | |||
140 | #define _DEFINE_CLOCK_PLL(name) \ | ||
141 | static struct clk name = { \ | ||
142 | .get_rate = name##_get_rate, \ | ||
143 | .enable = name##_enable, \ | ||
144 | .disable = name##_disable, \ | ||
145 | .parent = &ref_xtal_clk, \ | ||
146 | } | ||
147 | |||
148 | _DEFINE_CLOCK_PLL(pll0_clk); | ||
149 | _DEFINE_CLOCK_PLL(pll1_clk); | ||
150 | _DEFINE_CLOCK_PLL(pll2_clk); | ||
151 | |||
152 | /* | ||
153 | * ref_clk | ||
154 | */ | ||
155 | #define _CLK_GET_RATE_REF(name, sr, ss) \ | ||
156 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
157 | { \ | ||
158 | unsigned long parent_rate; \ | ||
159 | u32 reg, div; \ | ||
160 | \ | ||
161 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##sr); \ | ||
162 | div = (reg >> BP_CLKCTRL_##sr##_##ss##FRAC) & 0x3f; \ | ||
163 | parent_rate = clk_get_rate(clk->parent); \ | ||
164 | \ | ||
165 | return SH_DIV((parent_rate >> PARENT_RATE_SHIFT) * 18, \ | ||
166 | div, PARENT_RATE_SHIFT); \ | ||
167 | } | ||
168 | |||
169 | _CLK_GET_RATE_REF(ref_cpu_clk, FRAC0, CPU) | ||
170 | _CLK_GET_RATE_REF(ref_emi_clk, FRAC0, EMI) | ||
171 | _CLK_GET_RATE_REF(ref_io0_clk, FRAC0, IO0) | ||
172 | _CLK_GET_RATE_REF(ref_io1_clk, FRAC0, IO1) | ||
173 | _CLK_GET_RATE_REF(ref_pix_clk, FRAC1, PIX) | ||
174 | _CLK_GET_RATE_REF(ref_gpmi_clk, FRAC1, GPMI) | ||
175 | |||
176 | #define _DEFINE_CLOCK_REF(name, er, es) \ | ||
177 | static struct clk name = { \ | ||
178 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
179 | .enable_shift = BP_CLKCTRL_##er##_CLKGATE##es, \ | ||
180 | .get_rate = name##_get_rate, \ | ||
181 | .enable = _raw_clk_enable, \ | ||
182 | .disable = _raw_clk_disable, \ | ||
183 | .parent = &pll0_clk, \ | ||
184 | } | ||
185 | |||
186 | _DEFINE_CLOCK_REF(ref_cpu_clk, FRAC0, CPU); | ||
187 | _DEFINE_CLOCK_REF(ref_emi_clk, FRAC0, EMI); | ||
188 | _DEFINE_CLOCK_REF(ref_io0_clk, FRAC0, IO0); | ||
189 | _DEFINE_CLOCK_REF(ref_io1_clk, FRAC0, IO1); | ||
190 | _DEFINE_CLOCK_REF(ref_pix_clk, FRAC1, PIX); | ||
191 | _DEFINE_CLOCK_REF(ref_gpmi_clk, FRAC1, GPMI); | ||
192 | |||
193 | /* | ||
194 | * General clocks | ||
195 | * | ||
196 | * clk_get_rate | ||
197 | */ | ||
198 | static unsigned long lradc_clk_get_rate(struct clk *clk) | ||
199 | { | ||
200 | return clk_get_rate(clk->parent) / 16; | ||
201 | } | ||
202 | |||
203 | static unsigned long rtc_clk_get_rate(struct clk *clk) | ||
204 | { | ||
205 | /* ref_xtal_clk is implemented as the only parent */ | ||
206 | return clk_get_rate(clk->parent) / 768; | ||
207 | } | ||
208 | |||
209 | static unsigned long clk32k_clk_get_rate(struct clk *clk) | ||
210 | { | ||
211 | return clk->parent->get_rate(clk->parent) / 750; | ||
212 | } | ||
213 | |||
214 | static unsigned long spdif_clk_get_rate(struct clk *clk) | ||
215 | { | ||
216 | return clk_get_rate(clk->parent) / 4; | ||
217 | } | ||
218 | |||
219 | #define _CLK_GET_RATE(name, rs) \ | ||
220 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
221 | { \ | ||
222 | u32 reg, div; \ | ||
223 | \ | ||
224 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
225 | \ | ||
226 | if (clk->parent == &ref_xtal_clk) \ | ||
227 | div = (reg & BM_CLKCTRL_##rs##_DIV_XTAL) >> \ | ||
228 | BP_CLKCTRL_##rs##_DIV_XTAL; \ | ||
229 | else \ | ||
230 | div = (reg & BM_CLKCTRL_##rs##_DIV_##rs) >> \ | ||
231 | BP_CLKCTRL_##rs##_DIV_##rs; \ | ||
232 | \ | ||
233 | if (!div) \ | ||
234 | return -EINVAL; \ | ||
235 | \ | ||
236 | return clk_get_rate(clk->parent) / div; \ | ||
237 | } | ||
238 | |||
239 | _CLK_GET_RATE(cpu_clk, CPU) | ||
240 | _CLK_GET_RATE(emi_clk, EMI) | ||
241 | |||
242 | #define _CLK_GET_RATE1(name, rs) \ | ||
243 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
244 | { \ | ||
245 | u32 reg, div; \ | ||
246 | \ | ||
247 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
248 | div = (reg & BM_CLKCTRL_##rs##_DIV) >> BP_CLKCTRL_##rs##_DIV; \ | ||
249 | \ | ||
250 | if (!div) \ | ||
251 | return -EINVAL; \ | ||
252 | \ | ||
253 | if (clk == &saif0_clk || clk == &saif1_clk) \ | ||
254 | return clk_get_rate(clk->parent) >> 16 * div; \ | ||
255 | else \ | ||
256 | return clk_get_rate(clk->parent) / div; \ | ||
257 | } | ||
258 | |||
259 | _CLK_GET_RATE1(hbus_clk, HBUS) | ||
260 | _CLK_GET_RATE1(xbus_clk, XBUS) | ||
261 | _CLK_GET_RATE1(ssp0_clk, SSP0) | ||
262 | _CLK_GET_RATE1(ssp1_clk, SSP1) | ||
263 | _CLK_GET_RATE1(ssp2_clk, SSP2) | ||
264 | _CLK_GET_RATE1(ssp3_clk, SSP3) | ||
265 | _CLK_GET_RATE1(gpmi_clk, GPMI) | ||
266 | _CLK_GET_RATE1(lcdif_clk, DIS_LCDIF) | ||
267 | _CLK_GET_RATE1(saif0_clk, SAIF0) | ||
268 | _CLK_GET_RATE1(saif1_clk, SAIF1) | ||
269 | |||
270 | #define _CLK_GET_RATE_STUB(name) \ | ||
271 | static unsigned long name##_get_rate(struct clk *clk) \ | ||
272 | { \ | ||
273 | return clk_get_rate(clk->parent); \ | ||
274 | } | ||
275 | |||
276 | _CLK_GET_RATE_STUB(uart_clk) | ||
277 | _CLK_GET_RATE_STUB(pwm_clk) | ||
278 | _CLK_GET_RATE_STUB(can0_clk) | ||
279 | _CLK_GET_RATE_STUB(can1_clk) | ||
280 | _CLK_GET_RATE_STUB(fec_clk) | ||
281 | |||
282 | /* | ||
283 | * clk_set_rate | ||
284 | */ | ||
285 | /* fool compiler */ | ||
286 | #define BM_CLKCTRL_CPU_DIV 0 | ||
287 | #define BP_CLKCTRL_CPU_DIV 0 | ||
288 | #define BM_CLKCTRL_CPU_BUSY 0 | ||
289 | |||
290 | #define _CLK_SET_RATE(name, dr, fr, fs) \ | ||
291 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
292 | { \ | ||
293 | u32 reg, bm_busy, div_max, d, f, div, frac; \ | ||
294 | unsigned long diff, parent_rate, calc_rate; \ | ||
295 | int i; \ | ||
296 | \ | ||
297 | parent_rate = clk_get_rate(clk->parent); \ | ||
298 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
299 | bm_busy = BM_CLKCTRL_##dr##_BUSY; \ | ||
300 | \ | ||
301 | if (clk->parent == &ref_xtal_clk) { \ | ||
302 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
303 | if (clk == &cpu_clk) { \ | ||
304 | div_max = BM_CLKCTRL_CPU_DIV_XTAL >> \ | ||
305 | BP_CLKCTRL_CPU_DIV_XTAL; \ | ||
306 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_XTAL; \ | ||
307 | } \ | ||
308 | if (div == 0 || div > div_max) \ | ||
309 | return -EINVAL; \ | ||
310 | } else { \ | ||
311 | rate >>= PARENT_RATE_SHIFT; \ | ||
312 | parent_rate >>= PARENT_RATE_SHIFT; \ | ||
313 | diff = parent_rate; \ | ||
314 | div = frac = 1; \ | ||
315 | if (clk == &cpu_clk) { \ | ||
316 | div_max = BM_CLKCTRL_CPU_DIV_CPU >> \ | ||
317 | BP_CLKCTRL_CPU_DIV_CPU; \ | ||
318 | bm_busy = BM_CLKCTRL_CPU_BUSY_REF_CPU; \ | ||
319 | } \ | ||
320 | for (d = 1; d <= div_max; d++) { \ | ||
321 | f = parent_rate * 18 / d / rate; \ | ||
322 | if ((parent_rate * 18 / d) % rate) \ | ||
323 | f++; \ | ||
324 | if (f < 18 || f > 35) \ | ||
325 | continue; \ | ||
326 | \ | ||
327 | calc_rate = parent_rate * 18 / f / d; \ | ||
328 | if (calc_rate > rate) \ | ||
329 | continue; \ | ||
330 | \ | ||
331 | if (rate - calc_rate < diff) { \ | ||
332 | frac = f; \ | ||
333 | div = d; \ | ||
334 | diff = rate - calc_rate; \ | ||
335 | } \ | ||
336 | \ | ||
337 | if (diff == 0) \ | ||
338 | break; \ | ||
339 | } \ | ||
340 | \ | ||
341 | if (diff == parent_rate) \ | ||
342 | return -EINVAL; \ | ||
343 | \ | ||
344 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ | ||
345 | reg &= ~BM_CLKCTRL_##fr##_##fs##FRAC; \ | ||
346 | reg |= frac; \ | ||
347 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ | ||
348 | } \ | ||
349 | \ | ||
350 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
351 | if (clk == &cpu_clk) { \ | ||
352 | reg &= ~BM_CLKCTRL_CPU_DIV_CPU; \ | ||
353 | reg |= div << BP_CLKCTRL_CPU_DIV_CPU; \ | ||
354 | } else { \ | ||
355 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
356 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
357 | if (reg | (1 << clk->enable_shift)) { \ | ||
358 | pr_err("%s: clock is gated\n", __func__); \ | ||
359 | return -EINVAL; \ | ||
360 | } \ | ||
361 | } \ | ||
362 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); \ | ||
363 | \ | ||
364 | for (i = 10000; i; i--) \ | ||
365 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
366 | HW_CLKCTRL_##dr) & bm_busy)) \ | ||
367 | break; \ | ||
368 | if (!i) { \ | ||
369 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
370 | return -ETIMEDOUT; \ | ||
371 | } \ | ||
372 | \ | ||
373 | return 0; \ | ||
374 | } | ||
375 | |||
376 | _CLK_SET_RATE(cpu_clk, CPU, FRAC0, CPU) | ||
377 | _CLK_SET_RATE(ssp0_clk, SSP0, FRAC0, IO0) | ||
378 | _CLK_SET_RATE(ssp1_clk, SSP1, FRAC0, IO0) | ||
379 | _CLK_SET_RATE(ssp2_clk, SSP2, FRAC0, IO1) | ||
380 | _CLK_SET_RATE(ssp3_clk, SSP3, FRAC0, IO1) | ||
381 | _CLK_SET_RATE(lcdif_clk, DIS_LCDIF, FRAC1, PIX) | ||
382 | _CLK_SET_RATE(gpmi_clk, GPMI, FRAC1, GPMI) | ||
383 | |||
384 | #define _CLK_SET_RATE1(name, dr) \ | ||
385 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
386 | { \ | ||
387 | u32 reg, div_max, div; \ | ||
388 | unsigned long parent_rate; \ | ||
389 | int i; \ | ||
390 | \ | ||
391 | parent_rate = clk_get_rate(clk->parent); \ | ||
392 | div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \ | ||
393 | \ | ||
394 | div = DIV_ROUND_UP(parent_rate, rate); \ | ||
395 | if (div == 0 || div > div_max) \ | ||
396 | return -EINVAL; \ | ||
397 | \ | ||
398 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
399 | reg &= ~BM_CLKCTRL_##dr##_DIV; \ | ||
400 | reg |= div << BP_CLKCTRL_##dr##_DIV; \ | ||
401 | if (reg | (1 << clk->enable_shift)) { \ | ||
402 | pr_err("%s: clock is gated\n", __func__); \ | ||
403 | return -EINVAL; \ | ||
404 | } \ | ||
405 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ | ||
406 | \ | ||
407 | for (i = 10000; i; i--) \ | ||
408 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
409 | HW_CLKCTRL_##dr) & BM_CLKCTRL_##dr##_BUSY)) \ | ||
410 | break; \ | ||
411 | if (!i) { \ | ||
412 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
413 | return -ETIMEDOUT; \ | ||
414 | } \ | ||
415 | \ | ||
416 | return 0; \ | ||
417 | } | ||
418 | |||
419 | _CLK_SET_RATE1(xbus_clk, XBUS) | ||
420 | |||
421 | /* saif clock uses 16 bits frac div */ | ||
422 | #define _CLK_SET_RATE_SAIF(name, rs) \ | ||
423 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
424 | { \ | ||
425 | u16 div; \ | ||
426 | u32 reg; \ | ||
427 | u64 lrate; \ | ||
428 | unsigned long parent_rate; \ | ||
429 | int i; \ | ||
430 | \ | ||
431 | parent_rate = clk_get_rate(clk->parent); \ | ||
432 | if (rate > parent_rate) \ | ||
433 | return -EINVAL; \ | ||
434 | \ | ||
435 | lrate = (u64)rate << 16; \ | ||
436 | do_div(lrate, parent_rate); \ | ||
437 | div = (u16)lrate; \ | ||
438 | \ | ||
439 | if (!div) \ | ||
440 | return -EINVAL; \ | ||
441 | \ | ||
442 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
443 | reg &= ~BM_CLKCTRL_##rs##_DIV; \ | ||
444 | reg |= div << BP_CLKCTRL_##rs##_DIV; \ | ||
445 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##rs); \ | ||
446 | \ | ||
447 | for (i = 10000; i; i--) \ | ||
448 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ | ||
449 | HW_CLKCTRL_##rs) & BM_CLKCTRL_##rs##_BUSY)) \ | ||
450 | break; \ | ||
451 | if (!i) { \ | ||
452 | pr_err("%s: divider writing timeout\n", __func__); \ | ||
453 | return -ETIMEDOUT; \ | ||
454 | } \ | ||
455 | \ | ||
456 | return 0; \ | ||
457 | } | ||
458 | |||
459 | _CLK_SET_RATE_SAIF(saif0_clk, SAIF0) | ||
460 | _CLK_SET_RATE_SAIF(saif1_clk, SAIF1) | ||
461 | |||
462 | #define _CLK_SET_RATE_STUB(name) \ | ||
463 | static int name##_set_rate(struct clk *clk, unsigned long rate) \ | ||
464 | { \ | ||
465 | return -EINVAL; \ | ||
466 | } | ||
467 | |||
468 | _CLK_SET_RATE_STUB(emi_clk) | ||
469 | _CLK_SET_RATE_STUB(uart_clk) | ||
470 | _CLK_SET_RATE_STUB(pwm_clk) | ||
471 | _CLK_SET_RATE_STUB(spdif_clk) | ||
472 | _CLK_SET_RATE_STUB(clk32k_clk) | ||
473 | _CLK_SET_RATE_STUB(can0_clk) | ||
474 | _CLK_SET_RATE_STUB(can1_clk) | ||
475 | _CLK_SET_RATE_STUB(fec_clk) | ||
476 | |||
477 | /* | ||
478 | * clk_set_parent | ||
479 | */ | ||
480 | #define _CLK_SET_PARENT(name, bit) \ | ||
481 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
482 | { \ | ||
483 | if (parent != clk->parent) { \ | ||
484 | __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ | ||
485 | HW_CLKCTRL_CLKSEQ_TOG); \ | ||
486 | clk->parent = parent; \ | ||
487 | } \ | ||
488 | \ | ||
489 | return 0; \ | ||
490 | } | ||
491 | |||
492 | _CLK_SET_PARENT(cpu_clk, CPU) | ||
493 | _CLK_SET_PARENT(emi_clk, EMI) | ||
494 | _CLK_SET_PARENT(ssp0_clk, SSP0) | ||
495 | _CLK_SET_PARENT(ssp1_clk, SSP1) | ||
496 | _CLK_SET_PARENT(ssp2_clk, SSP2) | ||
497 | _CLK_SET_PARENT(ssp3_clk, SSP3) | ||
498 | _CLK_SET_PARENT(lcdif_clk, DIS_LCDIF) | ||
499 | _CLK_SET_PARENT(gpmi_clk, GPMI) | ||
500 | _CLK_SET_PARENT(saif0_clk, SAIF0) | ||
501 | _CLK_SET_PARENT(saif1_clk, SAIF1) | ||
502 | |||
503 | #define _CLK_SET_PARENT_STUB(name) \ | ||
504 | static int name##_set_parent(struct clk *clk, struct clk *parent) \ | ||
505 | { \ | ||
506 | if (parent != clk->parent) \ | ||
507 | return -EINVAL; \ | ||
508 | else \ | ||
509 | return 0; \ | ||
510 | } | ||
511 | |||
512 | _CLK_SET_PARENT_STUB(pwm_clk) | ||
513 | _CLK_SET_PARENT_STUB(uart_clk) | ||
514 | _CLK_SET_PARENT_STUB(clk32k_clk) | ||
515 | _CLK_SET_PARENT_STUB(spdif_clk) | ||
516 | _CLK_SET_PARENT_STUB(fec_clk) | ||
517 | _CLK_SET_PARENT_STUB(can0_clk) | ||
518 | _CLK_SET_PARENT_STUB(can1_clk) | ||
519 | |||
520 | /* | ||
521 | * clk definition | ||
522 | */ | ||
523 | static struct clk cpu_clk = { | ||
524 | .get_rate = cpu_clk_get_rate, | ||
525 | .set_rate = cpu_clk_set_rate, | ||
526 | .set_parent = cpu_clk_set_parent, | ||
527 | .parent = &ref_cpu_clk, | ||
528 | }; | ||
529 | |||
530 | static struct clk hbus_clk = { | ||
531 | .get_rate = hbus_clk_get_rate, | ||
532 | .parent = &cpu_clk, | ||
533 | }; | ||
534 | |||
535 | static struct clk xbus_clk = { | ||
536 | .get_rate = xbus_clk_get_rate, | ||
537 | .set_rate = xbus_clk_set_rate, | ||
538 | .parent = &ref_xtal_clk, | ||
539 | }; | ||
540 | |||
541 | static struct clk lradc_clk = { | ||
542 | .get_rate = lradc_clk_get_rate, | ||
543 | .parent = &clk32k_clk, | ||
544 | }; | ||
545 | |||
546 | static struct clk rtc_clk = { | ||
547 | .get_rate = rtc_clk_get_rate, | ||
548 | .parent = &ref_xtal_clk, | ||
549 | }; | ||
550 | |||
551 | /* usb_clk gate is controlled in DIGCTRL other than CLKCTRL */ | ||
552 | static struct clk usb0_clk = { | ||
553 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
554 | .enable_shift = 2, | ||
555 | .enable = _raw_clk_enable, | ||
556 | .disable = _raw_clk_disable, | ||
557 | .parent = &pll0_clk, | ||
558 | }; | ||
559 | |||
560 | static struct clk usb1_clk = { | ||
561 | .enable_reg = DIGCTRL_BASE_ADDR, | ||
562 | .enable_shift = 16, | ||
563 | .enable = _raw_clk_enable, | ||
564 | .disable = _raw_clk_disable, | ||
565 | .parent = &pll1_clk, | ||
566 | }; | ||
567 | |||
568 | #define _DEFINE_CLOCK(name, er, es, p) \ | ||
569 | static struct clk name = { \ | ||
570 | .enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er, \ | ||
571 | .enable_shift = BP_CLKCTRL_##er##_##es, \ | ||
572 | .get_rate = name##_get_rate, \ | ||
573 | .set_rate = name##_set_rate, \ | ||
574 | .set_parent = name##_set_parent, \ | ||
575 | .enable = _raw_clk_enable, \ | ||
576 | .disable = _raw_clk_disable, \ | ||
577 | .parent = p, \ | ||
578 | } | ||
579 | |||
580 | _DEFINE_CLOCK(emi_clk, EMI, CLKGATE, &ref_xtal_clk); | ||
581 | _DEFINE_CLOCK(ssp0_clk, SSP0, CLKGATE, &ref_xtal_clk); | ||
582 | _DEFINE_CLOCK(ssp1_clk, SSP1, CLKGATE, &ref_xtal_clk); | ||
583 | _DEFINE_CLOCK(ssp2_clk, SSP2, CLKGATE, &ref_xtal_clk); | ||
584 | _DEFINE_CLOCK(ssp3_clk, SSP3, CLKGATE, &ref_xtal_clk); | ||
585 | _DEFINE_CLOCK(lcdif_clk, DIS_LCDIF, CLKGATE, &ref_xtal_clk); | ||
586 | _DEFINE_CLOCK(gpmi_clk, GPMI, CLKGATE, &ref_xtal_clk); | ||
587 | _DEFINE_CLOCK(saif0_clk, SAIF0, CLKGATE, &ref_xtal_clk); | ||
588 | _DEFINE_CLOCK(saif1_clk, SAIF1, CLKGATE, &ref_xtal_clk); | ||
589 | _DEFINE_CLOCK(can0_clk, FLEXCAN, STOP_CAN0, &ref_xtal_clk); | ||
590 | _DEFINE_CLOCK(can1_clk, FLEXCAN, STOP_CAN1, &ref_xtal_clk); | ||
591 | _DEFINE_CLOCK(pwm_clk, XTAL, PWM_CLK24M_GATE, &ref_xtal_clk); | ||
592 | _DEFINE_CLOCK(uart_clk, XTAL, UART_CLK_GATE, &ref_xtal_clk); | ||
593 | _DEFINE_CLOCK(clk32k_clk, XTAL, TIMROT_CLK32K_GATE, &ref_xtal_clk); | ||
594 | _DEFINE_CLOCK(spdif_clk, SPDIF, CLKGATE, &pll0_clk); | ||
595 | _DEFINE_CLOCK(fec_clk, ENET, DISABLE, &hbus_clk); | ||
596 | |||
597 | #define _REGISTER_CLOCK(d, n, c) \ | ||
598 | { \ | ||
599 | .dev_id = d, \ | ||
600 | .con_id = n, \ | ||
601 | .clk = &c, \ | ||
602 | }, | ||
603 | |||
604 | static struct clk_lookup lookups[] = { | ||
605 | _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) | ||
606 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | ||
607 | _REGISTER_CLOCK("rtc", NULL, rtc_clk) | ||
608 | _REGISTER_CLOCK("pll2", NULL, pll2_clk) | ||
609 | _REGISTER_CLOCK(NULL, "hclk", hbus_clk) | ||
610 | _REGISTER_CLOCK(NULL, "xclk", xbus_clk) | ||
611 | _REGISTER_CLOCK(NULL, "can0", can0_clk) | ||
612 | _REGISTER_CLOCK(NULL, "can1", can1_clk) | ||
613 | _REGISTER_CLOCK(NULL, "usb0", usb0_clk) | ||
614 | _REGISTER_CLOCK(NULL, "usb1", usb1_clk) | ||
615 | _REGISTER_CLOCK(NULL, "pwm", pwm_clk) | ||
616 | _REGISTER_CLOCK(NULL, "lradc", lradc_clk) | ||
617 | _REGISTER_CLOCK(NULL, "spdif", spdif_clk) | ||
618 | }; | ||
619 | |||
620 | static int clk_misc_init(void) | ||
621 | { | ||
622 | u32 reg; | ||
623 | int i; | ||
624 | |||
625 | /* Fix up parent per register setting */ | ||
626 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ); | ||
627 | cpu_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_CPU) ? | ||
628 | &ref_xtal_clk : &ref_cpu_clk; | ||
629 | emi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_EMI) ? | ||
630 | &ref_xtal_clk : &ref_emi_clk; | ||
631 | ssp0_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP0) ? | ||
632 | &ref_xtal_clk : &ref_io0_clk; | ||
633 | ssp1_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP1) ? | ||
634 | &ref_xtal_clk : &ref_io0_clk; | ||
635 | ssp2_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP2) ? | ||
636 | &ref_xtal_clk : &ref_io1_clk; | ||
637 | ssp3_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SSP3) ? | ||
638 | &ref_xtal_clk : &ref_io1_clk; | ||
639 | lcdif_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF) ? | ||
640 | &ref_xtal_clk : &ref_pix_clk; | ||
641 | gpmi_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_GPMI) ? | ||
642 | &ref_xtal_clk : &ref_gpmi_clk; | ||
643 | saif0_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SAIF0) ? | ||
644 | &ref_xtal_clk : &pll0_clk; | ||
645 | saif1_clk.parent = (reg & BM_CLKCTRL_CLKSEQ_BYPASS_SAIF1) ? | ||
646 | &ref_xtal_clk : &pll0_clk; | ||
647 | |||
648 | /* Use int div over frac when both are available */ | ||
649 | __raw_writel(BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN, | ||
650 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
651 | __raw_writel(BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN, | ||
652 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_CLR); | ||
653 | __raw_writel(BM_CLKCTRL_HBUS_DIV_FRAC_EN, | ||
654 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS_CLR); | ||
655 | |||
656 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
657 | reg &= ~BM_CLKCTRL_XBUS_DIV_FRAC_EN; | ||
658 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_XBUS); | ||
659 | |||
660 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP0); | ||
661 | reg &= ~BM_CLKCTRL_SSP0_DIV_FRAC_EN; | ||
662 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP0); | ||
663 | |||
664 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP1); | ||
665 | reg &= ~BM_CLKCTRL_SSP1_DIV_FRAC_EN; | ||
666 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP1); | ||
667 | |||
668 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP2); | ||
669 | reg &= ~BM_CLKCTRL_SSP2_DIV_FRAC_EN; | ||
670 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP2); | ||
671 | |||
672 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP3); | ||
673 | reg &= ~BM_CLKCTRL_SSP3_DIV_FRAC_EN; | ||
674 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SSP3); | ||
675 | |||
676 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
677 | reg &= ~BM_CLKCTRL_GPMI_DIV_FRAC_EN; | ||
678 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_GPMI); | ||
679 | |||
680 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_DIS_LCDIF); | ||
681 | reg &= ~BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN; | ||
682 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_DIS_LCDIF); | ||
683 | |||
684 | /* SAIF has to use frac div for functional operation */ | ||
685 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0); | ||
686 | reg &= ~BM_CLKCTRL_SAIF0_DIV_FRAC_EN; | ||
687 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0); | ||
688 | |||
689 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1); | ||
690 | reg &= ~BM_CLKCTRL_SAIF1_DIV_FRAC_EN; | ||
691 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1); | ||
692 | |||
693 | /* | ||
694 | * Set safe hbus clock divider. A divider of 3 ensure that | ||
695 | * the Vddd voltage required for the cpu clock is sufficiently | ||
696 | * high for the hbus clock. | ||
697 | */ | ||
698 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
699 | reg &= BM_CLKCTRL_HBUS_DIV; | ||
700 | reg |= 3 << BP_CLKCTRL_HBUS_DIV; | ||
701 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_HBUS); | ||
702 | |||
703 | for (i = 10000; i; i--) | ||
704 | if (!(__raw_readl(CLKCTRL_BASE_ADDR + | ||
705 | HW_CLKCTRL_HBUS) & BM_CLKCTRL_HBUS_ASM_BUSY)) | ||
706 | break; | ||
707 | if (!i) { | ||
708 | pr_err("%s: divider writing timeout\n", __func__); | ||
709 | return -ETIMEDOUT; | ||
710 | } | ||
711 | |||
712 | /* Gate off cpu clock in WFI for power saving */ | ||
713 | __raw_writel(BM_CLKCTRL_CPU_INTERRUPT_WAIT, | ||
714 | CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU_SET); | ||
715 | |||
716 | /* Extra fec clock setting */ | ||
717 | reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET); | ||
718 | reg &= ~BM_CLKCTRL_ENET_SLEEP; | ||
719 | reg |= BM_CLKCTRL_ENET_CLK_OUT_EN; | ||
720 | __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_ENET); | ||
721 | |||
722 | return 0; | ||
723 | } | ||
724 | |||
725 | int __init mx28_clocks_init(void) | ||
726 | { | ||
727 | clk_misc_init(); | ||
728 | |||
729 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
730 | |||
731 | mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0); | ||
732 | |||
733 | return 0; | ||
734 | } | ||
diff --git a/arch/arm/mach-mxs/clock.c b/arch/arm/mach-mxs/clock.c new file mode 100644 index 000000000000..e7d2269cf70e --- /dev/null +++ b/arch/arm/mach-mxs/clock.c | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * Based on arch/arm/plat-omap/clock.c | ||
3 | * | ||
4 | * Copyright (C) 2004 - 2005 Nokia corporation | ||
5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | ||
6 | * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> | ||
7 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
8 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version 2 | ||
13 | * of the License, or (at your option) any later version. | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
22 | * MA 02110-1301, USA. | ||
23 | */ | ||
24 | |||
25 | /* #define DEBUG */ | ||
26 | |||
27 | #include <linux/clk.h> | ||
28 | #include <linux/err.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/init.h> | ||
31 | #include <linux/io.h> | ||
32 | #include <linux/kernel.h> | ||
33 | #include <linux/list.h> | ||
34 | #include <linux/module.h> | ||
35 | #include <linux/mutex.h> | ||
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/proc_fs.h> | ||
38 | #include <linux/semaphore.h> | ||
39 | #include <linux/string.h> | ||
40 | |||
41 | #include <mach/clock.h> | ||
42 | |||
43 | static LIST_HEAD(clocks); | ||
44 | static DEFINE_MUTEX(clocks_mutex); | ||
45 | |||
46 | /*------------------------------------------------------------------------- | ||
47 | * Standard clock functions defined in include/linux/clk.h | ||
48 | *-------------------------------------------------------------------------*/ | ||
49 | |||
50 | static void __clk_disable(struct clk *clk) | ||
51 | { | ||
52 | if (clk == NULL || IS_ERR(clk)) | ||
53 | return; | ||
54 | WARN_ON(!clk->usecount); | ||
55 | |||
56 | if (!(--clk->usecount)) { | ||
57 | if (clk->disable) | ||
58 | clk->disable(clk); | ||
59 | __clk_disable(clk->parent); | ||
60 | __clk_disable(clk->secondary); | ||
61 | } | ||
62 | } | ||
63 | |||
64 | static int __clk_enable(struct clk *clk) | ||
65 | { | ||
66 | if (clk == NULL || IS_ERR(clk)) | ||
67 | return -EINVAL; | ||
68 | |||
69 | if (clk->usecount++ == 0) { | ||
70 | __clk_enable(clk->parent); | ||
71 | __clk_enable(clk->secondary); | ||
72 | |||
73 | if (clk->enable) | ||
74 | clk->enable(clk); | ||
75 | } | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | /* This function increments the reference count on the clock and enables the | ||
80 | * clock if not already enabled. The parent clock tree is recursively enabled | ||
81 | */ | ||
82 | int clk_enable(struct clk *clk) | ||
83 | { | ||
84 | int ret = 0; | ||
85 | |||
86 | if (clk == NULL || IS_ERR(clk)) | ||
87 | return -EINVAL; | ||
88 | |||
89 | mutex_lock(&clocks_mutex); | ||
90 | ret = __clk_enable(clk); | ||
91 | mutex_unlock(&clocks_mutex); | ||
92 | |||
93 | return ret; | ||
94 | } | ||
95 | EXPORT_SYMBOL(clk_enable); | ||
96 | |||
97 | /* This function decrements the reference count on the clock and disables | ||
98 | * the clock when reference count is 0. The parent clock tree is | ||
99 | * recursively disabled | ||
100 | */ | ||
101 | void clk_disable(struct clk *clk) | ||
102 | { | ||
103 | if (clk == NULL || IS_ERR(clk)) | ||
104 | return; | ||
105 | |||
106 | mutex_lock(&clocks_mutex); | ||
107 | __clk_disable(clk); | ||
108 | mutex_unlock(&clocks_mutex); | ||
109 | } | ||
110 | EXPORT_SYMBOL(clk_disable); | ||
111 | |||
112 | /* Retrieve the *current* clock rate. If the clock itself | ||
113 | * does not provide a special calculation routine, ask | ||
114 | * its parent and so on, until one is able to return | ||
115 | * a valid clock rate | ||
116 | */ | ||
117 | unsigned long clk_get_rate(struct clk *clk) | ||
118 | { | ||
119 | if (clk == NULL || IS_ERR(clk)) | ||
120 | return 0UL; | ||
121 | |||
122 | if (clk->get_rate) | ||
123 | return clk->get_rate(clk); | ||
124 | |||
125 | return clk_get_rate(clk->parent); | ||
126 | } | ||
127 | EXPORT_SYMBOL(clk_get_rate); | ||
128 | |||
129 | /* Round the requested clock rate to the nearest supported | ||
130 | * rate that is less than or equal to the requested rate. | ||
131 | * This is dependent on the clock's current parent. | ||
132 | */ | ||
133 | long clk_round_rate(struct clk *clk, unsigned long rate) | ||
134 | { | ||
135 | if (clk == NULL || IS_ERR(clk) || !clk->round_rate) | ||
136 | return 0; | ||
137 | |||
138 | return clk->round_rate(clk, rate); | ||
139 | } | ||
140 | EXPORT_SYMBOL(clk_round_rate); | ||
141 | |||
142 | /* Set the clock to the requested clock rate. The rate must | ||
143 | * match a supported rate exactly based on what clk_round_rate returns | ||
144 | */ | ||
145 | int clk_set_rate(struct clk *clk, unsigned long rate) | ||
146 | { | ||
147 | int ret = -EINVAL; | ||
148 | |||
149 | if (clk == NULL || IS_ERR(clk) || clk->set_rate == NULL || rate == 0) | ||
150 | return ret; | ||
151 | |||
152 | mutex_lock(&clocks_mutex); | ||
153 | ret = clk->set_rate(clk, rate); | ||
154 | mutex_unlock(&clocks_mutex); | ||
155 | |||
156 | return ret; | ||
157 | } | ||
158 | EXPORT_SYMBOL(clk_set_rate); | ||
159 | |||
160 | /* Set the clock's parent to another clock source */ | ||
161 | int clk_set_parent(struct clk *clk, struct clk *parent) | ||
162 | { | ||
163 | int ret = -EINVAL; | ||
164 | struct clk *old; | ||
165 | |||
166 | if (clk == NULL || IS_ERR(clk) || parent == NULL || | ||
167 | IS_ERR(parent) || clk->set_parent == NULL) | ||
168 | return ret; | ||
169 | |||
170 | if (clk->usecount) | ||
171 | clk_enable(parent); | ||
172 | |||
173 | mutex_lock(&clocks_mutex); | ||
174 | ret = clk->set_parent(clk, parent); | ||
175 | if (ret == 0) { | ||
176 | old = clk->parent; | ||
177 | clk->parent = parent; | ||
178 | } else { | ||
179 | old = parent; | ||
180 | } | ||
181 | mutex_unlock(&clocks_mutex); | ||
182 | |||
183 | if (clk->usecount) | ||
184 | clk_disable(old); | ||
185 | |||
186 | return ret; | ||
187 | } | ||
188 | EXPORT_SYMBOL(clk_set_parent); | ||
189 | |||
190 | /* Retrieve the clock's parent clock source */ | ||
191 | struct clk *clk_get_parent(struct clk *clk) | ||
192 | { | ||
193 | struct clk *ret = NULL; | ||
194 | |||
195 | if (clk == NULL || IS_ERR(clk)) | ||
196 | return ret; | ||
197 | |||
198 | return clk->parent; | ||
199 | } | ||
200 | EXPORT_SYMBOL(clk_get_parent); | ||
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h new file mode 100644 index 000000000000..d0f49fc0abb5 --- /dev/null +++ b/arch/arm/mach-mxs/devices-mx23.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx23.h> | ||
12 | #include <mach/devices-common.h> | ||
13 | |||
14 | extern const struct mxs_duart_data mx23_duart_data __initconst; | ||
15 | #define mx23_add_duart() \ | ||
16 | mxs_add_duart(&mx23_duart_data) | ||
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h new file mode 100644 index 000000000000..00b736c434ba --- /dev/null +++ b/arch/arm/mach-mxs/devices-mx28.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx28.h> | ||
12 | #include <mach/devices-common.h> | ||
13 | |||
14 | extern const struct mxs_duart_data mx28_duart_data __initconst; | ||
15 | #define mx28_add_duart() \ | ||
16 | mxs_add_duart(&mx28_duart_data) | ||
17 | |||
18 | extern const struct mxs_fec_data mx28_fec_data[] __initconst; | ||
19 | #define mx28_add_fec(id, pdata) \ | ||
20 | mxs_add_fec(&mx28_fec_data[id], pdata) | ||
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c new file mode 100644 index 000000000000..6b60f02ca2e3 --- /dev/null +++ b/arch/arm/mach-mxs/devices.c | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Copyright 2008 Sascha Hauer, kernel@pengutronix.de | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | * Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <mach/common.h> | ||
25 | |||
26 | struct platform_device *__init mxs_add_platform_device_dmamask( | ||
27 | const char *name, int id, | ||
28 | const struct resource *res, unsigned int num_resources, | ||
29 | const void *data, size_t size_data, u64 dmamask) | ||
30 | { | ||
31 | int ret = -ENOMEM; | ||
32 | struct platform_device *pdev; | ||
33 | |||
34 | pdev = platform_device_alloc(name, id); | ||
35 | if (!pdev) | ||
36 | goto err; | ||
37 | |||
38 | if (dmamask) { | ||
39 | /* | ||
40 | * This memory isn't freed when the device is put, | ||
41 | * I don't have a nice idea for that though. Conceptually | ||
42 | * dma_mask in struct device should not be a pointer. | ||
43 | * See http://thread.gmane.org/gmane.linux.kernel.pci/9081 | ||
44 | */ | ||
45 | pdev->dev.dma_mask = | ||
46 | kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | ||
47 | if (!pdev->dev.dma_mask) | ||
48 | /* ret is still -ENOMEM; */ | ||
49 | goto err; | ||
50 | |||
51 | *pdev->dev.dma_mask = dmamask; | ||
52 | pdev->dev.coherent_dma_mask = dmamask; | ||
53 | } | ||
54 | |||
55 | if (res) { | ||
56 | ret = platform_device_add_resources(pdev, res, num_resources); | ||
57 | if (ret) | ||
58 | goto err; | ||
59 | } | ||
60 | |||
61 | if (data) { | ||
62 | ret = platform_device_add_data(pdev, data, size_data); | ||
63 | if (ret) | ||
64 | goto err; | ||
65 | } | ||
66 | |||
67 | ret = platform_device_add(pdev); | ||
68 | if (ret) { | ||
69 | err: | ||
70 | platform_device_put(pdev); | ||
71 | return ERR_PTR(ret); | ||
72 | } | ||
73 | |||
74 | return pdev; | ||
75 | } | ||
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig new file mode 100644 index 000000000000..a35a2dc55395 --- /dev/null +++ b/arch/arm/mach-mxs/devices/Kconfig | |||
@@ -0,0 +1,5 @@ | |||
1 | config MXS_HAVE_PLATFORM_DUART | ||
2 | bool | ||
3 | |||
4 | config MXS_HAVE_PLATFORM_FEC | ||
5 | bool | ||
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile new file mode 100644 index 000000000000..4b5266a3e6d9 --- /dev/null +++ b/arch/arm/mach-mxs/devices/Makefile | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o | ||
2 | obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o | ||
diff --git a/arch/arm/mach-mxs/devices/platform-duart.c b/arch/arm/mach-mxs/devices/platform-duart.c new file mode 100644 index 000000000000..2fe0df5b0aad --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-duart.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it under | ||
8 | * the terms of the GNU General Public License version 2 as published by the | ||
9 | * Free Software Foundation. | ||
10 | */ | ||
11 | #include <mach/mx23.h> | ||
12 | #include <mach/mx28.h> | ||
13 | #include <mach/devices-common.h> | ||
14 | |||
15 | #define mxs_duart_data_entry(soc) \ | ||
16 | { \ | ||
17 | .iobase = soc ## _DUART_BASE_ADDR, \ | ||
18 | .irq = soc ## _INT_DUART, \ | ||
19 | } | ||
20 | |||
21 | #ifdef CONFIG_SOC_IMX23 | ||
22 | const struct mxs_duart_data mx23_duart_data __initconst = | ||
23 | mxs_duart_data_entry(MX23); | ||
24 | #endif | ||
25 | |||
26 | #ifdef CONFIG_SOC_IMX28 | ||
27 | const struct mxs_duart_data mx28_duart_data __initconst = | ||
28 | mxs_duart_data_entry(MX28); | ||
29 | #endif | ||
30 | |||
31 | struct platform_device *__init mxs_add_duart( | ||
32 | const struct mxs_duart_data *data) | ||
33 | { | ||
34 | struct resource res[] = { | ||
35 | { | ||
36 | .start = data->iobase, | ||
37 | .end = data->iobase + SZ_8K - 1, | ||
38 | .flags = IORESOURCE_MEM, | ||
39 | }, { | ||
40 | .start = data->irq, | ||
41 | .end = data->irq, | ||
42 | .flags = IORESOURCE_IRQ, | ||
43 | }, | ||
44 | }; | ||
45 | |||
46 | return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res), | ||
47 | NULL, 0); | ||
48 | } | ||
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c new file mode 100644 index 000000000000..c08168cf3dec --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-fec.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <asm/sizes.h> | ||
10 | #include <mach/mx28.h> | ||
11 | #include <mach/devices-common.h> | ||
12 | |||
13 | #define mxs_fec_data_entry_single(soc, _id) \ | ||
14 | { \ | ||
15 | .id = _id, \ | ||
16 | .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \ | ||
17 | .irq = soc ## _INT_ENET_MAC ## _id, \ | ||
18 | } | ||
19 | |||
20 | #define mxs_fec_data_entry(soc, _id) \ | ||
21 | [_id] = mxs_fec_data_entry_single(soc, _id) | ||
22 | |||
23 | #ifdef CONFIG_SOC_IMX28 | ||
24 | const struct mxs_fec_data mx28_fec_data[] __initconst = { | ||
25 | #define mx28_fec_data_entry(_id) \ | ||
26 | mxs_fec_data_entry(MX28, _id) | ||
27 | mx28_fec_data_entry(0), | ||
28 | mx28_fec_data_entry(1), | ||
29 | }; | ||
30 | #endif | ||
31 | |||
32 | struct platform_device *__init mxs_add_fec( | ||
33 | const struct mxs_fec_data *data, | ||
34 | const struct fec_platform_data *pdata) | ||
35 | { | ||
36 | struct resource res[] = { | ||
37 | { | ||
38 | .start = data->iobase, | ||
39 | .end = data->iobase + SZ_16K - 1, | ||
40 | .flags = IORESOURCE_MEM, | ||
41 | }, { | ||
42 | .start = data->irq, | ||
43 | .end = data->irq, | ||
44 | .flags = IORESOURCE_IRQ, | ||
45 | }, | ||
46 | }; | ||
47 | |||
48 | return mxs_add_platform_device("fec", data->id, | ||
49 | res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
50 | } | ||
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c new file mode 100644 index 000000000000..d7ad7a61366d --- /dev/null +++ b/arch/arm/mach-mxs/gpio.c | |||
@@ -0,0 +1,325 @@ | |||
1 | /* | ||
2 | * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de> | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * Based on code from Freescale, | ||
6 | * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version 2 | ||
11 | * of the License, or (at your option) any later version. | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
20 | * MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #include <linux/init.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/io.h> | ||
26 | #include <linux/irq.h> | ||
27 | #include <linux/gpio.h> | ||
28 | #include <mach/mx23.h> | ||
29 | #include <mach/mx28.h> | ||
30 | #include <asm-generic/bug.h> | ||
31 | |||
32 | #include "gpio.h" | ||
33 | |||
34 | static struct mxs_gpio_port *mxs_gpio_ports; | ||
35 | static int gpio_table_size; | ||
36 | |||
37 | #define PINCTRL_DOUT(n) ((cpu_is_mx23() ? 0x0500 : 0x0700) + (n) * 0x10) | ||
38 | #define PINCTRL_DIN(n) ((cpu_is_mx23() ? 0x0600 : 0x0900) + (n) * 0x10) | ||
39 | #define PINCTRL_DOE(n) ((cpu_is_mx23() ? 0x0700 : 0x0b00) + (n) * 0x10) | ||
40 | #define PINCTRL_PIN2IRQ(n) ((cpu_is_mx23() ? 0x0800 : 0x1000) + (n) * 0x10) | ||
41 | #define PINCTRL_IRQEN(n) ((cpu_is_mx23() ? 0x0900 : 0x1100) + (n) * 0x10) | ||
42 | #define PINCTRL_IRQLEV(n) ((cpu_is_mx23() ? 0x0a00 : 0x1200) + (n) * 0x10) | ||
43 | #define PINCTRL_IRQPOL(n) ((cpu_is_mx23() ? 0x0b00 : 0x1300) + (n) * 0x10) | ||
44 | #define PINCTRL_IRQSTAT(n) ((cpu_is_mx23() ? 0x0c00 : 0x1400) + (n) * 0x10) | ||
45 | |||
46 | #define GPIO_INT_FALL_EDGE 0x0 | ||
47 | #define GPIO_INT_LOW_LEV 0x1 | ||
48 | #define GPIO_INT_RISE_EDGE 0x2 | ||
49 | #define GPIO_INT_HIGH_LEV 0x3 | ||
50 | #define GPIO_INT_LEV_MASK (1 << 0) | ||
51 | #define GPIO_INT_POL_MASK (1 << 1) | ||
52 | |||
53 | /* Note: This driver assumes 32 GPIOs are handled in one register */ | ||
54 | |||
55 | static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index) | ||
56 | { | ||
57 | __mxs_clrl(1 << index, port->base + PINCTRL_IRQSTAT(port->id)); | ||
58 | } | ||
59 | |||
60 | static void set_gpio_irqenable(struct mxs_gpio_port *port, u32 index, | ||
61 | int enable) | ||
62 | { | ||
63 | if (enable) { | ||
64 | __mxs_setl(1 << index, port->base + PINCTRL_IRQEN(port->id)); | ||
65 | __mxs_setl(1 << index, port->base + PINCTRL_PIN2IRQ(port->id)); | ||
66 | } else { | ||
67 | __mxs_clrl(1 << index, port->base + PINCTRL_IRQEN(port->id)); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | static void mxs_gpio_ack_irq(u32 irq) | ||
72 | { | ||
73 | u32 gpio = irq_to_gpio(irq); | ||
74 | clear_gpio_irqstatus(&mxs_gpio_ports[gpio / 32], gpio & 0x1f); | ||
75 | } | ||
76 | |||
77 | static void mxs_gpio_mask_irq(u32 irq) | ||
78 | { | ||
79 | u32 gpio = irq_to_gpio(irq); | ||
80 | set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 0); | ||
81 | } | ||
82 | |||
83 | static void mxs_gpio_unmask_irq(u32 irq) | ||
84 | { | ||
85 | u32 gpio = irq_to_gpio(irq); | ||
86 | set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 1); | ||
87 | } | ||
88 | |||
89 | static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset); | ||
90 | |||
91 | static int mxs_gpio_set_irq_type(u32 irq, u32 type) | ||
92 | { | ||
93 | u32 gpio = irq_to_gpio(irq); | ||
94 | u32 pin_mask = 1 << (gpio & 31); | ||
95 | struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; | ||
96 | void __iomem *pin_addr; | ||
97 | int edge; | ||
98 | |||
99 | switch (type) { | ||
100 | case IRQ_TYPE_EDGE_RISING: | ||
101 | edge = GPIO_INT_RISE_EDGE; | ||
102 | break; | ||
103 | case IRQ_TYPE_EDGE_FALLING: | ||
104 | edge = GPIO_INT_FALL_EDGE; | ||
105 | break; | ||
106 | case IRQ_TYPE_LEVEL_LOW: | ||
107 | edge = GPIO_INT_LOW_LEV; | ||
108 | break; | ||
109 | case IRQ_TYPE_LEVEL_HIGH: | ||
110 | edge = GPIO_INT_HIGH_LEV; | ||
111 | break; | ||
112 | default: | ||
113 | return -EINVAL; | ||
114 | } | ||
115 | |||
116 | /* set level or edge */ | ||
117 | pin_addr = port->base + PINCTRL_IRQLEV(port->id); | ||
118 | if (edge & GPIO_INT_LEV_MASK) | ||
119 | __mxs_setl(pin_mask, pin_addr); | ||
120 | else | ||
121 | __mxs_clrl(pin_mask, pin_addr); | ||
122 | |||
123 | /* set polarity */ | ||
124 | pin_addr = port->base + PINCTRL_IRQPOL(port->id); | ||
125 | if (edge & GPIO_INT_POL_MASK) | ||
126 | __mxs_setl(pin_mask, pin_addr); | ||
127 | else | ||
128 | __mxs_clrl(pin_mask, pin_addr); | ||
129 | |||
130 | clear_gpio_irqstatus(port, gpio & 0x1f); | ||
131 | |||
132 | return 0; | ||
133 | } | ||
134 | |||
135 | /* MXS has one interrupt *per* gpio port */ | ||
136 | static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc) | ||
137 | { | ||
138 | u32 irq_stat; | ||
139 | struct mxs_gpio_port *port = (struct mxs_gpio_port *)get_irq_data(irq); | ||
140 | u32 gpio_irq_no_base = port->virtual_irq_start; | ||
141 | |||
142 | irq_stat = __raw_readl(port->base + PINCTRL_IRQSTAT(port->id)) & | ||
143 | __raw_readl(port->base + PINCTRL_IRQEN(port->id)); | ||
144 | |||
145 | while (irq_stat != 0) { | ||
146 | int irqoffset = fls(irq_stat) - 1; | ||
147 | generic_handle_irq(gpio_irq_no_base + irqoffset); | ||
148 | irq_stat &= ~(1 << irqoffset); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | /* | ||
153 | * Set interrupt number "irq" in the GPIO as a wake-up source. | ||
154 | * While system is running, all registered GPIO interrupts need to have | ||
155 | * wake-up enabled. When system is suspended, only selected GPIO interrupts | ||
156 | * need to have wake-up enabled. | ||
157 | * @param irq interrupt source number | ||
158 | * @param enable enable as wake-up if equal to non-zero | ||
159 | * @return This function returns 0 on success. | ||
160 | */ | ||
161 | static int mxs_gpio_set_wake_irq(u32 irq, u32 enable) | ||
162 | { | ||
163 | u32 gpio = irq_to_gpio(irq); | ||
164 | u32 gpio_idx = gpio & 0x1f; | ||
165 | struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; | ||
166 | |||
167 | if (enable) { | ||
168 | if (port->irq_high && (gpio_idx >= 16)) | ||
169 | enable_irq_wake(port->irq_high); | ||
170 | else | ||
171 | enable_irq_wake(port->irq); | ||
172 | } else { | ||
173 | if (port->irq_high && (gpio_idx >= 16)) | ||
174 | disable_irq_wake(port->irq_high); | ||
175 | else | ||
176 | disable_irq_wake(port->irq); | ||
177 | } | ||
178 | |||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static struct irq_chip gpio_irq_chip = { | ||
183 | .ack = mxs_gpio_ack_irq, | ||
184 | .mask = mxs_gpio_mask_irq, | ||
185 | .unmask = mxs_gpio_unmask_irq, | ||
186 | .set_type = mxs_gpio_set_irq_type, | ||
187 | .set_wake = mxs_gpio_set_wake_irq, | ||
188 | }; | ||
189 | |||
190 | static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset, | ||
191 | int dir) | ||
192 | { | ||
193 | struct mxs_gpio_port *port = | ||
194 | container_of(chip, struct mxs_gpio_port, chip); | ||
195 | void __iomem *pin_addr = port->base + PINCTRL_DOE(port->id); | ||
196 | |||
197 | if (dir) | ||
198 | __mxs_setl(1 << offset, pin_addr); | ||
199 | else | ||
200 | __mxs_clrl(1 << offset, pin_addr); | ||
201 | } | ||
202 | |||
203 | static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
204 | { | ||
205 | struct mxs_gpio_port *port = | ||
206 | container_of(chip, struct mxs_gpio_port, chip); | ||
207 | |||
208 | return (__raw_readl(port->base + PINCTRL_DIN(port->id)) >> offset) & 1; | ||
209 | } | ||
210 | |||
211 | static void mxs_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
212 | { | ||
213 | struct mxs_gpio_port *port = | ||
214 | container_of(chip, struct mxs_gpio_port, chip); | ||
215 | void __iomem *pin_addr = port->base + PINCTRL_DOUT(port->id); | ||
216 | |||
217 | if (value) | ||
218 | __mxs_setl(1 << offset, pin_addr); | ||
219 | else | ||
220 | __mxs_clrl(1 << offset, pin_addr); | ||
221 | } | ||
222 | |||
223 | static int mxs_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
224 | { | ||
225 | struct mxs_gpio_port *port = | ||
226 | container_of(chip, struct mxs_gpio_port, chip); | ||
227 | |||
228 | return port->virtual_irq_start + offset; | ||
229 | } | ||
230 | |||
231 | static int mxs_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | ||
232 | { | ||
233 | mxs_set_gpio_direction(chip, offset, 0); | ||
234 | return 0; | ||
235 | } | ||
236 | |||
237 | static int mxs_gpio_direction_output(struct gpio_chip *chip, | ||
238 | unsigned offset, int value) | ||
239 | { | ||
240 | mxs_gpio_set(chip, offset, value); | ||
241 | mxs_set_gpio_direction(chip, offset, 1); | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt) | ||
246 | { | ||
247 | int i, j; | ||
248 | |||
249 | /* save for local usage */ | ||
250 | mxs_gpio_ports = port; | ||
251 | gpio_table_size = cnt; | ||
252 | |||
253 | pr_info("MXS GPIO hardware\n"); | ||
254 | |||
255 | for (i = 0; i < cnt; i++) { | ||
256 | /* disable the interrupt and clear the status */ | ||
257 | __raw_writel(0, port[i].base + PINCTRL_PIN2IRQ(i)); | ||
258 | __raw_writel(0, port[i].base + PINCTRL_IRQEN(i)); | ||
259 | |||
260 | /* clear address has to be used to clear IRQSTAT bits */ | ||
261 | __mxs_clrl(~0U, port[i].base + PINCTRL_IRQSTAT(i)); | ||
262 | |||
263 | for (j = port[i].virtual_irq_start; | ||
264 | j < port[i].virtual_irq_start + 32; j++) { | ||
265 | set_irq_chip(j, &gpio_irq_chip); | ||
266 | set_irq_handler(j, handle_level_irq); | ||
267 | set_irq_flags(j, IRQF_VALID); | ||
268 | } | ||
269 | |||
270 | /* setup one handler for each entry */ | ||
271 | set_irq_chained_handler(port[i].irq, mxs_gpio_irq_handler); | ||
272 | set_irq_data(port[i].irq, &port[i]); | ||
273 | |||
274 | /* register gpio chip */ | ||
275 | port[i].chip.direction_input = mxs_gpio_direction_input; | ||
276 | port[i].chip.direction_output = mxs_gpio_direction_output; | ||
277 | port[i].chip.get = mxs_gpio_get; | ||
278 | port[i].chip.set = mxs_gpio_set; | ||
279 | port[i].chip.to_irq = mxs_gpio_to_irq; | ||
280 | port[i].chip.base = i * 32; | ||
281 | port[i].chip.ngpio = 32; | ||
282 | |||
283 | /* its a serious configuration bug when it fails */ | ||
284 | BUG_ON(gpiochip_add(&port[i].chip) < 0); | ||
285 | } | ||
286 | |||
287 | return 0; | ||
288 | } | ||
289 | |||
290 | #define DEFINE_MXS_GPIO_PORT(soc, _id) \ | ||
291 | { \ | ||
292 | .chip.label = "gpio-" #_id, \ | ||
293 | .id = _id, \ | ||
294 | .irq = soc ## _INT_GPIO ## _id, \ | ||
295 | .base = soc ## _IO_ADDRESS( \ | ||
296 | soc ## _PINCTRL ## _BASE_ADDR), \ | ||
297 | .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ | ||
298 | } | ||
299 | |||
300 | #define DEFINE_REGISTER_FUNCTION(prefix) \ | ||
301 | int __init prefix ## _register_gpios(void) \ | ||
302 | { \ | ||
303 | return mxs_gpio_init(prefix ## _gpio_ports, \ | ||
304 | ARRAY_SIZE(prefix ## _gpio_ports)); \ | ||
305 | } | ||
306 | |||
307 | #ifdef CONFIG_SOC_IMX23 | ||
308 | static struct mxs_gpio_port mx23_gpio_ports[] = { | ||
309 | DEFINE_MXS_GPIO_PORT(MX23, 0), | ||
310 | DEFINE_MXS_GPIO_PORT(MX23, 1), | ||
311 | DEFINE_MXS_GPIO_PORT(MX23, 2), | ||
312 | }; | ||
313 | DEFINE_REGISTER_FUNCTION(mx23) | ||
314 | #endif | ||
315 | |||
316 | #ifdef CONFIG_SOC_IMX28 | ||
317 | static struct mxs_gpio_port mx28_gpio_ports[] = { | ||
318 | DEFINE_MXS_GPIO_PORT(MX28, 0), | ||
319 | DEFINE_MXS_GPIO_PORT(MX28, 1), | ||
320 | DEFINE_MXS_GPIO_PORT(MX28, 2), | ||
321 | DEFINE_MXS_GPIO_PORT(MX28, 3), | ||
322 | DEFINE_MXS_GPIO_PORT(MX28, 4), | ||
323 | }; | ||
324 | DEFINE_REGISTER_FUNCTION(mx28) | ||
325 | #endif | ||
diff --git a/arch/arm/mach-mxs/gpio.h b/arch/arm/mach-mxs/gpio.h new file mode 100644 index 000000000000..005bb06630b1 --- /dev/null +++ b/arch/arm/mach-mxs/gpio.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
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 Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MXS_GPIO_H__ | ||
21 | #define __MXS_GPIO_H__ | ||
22 | |||
23 | struct mxs_gpio_port { | ||
24 | void __iomem *base; | ||
25 | int id; | ||
26 | int irq; | ||
27 | int irq_high; | ||
28 | int virtual_irq_start; | ||
29 | struct gpio_chip chip; | ||
30 | }; | ||
31 | |||
32 | int mxs_gpio_init(struct mxs_gpio_port*, int); | ||
33 | |||
34 | #endif /* __MXS_GPIO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/icoll.c b/arch/arm/mach-mxs/icoll.c new file mode 100644 index 000000000000..5dd43ba70058 --- /dev/null +++ b/arch/arm/mach-mxs/icoll.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/irq.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <mach/mxs.h> | ||
25 | #include <mach/common.h> | ||
26 | |||
27 | #define HW_ICOLL_VECTOR 0x0000 | ||
28 | #define HW_ICOLL_LEVELACK 0x0010 | ||
29 | #define HW_ICOLL_CTRL 0x0020 | ||
30 | #define HW_ICOLL_INTERRUPTn_SET(n) (0x0124 + (n) * 0x10) | ||
31 | #define HW_ICOLL_INTERRUPTn_CLR(n) (0x0128 + (n) * 0x10) | ||
32 | #define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004 | ||
33 | #define BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 0x1 | ||
34 | |||
35 | static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR); | ||
36 | |||
37 | static void icoll_ack_irq(unsigned int irq) | ||
38 | { | ||
39 | /* | ||
40 | * The Interrupt Collector is able to prioritize irqs. | ||
41 | * Currently only level 0 is used. So acking can use | ||
42 | * BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 unconditionally. | ||
43 | */ | ||
44 | __raw_writel(BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0, | ||
45 | icoll_base + HW_ICOLL_LEVELACK); | ||
46 | } | ||
47 | |||
48 | static void icoll_mask_irq(unsigned int irq) | ||
49 | { | ||
50 | __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, | ||
51 | icoll_base + HW_ICOLL_INTERRUPTn_CLR(irq)); | ||
52 | } | ||
53 | |||
54 | static void icoll_unmask_irq(unsigned int irq) | ||
55 | { | ||
56 | __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, | ||
57 | icoll_base + HW_ICOLL_INTERRUPTn_SET(irq)); | ||
58 | } | ||
59 | |||
60 | static struct irq_chip mxs_icoll_chip = { | ||
61 | .ack = icoll_ack_irq, | ||
62 | .mask = icoll_mask_irq, | ||
63 | .unmask = icoll_unmask_irq, | ||
64 | }; | ||
65 | |||
66 | void __init icoll_init_irq(void) | ||
67 | { | ||
68 | int i; | ||
69 | |||
70 | /* | ||
71 | * Interrupt Collector reset, which initializes the priority | ||
72 | * for each irq to level 0. | ||
73 | */ | ||
74 | mxs_reset_block(icoll_base + HW_ICOLL_CTRL); | ||
75 | |||
76 | for (i = 0; i < MXS_INTERNAL_IRQS; i++) { | ||
77 | set_irq_chip(i, &mxs_icoll_chip); | ||
78 | set_irq_handler(i, handle_level_irq); | ||
79 | set_irq_flags(i, IRQF_VALID); | ||
80 | } | ||
81 | } | ||
diff --git a/arch/arm/mach-mxs/include/mach/clkdev.h b/arch/arm/mach-mxs/include/mach/clkdev.h new file mode 100644 index 000000000000..3a8f2e3a6309 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/clkdev.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __MACH_MXS_CLKDEV_H__ | ||
2 | #define __MACH_MXS_CLKDEV_H__ | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h new file mode 100644 index 000000000000..041e276d8a32 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/clock.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
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 Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MACH_MXS_CLOCK_H__ | ||
21 | #define __MACH_MXS_CLOCK_H__ | ||
22 | |||
23 | #ifndef __ASSEMBLY__ | ||
24 | #include <linux/list.h> | ||
25 | |||
26 | struct module; | ||
27 | |||
28 | struct clk { | ||
29 | int id; | ||
30 | /* Source clock this clk depends on */ | ||
31 | struct clk *parent; | ||
32 | /* Secondary clock to enable/disable with this clock */ | ||
33 | struct clk *secondary; | ||
34 | /* Reference count of clock enable/disable */ | ||
35 | __s8 usecount; | ||
36 | /* Register bit position for clock's enable/disable control. */ | ||
37 | u8 enable_shift; | ||
38 | /* Register address for clock's enable/disable control. */ | ||
39 | void __iomem *enable_reg; | ||
40 | u32 flags; | ||
41 | /* get the current clock rate (always a fresh value) */ | ||
42 | unsigned long (*get_rate) (struct clk *); | ||
43 | /* Function ptr to set the clock to a new rate. The rate must match a | ||
44 | supported rate returned from round_rate. Leave blank if clock is not | ||
45 | programmable */ | ||
46 | int (*set_rate) (struct clk *, unsigned long); | ||
47 | /* Function ptr to round the requested clock rate to the nearest | ||
48 | supported rate that is less than or equal to the requested rate. */ | ||
49 | unsigned long (*round_rate) (struct clk *, unsigned long); | ||
50 | /* Function ptr to enable the clock. Leave blank if clock can not | ||
51 | be gated. */ | ||
52 | int (*enable) (struct clk *); | ||
53 | /* Function ptr to disable the clock. Leave blank if clock can not | ||
54 | be gated. */ | ||
55 | void (*disable) (struct clk *); | ||
56 | /* Function ptr to set the parent clock of the clock. */ | ||
57 | int (*set_parent) (struct clk *, struct clk *); | ||
58 | }; | ||
59 | |||
60 | int clk_register(struct clk *clk); | ||
61 | void clk_unregister(struct clk *clk); | ||
62 | |||
63 | #endif /* __ASSEMBLY__ */ | ||
64 | #endif /* __MACH_MXS_CLOCK_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h new file mode 100644 index 000000000000..59133eb3cc96 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/common.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_MXS_COMMON_H__ | ||
12 | #define __MACH_MXS_COMMON_H__ | ||
13 | |||
14 | struct clk; | ||
15 | |||
16 | extern int mxs_reset_block(void __iomem *); | ||
17 | extern void mxs_timer_init(struct clk *, int); | ||
18 | |||
19 | extern int mx23_register_gpios(void); | ||
20 | extern int mx23_clocks_init(void); | ||
21 | extern void mx23_map_io(void); | ||
22 | extern void mx23_init_irq(void); | ||
23 | |||
24 | extern int mx28_register_gpios(void); | ||
25 | extern int mx28_clocks_init(void); | ||
26 | extern void mx28_map_io(void); | ||
27 | extern void mx28_init_irq(void); | ||
28 | |||
29 | extern void icoll_init_irq(void); | ||
30 | |||
31 | #endif /* __MACH_MXS_COMMON_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/debug-macro.S b/arch/arm/mach-mxs/include/mach/debug-macro.S new file mode 100644 index 000000000000..79650a1ad78d --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* arch/arm/mach-mxs/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
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 | |||
14 | #include <mach/mx23.h> | ||
15 | #include <mach/mx28.h> | ||
16 | |||
17 | #ifdef CONFIG_SOC_IMX23 | ||
18 | #ifdef UART_PADDR | ||
19 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
20 | #endif | ||
21 | #define UART_PADDR MX23_DUART_BASE_ADDR | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX28 | ||
25 | #ifdef UART_PADDR | ||
26 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
27 | #endif | ||
28 | #define UART_PADDR MX28_DUART_BASE_ADDR | ||
29 | #endif | ||
30 | |||
31 | #define UART_VADDR MXS_IO_ADDRESS(UART_PADDR) | ||
32 | |||
33 | .macro addruart, rp, rv | ||
34 | ldr \rp, =UART_PADDR @ physical | ||
35 | ldr \rv, =UART_VADDR @ virtual | ||
36 | .endm | ||
37 | |||
38 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h new file mode 100644 index 000000000000..3da48d4d3273 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/devices-common.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/platform_device.h> | ||
11 | #include <linux/init.h> | ||
12 | |||
13 | struct platform_device *mxs_add_platform_device_dmamask( | ||
14 | const char *name, int id, | ||
15 | const struct resource *res, unsigned int num_resources, | ||
16 | const void *data, size_t size_data, u64 dmamask); | ||
17 | |||
18 | static inline struct platform_device *mxs_add_platform_device( | ||
19 | const char *name, int id, | ||
20 | const struct resource *res, unsigned int num_resources, | ||
21 | const void *data, size_t size_data) | ||
22 | { | ||
23 | return mxs_add_platform_device_dmamask( | ||
24 | name, id, res, num_resources, data, size_data, 0); | ||
25 | } | ||
26 | |||
27 | /* duart */ | ||
28 | struct mxs_duart_data { | ||
29 | resource_size_t iobase; | ||
30 | resource_size_t iosize; | ||
31 | resource_size_t irq; | ||
32 | }; | ||
33 | struct platform_device *__init mxs_add_duart( | ||
34 | const struct mxs_duart_data *data); | ||
35 | |||
36 | /* fec */ | ||
37 | #include <linux/fec.h> | ||
38 | struct mxs_fec_data { | ||
39 | int id; | ||
40 | resource_size_t iobase; | ||
41 | resource_size_t iosize; | ||
42 | resource_size_t irq; | ||
43 | }; | ||
44 | struct platform_device *__init mxs_add_fec( | ||
45 | const struct mxs_fec_data *data, | ||
46 | const struct fec_platform_data *pdata); | ||
diff --git a/arch/arm/mach-mxs/include/mach/entry-macro.S b/arch/arm/mach-mxs/include/mach/entry-macro.S new file mode 100644 index 000000000000..9f0da12e657a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/entry-macro.S | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Low-level IRQ helper macros for Freescale MXS-based | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #include <mach/mxs.h> | ||
22 | |||
23 | #define MXS_ICOLL_VBASE MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR) | ||
24 | #define HW_ICOLL_STAT_OFFSET 0x70 | ||
25 | |||
26 | .macro disable_fiq | ||
27 | .endm | ||
28 | |||
29 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
30 | ldr \irqnr, [\base, #HW_ICOLL_STAT_OFFSET] | ||
31 | cmp \irqnr, #0x7F | ||
32 | strne \irqnr, [\base] | ||
33 | moveqs \irqnr, #0 | ||
34 | .endm | ||
35 | |||
36 | .macro get_irqnr_preamble, base, tmp | ||
37 | ldr \base, =MXS_ICOLL_VBASE | ||
38 | .endm | ||
39 | |||
40 | .macro arch_ret_to_user, tmp1, tmp2 | ||
41 | .endm | ||
diff --git a/arch/arm/mach-mxs/include/mach/gpio.h b/arch/arm/mach-mxs/include/mach/gpio.h new file mode 100644 index 000000000000..828ccccb6aad --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/gpio.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
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 Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MACH_MXS_GPIO_H__ | ||
21 | #define __MACH_MXS_GPIO_H__ | ||
22 | |||
23 | #include <asm-generic/gpio.h> | ||
24 | |||
25 | #define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr)) | ||
26 | |||
27 | /* use gpiolib dispatchers */ | ||
28 | #define gpio_get_value __gpio_get_value | ||
29 | #define gpio_set_value __gpio_set_value | ||
30 | #define gpio_cansleep __gpio_cansleep | ||
31 | #define gpio_to_irq __gpio_to_irq | ||
32 | |||
33 | #define irq_to_gpio(irq) ((irq) - MXS_GPIO_IRQ_START) | ||
34 | |||
35 | #endif /* __MACH_MXS_GPIO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/hardware.h b/arch/arm/mach-mxs/include/mach/hardware.h new file mode 100644 index 000000000000..53e89a09bf0d --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/hardware.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
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 Street, Fifth Floor, Boston, | ||
17 | * MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef __MACH_MXS_HARDWARE_H__ | ||
21 | #define __MACH_MXS_HARDWARE_H__ | ||
22 | |||
23 | #ifdef __ASSEMBLER__ | ||
24 | #define IOMEM(addr) (addr) | ||
25 | #else | ||
26 | #define IOMEM(addr) ((void __force __iomem *)(addr)) | ||
27 | #endif | ||
28 | |||
29 | #endif /* __MACH_MXS_HARDWARE_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/io.h b/arch/arm/mach-mxs/include/mach/io.h new file mode 100644 index 000000000000..289b7227e072 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/io.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_MXS_IO_H__ | ||
12 | #define __MACH_MXS_IO_H__ | ||
13 | |||
14 | /* Allow IO space to be anywhere in the memory */ | ||
15 | #define IO_SPACE_LIMIT 0xffffffff | ||
16 | |||
17 | /* io address mapping macro */ | ||
18 | #define __io(a) __typesafe_io(a) | ||
19 | |||
20 | #define __mem_pci(a) (a) | ||
21 | |||
22 | #endif /* __MACH_MXS_IO_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx23.h b/arch/arm/mach-mxs/include/mach/iomux-mx23.h new file mode 100644 index 000000000000..94e5dd83cdb8 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux-mx23.h | |||
@@ -0,0 +1,355 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> | ||
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_IOMUX_MX23_H__ | ||
14 | #define __MACH_IOMUX_MX23_H__ | ||
15 | |||
16 | #include <mach/iomux.h> | ||
17 | |||
18 | /* | ||
19 | * The naming convention for the pad modes is MX23_PAD_<padname>__<padmode> | ||
20 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num> | ||
21 | * See also iomux.h | ||
22 | * | ||
23 | * BANK PIN MUX | ||
24 | */ | ||
25 | /* MUXSEL_0 */ | ||
26 | #define MX23_PAD_GPMI_D00__GPMI_D00 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0) | ||
27 | #define MX23_PAD_GPMI_D01__GPMI_D01 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0) | ||
28 | #define MX23_PAD_GPMI_D02__GPMI_D02 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0) | ||
29 | #define MX23_PAD_GPMI_D03__GPMI_D03 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0) | ||
30 | #define MX23_PAD_GPMI_D04__GPMI_D04 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0) | ||
31 | #define MX23_PAD_GPMI_D05__GPMI_D05 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0) | ||
32 | #define MX23_PAD_GPMI_D06__GPMI_D06 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0) | ||
33 | #define MX23_PAD_GPMI_D07__GPMI_D07 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0) | ||
34 | #define MX23_PAD_GPMI_D08__GPMI_D08 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_0) | ||
35 | #define MX23_PAD_GPMI_D09__GPMI_D09 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_0) | ||
36 | #define MX23_PAD_GPMI_D10__GPMI_D10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_0) | ||
37 | #define MX23_PAD_GPMI_D11__GPMI_D11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_0) | ||
38 | #define MX23_PAD_GPMI_D12__GPMI_D12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_0) | ||
39 | #define MX23_PAD_GPMI_D13__GPMI_D13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_0) | ||
40 | #define MX23_PAD_GPMI_D14__GPMI_D14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_0) | ||
41 | #define MX23_PAD_GPMI_D15__GPMI_D15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_0) | ||
42 | #define MX23_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0) | ||
43 | #define MX23_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0) | ||
44 | #define MX23_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0) | ||
45 | #define MX23_PAD_GPMI_RDY0__GPMI_RDY0 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0) | ||
46 | #define MX23_PAD_GPMI_RDY1__GPMI_RDY1 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0) | ||
47 | #define MX23_PAD_GPMI_RDY2__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0) | ||
48 | #define MX23_PAD_GPMI_RDY3__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0) | ||
49 | #define MX23_PAD_GPMI_WPN__GPMI_WPN MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0) | ||
50 | #define MX23_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0) | ||
51 | #define MX23_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0) | ||
52 | #define MX23_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0) | ||
53 | #define MX23_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0) | ||
54 | #define MX23_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0) | ||
55 | #define MX23_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_0) | ||
56 | #define MX23_PAD_I2C_SCL__I2C_SCL MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_0) | ||
57 | #define MX23_PAD_I2C_SDA__I2C_SDA MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_0) | ||
58 | |||
59 | #define MX23_PAD_LCD_D00__LCD_D00 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0) | ||
60 | #define MX23_PAD_LCD_D01__LCD_D01 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0) | ||
61 | #define MX23_PAD_LCD_D02__LCD_D02 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0) | ||
62 | #define MX23_PAD_LCD_D03__LCD_D03 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0) | ||
63 | #define MX23_PAD_LCD_D04__LCD_D04 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0) | ||
64 | #define MX23_PAD_LCD_D05__LCD_D05 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0) | ||
65 | #define MX23_PAD_LCD_D06__LCD_D06 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0) | ||
66 | #define MX23_PAD_LCD_D07__LCD_D07 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0) | ||
67 | #define MX23_PAD_LCD_D08__LCD_D08 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0) | ||
68 | #define MX23_PAD_LCD_D09__LCD_D09 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0) | ||
69 | #define MX23_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0) | ||
70 | #define MX23_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0) | ||
71 | #define MX23_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0) | ||
72 | #define MX23_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0) | ||
73 | #define MX23_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0) | ||
74 | #define MX23_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0) | ||
75 | #define MX23_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0) | ||
76 | #define MX23_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0) | ||
77 | #define MX23_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0) | ||
78 | #define MX23_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0) | ||
79 | #define MX23_PAD_LCD_WR__LCD_WR MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0) | ||
80 | #define MX23_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0) | ||
81 | #define MX23_PAD_LCD_DOTCK__LCD_DOTCK MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0) | ||
82 | #define MX23_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0) | ||
83 | #define MX23_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0) | ||
84 | #define MX23_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0) | ||
85 | #define MX23_PAD_PWM0__PWM0 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0) | ||
86 | #define MX23_PAD_PWM1__PWM1 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0) | ||
87 | #define MX23_PAD_PWM2__PWM2 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0) | ||
88 | #define MX23_PAD_PWM3__PWM3 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0) | ||
89 | #define MX23_PAD_PWM4__PWM4 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0) | ||
90 | |||
91 | #define MX23_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0) | ||
92 | #define MX23_PAD_SSP1_DETECT__SSP1_DETECT MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0) | ||
93 | #define MX23_PAD_SSP1_DATA0__SSP1_DATA0 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0) | ||
94 | #define MX23_PAD_SSP1_DATA1__SSP1_DATA1 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0) | ||
95 | #define MX23_PAD_SSP1_DATA2__SSP1_DATA2 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0) | ||
96 | #define MX23_PAD_SSP1_DATA3__SSP1_DATA3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0) | ||
97 | #define MX23_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0) | ||
98 | #define MX23_PAD_ROTARYA__ROTARYA MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0) | ||
99 | #define MX23_PAD_ROTARYB__ROTARYB MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0) | ||
100 | #define MX23_PAD_EMI_A00__EMI_A00 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0) | ||
101 | #define MX23_PAD_EMI_A01__EMI_A01 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0) | ||
102 | #define MX23_PAD_EMI_A02__EMI_A02 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_0) | ||
103 | #define MX23_PAD_EMI_A03__EMI_A03 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0) | ||
104 | #define MX23_PAD_EMI_A04__EMI_A04 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0) | ||
105 | #define MX23_PAD_EMI_A05__EMI_A05 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0) | ||
106 | #define MX23_PAD_EMI_A06__EMI_A06 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0) | ||
107 | #define MX23_PAD_EMI_A07__EMI_A07 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0) | ||
108 | #define MX23_PAD_EMI_A08__EMI_A08 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0) | ||
109 | #define MX23_PAD_EMI_A09__EMI_A09 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0) | ||
110 | #define MX23_PAD_EMI_A10__EMI_A10 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0) | ||
111 | #define MX23_PAD_EMI_A11__EMI_A11 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0) | ||
112 | #define MX23_PAD_EMI_A12__EMI_A12 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0) | ||
113 | #define MX23_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_0) | ||
114 | #define MX23_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_0) | ||
115 | #define MX23_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0) | ||
116 | #define MX23_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0) | ||
117 | #define MX23_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0) | ||
118 | #define MX23_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0) | ||
119 | #define MX23_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_0) | ||
120 | #define MX23_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_0) | ||
121 | #define MX23_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_0) | ||
122 | #define MX23_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_0) | ||
123 | |||
124 | #define MX23_PAD_EMI_D00__EMI_D00 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0) | ||
125 | #define MX23_PAD_EMI_D01__EMI_D01 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0) | ||
126 | #define MX23_PAD_EMI_D02__EMI_D02 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0) | ||
127 | #define MX23_PAD_EMI_D03__EMI_D03 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0) | ||
128 | #define MX23_PAD_EMI_D04__EMI_D04 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0) | ||
129 | #define MX23_PAD_EMI_D05__EMI_D05 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0) | ||
130 | #define MX23_PAD_EMI_D06__EMI_D06 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0) | ||
131 | #define MX23_PAD_EMI_D07__EMI_D07 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0) | ||
132 | #define MX23_PAD_EMI_D08__EMI_D08 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0) | ||
133 | #define MX23_PAD_EMI_D09__EMI_D09 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0) | ||
134 | #define MX23_PAD_EMI_D10__EMI_D10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0) | ||
135 | #define MX23_PAD_EMI_D11__EMI_D11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0) | ||
136 | #define MX23_PAD_EMI_D12__EMI_D12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0) | ||
137 | #define MX23_PAD_EMI_D13__EMI_D13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0) | ||
138 | #define MX23_PAD_EMI_D14__EMI_D14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0) | ||
139 | #define MX23_PAD_EMI_D15__EMI_D15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0) | ||
140 | #define MX23_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0) | ||
141 | #define MX23_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0) | ||
142 | #define MX23_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0) | ||
143 | #define MX23_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(3, 19, PAD_MUXSEL_0) | ||
144 | #define MX23_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0) | ||
145 | #define MX23_PAD_EMI_CLKN__EMI_CLKN MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0) | ||
146 | |||
147 | /* MUXSEL_1 */ | ||
148 | #define MX23_PAD_GPMI_D00__LCD_D8 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1) | ||
149 | #define MX23_PAD_GPMI_D01__LCD_D9 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1) | ||
150 | #define MX23_PAD_GPMI_D02__LCD_D10 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1) | ||
151 | #define MX23_PAD_GPMI_D03__LCD_D11 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1) | ||
152 | #define MX23_PAD_GPMI_D04__LCD_D12 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1) | ||
153 | #define MX23_PAD_GPMI_D05__LCD_D13 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1) | ||
154 | #define MX23_PAD_GPMI_D06__LCD_D14 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1) | ||
155 | #define MX23_PAD_GPMI_D07__LCD_D15 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1) | ||
156 | #define MX23_PAD_GPMI_D08__LCD_D18 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_1) | ||
157 | #define MX23_PAD_GPMI_D09__LCD_D19 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_1) | ||
158 | #define MX23_PAD_GPMI_D10__LCD_D20 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_1) | ||
159 | #define MX23_PAD_GPMI_D11__LCD_D21 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_1) | ||
160 | #define MX23_PAD_GPMI_D12__LCD_D22 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_1) | ||
161 | #define MX23_PAD_GPMI_D13__LCD_D23 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_1) | ||
162 | #define MX23_PAD_GPMI_D14__AUART2_RX MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_1) | ||
163 | #define MX23_PAD_GPMI_D15__AUART2_TX MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_1) | ||
164 | #define MX23_PAD_GPMI_CLE__LCD_D16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1) | ||
165 | #define MX23_PAD_GPMI_ALE__LCD_D17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1) | ||
166 | #define MX23_PAD_GPMI_CE2N__ATA_A2 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1) | ||
167 | #define MX23_PAD_AUART1_RTS__IR_CLK MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1) | ||
168 | #define MX23_PAD_AUART1_RX__IR_RX MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1) | ||
169 | #define MX23_PAD_AUART1_TX__IR_TX MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_1) | ||
170 | #define MX23_PAD_I2C_SCL__GPMI_RDY2 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_1) | ||
171 | #define MX23_PAD_I2C_SDA__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_1) | ||
172 | |||
173 | #define MX23_PAD_LCD_D00__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_1) | ||
174 | #define MX23_PAD_LCD_D01__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_1) | ||
175 | #define MX23_PAD_LCD_D02__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_1) | ||
176 | #define MX23_PAD_LCD_D03__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1) | ||
177 | #define MX23_PAD_LCD_D04__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1) | ||
178 | #define MX23_PAD_LCD_D05__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_1) | ||
179 | #define MX23_PAD_LCD_D06__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_1) | ||
180 | #define MX23_PAD_LCD_D07__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_1) | ||
181 | #define MX23_PAD_LCD_D08__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1) | ||
182 | #define MX23_PAD_LCD_D09__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1) | ||
183 | #define MX23_PAD_LCD_D10__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_1) | ||
184 | #define MX23_PAD_LCD_D11__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_1) | ||
185 | #define MX23_PAD_LCD_D12__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_1) | ||
186 | #define MX23_PAD_LCD_D13__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_1) | ||
187 | #define MX23_PAD_LCD_D14__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_1) | ||
188 | #define MX23_PAD_LCD_D15__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_1) | ||
189 | #define MX23_PAD_LCD_RESET__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_1) | ||
190 | #define MX23_PAD_LCD_RS__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_1) | ||
191 | #define MX23_PAD_LCD_DOTCK__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1) | ||
192 | #define MX23_PAD_LCD_ENABLE__I2C_SCL MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1) | ||
193 | #define MX23_PAD_LCD_HSYNC__I2C_SDA MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1) | ||
194 | #define MX23_PAD_LCD_VSYNC__LCD_BUSY MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1) | ||
195 | #define MX23_PAD_PWM0__ROTARYA MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1) | ||
196 | #define MX23_PAD_PWM1__ROTARYB MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1) | ||
197 | #define MX23_PAD_PWM2__GPMI_RDY3 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1) | ||
198 | #define MX23_PAD_PWM3__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1) | ||
199 | #define MX23_PAD_PWM4__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1) | ||
200 | |||
201 | #define MX23_PAD_SSP1_DETECT__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_1) | ||
202 | #define MX23_PAD_SSP1_DATA1__I2C_SCL MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_1) | ||
203 | #define MX23_PAD_SSP1_DATA2__I2C_SDA MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1) | ||
204 | #define MX23_PAD_ROTARYA__AUART2_RTS MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1) | ||
205 | #define MX23_PAD_ROTARYB__AUART2_CTS MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_1) | ||
206 | |||
207 | /* MUXSEL_2 */ | ||
208 | #define MX23_PAD_GPMI_D00__SSP2_DATA0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_2) | ||
209 | #define MX23_PAD_GPMI_D01__SSP2_DATA1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_2) | ||
210 | #define MX23_PAD_GPMI_D02__SSP2_DATA2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_2) | ||
211 | #define MX23_PAD_GPMI_D03__SSP2_DATA3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_2) | ||
212 | #define MX23_PAD_GPMI_D04__SSP2_DATA4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_2) | ||
213 | #define MX23_PAD_GPMI_D05__SSP2_DATA5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_2) | ||
214 | #define MX23_PAD_GPMI_D06__SSP2_DATA6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_2) | ||
215 | #define MX23_PAD_GPMI_D07__SSP2_DATA7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_2) | ||
216 | #define MX23_PAD_GPMI_D08__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_2) | ||
217 | #define MX23_PAD_GPMI_D09__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_2) | ||
218 | #define MX23_PAD_GPMI_D10__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_2) | ||
219 | #define MX23_PAD_GPMI_D11__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_2) | ||
220 | #define MX23_PAD_GPMI_D15__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_2) | ||
221 | #define MX23_PAD_GPMI_RDY0__SSP2_DETECT MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2) | ||
222 | #define MX23_PAD_GPMI_RDY1__SSP2_CMD MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2) | ||
223 | #define MX23_PAD_GPMI_WRN__SSP2_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_2) | ||
224 | #define MX23_PAD_AUART1_CTS__SSP1_DATA4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2) | ||
225 | #define MX23_PAD_AUART1_RTS__SSP1_DATA5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2) | ||
226 | #define MX23_PAD_AUART1_RX__SSP1_DATA6 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_2) | ||
227 | #define MX23_PAD_AUART1_TX__SSP1_DATA7 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_2) | ||
228 | #define MX23_PAD_I2C_SCL__AUART1_TX MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_2) | ||
229 | #define MX23_PAD_I2C_SDA__AUART1_RX MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_2) | ||
230 | |||
231 | #define MX23_PAD_LCD_D08__SAIF2_SDATA0 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2) | ||
232 | #define MX23_PAD_LCD_D09__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2) | ||
233 | #define MX23_PAD_LCD_D10__SAIF_MCLK_BITCLK MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2) | ||
234 | #define MX23_PAD_LCD_D11__SAIF_LRCLK MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2) | ||
235 | #define MX23_PAD_LCD_D12__SAIF2_SDATA1 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2) | ||
236 | #define MX23_PAD_LCD_D13__SAIF2_SDATA2 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2) | ||
237 | #define MX23_PAD_LCD_D14__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2) | ||
238 | #define MX23_PAD_LCD_D15__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2) | ||
239 | #define MX23_PAD_LCD_D16__SAIF_ALT_BITCLK MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2) | ||
240 | #define MX23_PAD_LCD_RESET__GPMI_CE3N MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2) | ||
241 | #define MX23_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_2) | ||
242 | #define MX23_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_2) | ||
243 | #define MX23_PAD_PWM3__AUART1_CTS MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2) | ||
244 | #define MX23_PAD_PWM4__AUART1_RTS MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2) | ||
245 | |||
246 | #define MX23_PAD_SSP1_CMD__JTAG_TDO MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_2) | ||
247 | #define MX23_PAD_SSP1_DETECT__USB_OTG_ID MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_2) | ||
248 | #define MX23_PAD_SSP1_DATA0__JTAG_TDI MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_2) | ||
249 | #define MX23_PAD_SSP1_DATA1__JTAG_TCLK MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_2) | ||
250 | #define MX23_PAD_SSP1_DATA2__JTAG_RTCK MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_2) | ||
251 | #define MX23_PAD_SSP1_DATA3__JTAG_TMS MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_2) | ||
252 | #define MX23_PAD_SSP1_SCK__JTAG_TRST MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_2) | ||
253 | #define MX23_PAD_ROTARYA__SPDIF MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_2) | ||
254 | #define MX23_PAD_ROTARYB__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_2) | ||
255 | |||
256 | /* MUXSEL_GPIO */ | ||
257 | #define MX23_PAD_GPMI_D00__GPO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO) | ||
258 | #define MX23_PAD_GPMI_D01__GPO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO) | ||
259 | #define MX23_PAD_GPMI_D02__GPO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO) | ||
260 | #define MX23_PAD_GPMI_D03__GPO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO) | ||
261 | #define MX23_PAD_GPMI_D04__GPO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO) | ||
262 | #define MX23_PAD_GPMI_D05__GPO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO) | ||
263 | #define MX23_PAD_GPMI_D06__GPO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO) | ||
264 | #define MX23_PAD_GPMI_D07__GPO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO) | ||
265 | #define MX23_PAD_GPMI_D08__GPO_0_8 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_GPIO) | ||
266 | #define MX23_PAD_GPMI_D09__GPO_0_9 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_GPIO) | ||
267 | #define MX23_PAD_GPMI_D10__GPO_0_10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO) | ||
268 | #define MX23_PAD_GPMI_D11__GPO_0_11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO) | ||
269 | #define MX23_PAD_GPMI_D12__GPO_0_12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO) | ||
270 | #define MX23_PAD_GPMI_D13__GPO_0_13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO) | ||
271 | #define MX23_PAD_GPMI_D14__GPO_0_14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO) | ||
272 | #define MX23_PAD_GPMI_D15__GPO_0_15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO) | ||
273 | #define MX23_PAD_GPMI_CLE__GPO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO) | ||
274 | #define MX23_PAD_GPMI_ALE__GPO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO) | ||
275 | #define MX23_PAD_GPMI_CE2N__GPO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO) | ||
276 | #define MX23_PAD_GPMI_RDY0__GPO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO) | ||
277 | #define MX23_PAD_GPMI_RDY1__GPO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO) | ||
278 | #define MX23_PAD_GPMI_RDY2__GPO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO) | ||
279 | #define MX23_PAD_GPMI_RDY3__GPO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO) | ||
280 | #define MX23_PAD_GPMI_WPN__GPO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO) | ||
281 | #define MX23_PAD_GPMI_WRN__GPO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO) | ||
282 | #define MX23_PAD_GPMI_RDN__GPO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO) | ||
283 | #define MX23_PAD_AUART1_CTS__GPO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO) | ||
284 | #define MX23_PAD_AUART1_RTS__GPO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO) | ||
285 | #define MX23_PAD_AUART1_RX__GPO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO) | ||
286 | #define MX23_PAD_AUART1_TX__GPO_0_29 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO) | ||
287 | #define MX23_PAD_I2C_SCL__GPO_0_30 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO) | ||
288 | #define MX23_PAD_I2C_SDA__GPO_0_31 MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO) | ||
289 | |||
290 | #define MX23_PAD_LCD_D00__GPO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO) | ||
291 | #define MX23_PAD_LCD_D01__GPO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO) | ||
292 | #define MX23_PAD_LCD_D02__GPO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO) | ||
293 | #define MX23_PAD_LCD_D03__GPO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO) | ||
294 | #define MX23_PAD_LCD_D04__GPO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO) | ||
295 | #define MX23_PAD_LCD_D05__GPO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO) | ||
296 | #define MX23_PAD_LCD_D06__GPO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO) | ||
297 | #define MX23_PAD_LCD_D07__GPO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO) | ||
298 | #define MX23_PAD_LCD_D08__GPO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO) | ||
299 | #define MX23_PAD_LCD_D09__GPO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO) | ||
300 | #define MX23_PAD_LCD_D10__GPO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO) | ||
301 | #define MX23_PAD_LCD_D11__GPO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO) | ||
302 | #define MX23_PAD_LCD_D12__GPO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO) | ||
303 | #define MX23_PAD_LCD_D13__GPO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO) | ||
304 | #define MX23_PAD_LCD_D14__GPO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO) | ||
305 | #define MX23_PAD_LCD_D15__GPO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO) | ||
306 | #define MX23_PAD_LCD_D16__GPO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO) | ||
307 | #define MX23_PAD_LCD_D17__GPO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO) | ||
308 | #define MX23_PAD_LCD_RESET__GPO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO) | ||
309 | #define MX23_PAD_LCD_RS__GPO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO) | ||
310 | #define MX23_PAD_LCD_WR__GPO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO) | ||
311 | #define MX23_PAD_LCD_CS__GPO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO) | ||
312 | #define MX23_PAD_LCD_DOTCK__GPO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO) | ||
313 | #define MX23_PAD_LCD_ENABLE__GPO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO) | ||
314 | #define MX23_PAD_LCD_HSYNC__GPO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO) | ||
315 | #define MX23_PAD_LCD_VSYNC__GPO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO) | ||
316 | #define MX23_PAD_PWM0__GPO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO) | ||
317 | #define MX23_PAD_PWM1__GPO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO) | ||
318 | #define MX23_PAD_PWM2__GPO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO) | ||
319 | #define MX23_PAD_PWM3__GPO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO) | ||
320 | #define MX23_PAD_PWM4__GPO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO) | ||
321 | |||
322 | #define MX23_PAD_SSP1_CMD__GPO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO) | ||
323 | #define MX23_PAD_SSP1_DETECT__GPO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO) | ||
324 | #define MX23_PAD_SSP1_DATA0__GPO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO) | ||
325 | #define MX23_PAD_SSP1_DATA1__GPO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO) | ||
326 | #define MX23_PAD_SSP1_DATA2__GPO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO) | ||
327 | #define MX23_PAD_SSP1_DATA3__GPO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO) | ||
328 | #define MX23_PAD_SSP1_SCK__GPO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO) | ||
329 | #define MX23_PAD_ROTARYA__GPO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO) | ||
330 | #define MX23_PAD_ROTARYB__GPO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO) | ||
331 | #define MX23_PAD_EMI_A00__GPO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO) | ||
332 | #define MX23_PAD_EMI_A01__GPO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO) | ||
333 | #define MX23_PAD_EMI_A02__GPO_2_11 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO) | ||
334 | #define MX23_PAD_EMI_A03__GPO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO) | ||
335 | #define MX23_PAD_EMI_A04__GPO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO) | ||
336 | #define MX23_PAD_EMI_A05__GPO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO) | ||
337 | #define MX23_PAD_EMI_A06__GPO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO) | ||
338 | #define MX23_PAD_EMI_A07__GPO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO) | ||
339 | #define MX23_PAD_EMI_A08__GPO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO) | ||
340 | #define MX23_PAD_EMI_A09__GPO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO) | ||
341 | #define MX23_PAD_EMI_A10__GPO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO) | ||
342 | #define MX23_PAD_EMI_A11__GPO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO) | ||
343 | #define MX23_PAD_EMI_A12__GPO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO) | ||
344 | #define MX23_PAD_EMI_BA0__GPO_2_22 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO) | ||
345 | #define MX23_PAD_EMI_BA1__GPO_2_23 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO) | ||
346 | #define MX23_PAD_EMI_CASN__GPO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO) | ||
347 | #define MX23_PAD_EMI_CE0N__GPO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO) | ||
348 | #define MX23_PAD_EMI_CE1N__GPO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO) | ||
349 | #define MX23_PAD_GPMI_CE1N__GPO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO) | ||
350 | #define MX23_PAD_GPMI_CE0N__GPO_2_28 MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO) | ||
351 | #define MX23_PAD_EMI_CKE__GPO_2_29 MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO) | ||
352 | #define MX23_PAD_EMI_RASN__GPO_2_30 MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO) | ||
353 | #define MX23_PAD_EMI_WEN__GPO_2_31 MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO) | ||
354 | |||
355 | #endif /* __MACH_IOMUX_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx28.h b/arch/arm/mach-mxs/include/mach/iomux-mx28.h new file mode 100644 index 000000000000..f50fefd10520 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux-mx28.h | |||
@@ -0,0 +1,537 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> | ||
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_IOMUX_MX28_H__ | ||
14 | #define __MACH_IOMUX_MX28_H__ | ||
15 | |||
16 | #include <mach/iomux.h> | ||
17 | |||
18 | /* | ||
19 | * The naming convention for the pad modes is MX28_PAD_<padname>__<padmode> | ||
20 | * If <padname> or <padmode> refers to a GPIO, it is named GPIO_<unit>_<num> | ||
21 | * See also iomux.h | ||
22 | * | ||
23 | * BANK PIN MUX | ||
24 | */ | ||
25 | /* MUXSEL_0 */ | ||
26 | #define MX28_PAD_GPMI_D00__GPMI_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_0) | ||
27 | #define MX28_PAD_GPMI_D01__GPMI_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_0) | ||
28 | #define MX28_PAD_GPMI_D02__GPMI_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_0) | ||
29 | #define MX28_PAD_GPMI_D03__GPMI_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_0) | ||
30 | #define MX28_PAD_GPMI_D04__GPMI_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_0) | ||
31 | #define MX28_PAD_GPMI_D05__GPMI_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_0) | ||
32 | #define MX28_PAD_GPMI_D06__GPMI_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_0) | ||
33 | #define MX28_PAD_GPMI_D07__GPMI_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_0) | ||
34 | #define MX28_PAD_GPMI_CE0N__GPMI_CE0N MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_0) | ||
35 | #define MX28_PAD_GPMI_CE1N__GPMI_CE1N MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_0) | ||
36 | #define MX28_PAD_GPMI_CE2N__GPMI_CE2N MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_0) | ||
37 | #define MX28_PAD_GPMI_CE3N__GPMI_CE3N MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_0) | ||
38 | #define MX28_PAD_GPMI_RDY0__GPMI_READY0 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_0) | ||
39 | #define MX28_PAD_GPMI_RDY1__GPMI_READY1 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_0) | ||
40 | #define MX28_PAD_GPMI_RDY2__GPMI_READY2 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_0) | ||
41 | #define MX28_PAD_GPMI_RDY3__GPMI_READY3 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_0) | ||
42 | #define MX28_PAD_GPMI_RDN__GPMI_RDN MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_0) | ||
43 | #define MX28_PAD_GPMI_WRN__GPMI_WRN MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_0) | ||
44 | #define MX28_PAD_GPMI_ALE__GPMI_ALE MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_0) | ||
45 | #define MX28_PAD_GPMI_CLE__GPMI_CLE MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_0) | ||
46 | #define MX28_PAD_GPMI_RESETN__GPMI_RESETN MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_0) | ||
47 | |||
48 | #define MX28_PAD_LCD_D00__LCD_D0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_0) | ||
49 | #define MX28_PAD_LCD_D01__LCD_D1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_0) | ||
50 | #define MX28_PAD_LCD_D02__LCD_D2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_0) | ||
51 | #define MX28_PAD_LCD_D03__LCD_D3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_0) | ||
52 | #define MX28_PAD_LCD_D04__LCD_D4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_0) | ||
53 | #define MX28_PAD_LCD_D05__LCD_D5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_0) | ||
54 | #define MX28_PAD_LCD_D06__LCD_D6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_0) | ||
55 | #define MX28_PAD_LCD_D07__LCD_D7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_0) | ||
56 | #define MX28_PAD_LCD_D08__LCD_D8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_0) | ||
57 | #define MX28_PAD_LCD_D09__LCD_D9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_0) | ||
58 | #define MX28_PAD_LCD_D10__LCD_D10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_0) | ||
59 | #define MX28_PAD_LCD_D11__LCD_D11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_0) | ||
60 | #define MX28_PAD_LCD_D12__LCD_D12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_0) | ||
61 | #define MX28_PAD_LCD_D13__LCD_D13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_0) | ||
62 | #define MX28_PAD_LCD_D14__LCD_D14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_0) | ||
63 | #define MX28_PAD_LCD_D15__LCD_D15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_0) | ||
64 | #define MX28_PAD_LCD_D16__LCD_D16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_0) | ||
65 | #define MX28_PAD_LCD_D17__LCD_D17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_0) | ||
66 | #define MX28_PAD_LCD_D18__LCD_D18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_0) | ||
67 | #define MX28_PAD_LCD_D19__LCD_D19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_0) | ||
68 | #define MX28_PAD_LCD_D20__LCD_D20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_0) | ||
69 | #define MX28_PAD_LCD_D21__LCD_D21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_0) | ||
70 | #define MX28_PAD_LCD_D22__LCD_D22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_0) | ||
71 | #define MX28_PAD_LCD_D23__LCD_D23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_0) | ||
72 | #define MX28_PAD_LCD_RD_E__LCD_RD_E MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_0) | ||
73 | #define MX28_PAD_LCD_WR_RWN__LCD_WR_RWN MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_0) | ||
74 | #define MX28_PAD_LCD_RS__LCD_RS MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_0) | ||
75 | #define MX28_PAD_LCD_CS__LCD_CS MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_0) | ||
76 | #define MX28_PAD_LCD_VSYNC__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_0) | ||
77 | #define MX28_PAD_LCD_HSYNC__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_0) | ||
78 | #define MX28_PAD_LCD_DOTCLK__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_0) | ||
79 | #define MX28_PAD_LCD_ENABLE__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_0) | ||
80 | |||
81 | #define MX28_PAD_SSP0_DATA0__SSP0_D0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_0) | ||
82 | #define MX28_PAD_SSP0_DATA1__SSP0_D1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_0) | ||
83 | #define MX28_PAD_SSP0_DATA2__SSP0_D2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_0) | ||
84 | #define MX28_PAD_SSP0_DATA3__SSP0_D3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_0) | ||
85 | #define MX28_PAD_SSP0_DATA4__SSP0_D4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_0) | ||
86 | #define MX28_PAD_SSP0_DATA5__SSP0_D5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_0) | ||
87 | #define MX28_PAD_SSP0_DATA6__SSP0_D6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_0) | ||
88 | #define MX28_PAD_SSP0_DATA7__SSP0_D7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_0) | ||
89 | #define MX28_PAD_SSP0_CMD__SSP0_CMD MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_0) | ||
90 | #define MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_0) | ||
91 | #define MX28_PAD_SSP0_SCK__SSP0_SCK MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_0) | ||
92 | #define MX28_PAD_SSP1_SCK__SSP1_SCK MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_0) | ||
93 | #define MX28_PAD_SSP1_CMD__SSP1_CMD MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_0) | ||
94 | #define MX28_PAD_SSP1_DATA0__SSP1_D0 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_0) | ||
95 | #define MX28_PAD_SSP1_DATA3__SSP1_D3 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_0) | ||
96 | #define MX28_PAD_SSP2_SCK__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_0) | ||
97 | #define MX28_PAD_SSP2_MOSI__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_0) | ||
98 | #define MX28_PAD_SSP2_MISO__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_0) | ||
99 | #define MX28_PAD_SSP2_SS0__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_0) | ||
100 | #define MX28_PAD_SSP2_SS1__SSP2_D4 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_0) | ||
101 | #define MX28_PAD_SSP2_SS2__SSP2_D5 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_0) | ||
102 | #define MX28_PAD_SSP3_SCK__SSP3_SCK MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_0) | ||
103 | #define MX28_PAD_SSP3_MOSI__SSP3_CMD MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_0) | ||
104 | #define MX28_PAD_SSP3_MISO__SSP3_D0 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_0) | ||
105 | #define MX28_PAD_SSP3_SS0__SSP3_D3 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_0) | ||
106 | |||
107 | #define MX28_PAD_AUART0_RX__AUART0_RX MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_0) | ||
108 | #define MX28_PAD_AUART0_TX__AUART0_TX MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_0) | ||
109 | #define MX28_PAD_AUART0_CTS__AUART0_CTS MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_0) | ||
110 | #define MX28_PAD_AUART0_RTS__AUART0_RTS MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_0) | ||
111 | #define MX28_PAD_AUART1_RX__AUART1_RX MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_0) | ||
112 | #define MX28_PAD_AUART1_TX__AUART1_TX MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_0) | ||
113 | #define MX28_PAD_AUART1_CTS__AUART1_CTS MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_0) | ||
114 | #define MX28_PAD_AUART1_RTS__AUART1_RTS MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_0) | ||
115 | #define MX28_PAD_AUART2_RX__AUART2_RX MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_0) | ||
116 | #define MX28_PAD_AUART2_TX__AUART2_TX MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_0) | ||
117 | #define MX28_PAD_AUART2_CTS__AUART2_CTS MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_0) | ||
118 | #define MX28_PAD_AUART2_RTS__AUART2_RTS MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_0) | ||
119 | #define MX28_PAD_AUART3_RX__AUART3_RX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_0) | ||
120 | #define MX28_PAD_AUART3_TX__AUART3_TX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_0) | ||
121 | #define MX28_PAD_AUART3_CTS__AUART3_CTS MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_0) | ||
122 | #define MX28_PAD_AUART3_RTS__AUART3_RTS MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_0) | ||
123 | #define MX28_PAD_PWM0__PWM_0 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_0) | ||
124 | #define MX28_PAD_PWM1__PWM_1 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_0) | ||
125 | #define MX28_PAD_PWM2__PWM_2 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_0) | ||
126 | #define MX28_PAD_SAIF0_MCLK__SAIF0_MCLK MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_0) | ||
127 | #define MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_0) | ||
128 | #define MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_0) | ||
129 | #define MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_0) | ||
130 | #define MX28_PAD_I2C0_SCL__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_0) | ||
131 | #define MX28_PAD_I2C0_SDA__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_0) | ||
132 | #define MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_0) | ||
133 | #define MX28_PAD_SPDIF__SPDIF_TX MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_0) | ||
134 | #define MX28_PAD_PWM3__PWM_3 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_0) | ||
135 | #define MX28_PAD_PWM4__PWM_4 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_0) | ||
136 | #define MX28_PAD_LCD_RESET__LCD_RESET MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_0) | ||
137 | |||
138 | #define MX28_PAD_ENET0_MDC__ENET0_MDC MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_0) | ||
139 | #define MX28_PAD_ENET0_MDIO__ENET0_MDIO MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_0) | ||
140 | #define MX28_PAD_ENET0_RX_EN__ENET0_RX_EN MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_0) | ||
141 | #define MX28_PAD_ENET0_RXD0__ENET0_RXD0 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_0) | ||
142 | #define MX28_PAD_ENET0_RXD1__ENET0_RXD1 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_0) | ||
143 | #define MX28_PAD_ENET0_TX_CLK__ENET0_TX_CLK MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_0) | ||
144 | #define MX28_PAD_ENET0_TX_EN__ENET0_TX_EN MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_0) | ||
145 | #define MX28_PAD_ENET0_TXD0__ENET0_TXD0 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_0) | ||
146 | #define MX28_PAD_ENET0_TXD1__ENET0_TXD1 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_0) | ||
147 | #define MX28_PAD_ENET0_RXD2__ENET0_RXD2 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_0) | ||
148 | #define MX28_PAD_ENET0_RXD3__ENET0_RXD3 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_0) | ||
149 | #define MX28_PAD_ENET0_TXD2__ENET0_TXD2 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_0) | ||
150 | #define MX28_PAD_ENET0_TXD3__ENET0_TXD3 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_0) | ||
151 | #define MX28_PAD_ENET0_RX_CLK__ENET0_RX_CLK MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_0) | ||
152 | #define MX28_PAD_ENET0_COL__ENET0_COL MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_0) | ||
153 | #define MX28_PAD_ENET0_CRS__ENET0_CRS MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_0) | ||
154 | #define MX28_PAD_ENET_CLK__CLKCTRL_ENET MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_0) | ||
155 | #define MX28_PAD_JTAG_RTCK__JTAG_RTCK MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_0) | ||
156 | |||
157 | #define MX28_PAD_EMI_D00__EMI_DATA0 MXS_IOMUX_PAD_NAKED(5, 0, PAD_MUXSEL_0) | ||
158 | #define MX28_PAD_EMI_D01__EMI_DATA1 MXS_IOMUX_PAD_NAKED(5, 1, PAD_MUXSEL_0) | ||
159 | #define MX28_PAD_EMI_D02__EMI_DATA2 MXS_IOMUX_PAD_NAKED(5, 2, PAD_MUXSEL_0) | ||
160 | #define MX28_PAD_EMI_D03__EMI_DATA3 MXS_IOMUX_PAD_NAKED(5, 3, PAD_MUXSEL_0) | ||
161 | #define MX28_PAD_EMI_D04__EMI_DATA4 MXS_IOMUX_PAD_NAKED(5, 4, PAD_MUXSEL_0) | ||
162 | #define MX28_PAD_EMI_D05__EMI_DATA5 MXS_IOMUX_PAD_NAKED(5, 5, PAD_MUXSEL_0) | ||
163 | #define MX28_PAD_EMI_D06__EMI_DATA6 MXS_IOMUX_PAD_NAKED(5, 6, PAD_MUXSEL_0) | ||
164 | #define MX28_PAD_EMI_D07__EMI_DATA7 MXS_IOMUX_PAD_NAKED(5, 7, PAD_MUXSEL_0) | ||
165 | #define MX28_PAD_EMI_D08__EMI_DATA8 MXS_IOMUX_PAD_NAKED(5, 8, PAD_MUXSEL_0) | ||
166 | #define MX28_PAD_EMI_D09__EMI_DATA9 MXS_IOMUX_PAD_NAKED(5, 9, PAD_MUXSEL_0) | ||
167 | #define MX28_PAD_EMI_D10__EMI_DATA10 MXS_IOMUX_PAD_NAKED(5, 10, PAD_MUXSEL_0) | ||
168 | #define MX28_PAD_EMI_D11__EMI_DATA11 MXS_IOMUX_PAD_NAKED(5, 11, PAD_MUXSEL_0) | ||
169 | #define MX28_PAD_EMI_D12__EMI_DATA12 MXS_IOMUX_PAD_NAKED(5, 12, PAD_MUXSEL_0) | ||
170 | #define MX28_PAD_EMI_D13__EMI_DATA13 MXS_IOMUX_PAD_NAKED(5, 13, PAD_MUXSEL_0) | ||
171 | #define MX28_PAD_EMI_D14__EMI_DATA14 MXS_IOMUX_PAD_NAKED(5, 14, PAD_MUXSEL_0) | ||
172 | #define MX28_PAD_EMI_D15__EMI_DATA15 MXS_IOMUX_PAD_NAKED(5, 15, PAD_MUXSEL_0) | ||
173 | #define MX28_PAD_EMI_ODT0__EMI_ODT0 MXS_IOMUX_PAD_NAKED(5, 16, PAD_MUXSEL_0) | ||
174 | #define MX28_PAD_EMI_DQM0__EMI_DQM0 MXS_IOMUX_PAD_NAKED(5, 17, PAD_MUXSEL_0) | ||
175 | #define MX28_PAD_EMI_ODT1__EMI_ODT1 MXS_IOMUX_PAD_NAKED(5, 18, PAD_MUXSEL_0) | ||
176 | #define MX28_PAD_EMI_DQM1__EMI_DQM1 MXS_IOMUX_PAD_NAKED(5, 19, PAD_MUXSEL_0) | ||
177 | #define MX28_PAD_EMI_DDR_OPEN_FB__EMI_DDR_OPEN_FEEDBACK MXS_IOMUX_PAD_NAKED(5, 20, PAD_MUXSEL_0) | ||
178 | #define MX28_PAD_EMI_CLK__EMI_CLK MXS_IOMUX_PAD_NAKED(5, 21, PAD_MUXSEL_0) | ||
179 | #define MX28_PAD_EMI_DQS0__EMI_DQS0 MXS_IOMUX_PAD_NAKED(5, 22, PAD_MUXSEL_0) | ||
180 | #define MX28_PAD_EMI_DQS1__EMI_DQS1 MXS_IOMUX_PAD_NAKED(5, 23, PAD_MUXSEL_0) | ||
181 | #define MX28_PAD_EMI_DDR_OPEN__EMI_DDR_OPEN MXS_IOMUX_PAD_NAKED(5, 26, PAD_MUXSEL_0) | ||
182 | |||
183 | #define MX28_PAD_EMI_A00__EMI_ADDR0 MXS_IOMUX_PAD_NAKED(6, 0, PAD_MUXSEL_0) | ||
184 | #define MX28_PAD_EMI_A01__EMI_ADDR1 MXS_IOMUX_PAD_NAKED(6, 1, PAD_MUXSEL_0) | ||
185 | #define MX28_PAD_EMI_A02__EMI_ADDR2 MXS_IOMUX_PAD_NAKED(6, 2, PAD_MUXSEL_0) | ||
186 | #define MX28_PAD_EMI_A03__EMI_ADDR3 MXS_IOMUX_PAD_NAKED(6, 3, PAD_MUXSEL_0) | ||
187 | #define MX28_PAD_EMI_A04__EMI_ADDR4 MXS_IOMUX_PAD_NAKED(6, 4, PAD_MUXSEL_0) | ||
188 | #define MX28_PAD_EMI_A05__EMI_ADDR5 MXS_IOMUX_PAD_NAKED(6, 5, PAD_MUXSEL_0) | ||
189 | #define MX28_PAD_EMI_A06__EMI_ADDR6 MXS_IOMUX_PAD_NAKED(6, 6, PAD_MUXSEL_0) | ||
190 | #define MX28_PAD_EMI_A07__EMI_ADDR7 MXS_IOMUX_PAD_NAKED(6, 7, PAD_MUXSEL_0) | ||
191 | #define MX28_PAD_EMI_A08__EMI_ADDR8 MXS_IOMUX_PAD_NAKED(6, 8, PAD_MUXSEL_0) | ||
192 | #define MX28_PAD_EMI_A09__EMI_ADDR9 MXS_IOMUX_PAD_NAKED(6, 9, PAD_MUXSEL_0) | ||
193 | #define MX28_PAD_EMI_A10__EMI_ADDR10 MXS_IOMUX_PAD_NAKED(6, 10, PAD_MUXSEL_0) | ||
194 | #define MX28_PAD_EMI_A11__EMI_ADDR11 MXS_IOMUX_PAD_NAKED(6, 11, PAD_MUXSEL_0) | ||
195 | #define MX28_PAD_EMI_A12__EMI_ADDR12 MXS_IOMUX_PAD_NAKED(6, 12, PAD_MUXSEL_0) | ||
196 | #define MX28_PAD_EMI_A13__EMI_ADDR13 MXS_IOMUX_PAD_NAKED(6, 13, PAD_MUXSEL_0) | ||
197 | #define MX28_PAD_EMI_A14__EMI_ADDR14 MXS_IOMUX_PAD_NAKED(6, 14, PAD_MUXSEL_0) | ||
198 | #define MX28_PAD_EMI_BA0__EMI_BA0 MXS_IOMUX_PAD_NAKED(6, 16, PAD_MUXSEL_0) | ||
199 | #define MX28_PAD_EMI_BA1__EMI_BA1 MXS_IOMUX_PAD_NAKED(6, 17, PAD_MUXSEL_0) | ||
200 | #define MX28_PAD_EMI_BA2__EMI_BA2 MXS_IOMUX_PAD_NAKED(6, 18, PAD_MUXSEL_0) | ||
201 | #define MX28_PAD_EMI_CASN__EMI_CASN MXS_IOMUX_PAD_NAKED(6, 19, PAD_MUXSEL_0) | ||
202 | #define MX28_PAD_EMI_RASN__EMI_RASN MXS_IOMUX_PAD_NAKED(6, 20, PAD_MUXSEL_0) | ||
203 | #define MX28_PAD_EMI_WEN__EMI_WEN MXS_IOMUX_PAD_NAKED(6, 21, PAD_MUXSEL_0) | ||
204 | #define MX28_PAD_EMI_CE0N__EMI_CE0N MXS_IOMUX_PAD_NAKED(6, 22, PAD_MUXSEL_0) | ||
205 | #define MX28_PAD_EMI_CE1N__EMI_CE1N MXS_IOMUX_PAD_NAKED(6, 23, PAD_MUXSEL_0) | ||
206 | #define MX28_PAD_EMI_CKE__EMI_CKE MXS_IOMUX_PAD_NAKED(6, 24, PAD_MUXSEL_0) | ||
207 | |||
208 | /* MUXSEL_1 */ | ||
209 | #define MX28_PAD_GPMI_D00__SSP1_D0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_1) | ||
210 | #define MX28_PAD_GPMI_D01__SSP1_D1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_1) | ||
211 | #define MX28_PAD_GPMI_D02__SSP1_D2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_1) | ||
212 | #define MX28_PAD_GPMI_D03__SSP1_D3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_1) | ||
213 | #define MX28_PAD_GPMI_D04__SSP1_D4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_1) | ||
214 | #define MX28_PAD_GPMI_D05__SSP1_D5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_1) | ||
215 | #define MX28_PAD_GPMI_D06__SSP1_D6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_1) | ||
216 | #define MX28_PAD_GPMI_D07__SSP1_D7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_1) | ||
217 | #define MX28_PAD_GPMI_CE0N__SSP3_D0 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_1) | ||
218 | #define MX28_PAD_GPMI_CE1N__SSP3_D3 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_1) | ||
219 | #define MX28_PAD_GPMI_CE2N__CAN1_TX MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_1) | ||
220 | #define MX28_PAD_GPMI_CE3N__CAN1_RX MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_1) | ||
221 | #define MX28_PAD_GPMI_RDY0__SSP1_CARD_DETECT MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_1) | ||
222 | #define MX28_PAD_GPMI_RDY1__SSP1_CMD MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_1) | ||
223 | #define MX28_PAD_GPMI_RDY2__CAN0_TX MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_1) | ||
224 | #define MX28_PAD_GPMI_RDY3__CAN0_RX MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_1) | ||
225 | #define MX28_PAD_GPMI_RDN__SSP3_SCK MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_1) | ||
226 | #define MX28_PAD_GPMI_WRN__SSP1_SCK MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_1) | ||
227 | #define MX28_PAD_GPMI_ALE__SSP3_D1 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_1) | ||
228 | #define MX28_PAD_GPMI_CLE__SSP3_D2 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_1) | ||
229 | #define MX28_PAD_GPMI_RESETN__SSP3_CMD MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_1) | ||
230 | |||
231 | #define MX28_PAD_LCD_D03__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_1) | ||
232 | #define MX28_PAD_LCD_D04__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_1) | ||
233 | #define MX28_PAD_LCD_D08__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_1) | ||
234 | #define MX28_PAD_LCD_D09__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_1) | ||
235 | #define MX28_PAD_LCD_D20__ENET1_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_1) | ||
236 | #define MX28_PAD_LCD_D21__ENET1_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_1) | ||
237 | #define MX28_PAD_LCD_D22__ENET1_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_1) | ||
238 | #define MX28_PAD_LCD_D23__ENET1_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_1) | ||
239 | #define MX28_PAD_LCD_RD_E__LCD_VSYNC MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_1) | ||
240 | #define MX28_PAD_LCD_WR_RWN__LCD_HSYNC MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_1) | ||
241 | #define MX28_PAD_LCD_RS__LCD_DOTCLK MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_1) | ||
242 | #define MX28_PAD_LCD_CS__LCD_ENABLE MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_1) | ||
243 | #define MX28_PAD_LCD_VSYNC__SAIF1_SDATA0 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_1) | ||
244 | #define MX28_PAD_LCD_HSYNC__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_1) | ||
245 | #define MX28_PAD_LCD_DOTCLK__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_1) | ||
246 | |||
247 | #define MX28_PAD_SSP0_DATA4__SSP2_D0 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_1) | ||
248 | #define MX28_PAD_SSP0_DATA5__SSP2_D3 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_1) | ||
249 | #define MX28_PAD_SSP0_DATA6__SSP2_CMD MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_1) | ||
250 | #define MX28_PAD_SSP0_DATA7__SSP2_SCK MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_1) | ||
251 | #define MX28_PAD_SSP1_SCK__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_1) | ||
252 | #define MX28_PAD_SSP1_CMD__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_1) | ||
253 | #define MX28_PAD_SSP1_DATA0__SSP2_D6 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_1) | ||
254 | #define MX28_PAD_SSP1_DATA3__SSP2_D7 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_1) | ||
255 | #define MX28_PAD_SSP2_SCK__AUART2_RX MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_1) | ||
256 | #define MX28_PAD_SSP2_MOSI__AUART2_TX MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_1) | ||
257 | #define MX28_PAD_SSP2_MISO__AUART3_RX MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_1) | ||
258 | #define MX28_PAD_SSP2_SS0__AUART3_TX MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_1) | ||
259 | #define MX28_PAD_SSP2_SS1__SSP2_D1 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_1) | ||
260 | #define MX28_PAD_SSP2_SS2__SSP2_D2 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_1) | ||
261 | #define MX28_PAD_SSP3_SCK__AUART4_TX MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_1) | ||
262 | #define MX28_PAD_SSP3_MOSI__AUART4_RX MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_1) | ||
263 | #define MX28_PAD_SSP3_MISO__AUART4_RTS MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_1) | ||
264 | #define MX28_PAD_SSP3_SS0__AUART4_CTS MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_1) | ||
265 | |||
266 | #define MX28_PAD_AUART0_RX__I2C0_SCL MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_1) | ||
267 | #define MX28_PAD_AUART0_TX__I2C0_SDA MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_1) | ||
268 | #define MX28_PAD_AUART0_CTS__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_1) | ||
269 | #define MX28_PAD_AUART0_RTS__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_1) | ||
270 | #define MX28_PAD_AUART1_RX__SSP2_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_1) | ||
271 | #define MX28_PAD_AUART1_TX__SSP3_CARD_DETECT MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_1) | ||
272 | #define MX28_PAD_AUART1_CTS__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_1) | ||
273 | #define MX28_PAD_AUART1_RTS__USB0_ID MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_1) | ||
274 | #define MX28_PAD_AUART2_RX__SSP3_D1 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_1) | ||
275 | #define MX28_PAD_AUART2_TX__SSP3_D2 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_1) | ||
276 | #define MX28_PAD_AUART2_CTS__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_1) | ||
277 | #define MX28_PAD_AUART2_RTS__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_1) | ||
278 | #define MX28_PAD_AUART3_RX__CAN0_TX MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_1) | ||
279 | #define MX28_PAD_AUART3_TX__CAN0_RX MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_1) | ||
280 | #define MX28_PAD_AUART3_CTS__CAN1_TX MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_1) | ||
281 | #define MX28_PAD_AUART3_RTS__CAN1_RX MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_1) | ||
282 | #define MX28_PAD_PWM0__I2C1_SCL MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_1) | ||
283 | #define MX28_PAD_PWM1__I2C1_SDA MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_1) | ||
284 | #define MX28_PAD_PWM2__USB0_ID MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_1) | ||
285 | #define MX28_PAD_SAIF0_MCLK__PWM_3 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_1) | ||
286 | #define MX28_PAD_SAIF0_LRCLK__PWM_4 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_1) | ||
287 | #define MX28_PAD_SAIF0_BITCLK__PWM_5 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_1) | ||
288 | #define MX28_PAD_SAIF0_SDATA0__PWM_6 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_1) | ||
289 | #define MX28_PAD_I2C0_SCL__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_1) | ||
290 | #define MX28_PAD_I2C0_SDA__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_1) | ||
291 | #define MX28_PAD_SAIF1_SDATA0__PWM_7 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_1) | ||
292 | #define MX28_PAD_LCD_RESET__LCD_VSYNC MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_1) | ||
293 | |||
294 | #define MX28_PAD_ENET0_MDC__GPMI_CE4N MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_1) | ||
295 | #define MX28_PAD_ENET0_MDIO__GPMI_CE5N MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_1) | ||
296 | #define MX28_PAD_ENET0_RX_EN__GPMI_CE6N MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_1) | ||
297 | #define MX28_PAD_ENET0_RXD0__GPMI_CE7N MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_1) | ||
298 | #define MX28_PAD_ENET0_RXD1__GPMI_READY4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_1) | ||
299 | #define MX28_PAD_ENET0_TX_CLK__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_1) | ||
300 | #define MX28_PAD_ENET0_TX_EN__GPMI_READY5 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_1) | ||
301 | #define MX28_PAD_ENET0_TXD0__GPMI_READY6 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_1) | ||
302 | #define MX28_PAD_ENET0_TXD1__GPMI_READY7 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_1) | ||
303 | #define MX28_PAD_ENET0_RXD2__ENET1_RXD0 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_1) | ||
304 | #define MX28_PAD_ENET0_RXD3__ENET1_RXD1 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_1) | ||
305 | #define MX28_PAD_ENET0_TXD2__ENET1_TXD0 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_1) | ||
306 | #define MX28_PAD_ENET0_TXD3__ENET1_TXD1 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_1) | ||
307 | #define MX28_PAD_ENET0_RX_CLK__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_1) | ||
308 | #define MX28_PAD_ENET0_COL__ENET1_TX_EN MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_1) | ||
309 | #define MX28_PAD_ENET0_CRS__ENET1_RX_EN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_1) | ||
310 | |||
311 | /* MUXSEL_2 */ | ||
312 | #define MX28_PAD_GPMI_CE2N__ENET0_RX_ER MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_2) | ||
313 | #define MX28_PAD_GPMI_CE3N__SAIF1_MCLK MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_2) | ||
314 | #define MX28_PAD_GPMI_RDY0__USB0_ID MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_2) | ||
315 | #define MX28_PAD_GPMI_RDY2__ENET0_TX_ER MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_2) | ||
316 | #define MX28_PAD_GPMI_RDY3__HSADC_TRIGGER MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_2) | ||
317 | #define MX28_PAD_GPMI_ALE__SSP3_D4 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_2) | ||
318 | #define MX28_PAD_GPMI_CLE__SSP3_D5 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_2) | ||
319 | |||
320 | #define MX28_PAD_LCD_D00__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_2) | ||
321 | #define MX28_PAD_LCD_D01__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_2) | ||
322 | #define MX28_PAD_LCD_D02__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_2) | ||
323 | #define MX28_PAD_LCD_D03__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_2) | ||
324 | #define MX28_PAD_LCD_D04__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_2) | ||
325 | #define MX28_PAD_LCD_D05__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_2) | ||
326 | #define MX28_PAD_LCD_D06__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_2) | ||
327 | #define MX28_PAD_LCD_D07__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_2) | ||
328 | #define MX28_PAD_LCD_D08__ETM_DA8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_2) | ||
329 | #define MX28_PAD_LCD_D09__ETM_DA9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_2) | ||
330 | #define MX28_PAD_LCD_D10__ETM_DA10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_2) | ||
331 | #define MX28_PAD_LCD_D11__ETM_DA11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_2) | ||
332 | #define MX28_PAD_LCD_D12__ETM_DA12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_2) | ||
333 | #define MX28_PAD_LCD_D13__ETM_DA13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_2) | ||
334 | #define MX28_PAD_LCD_D14__ETM_DA14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_2) | ||
335 | #define MX28_PAD_LCD_D15__ETM_DA15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_2) | ||
336 | #define MX28_PAD_LCD_D16__ETM_DA7 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_2) | ||
337 | #define MX28_PAD_LCD_D17__ETM_DA6 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_2) | ||
338 | #define MX28_PAD_LCD_D18__ETM_DA5 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_2) | ||
339 | #define MX28_PAD_LCD_D19__ETM_DA4 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_2) | ||
340 | #define MX28_PAD_LCD_D20__ETM_DA3 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_2) | ||
341 | #define MX28_PAD_LCD_D21__ETM_DA2 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_2) | ||
342 | #define MX28_PAD_LCD_D22__ETM_DA1 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_2) | ||
343 | #define MX28_PAD_LCD_D23__ETM_DA0 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_2) | ||
344 | #define MX28_PAD_LCD_RD_E__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_2) | ||
345 | #define MX28_PAD_LCD_WR_RWN__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_2) | ||
346 | #define MX28_PAD_LCD_HSYNC__ETM_TCTL MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_2) | ||
347 | #define MX28_PAD_LCD_DOTCLK__ETM_TCLK MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_2) | ||
348 | |||
349 | #define MX28_PAD_SSP1_SCK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_2) | ||
350 | #define MX28_PAD_SSP1_CMD__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_2) | ||
351 | #define MX28_PAD_SSP1_DATA0__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_2) | ||
352 | #define MX28_PAD_SSP1_DATA3__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_2) | ||
353 | #define MX28_PAD_SSP2_SCK__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_2) | ||
354 | #define MX28_PAD_SSP2_MOSI__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_2) | ||
355 | #define MX28_PAD_SSP2_MISO__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_2) | ||
356 | #define MX28_PAD_SSP2_SS0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_2) | ||
357 | #define MX28_PAD_SSP2_SS1__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_2) | ||
358 | #define MX28_PAD_SSP2_SS2__USB0_OVERCURRENT MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_2) | ||
359 | #define MX28_PAD_SSP3_SCK__ENET1_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_2) | ||
360 | #define MX28_PAD_SSP3_MOSI__ENET1_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_2) | ||
361 | #define MX28_PAD_SSP3_MISO__ENET1_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_2) | ||
362 | #define MX28_PAD_SSP3_SS0__ENET1_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_2) | ||
363 | |||
364 | #define MX28_PAD_AUART0_RX__DUART_CTS MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_2) | ||
365 | #define MX28_PAD_AUART0_TX__DUART_RTS MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_2) | ||
366 | #define MX28_PAD_AUART0_CTS__DUART_RX MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_2) | ||
367 | #define MX28_PAD_AUART0_RTS__DUART_TX MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_2) | ||
368 | #define MX28_PAD_AUART1_RX__PWM_0 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_2) | ||
369 | #define MX28_PAD_AUART1_TX__PWM_1 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_2) | ||
370 | #define MX28_PAD_AUART1_CTS__TIMROT_ROTARYA MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_2) | ||
371 | #define MX28_PAD_AUART1_RTS__TIMROT_ROTARYB MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_2) | ||
372 | #define MX28_PAD_AUART2_RX__SSP3_D4 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_2) | ||
373 | #define MX28_PAD_AUART2_TX__SSP3_D5 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_2) | ||
374 | #define MX28_PAD_AUART2_CTS__SAIF1_BITCLK MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_2) | ||
375 | #define MX28_PAD_AUART2_RTS__SAIF1_LRCLK MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_2) | ||
376 | #define MX28_PAD_AUART3_RX__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_2) | ||
377 | #define MX28_PAD_AUART3_TX__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_2) | ||
378 | #define MX28_PAD_AUART3_CTS__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_2) | ||
379 | #define MX28_PAD_AUART3_RTS__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_2) | ||
380 | #define MX28_PAD_PWM0__DUART_RX MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_2) | ||
381 | #define MX28_PAD_PWM1__DUART_TX MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_2) | ||
382 | #define MX28_PAD_PWM2__USB1_OVERCURRENT MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_2) | ||
383 | #define MX28_PAD_SAIF0_MCLK__AUART4_CTS MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_2) | ||
384 | #define MX28_PAD_SAIF0_LRCLK__AUART4_RTS MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_2) | ||
385 | #define MX28_PAD_SAIF0_BITCLK__AUART4_RX MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_2) | ||
386 | #define MX28_PAD_SAIF0_SDATA0__AUART4_TX MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_2) | ||
387 | #define MX28_PAD_I2C0_SCL__DUART_RX MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_2) | ||
388 | #define MX28_PAD_I2C0_SDA__DUART_TX MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_2) | ||
389 | #define MX28_PAD_SAIF1_SDATA0__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_2) | ||
390 | #define MX28_PAD_SPDIF__ENET1_RX_ER MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_2) | ||
391 | |||
392 | #define MX28_PAD_ENET0_MDC__SAIF0_SDATA1 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_2) | ||
393 | #define MX28_PAD_ENET0_MDIO__SAIF0_SDATA2 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_2) | ||
394 | #define MX28_PAD_ENET0_RX_EN__SAIF1_SDATA1 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_2) | ||
395 | #define MX28_PAD_ENET0_RXD0__SAIF1_SDATA2 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_2) | ||
396 | #define MX28_PAD_ENET0_TX_CLK__ENET0_1588_EVENT2_OUT MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_2) | ||
397 | #define MX28_PAD_ENET0_RXD2__ENET0_1588_EVENT0_OUT MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_2) | ||
398 | #define MX28_PAD_ENET0_RXD3__ENET0_1588_EVENT0_IN MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_2) | ||
399 | #define MX28_PAD_ENET0_TXD2__ENET0_1588_EVENT1_OUT MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_2) | ||
400 | #define MX28_PAD_ENET0_TXD3__ENET0_1588_EVENT1_IN MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_2) | ||
401 | #define MX28_PAD_ENET0_RX_CLK__ENET0_1588_EVENT2_IN MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_2) | ||
402 | #define MX28_PAD_ENET0_COL__ENET0_1588_EVENT3_OUT MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_2) | ||
403 | #define MX28_PAD_ENET0_CRS__ENET0_1588_EVENT3_IN MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_2) | ||
404 | |||
405 | /* MUXSEL_GPIO */ | ||
406 | #define MX28_PAD_GPMI_D00__GPIO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO) | ||
407 | #define MX28_PAD_GPMI_D01__GPIO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO) | ||
408 | #define MX28_PAD_GPMI_D02__GPIO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO) | ||
409 | #define MX28_PAD_GPMI_D03__GPIO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO) | ||
410 | #define MX28_PAD_GPMI_D04__GPIO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO) | ||
411 | #define MX28_PAD_GPMI_D05__GPIO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO) | ||
412 | #define MX28_PAD_GPMI_D06__GPIO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO) | ||
413 | #define MX28_PAD_GPMI_D07__GPIO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO) | ||
414 | #define MX28_PAD_GPMI_CE0N__GPIO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO) | ||
415 | #define MX28_PAD_GPMI_CE1N__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO) | ||
416 | #define MX28_PAD_GPMI_CE2N__GPIO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO) | ||
417 | #define MX28_PAD_GPMI_CE3N__GPIO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO) | ||
418 | #define MX28_PAD_GPMI_RDY0__GPIO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO) | ||
419 | #define MX28_PAD_GPMI_RDY1__GPIO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO) | ||
420 | #define MX28_PAD_GPMI_RDY2__GPIO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO) | ||
421 | #define MX28_PAD_GPMI_RDY3__GPIO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO) | ||
422 | #define MX28_PAD_GPMI_RDN__GPIO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO) | ||
423 | #define MX28_PAD_GPMI_WRN__GPIO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO) | ||
424 | #define MX28_PAD_GPMI_ALE__GPIO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO) | ||
425 | #define MX28_PAD_GPMI_CLE__GPIO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO) | ||
426 | #define MX28_PAD_GPMI_RESETN__GPIO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO) | ||
427 | |||
428 | #define MX28_PAD_LCD_D00__GPIO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO) | ||
429 | #define MX28_PAD_LCD_D01__GPIO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO) | ||
430 | #define MX28_PAD_LCD_D02__GPIO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO) | ||
431 | #define MX28_PAD_LCD_D03__GPIO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO) | ||
432 | #define MX28_PAD_LCD_D04__GPIO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO) | ||
433 | #define MX28_PAD_LCD_D05__GPIO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO) | ||
434 | #define MX28_PAD_LCD_D06__GPIO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO) | ||
435 | #define MX28_PAD_LCD_D07__GPIO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO) | ||
436 | #define MX28_PAD_LCD_D08__GPIO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO) | ||
437 | #define MX28_PAD_LCD_D09__GPIO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO) | ||
438 | #define MX28_PAD_LCD_D10__GPIO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO) | ||
439 | #define MX28_PAD_LCD_D11__GPIO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO) | ||
440 | #define MX28_PAD_LCD_D12__GPIO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO) | ||
441 | #define MX28_PAD_LCD_D13__GPIO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO) | ||
442 | #define MX28_PAD_LCD_D14__GPIO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO) | ||
443 | #define MX28_PAD_LCD_D15__GPIO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO) | ||
444 | #define MX28_PAD_LCD_D16__GPIO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO) | ||
445 | #define MX28_PAD_LCD_D17__GPIO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO) | ||
446 | #define MX28_PAD_LCD_D18__GPIO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO) | ||
447 | #define MX28_PAD_LCD_D19__GPIO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO) | ||
448 | #define MX28_PAD_LCD_D20__GPIO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO) | ||
449 | #define MX28_PAD_LCD_D21__GPIO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO) | ||
450 | #define MX28_PAD_LCD_D22__GPIO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO) | ||
451 | #define MX28_PAD_LCD_D23__GPIO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO) | ||
452 | #define MX28_PAD_LCD_RD_E__GPIO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO) | ||
453 | #define MX28_PAD_LCD_WR_RWN__GPIO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO) | ||
454 | #define MX28_PAD_LCD_RS__GPIO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO) | ||
455 | #define MX28_PAD_LCD_CS__GPIO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO) | ||
456 | #define MX28_PAD_LCD_VSYNC__GPIO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO) | ||
457 | #define MX28_PAD_LCD_HSYNC__GPIO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO) | ||
458 | #define MX28_PAD_LCD_DOTCLK__GPIO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO) | ||
459 | #define MX28_PAD_LCD_ENABLE__GPIO_1_31 MXS_IOMUX_PAD_NAKED(1, 31, PAD_MUXSEL_GPIO) | ||
460 | |||
461 | #define MX28_PAD_SSP0_DATA0__GPIO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO) | ||
462 | #define MX28_PAD_SSP0_DATA1__GPIO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO) | ||
463 | #define MX28_PAD_SSP0_DATA2__GPIO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO) | ||
464 | #define MX28_PAD_SSP0_DATA3__GPIO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO) | ||
465 | #define MX28_PAD_SSP0_DATA4__GPIO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO) | ||
466 | #define MX28_PAD_SSP0_DATA5__GPIO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO) | ||
467 | #define MX28_PAD_SSP0_DATA6__GPIO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO) | ||
468 | #define MX28_PAD_SSP0_DATA7__GPIO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO) | ||
469 | #define MX28_PAD_SSP0_CMD__GPIO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO) | ||
470 | #define MX28_PAD_SSP0_DETECT__GPIO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO) | ||
471 | #define MX28_PAD_SSP0_SCK__GPIO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO) | ||
472 | #define MX28_PAD_SSP1_SCK__GPIO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO) | ||
473 | #define MX28_PAD_SSP1_CMD__GPIO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO) | ||
474 | #define MX28_PAD_SSP1_DATA0__GPIO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO) | ||
475 | #define MX28_PAD_SSP1_DATA3__GPIO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO) | ||
476 | #define MX28_PAD_SSP2_SCK__GPIO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO) | ||
477 | #define MX28_PAD_SSP2_MOSI__GPIO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO) | ||
478 | #define MX28_PAD_SSP2_MISO__GPIO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO) | ||
479 | #define MX28_PAD_SSP2_SS0__GPIO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO) | ||
480 | #define MX28_PAD_SSP2_SS1__GPIO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO) | ||
481 | #define MX28_PAD_SSP2_SS2__GPIO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO) | ||
482 | #define MX28_PAD_SSP3_SCK__GPIO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO) | ||
483 | #define MX28_PAD_SSP3_MOSI__GPIO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO) | ||
484 | #define MX28_PAD_SSP3_MISO__GPIO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO) | ||
485 | #define MX28_PAD_SSP3_SS0__GPIO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO) | ||
486 | |||
487 | #define MX28_PAD_AUART0_RX__GPIO_3_0 MXS_IOMUX_PAD_NAKED(3, 0, PAD_MUXSEL_GPIO) | ||
488 | #define MX28_PAD_AUART0_TX__GPIO_3_1 MXS_IOMUX_PAD_NAKED(3, 1, PAD_MUXSEL_GPIO) | ||
489 | #define MX28_PAD_AUART0_CTS__GPIO_3_2 MXS_IOMUX_PAD_NAKED(3, 2, PAD_MUXSEL_GPIO) | ||
490 | #define MX28_PAD_AUART0_RTS__GPIO_3_3 MXS_IOMUX_PAD_NAKED(3, 3, PAD_MUXSEL_GPIO) | ||
491 | #define MX28_PAD_AUART1_RX__GPIO_3_4 MXS_IOMUX_PAD_NAKED(3, 4, PAD_MUXSEL_GPIO) | ||
492 | #define MX28_PAD_AUART1_TX__GPIO_3_5 MXS_IOMUX_PAD_NAKED(3, 5, PAD_MUXSEL_GPIO) | ||
493 | #define MX28_PAD_AUART1_CTS__GPIO_3_6 MXS_IOMUX_PAD_NAKED(3, 6, PAD_MUXSEL_GPIO) | ||
494 | #define MX28_PAD_AUART1_RTS__GPIO_3_7 MXS_IOMUX_PAD_NAKED(3, 7, PAD_MUXSEL_GPIO) | ||
495 | #define MX28_PAD_AUART2_RX__GPIO_3_8 MXS_IOMUX_PAD_NAKED(3, 8, PAD_MUXSEL_GPIO) | ||
496 | #define MX28_PAD_AUART2_TX__GPIO_3_9 MXS_IOMUX_PAD_NAKED(3, 9, PAD_MUXSEL_GPIO) | ||
497 | #define MX28_PAD_AUART2_CTS__GPIO_3_10 MXS_IOMUX_PAD_NAKED(3, 10, PAD_MUXSEL_GPIO) | ||
498 | #define MX28_PAD_AUART2_RTS__GPIO_3_11 MXS_IOMUX_PAD_NAKED(3, 11, PAD_MUXSEL_GPIO) | ||
499 | #define MX28_PAD_AUART3_RX__GPIO_3_12 MXS_IOMUX_PAD_NAKED(3, 12, PAD_MUXSEL_GPIO) | ||
500 | #define MX28_PAD_AUART3_TX__GPIO_3_13 MXS_IOMUX_PAD_NAKED(3, 13, PAD_MUXSEL_GPIO) | ||
501 | #define MX28_PAD_AUART3_CTS__GPIO_3_14 MXS_IOMUX_PAD_NAKED(3, 14, PAD_MUXSEL_GPIO) | ||
502 | #define MX28_PAD_AUART3_RTS__GPIO_3_15 MXS_IOMUX_PAD_NAKED(3, 15, PAD_MUXSEL_GPIO) | ||
503 | #define MX28_PAD_PWM0__GPIO_3_16 MXS_IOMUX_PAD_NAKED(3, 16, PAD_MUXSEL_GPIO) | ||
504 | #define MX28_PAD_PWM1__GPIO_3_17 MXS_IOMUX_PAD_NAKED(3, 17, PAD_MUXSEL_GPIO) | ||
505 | #define MX28_PAD_PWM2__GPIO_3_18 MXS_IOMUX_PAD_NAKED(3, 18, PAD_MUXSEL_GPIO) | ||
506 | #define MX28_PAD_SAIF0_MCLK__GPIO_3_20 MXS_IOMUX_PAD_NAKED(3, 20, PAD_MUXSEL_GPIO) | ||
507 | #define MX28_PAD_SAIF0_LRCLK__GPIO_3_21 MXS_IOMUX_PAD_NAKED(3, 21, PAD_MUXSEL_GPIO) | ||
508 | #define MX28_PAD_SAIF0_BITCLK__GPIO_3_22 MXS_IOMUX_PAD_NAKED(3, 22, PAD_MUXSEL_GPIO) | ||
509 | #define MX28_PAD_SAIF0_SDATA0__GPIO_3_23 MXS_IOMUX_PAD_NAKED(3, 23, PAD_MUXSEL_GPIO) | ||
510 | #define MX28_PAD_I2C0_SCL__GPIO_3_24 MXS_IOMUX_PAD_NAKED(3, 24, PAD_MUXSEL_GPIO) | ||
511 | #define MX28_PAD_I2C0_SDA__GPIO_3_25 MXS_IOMUX_PAD_NAKED(3, 25, PAD_MUXSEL_GPIO) | ||
512 | #define MX28_PAD_SAIF1_SDATA0__GPIO_3_26 MXS_IOMUX_PAD_NAKED(3, 26, PAD_MUXSEL_GPIO) | ||
513 | #define MX28_PAD_SPDIF__GPIO_3_27 MXS_IOMUX_PAD_NAKED(3, 27, PAD_MUXSEL_GPIO) | ||
514 | #define MX28_PAD_PWM3__GPIO_3_28 MXS_IOMUX_PAD_NAKED(3, 28, PAD_MUXSEL_GPIO) | ||
515 | #define MX28_PAD_PWM4__GPIO_3_29 MXS_IOMUX_PAD_NAKED(3, 29, PAD_MUXSEL_GPIO) | ||
516 | #define MX28_PAD_LCD_RESET__GPIO_3_30 MXS_IOMUX_PAD_NAKED(3, 30, PAD_MUXSEL_GPIO) | ||
517 | |||
518 | #define MX28_PAD_ENET0_MDC__GPIO_4_0 MXS_IOMUX_PAD_NAKED(4, 0, PAD_MUXSEL_GPIO) | ||
519 | #define MX28_PAD_ENET0_MDIO__GPIO_4_1 MXS_IOMUX_PAD_NAKED(4, 1, PAD_MUXSEL_GPIO) | ||
520 | #define MX28_PAD_ENET0_RX_EN__GPIO_4_2 MXS_IOMUX_PAD_NAKED(4, 2, PAD_MUXSEL_GPIO) | ||
521 | #define MX28_PAD_ENET0_RXD0__GPIO_4_3 MXS_IOMUX_PAD_NAKED(4, 3, PAD_MUXSEL_GPIO) | ||
522 | #define MX28_PAD_ENET0_RXD1__GPIO_4_4 MXS_IOMUX_PAD_NAKED(4, 4, PAD_MUXSEL_GPIO) | ||
523 | #define MX28_PAD_ENET0_TX_CLK__GPIO_4_5 MXS_IOMUX_PAD_NAKED(4, 5, PAD_MUXSEL_GPIO) | ||
524 | #define MX28_PAD_ENET0_TX_EN__GPIO_4_6 MXS_IOMUX_PAD_NAKED(4, 6, PAD_MUXSEL_GPIO) | ||
525 | #define MX28_PAD_ENET0_TXD0__GPIO_4_7 MXS_IOMUX_PAD_NAKED(4, 7, PAD_MUXSEL_GPIO) | ||
526 | #define MX28_PAD_ENET0_TXD1__GPIO_4_8 MXS_IOMUX_PAD_NAKED(4, 8, PAD_MUXSEL_GPIO) | ||
527 | #define MX28_PAD_ENET0_RXD2__GPIO_4_9 MXS_IOMUX_PAD_NAKED(4, 9, PAD_MUXSEL_GPIO) | ||
528 | #define MX28_PAD_ENET0_RXD3__GPIO_4_10 MXS_IOMUX_PAD_NAKED(4, 10, PAD_MUXSEL_GPIO) | ||
529 | #define MX28_PAD_ENET0_TXD2__GPIO_4_11 MXS_IOMUX_PAD_NAKED(4, 11, PAD_MUXSEL_GPIO) | ||
530 | #define MX28_PAD_ENET0_TXD3__GPIO_4_12 MXS_IOMUX_PAD_NAKED(4, 12, PAD_MUXSEL_GPIO) | ||
531 | #define MX28_PAD_ENET0_RX_CLK__GPIO_4_13 MXS_IOMUX_PAD_NAKED(4, 13, PAD_MUXSEL_GPIO) | ||
532 | #define MX28_PAD_ENET0_COL__GPIO_4_14 MXS_IOMUX_PAD_NAKED(4, 14, PAD_MUXSEL_GPIO) | ||
533 | #define MX28_PAD_ENET0_CRS__GPIO_4_15 MXS_IOMUX_PAD_NAKED(4, 15, PAD_MUXSEL_GPIO) | ||
534 | #define MX28_PAD_ENET_CLK__GPIO_4_16 MXS_IOMUX_PAD_NAKED(4, 16, PAD_MUXSEL_GPIO) | ||
535 | #define MX28_PAD_JTAG_RTCK__GPIO_4_20 MXS_IOMUX_PAD_NAKED(4, 20, PAD_MUXSEL_GPIO) | ||
536 | |||
537 | #endif /* __MACH_IOMUX_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h new file mode 100644 index 000000000000..fe558e3c5a9a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/iomux.h | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH, | ||
3 | * <armlinux@phytec.de> | ||
4 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
18 | * MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __MACH_MXS_IOMUX_H__ | ||
22 | #define __MACH_MXS_IOMUX_H__ | ||
23 | |||
24 | /* | ||
25 | * IOMUX/PAD Bit field definitions | ||
26 | * | ||
27 | * PAD_BANK: 0..2 (3) | ||
28 | * PAD_PIN: 3..7 (5) | ||
29 | * PAD_MUXSEL: 8..9 (2) | ||
30 | * PAD_MA: 10..11 (2) | ||
31 | * PAD_MA_VALID: 12 (1) | ||
32 | * PAD_VOL: 13 (1) | ||
33 | * PAD_VOL_VALID: 14 (1) | ||
34 | * PAD_PULL: 15 (1) | ||
35 | * PAD_PULL_VALID: 16 (1) | ||
36 | * RESERVED: 17..31 (15) | ||
37 | */ | ||
38 | typedef u32 iomux_cfg_t; | ||
39 | |||
40 | #define MXS_PAD_BANK_SHIFT 0 | ||
41 | #define MXS_PAD_BANK_MASK ((iomux_cfg_t)0x7 << MXS_PAD_BANK_SHIFT) | ||
42 | #define MXS_PAD_PIN_SHIFT 3 | ||
43 | #define MXS_PAD_PIN_MASK ((iomux_cfg_t)0x1f << MXS_PAD_PIN_SHIFT) | ||
44 | #define MXS_PAD_MUXSEL_SHIFT 8 | ||
45 | #define MXS_PAD_MUXSEL_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MUXSEL_SHIFT) | ||
46 | #define MXS_PAD_MA_SHIFT 10 | ||
47 | #define MXS_PAD_MA_MASK ((iomux_cfg_t)0x3 << MXS_PAD_MA_SHIFT) | ||
48 | #define MXS_PAD_MA_VALID_SHIFT 12 | ||
49 | #define MXS_PAD_MA_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_MA_VALID_SHIFT) | ||
50 | #define MXS_PAD_VOL_SHIFT 13 | ||
51 | #define MXS_PAD_VOL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_SHIFT) | ||
52 | #define MXS_PAD_VOL_VALID_SHIFT 14 | ||
53 | #define MXS_PAD_VOL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_VOL_VALID_SHIFT) | ||
54 | #define MXS_PAD_PULL_SHIFT 15 | ||
55 | #define MXS_PAD_PULL_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_SHIFT) | ||
56 | #define MXS_PAD_PULL_VALID_SHIFT 16 | ||
57 | #define MXS_PAD_PULL_VALID_MASK ((iomux_cfg_t)0x1 << MXS_PAD_PULL_VALID_SHIFT) | ||
58 | |||
59 | #define PAD_MUXSEL_0 0 | ||
60 | #define PAD_MUXSEL_1 1 | ||
61 | #define PAD_MUXSEL_2 2 | ||
62 | #define PAD_MUXSEL_GPIO 3 | ||
63 | |||
64 | #define PAD_4MA 0 | ||
65 | #define PAD_8MA 1 | ||
66 | #define PAD_12MA 2 | ||
67 | #define PAD_16MA 3 | ||
68 | |||
69 | #define PAD_1V8 0 | ||
70 | #define PAD_3V3 1 | ||
71 | |||
72 | #define PAD_NOPULL 0 | ||
73 | #define PAD_PULLUP 1 | ||
74 | |||
75 | #define MXS_PAD_4MA ((PAD_4MA << MXS_PAD_MA_SHIFT) | \ | ||
76 | MXS_PAD_MA_VALID_MASK) | ||
77 | #define MXS_PAD_8MA ((PAD_8MA << MXS_PAD_MA_SHIFT) | \ | ||
78 | MXS_PAD_MA_VALID_MASK) | ||
79 | #define MXS_PAD_12MA ((PAD_12MA << MXS_PAD_MA_SHIFT) | \ | ||
80 | MXS_PAD_MA_VALID_MASK) | ||
81 | #define MXS_PAD_16MA ((PAD_16MA << MXS_PAD_MA_SHIFT) | \ | ||
82 | MXS_PAD_MA_VALID_MASK) | ||
83 | |||
84 | #define MXS_PAD_1V8 ((PAD_1V8 << MXS_PAD_VOL_SHIFT) | \ | ||
85 | MXS_PAD_VOL_VALID_MASK) | ||
86 | #define MXS_PAD_3V3 ((PAD_3V3 << MXS_PAD_VOL_SHIFT) | \ | ||
87 | MXS_PAD_VOL_VALID_MASK) | ||
88 | |||
89 | #define MXS_PAD_NOPULL ((PAD_NOPULL << MXS_PAD_PULL_SHIFT) | \ | ||
90 | MXS_PAD_PULL_VALID_MASK) | ||
91 | #define MXS_PAD_PULLUP ((PAD_PULLUP << MXS_PAD_PULL_SHIFT) | \ | ||
92 | MXS_PAD_PULL_VALID_MASK) | ||
93 | |||
94 | #define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \ | ||
95 | (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \ | ||
96 | ((iomux_cfg_t)(_pin) << MXS_PAD_PIN_SHIFT) | \ | ||
97 | ((iomux_cfg_t)(_muxsel) << MXS_PAD_MUXSEL_SHIFT) | \ | ||
98 | ((iomux_cfg_t)(_ma) << MXS_PAD_MA_SHIFT) | \ | ||
99 | ((iomux_cfg_t)(_vol) << MXS_PAD_VOL_SHIFT) | \ | ||
100 | ((iomux_cfg_t)(_pull) << MXS_PAD_PULL_SHIFT)) | ||
101 | |||
102 | /* | ||
103 | * A pad becomes naked, when none of mA, vol or pull | ||
104 | * validity bits is set. | ||
105 | */ | ||
106 | #define MXS_IOMUX_PAD_NAKED(_bank, _pin, _muxsel) \ | ||
107 | MXS_IOMUX_PAD(_bank, _pin, _muxsel, 0, 0, 0) | ||
108 | |||
109 | static inline unsigned int PAD_BANK(iomux_cfg_t pad) | ||
110 | { | ||
111 | return (pad & MXS_PAD_BANK_MASK) >> MXS_PAD_BANK_SHIFT; | ||
112 | } | ||
113 | |||
114 | static inline unsigned int PAD_PIN(iomux_cfg_t pad) | ||
115 | { | ||
116 | return (pad & MXS_PAD_PIN_MASK) >> MXS_PAD_PIN_SHIFT; | ||
117 | } | ||
118 | |||
119 | static inline unsigned int PAD_MUXSEL(iomux_cfg_t pad) | ||
120 | { | ||
121 | return (pad & MXS_PAD_MUXSEL_MASK) >> MXS_PAD_MUXSEL_SHIFT; | ||
122 | } | ||
123 | |||
124 | static inline unsigned int PAD_MA(iomux_cfg_t pad) | ||
125 | { | ||
126 | return (pad & MXS_PAD_MA_MASK) >> MXS_PAD_MA_SHIFT; | ||
127 | } | ||
128 | |||
129 | static inline unsigned int PAD_MA_VALID(iomux_cfg_t pad) | ||
130 | { | ||
131 | return (pad & MXS_PAD_MA_VALID_MASK) >> MXS_PAD_MA_VALID_SHIFT; | ||
132 | } | ||
133 | |||
134 | static inline unsigned int PAD_VOL(iomux_cfg_t pad) | ||
135 | { | ||
136 | return (pad & MXS_PAD_VOL_MASK) >> MXS_PAD_VOL_SHIFT; | ||
137 | } | ||
138 | |||
139 | static inline unsigned int PAD_VOL_VALID(iomux_cfg_t pad) | ||
140 | { | ||
141 | return (pad & MXS_PAD_VOL_VALID_MASK) >> MXS_PAD_VOL_VALID_SHIFT; | ||
142 | } | ||
143 | |||
144 | static inline unsigned int PAD_PULL(iomux_cfg_t pad) | ||
145 | { | ||
146 | return (pad & MXS_PAD_PULL_MASK) >> MXS_PAD_PULL_SHIFT; | ||
147 | } | ||
148 | |||
149 | static inline unsigned int PAD_PULL_VALID(iomux_cfg_t pad) | ||
150 | { | ||
151 | return (pad & MXS_PAD_PULL_VALID_MASK) >> MXS_PAD_PULL_VALID_SHIFT; | ||
152 | } | ||
153 | |||
154 | /* | ||
155 | * configures a single pad in the iomuxer | ||
156 | */ | ||
157 | int mxs_iomux_setup_pad(iomux_cfg_t pad); | ||
158 | |||
159 | /* | ||
160 | * configures multiple pads | ||
161 | * convenient way to call the above function with tables | ||
162 | */ | ||
163 | int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count); | ||
164 | |||
165 | #endif /* __MACH_MXS_IOMUX_H__*/ | ||
diff --git a/arch/arm/mach-mxs/include/mach/irqs.h b/arch/arm/mach-mxs/include/mach/irqs.h new file mode 100644 index 000000000000..f771039b814a --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/irqs.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | */ | ||
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_MXS_IRQS_H__ | ||
12 | #define __MACH_MXS_IRQS_H__ | ||
13 | |||
14 | #define MXS_INTERNAL_IRQS 128 | ||
15 | |||
16 | #define MXS_GPIO_IRQ_START MXS_INTERNAL_IRQS | ||
17 | |||
18 | /* the maximum for MXS-based */ | ||
19 | #define MXS_GPIO_IRQS (32 * 5) | ||
20 | |||
21 | /* | ||
22 | * The next 16 interrupts are for board specific purposes. Since | ||
23 | * the kernel can only run on one machine at a time, we can re-use | ||
24 | * these. If you need more, increase MXS_BOARD_IRQS, but keep it | ||
25 | * within sensible limits. | ||
26 | */ | ||
27 | #define MXS_BOARD_IRQ_START (MXS_GPIO_IRQ_START + MXS_GPIO_IRQS) | ||
28 | #define MXS_BOARD_IRQS 16 | ||
29 | |||
30 | #define NR_IRQS (MXS_BOARD_IRQ_START + MXS_BOARD_IRQS) | ||
31 | |||
32 | #endif /* __MACH_MXS_IRQS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/memory.h b/arch/arm/mach-mxs/include/mach/memory.h new file mode 100644 index 000000000000..b5420a5c2d4b --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/memory.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MXS_MEMORY_H__ | ||
20 | #define __MACH_MXS_MEMORY_H__ | ||
21 | |||
22 | #define PHYS_OFFSET UL(0x40000000) | ||
23 | |||
24 | #endif /* __MACH_MXS_MEMORY_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mx23.h b/arch/arm/mach-mxs/include/mach/mx23.h new file mode 100644 index 000000000000..9edd02ec8e30 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mx23.h | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MX23_H__ | ||
20 | #define __MACH_MX23_H__ | ||
21 | |||
22 | #include <mach/mxs.h> | ||
23 | |||
24 | /* | ||
25 | * OCRAM | ||
26 | */ | ||
27 | #define MX23_OCRAM_BASE_ADDR 0x00000000 | ||
28 | #define MX23_OCRAM_SIZE SZ_32K | ||
29 | |||
30 | /* | ||
31 | * IO | ||
32 | */ | ||
33 | #define MX23_IO_BASE_ADDR 0x80000000 | ||
34 | #define MX23_IO_SIZE SZ_1M | ||
35 | |||
36 | #define MX23_ICOLL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x000000) | ||
37 | #define MX23_APBH_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x004000) | ||
38 | #define MX23_BCH_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00a000) | ||
39 | #define MX23_GPMI_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00c000) | ||
40 | #define MX23_SSP1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x010000) | ||
41 | #define MX23_PINCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x018000) | ||
42 | #define MX23_DIGCTL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x01c000) | ||
43 | #define MX23_ETM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x020000) | ||
44 | #define MX23_APBX_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x024000) | ||
45 | #define MX23_DCP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x028000) | ||
46 | #define MX23_PXP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02a000) | ||
47 | #define MX23_OCOTP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02c000) | ||
48 | #define MX23_AXI_AHB0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02e000) | ||
49 | #define MX23_LCDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x030000) | ||
50 | #define MX23_SSP2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x034000) | ||
51 | #define MX23_TVENC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x038000) | ||
52 | #define MX23_CLKCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x040000) | ||
53 | #define MX23_SAIF0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x042000) | ||
54 | #define MX23_POWER_BASE_ADDR (MX23_IO_BASE_ADDR + 0x044000) | ||
55 | #define MX23_SAIF1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x046000) | ||
56 | #define MX23_AUDIOOUT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x048000) | ||
57 | #define MX23_AUDIOIN_BASE_ADDR (MX23_IO_BASE_ADDR + 0x04c000) | ||
58 | #define MX23_LRADC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x050000) | ||
59 | #define MX23_SPDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x054000) | ||
60 | #define MX23_I2C0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x058000) | ||
61 | #define MX23_RTC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x05c000) | ||
62 | #define MX23_PWM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x064000) | ||
63 | #define MX23_TIMROT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x068000) | ||
64 | #define MX23_AUART1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06c000) | ||
65 | #define MX23_AUART2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06e000) | ||
66 | #define MX23_DUART_BASE_ADDR (MX23_IO_BASE_ADDR + 0x070000) | ||
67 | #define MX23_USBPHY_BASE_ADDR (MX23_IO_BASE_ADDR + 0x07c000) | ||
68 | #define MX23_USBCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x080000) | ||
69 | #define MX23_DRAM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x0e0000) | ||
70 | |||
71 | #define MX23_IO_P2V(x) MXS_IO_P2V(x) | ||
72 | #define MX23_IO_ADDRESS(x) IOMEM(MX23_IO_P2V(x)) | ||
73 | |||
74 | /* | ||
75 | * IRQ | ||
76 | */ | ||
77 | #define MX23_INT_DUART 0 | ||
78 | #define MX23_INT_COMMS_RX 1 | ||
79 | #define MX23_INT_COMMS_TX 1 | ||
80 | #define MX23_INT_SSP2_ERROR 2 | ||
81 | #define MX23_INT_VDD5V 3 | ||
82 | #define MX23_INT_HEADPHONE_SHORT 4 | ||
83 | #define MX23_INT_DAC_DMA 5 | ||
84 | #define MX23_INT_DAC_ERROR 6 | ||
85 | #define MX23_INT_ADC_DMA 7 | ||
86 | #define MX23_INT_ADC_ERROR 8 | ||
87 | #define MX23_INT_SPDIF_DMA 9 | ||
88 | #define MX23_INT_SAIF2_DMA 9 | ||
89 | #define MX23_INT_SPDIF_ERROR 10 | ||
90 | #define MX23_INT_SAIF1_IRQ 10 | ||
91 | #define MX23_INT_SAIF2_IRQ 10 | ||
92 | #define MX23_INT_USB_CTRL 11 | ||
93 | #define MX23_INT_USB_WAKEUP 12 | ||
94 | #define MX23_INT_GPMI_DMA 13 | ||
95 | #define MX23_INT_SSP1_DMA 14 | ||
96 | #define MX23_INT_SSP_ERROR 15 | ||
97 | #define MX23_INT_GPIO0 16 | ||
98 | #define MX23_INT_GPIO1 17 | ||
99 | #define MX23_INT_GPIO2 18 | ||
100 | #define MX23_INT_SAIF1_DMA 19 | ||
101 | #define MX23_INT_SSP2_DMA 20 | ||
102 | #define MX23_INT_ECC8_IRQ 21 | ||
103 | #define MX23_INT_RTC_ALARM 22 | ||
104 | #define MX23_INT_UARTAPP_TX_DMA 23 | ||
105 | #define MX23_INT_UARTAPP_INTERNAL 24 | ||
106 | #define MX23_INT_UARTAPP_RX_DMA 25 | ||
107 | #define MX23_INT_I2C_DMA 26 | ||
108 | #define MX23_INT_I2C_ERROR 27 | ||
109 | #define MX23_INT_TIMER0 28 | ||
110 | #define MX23_INT_TIMER1 29 | ||
111 | #define MX23_INT_TIMER2 30 | ||
112 | #define MX23_INT_TIMER3 31 | ||
113 | #define MX23_INT_BATT_BRNOUT 32 | ||
114 | #define MX23_INT_VDDD_BRNOUT 33 | ||
115 | #define MX23_INT_VDDIO_BRNOUT 34 | ||
116 | #define MX23_INT_VDD18_BRNOUT 35 | ||
117 | #define MX23_INT_TOUCH_DETECT 36 | ||
118 | #define MX23_INT_LRADC_CH0 37 | ||
119 | #define MX23_INT_LRADC_CH1 38 | ||
120 | #define MX23_INT_LRADC_CH2 39 | ||
121 | #define MX23_INT_LRADC_CH3 40 | ||
122 | #define MX23_INT_LRADC_CH4 41 | ||
123 | #define MX23_INT_LRADC_CH5 42 | ||
124 | #define MX23_INT_LRADC_CH6 43 | ||
125 | #define MX23_INT_LRADC_CH7 44 | ||
126 | #define MX23_INT_LCDIF_DMA 45 | ||
127 | #define MX23_INT_LCDIF_ERROR 46 | ||
128 | #define MX23_INT_DIGCTL_DEBUG_TRAP 47 | ||
129 | #define MX23_INT_RTC_1MSEC 48 | ||
130 | #define MX23_INT_DRI_DMA 49 | ||
131 | #define MX23_INT_DRI_ATTENTION 50 | ||
132 | #define MX23_INT_GPMI_ATTENTION 51 | ||
133 | #define MX23_INT_IR 52 | ||
134 | #define MX23_INT_DCP_VMI 53 | ||
135 | #define MX23_INT_DCP 54 | ||
136 | #define MX23_INT_BCH 56 | ||
137 | #define MX23_INT_PXP 57 | ||
138 | #define MX23_INT_UARTAPP2_TX_DMA 58 | ||
139 | #define MX23_INT_UARTAPP2_INTERNAL 59 | ||
140 | #define MX23_INT_UARTAPP2_RX_DMA 60 | ||
141 | #define MX23_INT_VDAC_DETECT 61 | ||
142 | #define MX23_INT_VDD5V_DROOP 64 | ||
143 | #define MX23_INT_DCDC4P2_BO 65 | ||
144 | |||
145 | #endif /* __MACH_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h new file mode 100644 index 000000000000..0716745267ad --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mx28.h | |||
@@ -0,0 +1,188 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MX28_H__ | ||
20 | #define __MACH_MX28_H__ | ||
21 | |||
22 | #include <mach/mxs.h> | ||
23 | |||
24 | /* | ||
25 | * OCRAM | ||
26 | */ | ||
27 | #define MX28_OCRAM_BASE_ADDR 0x00000000 | ||
28 | #define MX28_OCRAM_SIZE SZ_128K | ||
29 | |||
30 | /* | ||
31 | * IO | ||
32 | */ | ||
33 | #define MX28_IO_BASE_ADDR 0x80000000 | ||
34 | #define MX28_IO_SIZE SZ_1M | ||
35 | |||
36 | #define MX28_ICOLL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x000000) | ||
37 | #define MX28_HSADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x002000) | ||
38 | #define MX28_APBH_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x004000) | ||
39 | #define MX28_PERFMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x006000) | ||
40 | #define MX28_BCH_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00a000) | ||
41 | #define MX28_GPMI_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00c000) | ||
42 | #define MX28_SSP0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x010000) | ||
43 | #define MX28_SSP1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x012000) | ||
44 | #define MX28_SSP2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x014000) | ||
45 | #define MX28_SSP3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x016000) | ||
46 | #define MX28_PINCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x018000) | ||
47 | #define MX28_DIGCTL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x01c000) | ||
48 | #define MX28_ETM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x022000) | ||
49 | #define MX28_APBX_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x024000) | ||
50 | #define MX28_DCP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x028000) | ||
51 | #define MX28_PXP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02a000) | ||
52 | #define MX28_OCOTP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02c000) | ||
53 | #define MX28_AXI_AHB0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02e000) | ||
54 | #define MX28_LCDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x030000) | ||
55 | #define MX28_CAN0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x032000) | ||
56 | #define MX28_CAN1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x034000) | ||
57 | #define MX28_SIMDBG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c000) | ||
58 | #define MX28_SIMGPMISEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c200) | ||
59 | #define MX28_SIMSSPSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c300) | ||
60 | #define MX28_SIMMEMSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c400) | ||
61 | #define MX28_GPIOMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c500) | ||
62 | #define MX28_SIMENET_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c700) | ||
63 | #define MX28_ARMJTAG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c800) | ||
64 | #define MX28_CLKCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x040000) | ||
65 | #define MX28_SAIF0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x042000) | ||
66 | #define MX28_POWER_BASE_ADDR (MX28_IO_BASE_ADDR + 0x044000) | ||
67 | #define MX28_SAIF1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x046000) | ||
68 | #define MX28_LRADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x050000) | ||
69 | #define MX28_SPDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x054000) | ||
70 | #define MX28_RTC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x056000) | ||
71 | #define MX28_I2C0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x058000) | ||
72 | #define MX28_I2C1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x05a000) | ||
73 | #define MX28_PWM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x064000) | ||
74 | #define MX28_TIMROT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x068000) | ||
75 | #define MX28_AUART0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06a000) | ||
76 | #define MX28_AUART1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06c000) | ||
77 | #define MX28_AUART2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06e000) | ||
78 | #define MX28_AUART3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x070000) | ||
79 | #define MX28_AUART4_BASE_ADDR (MX28_IO_BASE_ADDR + 0x072000) | ||
80 | #define MX28_DUART_BASE_ADDR (MX28_IO_BASE_ADDR + 0x074000) | ||
81 | #define MX28_USBPHY0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07C000) | ||
82 | #define MX28_USBPHY1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07e000) | ||
83 | #define MX28_USBCTRL0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x080000) | ||
84 | #define MX28_USBCTRL1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x090000) | ||
85 | #define MX28_DFLPT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0c0000) | ||
86 | #define MX28_DRAM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0e0000) | ||
87 | #define MX28_ENET_MAC0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f0000) | ||
88 | #define MX28_ENET_MAC1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f4000) | ||
89 | |||
90 | #define MX28_IO_P2V(x) MXS_IO_P2V(x) | ||
91 | #define MX28_IO_ADDRESS(x) IOMEM(MX28_IO_P2V(x)) | ||
92 | |||
93 | /* | ||
94 | * IRQ | ||
95 | */ | ||
96 | #define MX28_INT_BATT_BRNOUT 0 | ||
97 | #define MX28_INT_VDDD_BRNOUT 1 | ||
98 | #define MX28_INT_VDDIO_BRNOUT 2 | ||
99 | #define MX28_INT_VDDA_BRNOUT 3 | ||
100 | #define MX28_INT_VDD5V_DROOP 4 | ||
101 | #define MX28_INT_DCDC4P2_BRNOUT 5 | ||
102 | #define MX28_INT_VDD5V 6 | ||
103 | #define MX28_INT_CAN0 8 | ||
104 | #define MX28_INT_CAN1 9 | ||
105 | #define MX28_INT_LRADC_TOUCH 10 | ||
106 | #define MX28_INT_HSADC 13 | ||
107 | #define MX28_INT_IRADC_THRESH0 14 | ||
108 | #define MX28_INT_IRADC_THRESH1 15 | ||
109 | #define MX28_INT_LRADC_CH0 16 | ||
110 | #define MX28_INT_LRADC_CH1 17 | ||
111 | #define MX28_INT_LRADC_CH2 18 | ||
112 | #define MX28_INT_LRADC_CH3 19 | ||
113 | #define MX28_INT_LRADC_CH4 20 | ||
114 | #define MX28_INT_LRADC_CH5 21 | ||
115 | #define MX28_INT_LRADC_CH6 22 | ||
116 | #define MX28_INT_LRADC_CH7 23 | ||
117 | #define MX28_INT_LRADC_BUTTON0 24 | ||
118 | #define MX28_INT_LRADC_BUTTON1 25 | ||
119 | #define MX28_INT_PERFMON 27 | ||
120 | #define MX28_INT_RTC_1MSEC 28 | ||
121 | #define MX28_INT_RTC_ALARM 29 | ||
122 | #define MX28_INT_COMMS 31 | ||
123 | #define MX28_INT_EMI_ERR 32 | ||
124 | #define MX28_INT_LCDIF 38 | ||
125 | #define MX28_INT_PXP 39 | ||
126 | #define MX28_INT_BCH 41 | ||
127 | #define MX28_INT_GPMI 42 | ||
128 | #define MX28_INT_SPDIF_ERROR 45 | ||
129 | #define MX28_INT_DUART 47 | ||
130 | #define MX28_INT_TIMER0 48 | ||
131 | #define MX28_INT_TIMER1 49 | ||
132 | #define MX28_INT_TIMER2 50 | ||
133 | #define MX28_INT_TIMER3 51 | ||
134 | #define MX28_INT_DCP_VMI 52 | ||
135 | #define MX28_INT_DCP 53 | ||
136 | #define MX28_INT_DCP_SECURE 54 | ||
137 | #define MX28_INT_SAIF1 58 | ||
138 | #define MX28_INT_SAIF0 59 | ||
139 | #define MX28_INT_SPDIF_DMA 66 | ||
140 | #define MX28_INT_I2C0_DMA 68 | ||
141 | #define MX28_INT_I2C1_DMA 69 | ||
142 | #define MX28_INT_AUART0_RX_DMA 70 | ||
143 | #define MX28_INT_AUART0_TX_DMA 71 | ||
144 | #define MX28_INT_AUART1_RX_DMA 72 | ||
145 | #define MX28_INT_AUART1_TX_DMA 73 | ||
146 | #define MX28_INT_AUART2_RX_DMA 74 | ||
147 | #define MX28_INT_AUART2_TX_DMA 75 | ||
148 | #define MX28_INT_AUART3_RX_DMA 76 | ||
149 | #define MX28_INT_AUART3_TX_DMA 77 | ||
150 | #define MX28_INT_AUART4_RX_DMA 78 | ||
151 | #define MX28_INT_AUART4_TX_DMA 79 | ||
152 | #define MX28_INT_SAIF0_DMA 80 | ||
153 | #define MX28_INT_SAIF1_DMA 81 | ||
154 | #define MX28_INT_SSP0_DMA 82 | ||
155 | #define MX28_INT_SSP1_DMA 83 | ||
156 | #define MX28_INT_SSP2_DMA 84 | ||
157 | #define MX28_INT_SSP3_DMA 85 | ||
158 | #define MX28_INT_LCDIF_DMA 86 | ||
159 | #define MX28_INT_HSADC_DMA 87 | ||
160 | #define MX28_INT_GPMI_DMA 88 | ||
161 | #define MX28_INT_DIGCTL_DEBUG_TRAP 89 | ||
162 | #define MX28_INT_USB1 92 | ||
163 | #define MX28_INT_USB0 93 | ||
164 | #define MX28_INT_USB1_WAKEUP 94 | ||
165 | #define MX28_INT_USB0_WAKEUP 95 | ||
166 | #define MX28_INT_SSP0 96 | ||
167 | #define MX28_INT_SSP1 97 | ||
168 | #define MX28_INT_SSP2 98 | ||
169 | #define MX28_INT_SSP3 99 | ||
170 | #define MX28_INT_ENET_SWI 100 | ||
171 | #define MX28_INT_ENET_MAC0 101 | ||
172 | #define MX28_INT_ENET_MAC1 102 | ||
173 | #define MX28_INT_ENET_MAC0_1588 103 | ||
174 | #define MX28_INT_ENET_MAC1_1588 104 | ||
175 | #define MX28_INT_I2C1_ERROR 110 | ||
176 | #define MX28_INT_I2C0_ERROR 111 | ||
177 | #define MX28_INT_AUART0 112 | ||
178 | #define MX28_INT_AUART1 113 | ||
179 | #define MX28_INT_AUART2 114 | ||
180 | #define MX28_INT_AUART3 115 | ||
181 | #define MX28_INT_AUART4 116 | ||
182 | #define MX28_INT_GPIO4 123 | ||
183 | #define MX28_INT_GPIO3 124 | ||
184 | #define MX28_INT_GPIO2 125 | ||
185 | #define MX28_INT_GPIO1 126 | ||
186 | #define MX28_INT_GPIO0 127 | ||
187 | |||
188 | #endif /* __MACH_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h new file mode 100644 index 000000000000..f186c08c2911 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/mxs.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __MACH_MXS_H__ | ||
20 | #define __MACH_MXS_H__ | ||
21 | |||
22 | #ifndef __ASSEMBLER__ | ||
23 | #include <linux/io.h> | ||
24 | #endif | ||
25 | #include <asm/mach-types.h> | ||
26 | #include <mach/hardware.h> | ||
27 | |||
28 | /* | ||
29 | * MXS CPU types | ||
30 | */ | ||
31 | #define cpu_is_mx23() (machine_is_mx23evk()) | ||
32 | #define cpu_is_mx28() (machine_is_mx28evk()) | ||
33 | |||
34 | /* | ||
35 | * IO addresses common to MXS-based | ||
36 | */ | ||
37 | #define MXS_IO_BASE_ADDR 0x80000000 | ||
38 | #define MXS_IO_SIZE SZ_1M | ||
39 | |||
40 | #define MXS_ICOLL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x000000) | ||
41 | #define MXS_APBH_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x004000) | ||
42 | #define MXS_BCH_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00a000) | ||
43 | #define MXS_GPMI_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00c000) | ||
44 | #define MXS_PINCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x018000) | ||
45 | #define MXS_DIGCTL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x01c000) | ||
46 | #define MXS_APBX_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x024000) | ||
47 | #define MXS_DCP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x028000) | ||
48 | #define MXS_PXP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02a000) | ||
49 | #define MXS_OCOTP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02c000) | ||
50 | #define MXS_AXI_AHB0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02e000) | ||
51 | #define MXS_LCDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x030000) | ||
52 | #define MXS_CLKCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x040000) | ||
53 | #define MXS_SAIF0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x042000) | ||
54 | #define MXS_POWER_BASE_ADDR (MXS_IO_BASE_ADDR + 0x044000) | ||
55 | #define MXS_SAIF1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x046000) | ||
56 | #define MXS_LRADC_BASE_ADDR (MXS_IO_BASE_ADDR + 0x050000) | ||
57 | #define MXS_SPDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x054000) | ||
58 | #define MXS_I2C0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x058000) | ||
59 | #define MXS_PWM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x064000) | ||
60 | #define MXS_TIMROT_BASE_ADDR (MXS_IO_BASE_ADDR + 0x068000) | ||
61 | #define MXS_AUART1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06c000) | ||
62 | #define MXS_AUART2_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06e000) | ||
63 | #define MXS_DRAM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x0e0000) | ||
64 | |||
65 | /* | ||
66 | * It maps the whole address space to [0xf4000000, 0xf50fffff]. | ||
67 | * | ||
68 | * OCRAM 0x00000000+0x020000 -> 0xf4000000+0x020000 | ||
69 | * IO 0x80000000+0x100000 -> 0xf5000000+0x100000 | ||
70 | */ | ||
71 | #define MXS_IO_P2V(x) (0xf4000000 + \ | ||
72 | (((x) & 0x80000000) >> 7) + \ | ||
73 | (((x) & 0x000fffff))) | ||
74 | |||
75 | #define MXS_IO_ADDRESS(x) IOMEM(MXS_IO_P2V(x)) | ||
76 | |||
77 | #define mxs_map_entry(soc, name, _type) { \ | ||
78 | .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \ | ||
79 | .pfn = __phys_to_pfn(soc ## _ ## name ## _BASE_ADDR), \ | ||
80 | .length = soc ## _ ## name ## _SIZE, \ | ||
81 | .type = _type, \ | ||
82 | } | ||
83 | |||
84 | #define MXS_SET_ADDR 0x4 | ||
85 | #define MXS_CLR_ADDR 0x8 | ||
86 | #define MXS_TOG_ADDR 0xc | ||
87 | |||
88 | #ifndef __ASSEMBLER__ | ||
89 | static inline void __mxs_setl(u32 mask, void __iomem *reg) | ||
90 | { | ||
91 | __raw_writel(mask, reg + MXS_SET_ADDR); | ||
92 | } | ||
93 | |||
94 | static inline void __mxs_clrl(u32 mask, void __iomem *reg) | ||
95 | { | ||
96 | __raw_writel(mask, reg + MXS_CLR_ADDR); | ||
97 | } | ||
98 | |||
99 | static inline void __mxs_togl(u32 mask, void __iomem *reg) | ||
100 | { | ||
101 | __raw_writel(mask, reg + MXS_TOG_ADDR); | ||
102 | } | ||
103 | #endif | ||
104 | |||
105 | #endif /* __MACH_MXS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/system.h b/arch/arm/mach-mxs/include/mach/system.h new file mode 100644 index 000000000000..0e428239b433 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/system.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2004-2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __MACH_MXS_SYSTEM_H__ | ||
18 | #define __MACH_MXS_SYSTEM_H__ | ||
19 | |||
20 | static inline void arch_idle(void) | ||
21 | { | ||
22 | cpu_do_idle(); | ||
23 | } | ||
24 | |||
25 | void arch_reset(char mode, const char *cmd); | ||
26 | |||
27 | #endif /* __MACH_MXS_SYSTEM_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/timex.h b/arch/arm/mach-mxs/include/mach/timex.h new file mode 100644 index 000000000000..734ce8984a64 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/timex.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MACH_MXS_TIMEX_H__ | ||
17 | #define __MACH_MXS_TIMEX_H__ | ||
18 | |||
19 | #define CLOCK_TICK_RATE 32000 /* 32K */ | ||
20 | |||
21 | #endif /* __MACH_MXS_TIMEX_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h new file mode 100644 index 000000000000..a005e76f34f9 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/uncompress.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mxs/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * Copyright (C) Shane Nay (shane@minirl.com) | ||
6 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | #ifndef __MACH_MXS_UNCOMPRESS_H__ | ||
19 | #define __MACH_MXS_UNCOMPRESS_H__ | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | |||
23 | static unsigned long mxs_duart_base; | ||
24 | |||
25 | #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) | ||
26 | |||
27 | #define MXS_DUART_DR 0x00 | ||
28 | #define MXS_DUART_FR 0x18 | ||
29 | #define MXS_DUART_FR_TXFE (1 << 7) | ||
30 | #define MXS_DUART_CR 0x30 | ||
31 | #define MXS_DUART_CR_UARTEN (1 << 0) | ||
32 | |||
33 | /* | ||
34 | * The following code assumes the serial port has already been | ||
35 | * initialized by the bootloader. If it's not, the output is | ||
36 | * simply discarded. | ||
37 | */ | ||
38 | |||
39 | static void putc(int ch) | ||
40 | { | ||
41 | if (!mxs_duart_base) | ||
42 | return; | ||
43 | if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN)) | ||
44 | return; | ||
45 | |||
46 | while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE)) | ||
47 | barrier(); | ||
48 | |||
49 | MXS_DUART(MXS_DUART_DR) = ch; | ||
50 | } | ||
51 | |||
52 | static inline void flush(void) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | #define MX23_DUART_BASE_ADDR 0x80070000 | ||
57 | #define MX28_DUART_BASE_ADDR 0x80074000 | ||
58 | |||
59 | static inline void __arch_decomp_setup(unsigned long arch_id) | ||
60 | { | ||
61 | switch (arch_id) { | ||
62 | case MACH_TYPE_MX23EVK: | ||
63 | mxs_duart_base = MX23_DUART_BASE_ADDR; | ||
64 | break; | ||
65 | case MACH_TYPE_MX28EVK: | ||
66 | mxs_duart_base = MX28_DUART_BASE_ADDR; | ||
67 | break; | ||
68 | default: | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
74 | #define arch_decomp_wdog() | ||
75 | |||
76 | #endif /* __MACH_MXS_UNCOMPRESS_H__ */ | ||
diff --git a/arch/arm/mach-mxs/include/mach/vmalloc.h b/arch/arm/mach-mxs/include/mach/vmalloc.h new file mode 100644 index 000000000000..103b0165ed0b --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/vmalloc.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Russell King. | ||
3 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __MACH_MXS_VMALLOC_H__ | ||
17 | #define __MACH_MXS_VMALLOC_H__ | ||
18 | |||
19 | /* vmalloc ending address */ | ||
20 | #define VMALLOC_END 0xf4000000UL | ||
21 | |||
22 | #endif /* __MACH_MXS_VMALLOC_H__ */ | ||
diff --git a/arch/arm/mach-mxs/iomux.c b/arch/arm/mach-mxs/iomux.c new file mode 100644 index 000000000000..0e804e2f11f4 --- /dev/null +++ b/arch/arm/mach-mxs/iomux.c | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * Copyright 2004-2006,2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> | ||
4 | * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH, | ||
5 | * <armlinux@phytec.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
19 | * MA 02110-1301, USA. | ||
20 | */ | ||
21 | |||
22 | #include <linux/errno.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/string.h> | ||
27 | #include <linux/gpio.h> | ||
28 | |||
29 | #include <asm/mach/map.h> | ||
30 | |||
31 | #include <mach/mxs.h> | ||
32 | #include <mach/iomux.h> | ||
33 | |||
34 | /* | ||
35 | * configures a single pad in the iomuxer | ||
36 | */ | ||
37 | int mxs_iomux_setup_pad(iomux_cfg_t pad) | ||
38 | { | ||
39 | u32 reg, ofs, bp, bm; | ||
40 | void __iomem *iomux_base = MXS_IO_ADDRESS(MXS_PINCTRL_BASE_ADDR); | ||
41 | |||
42 | /* muxsel */ | ||
43 | ofs = 0x100; | ||
44 | ofs += PAD_BANK(pad) * 0x20 + PAD_PIN(pad) / 16 * 0x10; | ||
45 | bp = PAD_PIN(pad) % 16 * 2; | ||
46 | bm = 0x3 << bp; | ||
47 | reg = __raw_readl(iomux_base + ofs); | ||
48 | reg &= ~bm; | ||
49 | reg |= PAD_MUXSEL(pad) << bp; | ||
50 | __raw_writel(reg, iomux_base + ofs); | ||
51 | |||
52 | /* drive */ | ||
53 | ofs = cpu_is_mx23() ? 0x200 : 0x300; | ||
54 | ofs += PAD_BANK(pad) * 0x40 + PAD_PIN(pad) / 8 * 0x10; | ||
55 | /* mA */ | ||
56 | if (PAD_MA_VALID(pad)) { | ||
57 | bp = PAD_PIN(pad) % 8 * 4; | ||
58 | bm = 0x3 << bp; | ||
59 | reg = __raw_readl(iomux_base + ofs); | ||
60 | reg &= ~bm; | ||
61 | reg |= PAD_MA(pad) << bp; | ||
62 | __raw_writel(reg, iomux_base + ofs); | ||
63 | } | ||
64 | /* vol */ | ||
65 | if (PAD_VOL_VALID(pad)) { | ||
66 | bp = PAD_PIN(pad) % 8 * 4 + 2; | ||
67 | if (PAD_VOL(pad)) | ||
68 | __mxs_setl(1 << bp, iomux_base + ofs); | ||
69 | else | ||
70 | __mxs_clrl(1 << bp, iomux_base + ofs); | ||
71 | } | ||
72 | |||
73 | /* pull */ | ||
74 | if (PAD_PULL_VALID(pad)) { | ||
75 | ofs = cpu_is_mx23() ? 0x400 : 0x600; | ||
76 | ofs += PAD_BANK(pad) * 0x10; | ||
77 | bp = PAD_PIN(pad); | ||
78 | if (PAD_PULL(pad)) | ||
79 | __mxs_setl(1 << bp, iomux_base + ofs); | ||
80 | else | ||
81 | __mxs_clrl(1 << bp, iomux_base + ofs); | ||
82 | } | ||
83 | |||
84 | return 0; | ||
85 | } | ||
86 | |||
87 | int mxs_iomux_setup_multiple_pads(const iomux_cfg_t *pad_list, unsigned count) | ||
88 | { | ||
89 | const iomux_cfg_t *p = pad_list; | ||
90 | int i; | ||
91 | int ret; | ||
92 | |||
93 | for (i = 0; i < count; i++) { | ||
94 | ret = mxs_iomux_setup_pad(*p); | ||
95 | if (ret) | ||
96 | return ret; | ||
97 | p++; | ||
98 | } | ||
99 | |||
100 | return 0; | ||
101 | } | ||
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c new file mode 100644 index 000000000000..aa0640052f58 --- /dev/null +++ b/arch/arm/mach-mxs/mach-mx23evk.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 | |||
15 | #include <linux/delay.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/irq.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <asm/mach/time.h> | ||
23 | |||
24 | #include <mach/common.h> | ||
25 | #include <mach/iomux-mx23.h> | ||
26 | |||
27 | #include "devices-mx23.h" | ||
28 | |||
29 | static const iomux_cfg_t mx23evk_pads[] __initconst = { | ||
30 | /* duart */ | ||
31 | MX23_PAD_PWM0__DUART_RX | MXS_PAD_4MA, | ||
32 | MX23_PAD_PWM1__DUART_TX | MXS_PAD_4MA, | ||
33 | }; | ||
34 | |||
35 | static void __init mx23evk_init(void) | ||
36 | { | ||
37 | mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); | ||
38 | |||
39 | mx23_add_duart(); | ||
40 | } | ||
41 | |||
42 | static void __init mx23evk_timer_init(void) | ||
43 | { | ||
44 | mx23_clocks_init(); | ||
45 | } | ||
46 | |||
47 | static struct sys_timer mx23evk_timer = { | ||
48 | .init = mx23evk_timer_init, | ||
49 | }; | ||
50 | |||
51 | MACHINE_START(MX23EVK, "Freescale MX23 EVK") | ||
52 | /* Maintainer: Freescale Semiconductor, Inc. */ | ||
53 | .map_io = mx23_map_io, | ||
54 | .init_irq = mx23_init_irq, | ||
55 | .init_machine = mx23evk_init, | ||
56 | .timer = &mx23evk_timer, | ||
57 | MACHINE_END | ||
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c new file mode 100644 index 000000000000..d162e95910f3 --- /dev/null +++ b/arch/arm/mach-mxs/mach-mx28evk.c | |||
@@ -0,0 +1,138 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 | |||
15 | #include <linux/delay.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/clk.h> | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/mach/arch.h> | ||
23 | #include <asm/mach/time.h> | ||
24 | |||
25 | #include <mach/common.h> | ||
26 | #include <mach/iomux-mx28.h> | ||
27 | |||
28 | #include "devices-mx28.h" | ||
29 | #include "gpio.h" | ||
30 | |||
31 | #define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15) | ||
32 | #define MX28EVK_FEC_PHY_RESET MXS_GPIO_NR(4, 13) | ||
33 | |||
34 | static const iomux_cfg_t mx28evk_pads[] __initconst = { | ||
35 | /* duart */ | ||
36 | MX28_PAD_PWM0__DUART_RX | | ||
37 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
38 | MX28_PAD_PWM1__DUART_TX | | ||
39 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
40 | |||
41 | /* fec0 */ | ||
42 | MX28_PAD_ENET0_MDC__ENET0_MDC | | ||
43 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
44 | MX28_PAD_ENET0_MDIO__ENET0_MDIO | | ||
45 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
46 | MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | | ||
47 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
48 | MX28_PAD_ENET0_RXD0__ENET0_RXD0 | | ||
49 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
50 | MX28_PAD_ENET0_RXD1__ENET0_RXD1 | | ||
51 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
52 | MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | | ||
53 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
54 | MX28_PAD_ENET0_TXD0__ENET0_TXD0 | | ||
55 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
56 | MX28_PAD_ENET0_TXD1__ENET0_TXD1 | | ||
57 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
58 | MX28_PAD_ENET_CLK__CLKCTRL_ENET | | ||
59 | (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), | ||
60 | /* phy power line */ | ||
61 | MX28_PAD_SSP1_DATA3__GPIO_2_15 | | ||
62 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
63 | /* phy reset line */ | ||
64 | MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | | ||
65 | (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), | ||
66 | }; | ||
67 | |||
68 | /* fec */ | ||
69 | static void __init mx28evk_fec_reset(void) | ||
70 | { | ||
71 | int ret; | ||
72 | struct clk *clk; | ||
73 | |||
74 | /* Enable fec phy clock */ | ||
75 | clk = clk_get_sys("pll2", NULL); | ||
76 | if (!IS_ERR(clk)) | ||
77 | clk_enable(clk); | ||
78 | |||
79 | /* Power up fec phy */ | ||
80 | ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power"); | ||
81 | if (ret) { | ||
82 | pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret); | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0); | ||
87 | if (ret) { | ||
88 | pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret); | ||
89 | return; | ||
90 | } | ||
91 | |||
92 | /* Reset fec phy */ | ||
93 | ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); | ||
94 | if (ret) { | ||
95 | pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret); | ||
96 | return; | ||
97 | } | ||
98 | |||
99 | gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0); | ||
100 | if (ret) { | ||
101 | pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret); | ||
102 | return; | ||
103 | } | ||
104 | |||
105 | mdelay(1); | ||
106 | gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); | ||
107 | } | ||
108 | |||
109 | static const struct fec_platform_data mx28_fec_pdata __initconst = { | ||
110 | .phy = PHY_INTERFACE_MODE_RMII, | ||
111 | }; | ||
112 | |||
113 | static void __init mx28evk_init(void) | ||
114 | { | ||
115 | mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads)); | ||
116 | |||
117 | mx28_add_duart(); | ||
118 | |||
119 | mx28evk_fec_reset(); | ||
120 | mx28_add_fec(0, &mx28_fec_pdata); | ||
121 | } | ||
122 | |||
123 | static void __init mx28evk_timer_init(void) | ||
124 | { | ||
125 | mx28_clocks_init(); | ||
126 | } | ||
127 | |||
128 | static struct sys_timer mx28evk_timer = { | ||
129 | .init = mx28evk_timer_init, | ||
130 | }; | ||
131 | |||
132 | MACHINE_START(MX28EVK, "Freescale MX28 EVK") | ||
133 | /* Maintainer: Freescale Semiconductor, Inc. */ | ||
134 | .map_io = mx28_map_io, | ||
135 | .init_irq = mx28_init_irq, | ||
136 | .init_machine = mx28evk_init, | ||
137 | .timer = &mx28evk_timer, | ||
138 | MACHINE_END | ||
diff --git a/arch/arm/mach-mxs/mm-mx23.c b/arch/arm/mach-mxs/mm-mx23.c new file mode 100644 index 000000000000..5148cd64a6b7 --- /dev/null +++ b/arch/arm/mach-mxs/mm-mx23.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | * | ||
11 | * Create static mapping between physical to virtual memory. | ||
12 | */ | ||
13 | |||
14 | #include <linux/mm.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/mx23.h> | ||
20 | #include <mach/common.h> | ||
21 | #include <mach/iomux.h> | ||
22 | |||
23 | /* | ||
24 | * Define the MX23 memory map. | ||
25 | */ | ||
26 | static struct map_desc mx23_io_desc[] __initdata = { | ||
27 | mxs_map_entry(MX23, OCRAM, MT_DEVICE), | ||
28 | mxs_map_entry(MX23, IO, MT_DEVICE), | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * This function initializes the memory map. It is called during the | ||
33 | * system startup to create static physical to virtual memory mappings | ||
34 | * for the IO modules. | ||
35 | */ | ||
36 | void __init mx23_map_io(void) | ||
37 | { | ||
38 | iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc)); | ||
39 | } | ||
40 | |||
41 | void __init mx23_init_irq(void) | ||
42 | { | ||
43 | icoll_init_irq(); | ||
44 | mx23_register_gpios(); | ||
45 | } | ||
diff --git a/arch/arm/mach-mxs/mm-mx28.c b/arch/arm/mach-mxs/mm-mx28.c new file mode 100644 index 000000000000..7e4cea32ebc6 --- /dev/null +++ b/arch/arm/mach-mxs/mm-mx28.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | * | ||
11 | * Create static mapping between physical to virtual memory. | ||
12 | */ | ||
13 | |||
14 | #include <linux/mm.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach/map.h> | ||
18 | |||
19 | #include <mach/mx28.h> | ||
20 | #include <mach/common.h> | ||
21 | #include <mach/iomux.h> | ||
22 | |||
23 | /* | ||
24 | * Define the MX28 memory map. | ||
25 | */ | ||
26 | static struct map_desc mx28_io_desc[] __initdata = { | ||
27 | mxs_map_entry(MX28, OCRAM, MT_DEVICE), | ||
28 | mxs_map_entry(MX28, IO, MT_DEVICE), | ||
29 | }; | ||
30 | |||
31 | /* | ||
32 | * This function initializes the memory map. It is called during the | ||
33 | * system startup to create static physical to virtual memory mappings | ||
34 | * for the IO modules. | ||
35 | */ | ||
36 | void __init mx28_map_io(void) | ||
37 | { | ||
38 | iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc)); | ||
39 | } | ||
40 | |||
41 | void __init mx28_init_irq(void) | ||
42 | { | ||
43 | icoll_init_irq(); | ||
44 | mx28_register_gpios(); | ||
45 | } | ||
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx23.h b/arch/arm/mach-mxs/regs-clkctrl-mx23.h new file mode 100644 index 000000000000..dbc04747b691 --- /dev/null +++ b/arch/arm/mach-mxs/regs-clkctrl-mx23.h | |||
@@ -0,0 +1,455 @@ | |||
1 | /* | ||
2 | * Freescale CLKCTRL Register Definitions | ||
3 | * | ||
4 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. | ||
5 | * Copyright 2008-2010 Freescale Semiconductor, Inc. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * This file is created by xml file. Don't Edit it. | ||
22 | * | ||
23 | * Xml Revision: 1.48 | ||
24 | * Template revision: 26195 | ||
25 | */ | ||
26 | |||
27 | #ifndef __REGS_CLKCTRL_MX23_H__ | ||
28 | #define __REGS_CLKCTRL_MX23_H__ | ||
29 | |||
30 | |||
31 | #define HW_CLKCTRL_PLLCTRL0 (0x00000000) | ||
32 | #define HW_CLKCTRL_PLLCTRL0_SET (0x00000004) | ||
33 | #define HW_CLKCTRL_PLLCTRL0_CLR (0x00000008) | ||
34 | #define HW_CLKCTRL_PLLCTRL0_TOG (0x0000000c) | ||
35 | |||
36 | #define BP_CLKCTRL_PLLCTRL0_RSRVD6 30 | ||
37 | #define BM_CLKCTRL_PLLCTRL0_RSRVD6 0xC0000000 | ||
38 | #define BF_CLKCTRL_PLLCTRL0_RSRVD6(v) \ | ||
39 | (((v) << 30) & BM_CLKCTRL_PLLCTRL0_RSRVD6) | ||
40 | #define BP_CLKCTRL_PLLCTRL0_LFR_SEL 28 | ||
41 | #define BM_CLKCTRL_PLLCTRL0_LFR_SEL 0x30000000 | ||
42 | #define BF_CLKCTRL_PLLCTRL0_LFR_SEL(v) \ | ||
43 | (((v) << 28) & BM_CLKCTRL_PLLCTRL0_LFR_SEL) | ||
44 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__DEFAULT 0x0 | ||
45 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_2 0x1 | ||
46 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_05 0x2 | ||
47 | #define BV_CLKCTRL_PLLCTRL0_LFR_SEL__UNDEFINED 0x3 | ||
48 | #define BP_CLKCTRL_PLLCTRL0_RSRVD5 26 | ||
49 | #define BM_CLKCTRL_PLLCTRL0_RSRVD5 0x0C000000 | ||
50 | #define BF_CLKCTRL_PLLCTRL0_RSRVD5(v) \ | ||
51 | (((v) << 26) & BM_CLKCTRL_PLLCTRL0_RSRVD5) | ||
52 | #define BP_CLKCTRL_PLLCTRL0_CP_SEL 24 | ||
53 | #define BM_CLKCTRL_PLLCTRL0_CP_SEL 0x03000000 | ||
54 | #define BF_CLKCTRL_PLLCTRL0_CP_SEL(v) \ | ||
55 | (((v) << 24) & BM_CLKCTRL_PLLCTRL0_CP_SEL) | ||
56 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__DEFAULT 0x0 | ||
57 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_2 0x1 | ||
58 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_05 0x2 | ||
59 | #define BV_CLKCTRL_PLLCTRL0_CP_SEL__UNDEFINED 0x3 | ||
60 | #define BP_CLKCTRL_PLLCTRL0_RSRVD4 22 | ||
61 | #define BM_CLKCTRL_PLLCTRL0_RSRVD4 0x00C00000 | ||
62 | #define BF_CLKCTRL_PLLCTRL0_RSRVD4(v) \ | ||
63 | (((v) << 22) & BM_CLKCTRL_PLLCTRL0_RSRVD4) | ||
64 | #define BP_CLKCTRL_PLLCTRL0_DIV_SEL 20 | ||
65 | #define BM_CLKCTRL_PLLCTRL0_DIV_SEL 0x00300000 | ||
66 | #define BF_CLKCTRL_PLLCTRL0_DIV_SEL(v) \ | ||
67 | (((v) << 20) & BM_CLKCTRL_PLLCTRL0_DIV_SEL) | ||
68 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__DEFAULT 0x0 | ||
69 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWER 0x1 | ||
70 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWEST 0x2 | ||
71 | #define BV_CLKCTRL_PLLCTRL0_DIV_SEL__UNDEFINED 0x3 | ||
72 | #define BM_CLKCTRL_PLLCTRL0_RSRVD3 0x00080000 | ||
73 | #define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000 | ||
74 | #define BM_CLKCTRL_PLLCTRL0_RSRVD2 0x00020000 | ||
75 | #define BM_CLKCTRL_PLLCTRL0_POWER 0x00010000 | ||
76 | #define BP_CLKCTRL_PLLCTRL0_RSRVD1 0 | ||
77 | #define BM_CLKCTRL_PLLCTRL0_RSRVD1 0x0000FFFF | ||
78 | #define BF_CLKCTRL_PLLCTRL0_RSRVD1(v) \ | ||
79 | (((v) << 0) & BM_CLKCTRL_PLLCTRL0_RSRVD1) | ||
80 | |||
81 | #define HW_CLKCTRL_PLLCTRL1 (0x00000010) | ||
82 | |||
83 | #define BM_CLKCTRL_PLLCTRL1_LOCK 0x80000000 | ||
84 | #define BM_CLKCTRL_PLLCTRL1_FORCE_LOCK 0x40000000 | ||
85 | #define BP_CLKCTRL_PLLCTRL1_RSRVD1 16 | ||
86 | #define BM_CLKCTRL_PLLCTRL1_RSRVD1 0x3FFF0000 | ||
87 | #define BF_CLKCTRL_PLLCTRL1_RSRVD1(v) \ | ||
88 | (((v) << 16) & BM_CLKCTRL_PLLCTRL1_RSRVD1) | ||
89 | #define BP_CLKCTRL_PLLCTRL1_LOCK_COUNT 0 | ||
90 | #define BM_CLKCTRL_PLLCTRL1_LOCK_COUNT 0x0000FFFF | ||
91 | #define BF_CLKCTRL_PLLCTRL1_LOCK_COUNT(v) \ | ||
92 | (((v) << 0) & BM_CLKCTRL_PLLCTRL1_LOCK_COUNT) | ||
93 | |||
94 | #define HW_CLKCTRL_CPU (0x00000020) | ||
95 | #define HW_CLKCTRL_CPU_SET (0x00000024) | ||
96 | #define HW_CLKCTRL_CPU_CLR (0x00000028) | ||
97 | #define HW_CLKCTRL_CPU_TOG (0x0000002c) | ||
98 | |||
99 | #define BP_CLKCTRL_CPU_RSRVD5 30 | ||
100 | #define BM_CLKCTRL_CPU_RSRVD5 0xC0000000 | ||
101 | #define BF_CLKCTRL_CPU_RSRVD5(v) \ | ||
102 | (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5) | ||
103 | #define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 | ||
104 | #define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 | ||
105 | #define BM_CLKCTRL_CPU_RSRVD4 0x08000000 | ||
106 | #define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 | ||
107 | #define BP_CLKCTRL_CPU_DIV_XTAL 16 | ||
108 | #define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 | ||
109 | #define BF_CLKCTRL_CPU_DIV_XTAL(v) \ | ||
110 | (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) | ||
111 | #define BP_CLKCTRL_CPU_RSRVD3 13 | ||
112 | #define BM_CLKCTRL_CPU_RSRVD3 0x0000E000 | ||
113 | #define BF_CLKCTRL_CPU_RSRVD3(v) \ | ||
114 | (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3) | ||
115 | #define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 | ||
116 | #define BM_CLKCTRL_CPU_RSRVD2 0x00000800 | ||
117 | #define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 | ||
118 | #define BP_CLKCTRL_CPU_RSRVD1 6 | ||
119 | #define BM_CLKCTRL_CPU_RSRVD1 0x000003C0 | ||
120 | #define BF_CLKCTRL_CPU_RSRVD1(v) \ | ||
121 | (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1) | ||
122 | #define BP_CLKCTRL_CPU_DIV_CPU 0 | ||
123 | #define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F | ||
124 | #define BF_CLKCTRL_CPU_DIV_CPU(v) \ | ||
125 | (((v) << 0) & BM_CLKCTRL_CPU_DIV_CPU) | ||
126 | |||
127 | #define HW_CLKCTRL_HBUS (0x00000030) | ||
128 | #define HW_CLKCTRL_HBUS_SET (0x00000034) | ||
129 | #define HW_CLKCTRL_HBUS_CLR (0x00000038) | ||
130 | #define HW_CLKCTRL_HBUS_TOG (0x0000003c) | ||
131 | |||
132 | #define BP_CLKCTRL_HBUS_RSRVD4 30 | ||
133 | #define BM_CLKCTRL_HBUS_RSRVD4 0xC0000000 | ||
134 | #define BF_CLKCTRL_HBUS_RSRVD4(v) \ | ||
135 | (((v) << 30) & BM_CLKCTRL_HBUS_RSRVD4) | ||
136 | #define BM_CLKCTRL_HBUS_BUSY 0x20000000 | ||
137 | #define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x10000000 | ||
138 | #define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x08000000 | ||
139 | #define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000 | ||
140 | #define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000 | ||
141 | #define BM_CLKCTRL_HBUS_TRAFFIC_JAM_AS_ENABLE 0x01000000 | ||
142 | #define BM_CLKCTRL_HBUS_TRAFFIC_AS_ENABLE 0x00800000 | ||
143 | #define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000 | ||
144 | #define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000 | ||
145 | #define BM_CLKCTRL_HBUS_AUTO_SLOW_MODE 0x00100000 | ||
146 | #define BM_CLKCTRL_HBUS_RSRVD2 0x00080000 | ||
147 | #define BP_CLKCTRL_HBUS_SLOW_DIV 16 | ||
148 | #define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000 | ||
149 | #define BF_CLKCTRL_HBUS_SLOW_DIV(v) \ | ||
150 | (((v) << 16) & BM_CLKCTRL_HBUS_SLOW_DIV) | ||
151 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY1 0x0 | ||
152 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY2 0x1 | ||
153 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY4 0x2 | ||
154 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 | ||
155 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 | ||
156 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 | ||
157 | #define BP_CLKCTRL_HBUS_RSRVD1 6 | ||
158 | #define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0 | ||
159 | #define BF_CLKCTRL_HBUS_RSRVD1(v) \ | ||
160 | (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1) | ||
161 | #define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 | ||
162 | #define BP_CLKCTRL_HBUS_DIV 0 | ||
163 | #define BM_CLKCTRL_HBUS_DIV 0x0000001F | ||
164 | #define BF_CLKCTRL_HBUS_DIV(v) \ | ||
165 | (((v) << 0) & BM_CLKCTRL_HBUS_DIV) | ||
166 | |||
167 | #define HW_CLKCTRL_XBUS (0x00000040) | ||
168 | |||
169 | #define BM_CLKCTRL_XBUS_BUSY 0x80000000 | ||
170 | #define BP_CLKCTRL_XBUS_RSRVD1 11 | ||
171 | #define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF800 | ||
172 | #define BF_CLKCTRL_XBUS_RSRVD1(v) \ | ||
173 | (((v) << 11) & BM_CLKCTRL_XBUS_RSRVD1) | ||
174 | #define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 | ||
175 | #define BP_CLKCTRL_XBUS_DIV 0 | ||
176 | #define BM_CLKCTRL_XBUS_DIV 0x000003FF | ||
177 | #define BF_CLKCTRL_XBUS_DIV(v) \ | ||
178 | (((v) << 0) & BM_CLKCTRL_XBUS_DIV) | ||
179 | |||
180 | #define HW_CLKCTRL_XTAL (0x00000050) | ||
181 | #define HW_CLKCTRL_XTAL_SET (0x00000054) | ||
182 | #define HW_CLKCTRL_XTAL_CLR (0x00000058) | ||
183 | #define HW_CLKCTRL_XTAL_TOG (0x0000005c) | ||
184 | |||
185 | #define BP_CLKCTRL_XTAL_UART_CLK_GATE 31 | ||
186 | #define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000 | ||
187 | #define BP_CLKCTRL_XTAL_FILT_CLK24M_GATE 30 | ||
188 | #define BM_CLKCTRL_XTAL_FILT_CLK24M_GATE 0x40000000 | ||
189 | #define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29 | ||
190 | #define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000 | ||
191 | #define BM_CLKCTRL_XTAL_DRI_CLK24M_GATE 0x10000000 | ||
192 | #define BM_CLKCTRL_XTAL_DIGCTRL_CLK1M_GATE 0x08000000 | ||
193 | #define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 | ||
194 | #define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 | ||
195 | #define BP_CLKCTRL_XTAL_RSRVD1 2 | ||
196 | #define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC | ||
197 | #define BF_CLKCTRL_XTAL_RSRVD1(v) \ | ||
198 | (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1) | ||
199 | #define BP_CLKCTRL_XTAL_DIV_UART 0 | ||
200 | #define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 | ||
201 | #define BF_CLKCTRL_XTAL_DIV_UART(v) \ | ||
202 | (((v) << 0) & BM_CLKCTRL_XTAL_DIV_UART) | ||
203 | |||
204 | #define HW_CLKCTRL_PIX (0x00000060) | ||
205 | |||
206 | #define BP_CLKCTRL_PIX_CLKGATE 31 | ||
207 | #define BM_CLKCTRL_PIX_CLKGATE 0x80000000 | ||
208 | #define BM_CLKCTRL_PIX_RSRVD2 0x40000000 | ||
209 | #define BM_CLKCTRL_PIX_BUSY 0x20000000 | ||
210 | #define BP_CLKCTRL_PIX_RSRVD1 13 | ||
211 | #define BM_CLKCTRL_PIX_RSRVD1 0x1FFFE000 | ||
212 | #define BF_CLKCTRL_PIX_RSRVD1(v) \ | ||
213 | (((v) << 13) & BM_CLKCTRL_PIX_RSRVD1) | ||
214 | #define BM_CLKCTRL_PIX_DIV_FRAC_EN 0x00001000 | ||
215 | #define BP_CLKCTRL_PIX_DIV 0 | ||
216 | #define BM_CLKCTRL_PIX_DIV 0x00000FFF | ||
217 | #define BF_CLKCTRL_PIX_DIV(v) \ | ||
218 | (((v) << 0) & BM_CLKCTRL_PIX_DIV) | ||
219 | |||
220 | #define HW_CLKCTRL_SSP (0x00000070) | ||
221 | |||
222 | #define BP_CLKCTRL_SSP_CLKGATE 31 | ||
223 | #define BM_CLKCTRL_SSP_CLKGATE 0x80000000 | ||
224 | #define BM_CLKCTRL_SSP_RSRVD2 0x40000000 | ||
225 | #define BM_CLKCTRL_SSP_BUSY 0x20000000 | ||
226 | #define BP_CLKCTRL_SSP_RSRVD1 10 | ||
227 | #define BM_CLKCTRL_SSP_RSRVD1 0x1FFFFC00 | ||
228 | #define BF_CLKCTRL_SSP_RSRVD1(v) \ | ||
229 | (((v) << 10) & BM_CLKCTRL_SSP_RSRVD1) | ||
230 | #define BM_CLKCTRL_SSP_DIV_FRAC_EN 0x00000200 | ||
231 | #define BP_CLKCTRL_SSP_DIV 0 | ||
232 | #define BM_CLKCTRL_SSP_DIV 0x000001FF | ||
233 | #define BF_CLKCTRL_SSP_DIV(v) \ | ||
234 | (((v) << 0) & BM_CLKCTRL_SSP_DIV) | ||
235 | |||
236 | #define HW_CLKCTRL_GPMI (0x00000080) | ||
237 | |||
238 | #define BP_CLKCTRL_GPMI_CLKGATE 31 | ||
239 | #define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 | ||
240 | #define BM_CLKCTRL_GPMI_RSRVD2 0x40000000 | ||
241 | #define BM_CLKCTRL_GPMI_BUSY 0x20000000 | ||
242 | #define BP_CLKCTRL_GPMI_RSRVD1 11 | ||
243 | #define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800 | ||
244 | #define BF_CLKCTRL_GPMI_RSRVD1(v) \ | ||
245 | (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1) | ||
246 | #define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 | ||
247 | #define BP_CLKCTRL_GPMI_DIV 0 | ||
248 | #define BM_CLKCTRL_GPMI_DIV 0x000003FF | ||
249 | #define BF_CLKCTRL_GPMI_DIV(v) \ | ||
250 | (((v) << 0) & BM_CLKCTRL_GPMI_DIV) | ||
251 | |||
252 | #define HW_CLKCTRL_SPDIF (0x00000090) | ||
253 | |||
254 | #define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 | ||
255 | #define BP_CLKCTRL_SPDIF_RSRVD 0 | ||
256 | #define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF | ||
257 | #define BF_CLKCTRL_SPDIF_RSRVD(v) \ | ||
258 | (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD) | ||
259 | |||
260 | #define HW_CLKCTRL_EMI (0x000000a0) | ||
261 | |||
262 | #define BP_CLKCTRL_EMI_CLKGATE 31 | ||
263 | #define BM_CLKCTRL_EMI_CLKGATE 0x80000000 | ||
264 | #define BM_CLKCTRL_EMI_SYNC_MODE_EN 0x40000000 | ||
265 | #define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000 | ||
266 | #define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 | ||
267 | #define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 | ||
268 | #define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 | ||
269 | #define BP_CLKCTRL_EMI_RSRVD3 18 | ||
270 | #define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000 | ||
271 | #define BF_CLKCTRL_EMI_RSRVD3(v) \ | ||
272 | (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3) | ||
273 | #define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 | ||
274 | #define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 | ||
275 | #define BP_CLKCTRL_EMI_RSRVD2 12 | ||
276 | #define BM_CLKCTRL_EMI_RSRVD2 0x0000F000 | ||
277 | #define BF_CLKCTRL_EMI_RSRVD2(v) \ | ||
278 | (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2) | ||
279 | #define BP_CLKCTRL_EMI_DIV_XTAL 8 | ||
280 | #define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 | ||
281 | #define BF_CLKCTRL_EMI_DIV_XTAL(v) \ | ||
282 | (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) | ||
283 | #define BP_CLKCTRL_EMI_RSRVD1 6 | ||
284 | #define BM_CLKCTRL_EMI_RSRVD1 0x000000C0 | ||
285 | #define BF_CLKCTRL_EMI_RSRVD1(v) \ | ||
286 | (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1) | ||
287 | #define BP_CLKCTRL_EMI_DIV_EMI 0 | ||
288 | #define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F | ||
289 | #define BF_CLKCTRL_EMI_DIV_EMI(v) \ | ||
290 | (((v) << 0) & BM_CLKCTRL_EMI_DIV_EMI) | ||
291 | |||
292 | #define HW_CLKCTRL_IR (0x000000b0) | ||
293 | |||
294 | #define BM_CLKCTRL_IR_CLKGATE 0x80000000 | ||
295 | #define BM_CLKCTRL_IR_RSRVD3 0x40000000 | ||
296 | #define BM_CLKCTRL_IR_AUTO_DIV 0x20000000 | ||
297 | #define BM_CLKCTRL_IR_IR_BUSY 0x10000000 | ||
298 | #define BM_CLKCTRL_IR_IROV_BUSY 0x08000000 | ||
299 | #define BP_CLKCTRL_IR_RSRVD2 25 | ||
300 | #define BM_CLKCTRL_IR_RSRVD2 0x06000000 | ||
301 | #define BF_CLKCTRL_IR_RSRVD2(v) \ | ||
302 | (((v) << 25) & BM_CLKCTRL_IR_RSRVD2) | ||
303 | #define BP_CLKCTRL_IR_IROV_DIV 16 | ||
304 | #define BM_CLKCTRL_IR_IROV_DIV 0x01FF0000 | ||
305 | #define BF_CLKCTRL_IR_IROV_DIV(v) \ | ||
306 | (((v) << 16) & BM_CLKCTRL_IR_IROV_DIV) | ||
307 | #define BP_CLKCTRL_IR_RSRVD1 10 | ||
308 | #define BM_CLKCTRL_IR_RSRVD1 0x0000FC00 | ||
309 | #define BF_CLKCTRL_IR_RSRVD1(v) \ | ||
310 | (((v) << 10) & BM_CLKCTRL_IR_RSRVD1) | ||
311 | #define BP_CLKCTRL_IR_IR_DIV 0 | ||
312 | #define BM_CLKCTRL_IR_IR_DIV 0x000003FF | ||
313 | #define BF_CLKCTRL_IR_IR_DIV(v) \ | ||
314 | (((v) << 0) & BM_CLKCTRL_IR_IR_DIV) | ||
315 | |||
316 | #define HW_CLKCTRL_SAIF (0x000000c0) | ||
317 | |||
318 | #define BM_CLKCTRL_SAIF_CLKGATE 0x80000000 | ||
319 | #define BM_CLKCTRL_SAIF_RSRVD2 0x40000000 | ||
320 | #define BM_CLKCTRL_SAIF_BUSY 0x20000000 | ||
321 | #define BP_CLKCTRL_SAIF_RSRVD1 17 | ||
322 | #define BM_CLKCTRL_SAIF_RSRVD1 0x1FFE0000 | ||
323 | #define BF_CLKCTRL_SAIF_RSRVD1(v) \ | ||
324 | (((v) << 17) & BM_CLKCTRL_SAIF_RSRVD1) | ||
325 | #define BM_CLKCTRL_SAIF_DIV_FRAC_EN 0x00010000 | ||
326 | #define BP_CLKCTRL_SAIF_DIV 0 | ||
327 | #define BM_CLKCTRL_SAIF_DIV 0x0000FFFF | ||
328 | #define BF_CLKCTRL_SAIF_DIV(v) \ | ||
329 | (((v) << 0) & BM_CLKCTRL_SAIF_DIV) | ||
330 | |||
331 | #define HW_CLKCTRL_TV (0x000000d0) | ||
332 | |||
333 | #define BM_CLKCTRL_TV_CLK_TV108M_GATE 0x80000000 | ||
334 | #define BM_CLKCTRL_TV_CLK_TV_GATE 0x40000000 | ||
335 | #define BP_CLKCTRL_TV_RSRVD 0 | ||
336 | #define BM_CLKCTRL_TV_RSRVD 0x3FFFFFFF | ||
337 | #define BF_CLKCTRL_TV_RSRVD(v) \ | ||
338 | (((v) << 0) & BM_CLKCTRL_TV_RSRVD) | ||
339 | |||
340 | #define HW_CLKCTRL_ETM (0x000000e0) | ||
341 | |||
342 | #define BM_CLKCTRL_ETM_CLKGATE 0x80000000 | ||
343 | #define BM_CLKCTRL_ETM_RSRVD2 0x40000000 | ||
344 | #define BM_CLKCTRL_ETM_BUSY 0x20000000 | ||
345 | #define BP_CLKCTRL_ETM_RSRVD1 7 | ||
346 | #define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF80 | ||
347 | #define BF_CLKCTRL_ETM_RSRVD1(v) \ | ||
348 | (((v) << 7) & BM_CLKCTRL_ETM_RSRVD1) | ||
349 | #define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000040 | ||
350 | #define BP_CLKCTRL_ETM_DIV 0 | ||
351 | #define BM_CLKCTRL_ETM_DIV 0x0000003F | ||
352 | #define BF_CLKCTRL_ETM_DIV(v) \ | ||
353 | (((v) << 0) & BM_CLKCTRL_ETM_DIV) | ||
354 | |||
355 | #define HW_CLKCTRL_FRAC (0x000000f0) | ||
356 | #define HW_CLKCTRL_FRAC_SET (0x000000f4) | ||
357 | #define HW_CLKCTRL_FRAC_CLR (0x000000f8) | ||
358 | #define HW_CLKCTRL_FRAC_TOG (0x000000fc) | ||
359 | |||
360 | #define BP_CLKCTRL_FRAC_CLKGATEIO 31 | ||
361 | #define BM_CLKCTRL_FRAC_CLKGATEIO 0x80000000 | ||
362 | #define BM_CLKCTRL_FRAC_IO_STABLE 0x40000000 | ||
363 | #define BP_CLKCTRL_FRAC_IOFRAC 24 | ||
364 | #define BM_CLKCTRL_FRAC_IOFRAC 0x3F000000 | ||
365 | #define BF_CLKCTRL_FRAC_IOFRAC(v) \ | ||
366 | (((v) << 24) & BM_CLKCTRL_FRAC_IOFRAC) | ||
367 | #define BP_CLKCTRL_FRAC_CLKGATEPIX 23 | ||
368 | #define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000 | ||
369 | #define BM_CLKCTRL_FRAC_PIX_STABLE 0x00400000 | ||
370 | #define BP_CLKCTRL_FRAC_PIXFRAC 16 | ||
371 | #define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000 | ||
372 | #define BF_CLKCTRL_FRAC_PIXFRAC(v) \ | ||
373 | (((v) << 16) & BM_CLKCTRL_FRAC_PIXFRAC) | ||
374 | #define BP_CLKCTRL_FRAC_CLKGATEEMI 15 | ||
375 | #define BM_CLKCTRL_FRAC_CLKGATEEMI 0x00008000 | ||
376 | #define BM_CLKCTRL_FRAC_EMI_STABLE 0x00004000 | ||
377 | #define BP_CLKCTRL_FRAC_EMIFRAC 8 | ||
378 | #define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00 | ||
379 | #define BF_CLKCTRL_FRAC_EMIFRAC(v) \ | ||
380 | (((v) << 8) & BM_CLKCTRL_FRAC_EMIFRAC) | ||
381 | #define BP_CLKCTRL_FRAC_CLKGATECPU 7 | ||
382 | #define BM_CLKCTRL_FRAC_CLKGATECPU 0x00000080 | ||
383 | #define BM_CLKCTRL_FRAC_CPU_STABLE 0x00000040 | ||
384 | #define BP_CLKCTRL_FRAC_CPUFRAC 0 | ||
385 | #define BM_CLKCTRL_FRAC_CPUFRAC 0x0000003F | ||
386 | #define BF_CLKCTRL_FRAC_CPUFRAC(v) \ | ||
387 | (((v) << 0) & BM_CLKCTRL_FRAC_CPUFRAC) | ||
388 | |||
389 | #define HW_CLKCTRL_FRAC1 (0x00000100) | ||
390 | #define HW_CLKCTRL_FRAC1_SET (0x00000104) | ||
391 | #define HW_CLKCTRL_FRAC1_CLR (0x00000108) | ||
392 | #define HW_CLKCTRL_FRAC1_TOG (0x0000010c) | ||
393 | |||
394 | #define BM_CLKCTRL_FRAC1_CLKGATEVID 0x80000000 | ||
395 | #define BM_CLKCTRL_FRAC1_VID_STABLE 0x40000000 | ||
396 | #define BP_CLKCTRL_FRAC1_RSRVD1 0 | ||
397 | #define BM_CLKCTRL_FRAC1_RSRVD1 0x3FFFFFFF | ||
398 | #define BF_CLKCTRL_FRAC1_RSRVD1(v) \ | ||
399 | (((v) << 0) & BM_CLKCTRL_FRAC1_RSRVD1) | ||
400 | |||
401 | #define HW_CLKCTRL_CLKSEQ (0x00000110) | ||
402 | #define HW_CLKCTRL_CLKSEQ_SET (0x00000114) | ||
403 | #define HW_CLKCTRL_CLKSEQ_CLR (0x00000118) | ||
404 | #define HW_CLKCTRL_CLKSEQ_TOG (0x0000011c) | ||
405 | |||
406 | #define BP_CLKCTRL_CLKSEQ_RSRVD1 9 | ||
407 | #define BM_CLKCTRL_CLKSEQ_RSRVD1 0xFFFFFE00 | ||
408 | #define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \ | ||
409 | (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD1) | ||
410 | #define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 | ||
411 | #define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00000080 | ||
412 | #define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000040 | ||
413 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP 0x00000020 | ||
414 | #define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000010 | ||
415 | #define BM_CLKCTRL_CLKSEQ_BYPASS_IR 0x00000008 | ||
416 | #define BM_CLKCTRL_CLKSEQ_RSRVD0 0x00000004 | ||
417 | #define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002 | ||
418 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF 0x00000001 | ||
419 | |||
420 | #define HW_CLKCTRL_RESET (0x00000120) | ||
421 | |||
422 | #define BP_CLKCTRL_RESET_RSRVD 2 | ||
423 | #define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFFC | ||
424 | #define BF_CLKCTRL_RESET_RSRVD(v) \ | ||
425 | (((v) << 2) & BM_CLKCTRL_RESET_RSRVD) | ||
426 | #define BM_CLKCTRL_RESET_CHIP 0x00000002 | ||
427 | #define BM_CLKCTRL_RESET_DIG 0x00000001 | ||
428 | |||
429 | #define HW_CLKCTRL_STATUS (0x00000130) | ||
430 | |||
431 | #define BP_CLKCTRL_STATUS_CPU_LIMIT 30 | ||
432 | #define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 | ||
433 | #define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ | ||
434 | (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) | ||
435 | #define BP_CLKCTRL_STATUS_RSRVD 0 | ||
436 | #define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF | ||
437 | #define BF_CLKCTRL_STATUS_RSRVD(v) \ | ||
438 | (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD) | ||
439 | |||
440 | #define HW_CLKCTRL_VERSION (0x00000140) | ||
441 | |||
442 | #define BP_CLKCTRL_VERSION_MAJOR 24 | ||
443 | #define BM_CLKCTRL_VERSION_MAJOR 0xFF000000 | ||
444 | #define BF_CLKCTRL_VERSION_MAJOR(v) \ | ||
445 | (((v) << 24) & BM_CLKCTRL_VERSION_MAJOR) | ||
446 | #define BP_CLKCTRL_VERSION_MINOR 16 | ||
447 | #define BM_CLKCTRL_VERSION_MINOR 0x00FF0000 | ||
448 | #define BF_CLKCTRL_VERSION_MINOR(v) \ | ||
449 | (((v) << 16) & BM_CLKCTRL_VERSION_MINOR) | ||
450 | #define BP_CLKCTRL_VERSION_STEP 0 | ||
451 | #define BM_CLKCTRL_VERSION_STEP 0x0000FFFF | ||
452 | #define BF_CLKCTRL_VERSION_STEP(v) \ | ||
453 | (((v) << 0) & BM_CLKCTRL_VERSION_STEP) | ||
454 | |||
455 | #endif /* __REGS_CLKCTRL_MX23_H__ */ | ||
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx28.h b/arch/arm/mach-mxs/regs-clkctrl-mx28.h new file mode 100644 index 000000000000..661df18755f7 --- /dev/null +++ b/arch/arm/mach-mxs/regs-clkctrl-mx28.h | |||
@@ -0,0 +1,663 @@ | |||
1 | /* | ||
2 | * Freescale CLKCTRL Register Definitions | ||
3 | * | ||
4 | * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | * | ||
20 | * This file is created by xml file. Don't Edit it. | ||
21 | * | ||
22 | * Xml Revision: 1.48 | ||
23 | * Template revision: 26195 | ||
24 | */ | ||
25 | |||
26 | #ifndef __REGS_CLKCTRL_MX28_H__ | ||
27 | #define __REGS_CLKCTRL_MX28_H__ | ||
28 | |||
29 | #define HW_CLKCTRL_PLL0CTRL0 (0x00000000) | ||
30 | #define HW_CLKCTRL_PLL0CTRL0_SET (0x00000004) | ||
31 | #define HW_CLKCTRL_PLL0CTRL0_CLR (0x00000008) | ||
32 | #define HW_CLKCTRL_PLL0CTRL0_TOG (0x0000000c) | ||
33 | |||
34 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD6 30 | ||
35 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD6 0xC0000000 | ||
36 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD6(v) \ | ||
37 | (((v) << 30) & BM_CLKCTRL_PLL0CTRL0_RSRVD6) | ||
38 | #define BP_CLKCTRL_PLL0CTRL0_LFR_SEL 28 | ||
39 | #define BM_CLKCTRL_PLL0CTRL0_LFR_SEL 0x30000000 | ||
40 | #define BF_CLKCTRL_PLL0CTRL0_LFR_SEL(v) \ | ||
41 | (((v) << 28) & BM_CLKCTRL_PLL0CTRL0_LFR_SEL) | ||
42 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__DEFAULT 0x0 | ||
43 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_2 0x1 | ||
44 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_05 0x2 | ||
45 | #define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__UNDEFINED 0x3 | ||
46 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD5 26 | ||
47 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD5 0x0C000000 | ||
48 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD5(v) \ | ||
49 | (((v) << 26) & BM_CLKCTRL_PLL0CTRL0_RSRVD5) | ||
50 | #define BP_CLKCTRL_PLL0CTRL0_CP_SEL 24 | ||
51 | #define BM_CLKCTRL_PLL0CTRL0_CP_SEL 0x03000000 | ||
52 | #define BF_CLKCTRL_PLL0CTRL0_CP_SEL(v) \ | ||
53 | (((v) << 24) & BM_CLKCTRL_PLL0CTRL0_CP_SEL) | ||
54 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__DEFAULT 0x0 | ||
55 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_2 0x1 | ||
56 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_05 0x2 | ||
57 | #define BV_CLKCTRL_PLL0CTRL0_CP_SEL__UNDEFINED 0x3 | ||
58 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD4 22 | ||
59 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD4 0x00C00000 | ||
60 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD4(v) \ | ||
61 | (((v) << 22) & BM_CLKCTRL_PLL0CTRL0_RSRVD4) | ||
62 | #define BP_CLKCTRL_PLL0CTRL0_DIV_SEL 20 | ||
63 | #define BM_CLKCTRL_PLL0CTRL0_DIV_SEL 0x00300000 | ||
64 | #define BF_CLKCTRL_PLL0CTRL0_DIV_SEL(v) \ | ||
65 | (((v) << 20) & BM_CLKCTRL_PLL0CTRL0_DIV_SEL) | ||
66 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__DEFAULT 0x0 | ||
67 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWER 0x1 | ||
68 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWEST 0x2 | ||
69 | #define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__UNDEFINED 0x3 | ||
70 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD3 0x00080000 | ||
71 | #define BM_CLKCTRL_PLL0CTRL0_EN_USB_CLKS 0x00040000 | ||
72 | #define BM_CLKCTRL_PLL0CTRL0_POWER 0x00020000 | ||
73 | #define BP_CLKCTRL_PLL0CTRL0_RSRVD1 0 | ||
74 | #define BM_CLKCTRL_PLL0CTRL0_RSRVD1 0x0001FFFF | ||
75 | #define BF_CLKCTRL_PLL0CTRL0_RSRVD1(v) \ | ||
76 | (((v) << 0) & BM_CLKCTRL_PLL0CTRL0_RSRVD1) | ||
77 | |||
78 | #define HW_CLKCTRL_PLL0CTRL1 (0x00000010) | ||
79 | |||
80 | #define BM_CLKCTRL_PLL0CTRL1_LOCK 0x80000000 | ||
81 | #define BM_CLKCTRL_PLL0CTRL1_FORCE_LOCK 0x40000000 | ||
82 | #define BP_CLKCTRL_PLL0CTRL1_RSRVD1 16 | ||
83 | #define BM_CLKCTRL_PLL0CTRL1_RSRVD1 0x3FFF0000 | ||
84 | #define BF_CLKCTRL_PLL0CTRL1_RSRVD1(v) \ | ||
85 | (((v) << 16) & BM_CLKCTRL_PLL0CTRL1_RSRVD1) | ||
86 | #define BP_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0 | ||
87 | #define BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0x0000FFFF | ||
88 | #define BF_CLKCTRL_PLL0CTRL1_LOCK_COUNT(v) \ | ||
89 | (((v) << 0) & BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT) | ||
90 | |||
91 | #define HW_CLKCTRL_PLL1CTRL0 (0x00000020) | ||
92 | #define HW_CLKCTRL_PLL1CTRL0_SET (0x00000024) | ||
93 | #define HW_CLKCTRL_PLL1CTRL0_CLR (0x00000028) | ||
94 | #define HW_CLKCTRL_PLL1CTRL0_TOG (0x0000002c) | ||
95 | |||
96 | #define BM_CLKCTRL_PLL1CTRL0_CLKGATEEMI 0x80000000 | ||
97 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD6 0x40000000 | ||
98 | #define BP_CLKCTRL_PLL1CTRL0_LFR_SEL 28 | ||
99 | #define BM_CLKCTRL_PLL1CTRL0_LFR_SEL 0x30000000 | ||
100 | #define BF_CLKCTRL_PLL1CTRL0_LFR_SEL(v) \ | ||
101 | (((v) << 28) & BM_CLKCTRL_PLL1CTRL0_LFR_SEL) | ||
102 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__DEFAULT 0x0 | ||
103 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_2 0x1 | ||
104 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_05 0x2 | ||
105 | #define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__UNDEFINED 0x3 | ||
106 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD5 26 | ||
107 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD5 0x0C000000 | ||
108 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD5(v) \ | ||
109 | (((v) << 26) & BM_CLKCTRL_PLL1CTRL0_RSRVD5) | ||
110 | #define BP_CLKCTRL_PLL1CTRL0_CP_SEL 24 | ||
111 | #define BM_CLKCTRL_PLL1CTRL0_CP_SEL 0x03000000 | ||
112 | #define BF_CLKCTRL_PLL1CTRL0_CP_SEL(v) \ | ||
113 | (((v) << 24) & BM_CLKCTRL_PLL1CTRL0_CP_SEL) | ||
114 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__DEFAULT 0x0 | ||
115 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_2 0x1 | ||
116 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_05 0x2 | ||
117 | #define BV_CLKCTRL_PLL1CTRL0_CP_SEL__UNDEFINED 0x3 | ||
118 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD4 22 | ||
119 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD4 0x00C00000 | ||
120 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD4(v) \ | ||
121 | (((v) << 22) & BM_CLKCTRL_PLL1CTRL0_RSRVD4) | ||
122 | #define BP_CLKCTRL_PLL1CTRL0_DIV_SEL 20 | ||
123 | #define BM_CLKCTRL_PLL1CTRL0_DIV_SEL 0x00300000 | ||
124 | #define BF_CLKCTRL_PLL1CTRL0_DIV_SEL(v) \ | ||
125 | (((v) << 20) & BM_CLKCTRL_PLL1CTRL0_DIV_SEL) | ||
126 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__DEFAULT 0x0 | ||
127 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWER 0x1 | ||
128 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWEST 0x2 | ||
129 | #define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__UNDEFINED 0x3 | ||
130 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD3 0x00080000 | ||
131 | #define BM_CLKCTRL_PLL1CTRL0_EN_USB_CLKS 0x00040000 | ||
132 | #define BM_CLKCTRL_PLL1CTRL0_POWER 0x00020000 | ||
133 | #define BP_CLKCTRL_PLL1CTRL0_RSRVD1 0 | ||
134 | #define BM_CLKCTRL_PLL1CTRL0_RSRVD1 0x0001FFFF | ||
135 | #define BF_CLKCTRL_PLL1CTRL0_RSRVD1(v) \ | ||
136 | (((v) << 0) & BM_CLKCTRL_PLL1CTRL0_RSRVD1) | ||
137 | |||
138 | #define HW_CLKCTRL_PLL1CTRL1 (0x00000030) | ||
139 | |||
140 | #define BM_CLKCTRL_PLL1CTRL1_LOCK 0x80000000 | ||
141 | #define BM_CLKCTRL_PLL1CTRL1_FORCE_LOCK 0x40000000 | ||
142 | #define BP_CLKCTRL_PLL1CTRL1_RSRVD1 16 | ||
143 | #define BM_CLKCTRL_PLL1CTRL1_RSRVD1 0x3FFF0000 | ||
144 | #define BF_CLKCTRL_PLL1CTRL1_RSRVD1(v) \ | ||
145 | (((v) << 16) & BM_CLKCTRL_PLL1CTRL1_RSRVD1) | ||
146 | #define BP_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0 | ||
147 | #define BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0x0000FFFF | ||
148 | #define BF_CLKCTRL_PLL1CTRL1_LOCK_COUNT(v) \ | ||
149 | (((v) << 0) & BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT) | ||
150 | |||
151 | #define HW_CLKCTRL_PLL2CTRL0 (0x00000040) | ||
152 | #define HW_CLKCTRL_PLL2CTRL0_SET (0x00000044) | ||
153 | #define HW_CLKCTRL_PLL2CTRL0_CLR (0x00000048) | ||
154 | #define HW_CLKCTRL_PLL2CTRL0_TOG (0x0000004c) | ||
155 | |||
156 | #define BM_CLKCTRL_PLL2CTRL0_CLKGATE 0x80000000 | ||
157 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD3 0x40000000 | ||
158 | #define BP_CLKCTRL_PLL2CTRL0_LFR_SEL 28 | ||
159 | #define BM_CLKCTRL_PLL2CTRL0_LFR_SEL 0x30000000 | ||
160 | #define BF_CLKCTRL_PLL2CTRL0_LFR_SEL(v) \ | ||
161 | (((v) << 28) & BM_CLKCTRL_PLL2CTRL0_LFR_SEL) | ||
162 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD2 0x08000000 | ||
163 | #define BM_CLKCTRL_PLL2CTRL0_HOLD_RING_OFF_B 0x04000000 | ||
164 | #define BP_CLKCTRL_PLL2CTRL0_CP_SEL 24 | ||
165 | #define BM_CLKCTRL_PLL2CTRL0_CP_SEL 0x03000000 | ||
166 | #define BF_CLKCTRL_PLL2CTRL0_CP_SEL(v) \ | ||
167 | (((v) << 24) & BM_CLKCTRL_PLL2CTRL0_CP_SEL) | ||
168 | #define BM_CLKCTRL_PLL2CTRL0_POWER 0x00800000 | ||
169 | #define BP_CLKCTRL_PLL2CTRL0_RSRVD1 0 | ||
170 | #define BM_CLKCTRL_PLL2CTRL0_RSRVD1 0x007FFFFF | ||
171 | #define BF_CLKCTRL_PLL2CTRL0_RSRVD1(v) \ | ||
172 | (((v) << 0) & BM_CLKCTRL_PLL2CTRL0_RSRVD1) | ||
173 | |||
174 | #define HW_CLKCTRL_CPU (0x00000050) | ||
175 | #define HW_CLKCTRL_CPU_SET (0x00000054) | ||
176 | #define HW_CLKCTRL_CPU_CLR (0x00000058) | ||
177 | #define HW_CLKCTRL_CPU_TOG (0x0000005c) | ||
178 | |||
179 | #define BP_CLKCTRL_CPU_RSRVD5 30 | ||
180 | #define BM_CLKCTRL_CPU_RSRVD5 0xC0000000 | ||
181 | #define BF_CLKCTRL_CPU_RSRVD5(v) \ | ||
182 | (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5) | ||
183 | #define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 | ||
184 | #define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 | ||
185 | #define BM_CLKCTRL_CPU_RSRVD4 0x08000000 | ||
186 | #define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 | ||
187 | #define BP_CLKCTRL_CPU_DIV_XTAL 16 | ||
188 | #define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 | ||
189 | #define BF_CLKCTRL_CPU_DIV_XTAL(v) \ | ||
190 | (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) | ||
191 | #define BP_CLKCTRL_CPU_RSRVD3 13 | ||
192 | #define BM_CLKCTRL_CPU_RSRVD3 0x0000E000 | ||
193 | #define BF_CLKCTRL_CPU_RSRVD3(v) \ | ||
194 | (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3) | ||
195 | #define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 | ||
196 | #define BM_CLKCTRL_CPU_RSRVD2 0x00000800 | ||
197 | #define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 | ||
198 | #define BP_CLKCTRL_CPU_RSRVD1 6 | ||
199 | #define BM_CLKCTRL_CPU_RSRVD1 0x000003C0 | ||
200 | #define BF_CLKCTRL_CPU_RSRVD1(v) \ | ||
201 | (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1) | ||
202 | #define BP_CLKCTRL_CPU_DIV_CPU 0 | ||
203 | #define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F | ||
204 | #define BF_CLKCTRL_CPU_DIV_CPU(v) \ | ||
205 | (((v) << 0) & BM_CLKCTRL_CPU_DIV_CPU) | ||
206 | |||
207 | #define HW_CLKCTRL_HBUS (0x00000060) | ||
208 | #define HW_CLKCTRL_HBUS_SET (0x00000064) | ||
209 | #define HW_CLKCTRL_HBUS_CLR (0x00000068) | ||
210 | #define HW_CLKCTRL_HBUS_TOG (0x0000006c) | ||
211 | |||
212 | #define BM_CLKCTRL_HBUS_ASM_BUSY 0x80000000 | ||
213 | #define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x40000000 | ||
214 | #define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x20000000 | ||
215 | #define BM_CLKCTRL_HBUS_RSRVD2 0x10000000 | ||
216 | #define BM_CLKCTRL_HBUS_ASM_EMIPORT_AS_ENABLE 0x08000000 | ||
217 | #define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000 | ||
218 | #define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000 | ||
219 | #define BM_CLKCTRL_HBUS_TRAFFIC_JAM_AS_ENABLE 0x01000000 | ||
220 | #define BM_CLKCTRL_HBUS_TRAFFIC_AS_ENABLE 0x00800000 | ||
221 | #define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000 | ||
222 | #define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000 | ||
223 | #define BM_CLKCTRL_HBUS_ASM_ENABLE 0x00100000 | ||
224 | #define BM_CLKCTRL_HBUS_AUTO_CLEAR_DIV_ENABLE 0x00080000 | ||
225 | #define BP_CLKCTRL_HBUS_SLOW_DIV 16 | ||
226 | #define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000 | ||
227 | #define BF_CLKCTRL_HBUS_SLOW_DIV(v) \ | ||
228 | (((v) << 16) & BM_CLKCTRL_HBUS_SLOW_DIV) | ||
229 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY1 0x0 | ||
230 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY2 0x1 | ||
231 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY4 0x2 | ||
232 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 | ||
233 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 | ||
234 | #define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 | ||
235 | #define BP_CLKCTRL_HBUS_RSRVD1 6 | ||
236 | #define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0 | ||
237 | #define BF_CLKCTRL_HBUS_RSRVD1(v) \ | ||
238 | (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1) | ||
239 | #define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 | ||
240 | #define BP_CLKCTRL_HBUS_DIV 0 | ||
241 | #define BM_CLKCTRL_HBUS_DIV 0x0000001F | ||
242 | #define BF_CLKCTRL_HBUS_DIV(v) \ | ||
243 | (((v) << 0) & BM_CLKCTRL_HBUS_DIV) | ||
244 | |||
245 | #define HW_CLKCTRL_XBUS (0x00000070) | ||
246 | |||
247 | #define BM_CLKCTRL_XBUS_BUSY 0x80000000 | ||
248 | #define BP_CLKCTRL_XBUS_RSRVD1 12 | ||
249 | #define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF000 | ||
250 | #define BF_CLKCTRL_XBUS_RSRVD1(v) \ | ||
251 | (((v) << 12) & BM_CLKCTRL_XBUS_RSRVD1) | ||
252 | #define BM_CLKCTRL_XBUS_AUTO_CLEAR_DIV_ENABLE 0x00000800 | ||
253 | #define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 | ||
254 | #define BP_CLKCTRL_XBUS_DIV 0 | ||
255 | #define BM_CLKCTRL_XBUS_DIV 0x000003FF | ||
256 | #define BF_CLKCTRL_XBUS_DIV(v) \ | ||
257 | (((v) << 0) & BM_CLKCTRL_XBUS_DIV) | ||
258 | |||
259 | #define HW_CLKCTRL_XTAL (0x00000080) | ||
260 | #define HW_CLKCTRL_XTAL_SET (0x00000084) | ||
261 | #define HW_CLKCTRL_XTAL_CLR (0x00000088) | ||
262 | #define HW_CLKCTRL_XTAL_TOG (0x0000008c) | ||
263 | |||
264 | #define BP_CLKCTRL_XTAL_UART_CLK_GATE 31 | ||
265 | #define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000 | ||
266 | #define BM_CLKCTRL_XTAL_RSRVD3 0x40000000 | ||
267 | #define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29 | ||
268 | #define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000 | ||
269 | #define BP_CLKCTRL_XTAL_RSRVD2 27 | ||
270 | #define BM_CLKCTRL_XTAL_RSRVD2 0x18000000 | ||
271 | #define BF_CLKCTRL_XTAL_RSRVD2(v) \ | ||
272 | (((v) << 27) & BM_CLKCTRL_XTAL_RSRVD2) | ||
273 | #define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 | ||
274 | #define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 | ||
275 | #define BP_CLKCTRL_XTAL_RSRVD1 2 | ||
276 | #define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC | ||
277 | #define BF_CLKCTRL_XTAL_RSRVD1(v) \ | ||
278 | (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1) | ||
279 | #define BP_CLKCTRL_XTAL_DIV_UART 0 | ||
280 | #define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 | ||
281 | #define BF_CLKCTRL_XTAL_DIV_UART(v) \ | ||
282 | (((v) << 0) & BM_CLKCTRL_XTAL_DIV_UART) | ||
283 | |||
284 | #define HW_CLKCTRL_SSP0 (0x00000090) | ||
285 | |||
286 | #define BP_CLKCTRL_SSP0_CLKGATE 31 | ||
287 | #define BM_CLKCTRL_SSP0_CLKGATE 0x80000000 | ||
288 | #define BM_CLKCTRL_SSP0_RSRVD2 0x40000000 | ||
289 | #define BM_CLKCTRL_SSP0_BUSY 0x20000000 | ||
290 | #define BP_CLKCTRL_SSP0_RSRVD1 10 | ||
291 | #define BM_CLKCTRL_SSP0_RSRVD1 0x1FFFFC00 | ||
292 | #define BF_CLKCTRL_SSP0_RSRVD1(v) \ | ||
293 | (((v) << 10) & BM_CLKCTRL_SSP0_RSRVD1) | ||
294 | #define BM_CLKCTRL_SSP0_DIV_FRAC_EN 0x00000200 | ||
295 | #define BP_CLKCTRL_SSP0_DIV 0 | ||
296 | #define BM_CLKCTRL_SSP0_DIV 0x000001FF | ||
297 | #define BF_CLKCTRL_SSP0_DIV(v) \ | ||
298 | (((v) << 0) & BM_CLKCTRL_SSP0_DIV) | ||
299 | |||
300 | #define HW_CLKCTRL_SSP1 (0x000000a0) | ||
301 | |||
302 | #define BP_CLKCTRL_SSP1_CLKGATE 31 | ||
303 | #define BM_CLKCTRL_SSP1_CLKGATE 0x80000000 | ||
304 | #define BM_CLKCTRL_SSP1_RSRVD2 0x40000000 | ||
305 | #define BM_CLKCTRL_SSP1_BUSY 0x20000000 | ||
306 | #define BP_CLKCTRL_SSP1_RSRVD1 10 | ||
307 | #define BM_CLKCTRL_SSP1_RSRVD1 0x1FFFFC00 | ||
308 | #define BF_CLKCTRL_SSP1_RSRVD1(v) \ | ||
309 | (((v) << 10) & BM_CLKCTRL_SSP1_RSRVD1) | ||
310 | #define BM_CLKCTRL_SSP1_DIV_FRAC_EN 0x00000200 | ||
311 | #define BP_CLKCTRL_SSP1_DIV 0 | ||
312 | #define BM_CLKCTRL_SSP1_DIV 0x000001FF | ||
313 | #define BF_CLKCTRL_SSP1_DIV(v) \ | ||
314 | (((v) << 0) & BM_CLKCTRL_SSP1_DIV) | ||
315 | |||
316 | #define HW_CLKCTRL_SSP2 (0x000000b0) | ||
317 | |||
318 | #define BP_CLKCTRL_SSP2_CLKGATE 31 | ||
319 | #define BM_CLKCTRL_SSP2_CLKGATE 0x80000000 | ||
320 | #define BM_CLKCTRL_SSP2_RSRVD2 0x40000000 | ||
321 | #define BM_CLKCTRL_SSP2_BUSY 0x20000000 | ||
322 | #define BP_CLKCTRL_SSP2_RSRVD1 10 | ||
323 | #define BM_CLKCTRL_SSP2_RSRVD1 0x1FFFFC00 | ||
324 | #define BF_CLKCTRL_SSP2_RSRVD1(v) \ | ||
325 | (((v) << 10) & BM_CLKCTRL_SSP2_RSRVD1) | ||
326 | #define BM_CLKCTRL_SSP2_DIV_FRAC_EN 0x00000200 | ||
327 | #define BP_CLKCTRL_SSP2_DIV 0 | ||
328 | #define BM_CLKCTRL_SSP2_DIV 0x000001FF | ||
329 | #define BF_CLKCTRL_SSP2_DIV(v) \ | ||
330 | (((v) << 0) & BM_CLKCTRL_SSP2_DIV) | ||
331 | |||
332 | #define HW_CLKCTRL_SSP3 (0x000000c0) | ||
333 | |||
334 | #define BP_CLKCTRL_SSP3_CLKGATE 31 | ||
335 | #define BM_CLKCTRL_SSP3_CLKGATE 0x80000000 | ||
336 | #define BM_CLKCTRL_SSP3_RSRVD2 0x40000000 | ||
337 | #define BM_CLKCTRL_SSP3_BUSY 0x20000000 | ||
338 | #define BP_CLKCTRL_SSP3_RSRVD1 10 | ||
339 | #define BM_CLKCTRL_SSP3_RSRVD1 0x1FFFFC00 | ||
340 | #define BF_CLKCTRL_SSP3_RSRVD1(v) \ | ||
341 | (((v) << 10) & BM_CLKCTRL_SSP3_RSRVD1) | ||
342 | #define BM_CLKCTRL_SSP3_DIV_FRAC_EN 0x00000200 | ||
343 | #define BP_CLKCTRL_SSP3_DIV 0 | ||
344 | #define BM_CLKCTRL_SSP3_DIV 0x000001FF | ||
345 | #define BF_CLKCTRL_SSP3_DIV(v) \ | ||
346 | (((v) << 0) & BM_CLKCTRL_SSP3_DIV) | ||
347 | |||
348 | #define HW_CLKCTRL_GPMI (0x000000d0) | ||
349 | |||
350 | #define BP_CLKCTRL_GPMI_CLKGATE 31 | ||
351 | #define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 | ||
352 | #define BM_CLKCTRL_GPMI_RSRVD2 0x40000000 | ||
353 | #define BM_CLKCTRL_GPMI_BUSY 0x20000000 | ||
354 | #define BP_CLKCTRL_GPMI_RSRVD1 11 | ||
355 | #define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800 | ||
356 | #define BF_CLKCTRL_GPMI_RSRVD1(v) \ | ||
357 | (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1) | ||
358 | #define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 | ||
359 | #define BP_CLKCTRL_GPMI_DIV 0 | ||
360 | #define BM_CLKCTRL_GPMI_DIV 0x000003FF | ||
361 | #define BF_CLKCTRL_GPMI_DIV(v) \ | ||
362 | (((v) << 0) & BM_CLKCTRL_GPMI_DIV) | ||
363 | |||
364 | #define HW_CLKCTRL_SPDIF (0x000000e0) | ||
365 | |||
366 | #define BP_CLKCTRL_SPDIF_CLKGATE 31 | ||
367 | #define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 | ||
368 | #define BP_CLKCTRL_SPDIF_RSRVD 0 | ||
369 | #define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF | ||
370 | #define BF_CLKCTRL_SPDIF_RSRVD(v) \ | ||
371 | (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD) | ||
372 | |||
373 | #define HW_CLKCTRL_EMI (0x000000f0) | ||
374 | |||
375 | #define BP_CLKCTRL_EMI_CLKGATE 31 | ||
376 | #define BM_CLKCTRL_EMI_CLKGATE 0x80000000 | ||
377 | #define BM_CLKCTRL_EMI_SYNC_MODE_EN 0x40000000 | ||
378 | #define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000 | ||
379 | #define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 | ||
380 | #define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 | ||
381 | #define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 | ||
382 | #define BP_CLKCTRL_EMI_RSRVD3 18 | ||
383 | #define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000 | ||
384 | #define BF_CLKCTRL_EMI_RSRVD3(v) \ | ||
385 | (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3) | ||
386 | #define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 | ||
387 | #define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 | ||
388 | #define BP_CLKCTRL_EMI_RSRVD2 12 | ||
389 | #define BM_CLKCTRL_EMI_RSRVD2 0x0000F000 | ||
390 | #define BF_CLKCTRL_EMI_RSRVD2(v) \ | ||
391 | (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2) | ||
392 | #define BP_CLKCTRL_EMI_DIV_XTAL 8 | ||
393 | #define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 | ||
394 | #define BF_CLKCTRL_EMI_DIV_XTAL(v) \ | ||
395 | (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) | ||
396 | #define BP_CLKCTRL_EMI_RSRVD1 6 | ||
397 | #define BM_CLKCTRL_EMI_RSRVD1 0x000000C0 | ||
398 | #define BF_CLKCTRL_EMI_RSRVD1(v) \ | ||
399 | (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1) | ||
400 | #define BP_CLKCTRL_EMI_DIV_EMI 0 | ||
401 | #define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F | ||
402 | #define BF_CLKCTRL_EMI_DIV_EMI(v) \ | ||
403 | (((v) << 0) & BM_CLKCTRL_EMI_DIV_EMI) | ||
404 | |||
405 | #define HW_CLKCTRL_SAIF0 (0x00000100) | ||
406 | |||
407 | #define BP_CLKCTRL_SAIF0_CLKGATE 31 | ||
408 | #define BM_CLKCTRL_SAIF0_CLKGATE 0x80000000 | ||
409 | #define BM_CLKCTRL_SAIF0_RSRVD2 0x40000000 | ||
410 | #define BM_CLKCTRL_SAIF0_BUSY 0x20000000 | ||
411 | #define BP_CLKCTRL_SAIF0_RSRVD1 17 | ||
412 | #define BM_CLKCTRL_SAIF0_RSRVD1 0x1FFE0000 | ||
413 | #define BF_CLKCTRL_SAIF0_RSRVD1(v) \ | ||
414 | (((v) << 17) & BM_CLKCTRL_SAIF0_RSRVD1) | ||
415 | #define BM_CLKCTRL_SAIF0_DIV_FRAC_EN 0x00010000 | ||
416 | #define BP_CLKCTRL_SAIF0_DIV 0 | ||
417 | #define BM_CLKCTRL_SAIF0_DIV 0x0000FFFF | ||
418 | #define BF_CLKCTRL_SAIF0_DIV(v) \ | ||
419 | (((v) << 0) & BM_CLKCTRL_SAIF0_DIV) | ||
420 | |||
421 | #define HW_CLKCTRL_SAIF1 (0x00000110) | ||
422 | |||
423 | #define BP_CLKCTRL_SAIF1_CLKGATE 31 | ||
424 | #define BM_CLKCTRL_SAIF1_CLKGATE 0x80000000 | ||
425 | #define BM_CLKCTRL_SAIF1_RSRVD2 0x40000000 | ||
426 | #define BM_CLKCTRL_SAIF1_BUSY 0x20000000 | ||
427 | #define BP_CLKCTRL_SAIF1_RSRVD1 17 | ||
428 | #define BM_CLKCTRL_SAIF1_RSRVD1 0x1FFE0000 | ||
429 | #define BF_CLKCTRL_SAIF1_RSRVD1(v) \ | ||
430 | (((v) << 17) & BM_CLKCTRL_SAIF1_RSRVD1) | ||
431 | #define BM_CLKCTRL_SAIF1_DIV_FRAC_EN 0x00010000 | ||
432 | #define BP_CLKCTRL_SAIF1_DIV 0 | ||
433 | #define BM_CLKCTRL_SAIF1_DIV 0x0000FFFF | ||
434 | #define BF_CLKCTRL_SAIF1_DIV(v) \ | ||
435 | (((v) << 0) & BM_CLKCTRL_SAIF1_DIV) | ||
436 | |||
437 | #define HW_CLKCTRL_DIS_LCDIF (0x00000120) | ||
438 | |||
439 | #define BP_CLKCTRL_DIS_LCDIF_CLKGATE 31 | ||
440 | #define BM_CLKCTRL_DIS_LCDIF_CLKGATE 0x80000000 | ||
441 | #define BM_CLKCTRL_DIS_LCDIF_RSRVD2 0x40000000 | ||
442 | #define BM_CLKCTRL_DIS_LCDIF_BUSY 0x20000000 | ||
443 | #define BP_CLKCTRL_DIS_LCDIF_RSRVD1 14 | ||
444 | #define BM_CLKCTRL_DIS_LCDIF_RSRVD1 0x1FFFC000 | ||
445 | #define BF_CLKCTRL_DIS_LCDIF_RSRVD1(v) \ | ||
446 | (((v) << 14) & BM_CLKCTRL_DIS_LCDIF_RSRVD1) | ||
447 | #define BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN 0x00002000 | ||
448 | #define BP_CLKCTRL_DIS_LCDIF_DIV 0 | ||
449 | #define BM_CLKCTRL_DIS_LCDIF_DIV 0x00001FFF | ||
450 | #define BF_CLKCTRL_DIS_LCDIF_DIV(v) \ | ||
451 | (((v) << 0) & BM_CLKCTRL_DIS_LCDIF_DIV) | ||
452 | |||
453 | #define HW_CLKCTRL_ETM (0x00000130) | ||
454 | |||
455 | #define BM_CLKCTRL_ETM_CLKGATE 0x80000000 | ||
456 | #define BM_CLKCTRL_ETM_RSRVD2 0x40000000 | ||
457 | #define BM_CLKCTRL_ETM_BUSY 0x20000000 | ||
458 | #define BP_CLKCTRL_ETM_RSRVD1 8 | ||
459 | #define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF00 | ||
460 | #define BF_CLKCTRL_ETM_RSRVD1(v) \ | ||
461 | (((v) << 8) & BM_CLKCTRL_ETM_RSRVD1) | ||
462 | #define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000080 | ||
463 | #define BP_CLKCTRL_ETM_DIV 0 | ||
464 | #define BM_CLKCTRL_ETM_DIV 0x0000007F | ||
465 | #define BF_CLKCTRL_ETM_DIV(v) \ | ||
466 | (((v) << 0) & BM_CLKCTRL_ETM_DIV) | ||
467 | |||
468 | #define HW_CLKCTRL_ENET (0x00000140) | ||
469 | |||
470 | #define BM_CLKCTRL_ENET_SLEEP 0x80000000 | ||
471 | #define BP_CLKCTRL_ENET_DISABLE 30 | ||
472 | #define BM_CLKCTRL_ENET_DISABLE 0x40000000 | ||
473 | #define BM_CLKCTRL_ENET_STATUS 0x20000000 | ||
474 | #define BM_CLKCTRL_ENET_RSRVD1 0x10000000 | ||
475 | #define BM_CLKCTRL_ENET_BUSY_TIME 0x08000000 | ||
476 | #define BP_CLKCTRL_ENET_DIV_TIME 21 | ||
477 | #define BM_CLKCTRL_ENET_DIV_TIME 0x07E00000 | ||
478 | #define BF_CLKCTRL_ENET_DIV_TIME(v) \ | ||
479 | (((v) << 21) & BM_CLKCTRL_ENET_DIV_TIME) | ||
480 | #define BM_CLKCTRL_ENET_BUSY 0x08000000 | ||
481 | #define BP_CLKCTRL_ENET_DIV 21 | ||
482 | #define BM_CLKCTRL_ENET_DIV 0x07E00000 | ||
483 | #define BF_CLKCTRL_ENET_DIV(v) \ | ||
484 | (((v) << 21) & BM_CLKCTRL_ENET_DIV) | ||
485 | #define BP_CLKCTRL_ENET_TIME_SEL 19 | ||
486 | #define BM_CLKCTRL_ENET_TIME_SEL 0x00180000 | ||
487 | #define BF_CLKCTRL_ENET_TIME_SEL(v) \ | ||
488 | (((v) << 19) & BM_CLKCTRL_ENET_TIME_SEL) | ||
489 | #define BV_CLKCTRL_ENET_TIME_SEL__XTAL 0x0 | ||
490 | #define BV_CLKCTRL_ENET_TIME_SEL__PLL 0x1 | ||
491 | #define BV_CLKCTRL_ENET_TIME_SEL__RMII_CLK 0x2 | ||
492 | #define BV_CLKCTRL_ENET_TIME_SEL__UNDEFINED 0x3 | ||
493 | #define BM_CLKCTRL_ENET_CLK_OUT_EN 0x00040000 | ||
494 | #define BM_CLKCTRL_ENET_RESET_BY_SW_CHIP 0x00020000 | ||
495 | #define BM_CLKCTRL_ENET_RESET_BY_SW 0x00010000 | ||
496 | #define BP_CLKCTRL_ENET_RSRVD0 0 | ||
497 | #define BM_CLKCTRL_ENET_RSRVD0 0x0000FFFF | ||
498 | #define BF_CLKCTRL_ENET_RSRVD0(v) \ | ||
499 | (((v) << 0) & BM_CLKCTRL_ENET_RSRVD0) | ||
500 | |||
501 | #define HW_CLKCTRL_HSADC (0x00000150) | ||
502 | |||
503 | #define BM_CLKCTRL_HSADC_RSRVD2 0x80000000 | ||
504 | #define BM_CLKCTRL_HSADC_RESETB 0x40000000 | ||
505 | #define BP_CLKCTRL_HSADC_FREQDIV 28 | ||
506 | #define BM_CLKCTRL_HSADC_FREQDIV 0x30000000 | ||
507 | #define BF_CLKCTRL_HSADC_FREQDIV(v) \ | ||
508 | (((v) << 28) & BM_CLKCTRL_HSADC_FREQDIV) | ||
509 | #define BP_CLKCTRL_HSADC_RSRVD1 0 | ||
510 | #define BM_CLKCTRL_HSADC_RSRVD1 0x0FFFFFFF | ||
511 | #define BF_CLKCTRL_HSADC_RSRVD1(v) \ | ||
512 | (((v) << 0) & BM_CLKCTRL_HSADC_RSRVD1) | ||
513 | |||
514 | #define HW_CLKCTRL_FLEXCAN (0x00000160) | ||
515 | |||
516 | #define BM_CLKCTRL_FLEXCAN_RSRVD2 0x80000000 | ||
517 | #define BP_CLKCTRL_FLEXCAN_STOP_CAN0 30 | ||
518 | #define BM_CLKCTRL_FLEXCAN_STOP_CAN0 0x40000000 | ||
519 | #define BM_CLKCTRL_FLEXCAN_CAN0_STATUS 0x20000000 | ||
520 | #define BP_CLKCTRL_FLEXCAN_STOP_CAN1 28 | ||
521 | #define BM_CLKCTRL_FLEXCAN_STOP_CAN1 0x10000000 | ||
522 | #define BM_CLKCTRL_FLEXCAN_CAN1_STATUS 0x08000000 | ||
523 | #define BP_CLKCTRL_FLEXCAN_RSRVD1 0 | ||
524 | #define BM_CLKCTRL_FLEXCAN_RSRVD1 0x07FFFFFF | ||
525 | #define BF_CLKCTRL_FLEXCAN_RSRVD1(v) \ | ||
526 | (((v) << 0) & BM_CLKCTRL_FLEXCAN_RSRVD1) | ||
527 | |||
528 | #define HW_CLKCTRL_FRAC0 (0x000001b0) | ||
529 | #define HW_CLKCTRL_FRAC0_SET (0x000001b4) | ||
530 | #define HW_CLKCTRL_FRAC0_CLR (0x000001b8) | ||
531 | #define HW_CLKCTRL_FRAC0_TOG (0x000001bc) | ||
532 | |||
533 | #define BP_CLKCTRL_FRAC0_CLKGATEIO0 31 | ||
534 | #define BM_CLKCTRL_FRAC0_CLKGATEIO0 0x80000000 | ||
535 | #define BM_CLKCTRL_FRAC0_IO0_STABLE 0x40000000 | ||
536 | #define BP_CLKCTRL_FRAC0_IO0FRAC 24 | ||
537 | #define BM_CLKCTRL_FRAC0_IO0FRAC 0x3F000000 | ||
538 | #define BF_CLKCTRL_FRAC0_IO0FRAC(v) \ | ||
539 | (((v) << 24) & BM_CLKCTRL_FRAC0_IO0FRAC) | ||
540 | #define BP_CLKCTRL_FRAC0_CLKGATEIO1 23 | ||
541 | #define BM_CLKCTRL_FRAC0_CLKGATEIO1 0x00800000 | ||
542 | #define BM_CLKCTRL_FRAC0_IO1_STABLE 0x00400000 | ||
543 | #define BP_CLKCTRL_FRAC0_IO1FRAC 16 | ||
544 | #define BM_CLKCTRL_FRAC0_IO1FRAC 0x003F0000 | ||
545 | #define BF_CLKCTRL_FRAC0_IO1FRAC(v) \ | ||
546 | (((v) << 16) & BM_CLKCTRL_FRAC0_IO1FRAC) | ||
547 | #define BP_CLKCTRL_FRAC0_CLKGATEEMI 15 | ||
548 | #define BM_CLKCTRL_FRAC0_CLKGATEEMI 0x00008000 | ||
549 | #define BM_CLKCTRL_FRAC0_EMI_STABLE 0x00004000 | ||
550 | #define BP_CLKCTRL_FRAC0_EMIFRAC 8 | ||
551 | #define BM_CLKCTRL_FRAC0_EMIFRAC 0x00003F00 | ||
552 | #define BF_CLKCTRL_FRAC0_EMIFRAC(v) \ | ||
553 | (((v) << 8) & BM_CLKCTRL_FRAC0_EMIFRAC) | ||
554 | #define BP_CLKCTRL_FRAC0_CLKGATECPU 7 | ||
555 | #define BM_CLKCTRL_FRAC0_CLKGATECPU 0x00000080 | ||
556 | #define BM_CLKCTRL_FRAC0_CPU_STABLE 0x00000040 | ||
557 | #define BP_CLKCTRL_FRAC0_CPUFRAC 0 | ||
558 | #define BM_CLKCTRL_FRAC0_CPUFRAC 0x0000003F | ||
559 | #define BF_CLKCTRL_FRAC0_CPUFRAC(v) \ | ||
560 | (((v) << 0) & BM_CLKCTRL_FRAC0_CPUFRAC) | ||
561 | |||
562 | #define HW_CLKCTRL_FRAC1 (0x000001c0) | ||
563 | #define HW_CLKCTRL_FRAC1_SET (0x000001c4) | ||
564 | #define HW_CLKCTRL_FRAC1_CLR (0x000001c8) | ||
565 | #define HW_CLKCTRL_FRAC1_TOG (0x000001cc) | ||
566 | |||
567 | #define BP_CLKCTRL_FRAC1_RSRVD2 24 | ||
568 | #define BM_CLKCTRL_FRAC1_RSRVD2 0xFF000000 | ||
569 | #define BF_CLKCTRL_FRAC1_RSRVD2(v) \ | ||
570 | (((v) << 24) & BM_CLKCTRL_FRAC1_RSRVD2) | ||
571 | #define BP_CLKCTRL_FRAC1_CLKGATEGPMI 23 | ||
572 | #define BM_CLKCTRL_FRAC1_CLKGATEGPMI 0x00800000 | ||
573 | #define BM_CLKCTRL_FRAC1_GPMI_STABLE 0x00400000 | ||
574 | #define BP_CLKCTRL_FRAC1_GPMIFRAC 16 | ||
575 | #define BM_CLKCTRL_FRAC1_GPMIFRAC 0x003F0000 | ||
576 | #define BF_CLKCTRL_FRAC1_GPMIFRAC(v) \ | ||
577 | (((v) << 16) & BM_CLKCTRL_FRAC1_GPMIFRAC) | ||
578 | #define BP_CLKCTRL_FRAC1_CLKGATEHSADC 15 | ||
579 | #define BM_CLKCTRL_FRAC1_CLKGATEHSADC 0x00008000 | ||
580 | #define BM_CLKCTRL_FRAC1_HSADC_STABLE 0x00004000 | ||
581 | #define BP_CLKCTRL_FRAC1_HSADCFRAC 8 | ||
582 | #define BM_CLKCTRL_FRAC1_HSADCFRAC 0x00003F00 | ||
583 | #define BF_CLKCTRL_FRAC1_HSADCFRAC(v) \ | ||
584 | (((v) << 8) & BM_CLKCTRL_FRAC1_HSADCFRAC) | ||
585 | #define BP_CLKCTRL_FRAC1_CLKGATEPIX 7 | ||
586 | #define BM_CLKCTRL_FRAC1_CLKGATEPIX 0x00000080 | ||
587 | #define BM_CLKCTRL_FRAC1_PIX_STABLE 0x00000040 | ||
588 | #define BP_CLKCTRL_FRAC1_PIXFRAC 0 | ||
589 | #define BM_CLKCTRL_FRAC1_PIXFRAC 0x0000003F | ||
590 | #define BF_CLKCTRL_FRAC1_PIXFRAC(v) \ | ||
591 | (((v) << 0) & BM_CLKCTRL_FRAC1_PIXFRAC) | ||
592 | |||
593 | #define HW_CLKCTRL_CLKSEQ (0x000001d0) | ||
594 | #define HW_CLKCTRL_CLKSEQ_SET (0x000001d4) | ||
595 | #define HW_CLKCTRL_CLKSEQ_CLR (0x000001d8) | ||
596 | #define HW_CLKCTRL_CLKSEQ_TOG (0x000001dc) | ||
597 | |||
598 | #define BP_CLKCTRL_CLKSEQ_RSRVD0 19 | ||
599 | #define BM_CLKCTRL_CLKSEQ_RSRVD0 0xFFF80000 | ||
600 | #define BF_CLKCTRL_CLKSEQ_RSRVD0(v) \ | ||
601 | (((v) << 19) & BM_CLKCTRL_CLKSEQ_RSRVD0) | ||
602 | #define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00040000 | ||
603 | #define BP_CLKCTRL_CLKSEQ_RSRVD1 15 | ||
604 | #define BM_CLKCTRL_CLKSEQ_RSRVD1 0x00038000 | ||
605 | #define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \ | ||
606 | (((v) << 15) & BM_CLKCTRL_CLKSEQ_RSRVD1) | ||
607 | #define BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF 0x00004000 | ||
608 | #define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__BYPASS 0x1 | ||
609 | #define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__PFD 0x0 | ||
610 | #define BP_CLKCTRL_CLKSEQ_RSRVD2 9 | ||
611 | #define BM_CLKCTRL_CLKSEQ_RSRVD2 0x00003E00 | ||
612 | #define BF_CLKCTRL_CLKSEQ_RSRVD2(v) \ | ||
613 | (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD2) | ||
614 | #define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 | ||
615 | #define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000080 | ||
616 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP3 0x00000040 | ||
617 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP2 0x00000020 | ||
618 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP1 0x00000010 | ||
619 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SSP0 0x00000008 | ||
620 | #define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000004 | ||
621 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF1 0x00000002 | ||
622 | #define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF0 0x00000001 | ||
623 | |||
624 | #define HW_CLKCTRL_RESET (0x000001e0) | ||
625 | |||
626 | #define BP_CLKCTRL_RESET_RSRVD 6 | ||
627 | #define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFC0 | ||
628 | #define BF_CLKCTRL_RESET_RSRVD(v) \ | ||
629 | (((v) << 6) & BM_CLKCTRL_RESET_RSRVD) | ||
630 | #define BM_CLKCTRL_RESET_WDOG_POR_DISABLE 0x00000020 | ||
631 | #define BM_CLKCTRL_RESET_EXTERNAL_RESET_ENABLE 0x00000010 | ||
632 | #define BM_CLKCTRL_RESET_THERMAL_RESET_ENABLE 0x00000008 | ||
633 | #define BM_CLKCTRL_RESET_THERMAL_RESET_DEFAULT 0x00000004 | ||
634 | #define BM_CLKCTRL_RESET_CHIP 0x00000002 | ||
635 | #define BM_CLKCTRL_RESET_DIG 0x00000001 | ||
636 | |||
637 | #define HW_CLKCTRL_STATUS (0x000001f0) | ||
638 | |||
639 | #define BP_CLKCTRL_STATUS_CPU_LIMIT 30 | ||
640 | #define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 | ||
641 | #define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ | ||
642 | (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) | ||
643 | #define BP_CLKCTRL_STATUS_RSRVD 0 | ||
644 | #define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF | ||
645 | #define BF_CLKCTRL_STATUS_RSRVD(v) \ | ||
646 | (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD) | ||
647 | |||
648 | #define HW_CLKCTRL_VERSION (0x00000200) | ||
649 | |||
650 | #define BP_CLKCTRL_VERSION_MAJOR 24 | ||
651 | #define BM_CLKCTRL_VERSION_MAJOR 0xFF000000 | ||
652 | #define BF_CLKCTRL_VERSION_MAJOR(v) \ | ||
653 | (((v) << 24) & BM_CLKCTRL_VERSION_MAJOR) | ||
654 | #define BP_CLKCTRL_VERSION_MINOR 16 | ||
655 | #define BM_CLKCTRL_VERSION_MINOR 0x00FF0000 | ||
656 | #define BF_CLKCTRL_VERSION_MINOR(v) \ | ||
657 | (((v) << 16) & BM_CLKCTRL_VERSION_MINOR) | ||
658 | #define BP_CLKCTRL_VERSION_STEP 0 | ||
659 | #define BM_CLKCTRL_VERSION_STEP 0x0000FFFF | ||
660 | #define BF_CLKCTRL_VERSION_STEP(v) \ | ||
661 | (((v) << 0) & BM_CLKCTRL_VERSION_STEP) | ||
662 | |||
663 | #endif /* __REGS_CLKCTRL_MX28_H__ */ | ||
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c new file mode 100644 index 000000000000..9343d7edd4f6 --- /dev/null +++ b/arch/arm/mach-mxs/system.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 ARM Limited | ||
3 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
4 | * Copyright 2006-2007,2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
5 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | ||
6 | * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/clk.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/err.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/init.h> | ||
25 | |||
26 | #include <asm/proc-fns.h> | ||
27 | #include <asm/system.h> | ||
28 | |||
29 | #include <mach/mxs.h> | ||
30 | #include <mach/common.h> | ||
31 | |||
32 | #define MX23_CLKCTRL_RESET_OFFSET 0x120 | ||
33 | #define MX28_CLKCTRL_RESET_OFFSET 0x1e0 | ||
34 | #define MXS_CLKCTRL_RESET_CHIP (1 << 1) | ||
35 | |||
36 | #define MXS_MODULE_CLKGATE (1 << 30) | ||
37 | #define MXS_MODULE_SFTRST (1 << 31) | ||
38 | |||
39 | static void __iomem *mxs_clkctrl_reset_addr; | ||
40 | |||
41 | /* | ||
42 | * Reset the system. It is called by machine_restart(). | ||
43 | */ | ||
44 | void arch_reset(char mode, const char *cmd) | ||
45 | { | ||
46 | /* reset the chip */ | ||
47 | __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr); | ||
48 | |||
49 | pr_err("Failed to assert the chip reset\n"); | ||
50 | |||
51 | /* Delay to allow the serial port to show the message */ | ||
52 | mdelay(50); | ||
53 | |||
54 | /* We'll take a jump through zero as a poor second */ | ||
55 | cpu_reset(0); | ||
56 | } | ||
57 | |||
58 | static int __init mxs_arch_reset_init(void) | ||
59 | { | ||
60 | struct clk *clk; | ||
61 | |||
62 | mxs_clkctrl_reset_addr = MXS_IO_ADDRESS(MXS_CLKCTRL_BASE_ADDR) + | ||
63 | (cpu_is_mx23() ? MX23_CLKCTRL_RESET_OFFSET : | ||
64 | MX28_CLKCTRL_RESET_OFFSET); | ||
65 | |||
66 | clk = clk_get_sys("rtc", NULL); | ||
67 | if (!IS_ERR(clk)) | ||
68 | clk_enable(clk); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | core_initcall(mxs_arch_reset_init); | ||
73 | |||
74 | /* | ||
75 | * Clear the bit and poll it cleared. This is usually called with | ||
76 | * a reset address and mask being either SFTRST(bit 31) or CLKGATE | ||
77 | * (bit 30). | ||
78 | */ | ||
79 | static int clear_poll_bit(void __iomem *addr, u32 mask) | ||
80 | { | ||
81 | int timeout = 0x400; | ||
82 | |||
83 | /* clear the bit */ | ||
84 | __mxs_clrl(mask, addr); | ||
85 | |||
86 | /* | ||
87 | * SFTRST needs 3 GPMI clocks to settle, the reference manual | ||
88 | * recommends to wait 1us. | ||
89 | */ | ||
90 | udelay(1); | ||
91 | |||
92 | /* poll the bit becoming clear */ | ||
93 | while ((__raw_readl(addr) & mask) && --timeout) | ||
94 | /* nothing */; | ||
95 | |||
96 | return !timeout; | ||
97 | } | ||
98 | |||
99 | int mxs_reset_block(void __iomem *reset_addr) | ||
100 | { | ||
101 | int ret; | ||
102 | int timeout = 0x400; | ||
103 | |||
104 | /* clear and poll SFTRST */ | ||
105 | ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST); | ||
106 | if (unlikely(ret)) | ||
107 | goto error; | ||
108 | |||
109 | /* clear CLKGATE */ | ||
110 | __mxs_clrl(MXS_MODULE_CLKGATE, reset_addr); | ||
111 | |||
112 | /* set SFTRST to reset the block */ | ||
113 | __mxs_setl(MXS_MODULE_SFTRST, reset_addr); | ||
114 | udelay(1); | ||
115 | |||
116 | /* poll CLKGATE becoming set */ | ||
117 | while ((!(__raw_readl(reset_addr) & MXS_MODULE_CLKGATE)) && --timeout) | ||
118 | /* nothing */; | ||
119 | if (unlikely(!timeout)) | ||
120 | goto error; | ||
121 | |||
122 | /* clear and poll SFTRST */ | ||
123 | ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST); | ||
124 | if (unlikely(ret)) | ||
125 | goto error; | ||
126 | |||
127 | /* clear and poll CLKGATE */ | ||
128 | ret = clear_poll_bit(reset_addr, MXS_MODULE_CLKGATE); | ||
129 | if (unlikely(ret)) | ||
130 | goto error; | ||
131 | |||
132 | return 0; | ||
133 | |||
134 | error: | ||
135 | pr_err("%s(%p): module reset timeout\n", __func__, reset_addr); | ||
136 | return -ETIMEDOUT; | ||
137 | } | ||
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c new file mode 100644 index 000000000000..13647f301860 --- /dev/null +++ b/arch/arm/mach-mxs/timer.c | |||
@@ -0,0 +1,296 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000-2001 Deep Blue Solutions | ||
3 | * Copyright (C) 2002 Shane Nay (shane@minirl.com) | ||
4 | * Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.com) | ||
5 | * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) | ||
6 | * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version 2 | ||
11 | * of the License, or (at your option) any later version. | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
20 | * MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #include <linux/interrupt.h> | ||
24 | #include <linux/irq.h> | ||
25 | #include <linux/clockchips.h> | ||
26 | #include <linux/clk.h> | ||
27 | |||
28 | #include <asm/mach/time.h> | ||
29 | #include <mach/mxs.h> | ||
30 | #include <mach/common.h> | ||
31 | |||
32 | /* | ||
33 | * There are 2 versions of the timrot on Freescale MXS-based SoCs. | ||
34 | * The v1 on MX23 only gets 16 bits counter, while v2 on MX28 | ||
35 | * extends the counter to 32 bits. | ||
36 | * | ||
37 | * The implementation uses two timers, one for clock_event and | ||
38 | * another for clocksource. MX28 uses timrot 0 and 1, while MX23 | ||
39 | * uses 0 and 2. | ||
40 | */ | ||
41 | |||
42 | #define MX23_TIMROT_VERSION_OFFSET 0x0a0 | ||
43 | #define MX28_TIMROT_VERSION_OFFSET 0x120 | ||
44 | #define BP_TIMROT_MAJOR_VERSION 24 | ||
45 | #define BV_TIMROT_VERSION_1 0x01 | ||
46 | #define BV_TIMROT_VERSION_2 0x02 | ||
47 | #define timrot_is_v1() (timrot_major_version == BV_TIMROT_VERSION_1) | ||
48 | |||
49 | /* | ||
50 | * There are 4 registers for each timrotv2 instance, and 2 registers | ||
51 | * for each timrotv1. So address step 0x40 in macros below strides | ||
52 | * one instance of timrotv2 while two instances of timrotv1. | ||
53 | * | ||
54 | * As the result, HW_TIMROT_XXXn(1) defines the address of timrot1 | ||
55 | * on MX28 while timrot2 on MX23. | ||
56 | */ | ||
57 | /* common between v1 and v2 */ | ||
58 | #define HW_TIMROT_ROTCTRL 0x00 | ||
59 | #define HW_TIMROT_TIMCTRLn(n) (0x20 + (n) * 0x40) | ||
60 | /* v1 only */ | ||
61 | #define HW_TIMROT_TIMCOUNTn(n) (0x30 + (n) * 0x40) | ||
62 | /* v2 only */ | ||
63 | #define HW_TIMROT_RUNNING_COUNTn(n) (0x30 + (n) * 0x40) | ||
64 | #define HW_TIMROT_FIXED_COUNTn(n) (0x40 + (n) * 0x40) | ||
65 | |||
66 | #define BM_TIMROT_TIMCTRLn_RELOAD (1 << 6) | ||
67 | #define BM_TIMROT_TIMCTRLn_UPDATE (1 << 7) | ||
68 | #define BM_TIMROT_TIMCTRLn_IRQ_EN (1 << 14) | ||
69 | #define BM_TIMROT_TIMCTRLn_IRQ (1 << 15) | ||
70 | #define BP_TIMROT_TIMCTRLn_SELECT 0 | ||
71 | #define BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL 0x8 | ||
72 | #define BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL 0xb | ||
73 | |||
74 | static struct clock_event_device mxs_clockevent_device; | ||
75 | static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; | ||
76 | |||
77 | static void __iomem *mxs_timrot_base = MXS_IO_ADDRESS(MXS_TIMROT_BASE_ADDR); | ||
78 | static u32 timrot_major_version; | ||
79 | |||
80 | static inline void timrot_irq_disable(void) | ||
81 | { | ||
82 | __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
83 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
84 | } | ||
85 | |||
86 | static inline void timrot_irq_enable(void) | ||
87 | { | ||
88 | __mxs_setl(BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
89 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
90 | } | ||
91 | |||
92 | static void timrot_irq_acknowledge(void) | ||
93 | { | ||
94 | __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ, | ||
95 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
96 | } | ||
97 | |||
98 | static cycle_t timrotv1_get_cycles(struct clocksource *cs) | ||
99 | { | ||
100 | return ~((__raw_readl(mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)) | ||
101 | & 0xffff0000) >> 16); | ||
102 | } | ||
103 | |||
104 | static cycle_t timrotv2_get_cycles(struct clocksource *cs) | ||
105 | { | ||
106 | return ~__raw_readl(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1)); | ||
107 | } | ||
108 | |||
109 | static int timrotv1_set_next_event(unsigned long evt, | ||
110 | struct clock_event_device *dev) | ||
111 | { | ||
112 | /* timrot decrements the count */ | ||
113 | __raw_writel(evt, mxs_timrot_base + HW_TIMROT_TIMCOUNTn(0)); | ||
114 | |||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | static int timrotv2_set_next_event(unsigned long evt, | ||
119 | struct clock_event_device *dev) | ||
120 | { | ||
121 | /* timrot decrements the count */ | ||
122 | __raw_writel(evt, mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(0)); | ||
123 | |||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static irqreturn_t mxs_timer_interrupt(int irq, void *dev_id) | ||
128 | { | ||
129 | struct clock_event_device *evt = dev_id; | ||
130 | |||
131 | timrot_irq_acknowledge(); | ||
132 | evt->event_handler(evt); | ||
133 | |||
134 | return IRQ_HANDLED; | ||
135 | } | ||
136 | |||
137 | static struct irqaction mxs_timer_irq = { | ||
138 | .name = "MXS Timer Tick", | ||
139 | .dev_id = &mxs_clockevent_device, | ||
140 | .flags = IRQF_TIMER | IRQF_IRQPOLL, | ||
141 | .handler = mxs_timer_interrupt, | ||
142 | }; | ||
143 | |||
144 | #ifdef DEBUG | ||
145 | static const char *clock_event_mode_label[] const = { | ||
146 | [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC", | ||
147 | [CLOCK_EVT_MODE_ONESHOT] = "CLOCK_EVT_MODE_ONESHOT", | ||
148 | [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN", | ||
149 | [CLOCK_EVT_MODE_UNUSED] = "CLOCK_EVT_MODE_UNUSED" | ||
150 | }; | ||
151 | #endif /* DEBUG */ | ||
152 | |||
153 | static void mxs_set_mode(enum clock_event_mode mode, | ||
154 | struct clock_event_device *evt) | ||
155 | { | ||
156 | /* Disable interrupt in timer module */ | ||
157 | timrot_irq_disable(); | ||
158 | |||
159 | if (mode != mxs_clockevent_mode) { | ||
160 | /* Set event time into the furthest future */ | ||
161 | if (timrot_is_v1()) | ||
162 | __raw_writel(0xffff, | ||
163 | mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)); | ||
164 | else | ||
165 | __raw_writel(0xffffffff, | ||
166 | mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(1)); | ||
167 | |||
168 | /* Clear pending interrupt */ | ||
169 | timrot_irq_acknowledge(); | ||
170 | } | ||
171 | |||
172 | #ifdef DEBUG | ||
173 | pr_info("%s: changing mode from %s to %s\n", __func__, | ||
174 | clock_event_mode_label[mxs_clockevent_mode], | ||
175 | clock_event_mode_label[mode]); | ||
176 | #endif /* DEBUG */ | ||
177 | |||
178 | /* Remember timer mode */ | ||
179 | mxs_clockevent_mode = mode; | ||
180 | |||
181 | switch (mode) { | ||
182 | case CLOCK_EVT_MODE_PERIODIC: | ||
183 | pr_err("%s: Periodic mode is not implemented\n", __func__); | ||
184 | break; | ||
185 | case CLOCK_EVT_MODE_ONESHOT: | ||
186 | timrot_irq_enable(); | ||
187 | break; | ||
188 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
189 | case CLOCK_EVT_MODE_UNUSED: | ||
190 | case CLOCK_EVT_MODE_RESUME: | ||
191 | /* Left event sources disabled, no more interrupts appear */ | ||
192 | break; | ||
193 | } | ||
194 | } | ||
195 | |||
196 | static struct clock_event_device mxs_clockevent_device = { | ||
197 | .name = "mxs_timrot", | ||
198 | .features = CLOCK_EVT_FEAT_ONESHOT, | ||
199 | .shift = 32, | ||
200 | .set_mode = mxs_set_mode, | ||
201 | .set_next_event = timrotv2_set_next_event, | ||
202 | .rating = 200, | ||
203 | }; | ||
204 | |||
205 | static int __init mxs_clockevent_init(struct clk *timer_clk) | ||
206 | { | ||
207 | unsigned int c = clk_get_rate(timer_clk); | ||
208 | |||
209 | mxs_clockevent_device.mult = | ||
210 | div_sc(c, NSEC_PER_SEC, mxs_clockevent_device.shift); | ||
211 | mxs_clockevent_device.cpumask = cpumask_of(0); | ||
212 | if (timrot_is_v1()) { | ||
213 | mxs_clockevent_device.set_next_event = timrotv1_set_next_event; | ||
214 | mxs_clockevent_device.max_delta_ns = | ||
215 | clockevent_delta2ns(0xfffe, &mxs_clockevent_device); | ||
216 | mxs_clockevent_device.min_delta_ns = | ||
217 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | ||
218 | } else { | ||
219 | mxs_clockevent_device.max_delta_ns = | ||
220 | clockevent_delta2ns(0xfffffffe, &mxs_clockevent_device); | ||
221 | mxs_clockevent_device.min_delta_ns = | ||
222 | clockevent_delta2ns(0xf, &mxs_clockevent_device); | ||
223 | } | ||
224 | |||
225 | clockevents_register_device(&mxs_clockevent_device); | ||
226 | |||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | static struct clocksource clocksource_mxs = { | ||
231 | .name = "mxs_timer", | ||
232 | .rating = 200, | ||
233 | .read = timrotv2_get_cycles, | ||
234 | .mask = CLOCKSOURCE_MASK(32), | ||
235 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
236 | }; | ||
237 | |||
238 | static int __init mxs_clocksource_init(struct clk *timer_clk) | ||
239 | { | ||
240 | unsigned int c = clk_get_rate(timer_clk); | ||
241 | |||
242 | if (timrot_is_v1()) { | ||
243 | clocksource_mxs.read = timrotv1_get_cycles; | ||
244 | clocksource_mxs.mask = CLOCKSOURCE_MASK(16); | ||
245 | } | ||
246 | |||
247 | clocksource_register_hz(&clocksource_mxs, c); | ||
248 | |||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | void __init mxs_timer_init(struct clk *timer_clk, int irq) | ||
253 | { | ||
254 | clk_enable(timer_clk); | ||
255 | |||
256 | /* | ||
257 | * Initialize timers to a known state | ||
258 | */ | ||
259 | mxs_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL); | ||
260 | |||
261 | /* get timrot version */ | ||
262 | timrot_major_version = __raw_readl(mxs_timrot_base + | ||
263 | (cpu_is_mx23() ? MX23_TIMROT_VERSION_OFFSET : | ||
264 | MX28_TIMROT_VERSION_OFFSET)); | ||
265 | timrot_major_version >>= BP_TIMROT_MAJOR_VERSION; | ||
266 | |||
267 | /* one for clock_event */ | ||
268 | __raw_writel((timrot_is_v1() ? | ||
269 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | ||
270 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | ||
271 | BM_TIMROT_TIMCTRLn_UPDATE | | ||
272 | BM_TIMROT_TIMCTRLn_IRQ_EN, | ||
273 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); | ||
274 | |||
275 | /* another for clocksource */ | ||
276 | __raw_writel((timrot_is_v1() ? | ||
277 | BV_TIMROTv1_TIMCTRLn_SELECT__32KHZ_XTAL : | ||
278 | BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL) | | ||
279 | BM_TIMROT_TIMCTRLn_RELOAD, | ||
280 | mxs_timrot_base + HW_TIMROT_TIMCTRLn(1)); | ||
281 | |||
282 | /* set clocksource timer fixed count to the maximum */ | ||
283 | if (timrot_is_v1()) | ||
284 | __raw_writel(0xffff, | ||
285 | mxs_timrot_base + HW_TIMROT_TIMCOUNTn(1)); | ||
286 | else | ||
287 | __raw_writel(0xffffffff, | ||
288 | mxs_timrot_base + HW_TIMROT_FIXED_COUNTn(1)); | ||
289 | |||
290 | /* init and register the timer to the framework */ | ||
291 | mxs_clocksource_init(timer_clk); | ||
292 | mxs_clockevent_init(timer_clk); | ||
293 | |||
294 | /* Make irqs happen */ | ||
295 | setup_irq(irq, &mxs_timer_irq); | ||
296 | } | ||