blob: baa4bd117b33a59c01fea7f96e352fe38ab26a55 [file] [log] [blame]
Sascha Hauere3d13ff2008-07-05 10:02:48 +02001/*
2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, 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,
17 * Boston, MA 02110-1301, USA.
18 */
19
Guennadi Liakhovetskieb05bbe2009-05-04 13:13:52 +020020#include <linux/dma-mapping.h>
Sascha Hauere3d13ff2008-07-05 10:02:48 +020021#include <linux/module.h>
22#include <linux/platform_device.h>
23#include <linux/serial.h>
Juergen Beisert07bd1a62008-07-05 10:02:49 +020024#include <linux/gpio.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010025#include <mach/hardware.h>
Russell King80b02c12009-01-08 10:01:47 +000026#include <mach/irqs.h>
Alan Carvalho de Assis45001e92009-04-02 12:38:41 -030027#include <mach/common.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010028#include <mach/imx-uart.h>
Valentin Longchamp9c70e222009-05-07 11:51:42 +020029#include <mach/mx3_camera.h>
Sascha Hauere3d13ff2008-07-05 10:02:48 +020030
Sascha Hauer87bbb192009-01-29 16:00:23 +010031#include "devices.h"
32
Sascha Hauere3d13ff2008-07-05 10:02:48 +020033static struct resource uart0[] = {
34 {
35 .start = UART1_BASE_ADDR,
36 .end = UART1_BASE_ADDR + 0x0B5,
37 .flags = IORESOURCE_MEM,
38 }, {
39 .start = MXC_INT_UART1,
40 .end = MXC_INT_UART1,
41 .flags = IORESOURCE_IRQ,
42 },
43};
44
Sascha Hauer5cf09422008-09-09 10:19:41 +020045struct platform_device mxc_uart_device0 = {
Sascha Hauere3d13ff2008-07-05 10:02:48 +020046 .name = "imx-uart",
47 .id = 0,
48 .resource = uart0,
49 .num_resources = ARRAY_SIZE(uart0),
50};
51
52static struct resource uart1[] = {
53 {
54 .start = UART2_BASE_ADDR,
55 .end = UART2_BASE_ADDR + 0x0B5,
56 .flags = IORESOURCE_MEM,
57 }, {
58 .start = MXC_INT_UART2,
59 .end = MXC_INT_UART2,
60 .flags = IORESOURCE_IRQ,
61 },
62};
63
Sascha Hauer5cf09422008-09-09 10:19:41 +020064struct platform_device mxc_uart_device1 = {
Sascha Hauere3d13ff2008-07-05 10:02:48 +020065 .name = "imx-uart",
66 .id = 1,
67 .resource = uart1,
68 .num_resources = ARRAY_SIZE(uart1),
69};
70
71static struct resource uart2[] = {
72 {
73 .start = UART3_BASE_ADDR,
74 .end = UART3_BASE_ADDR + 0x0B5,
75 .flags = IORESOURCE_MEM,
76 }, {
77 .start = MXC_INT_UART3,
78 .end = MXC_INT_UART3,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
Sascha Hauer5cf09422008-09-09 10:19:41 +020083struct platform_device mxc_uart_device2 = {
Sascha Hauere3d13ff2008-07-05 10:02:48 +020084 .name = "imx-uart",
85 .id = 2,
86 .resource = uart2,
87 .num_resources = ARRAY_SIZE(uart2),
88};
89
Sascha Hauer9536ff32009-02-06 15:38:51 +010090#ifdef CONFIG_ARCH_MX31
Sascha Hauere3d13ff2008-07-05 10:02:48 +020091static struct resource uart3[] = {
92 {
93 .start = UART4_BASE_ADDR,
94 .end = UART4_BASE_ADDR + 0x0B5,
95 .flags = IORESOURCE_MEM,
96 }, {
97 .start = MXC_INT_UART4,
98 .end = MXC_INT_UART4,
99 .flags = IORESOURCE_IRQ,
100 },
101};
102
Sascha Hauer5cf09422008-09-09 10:19:41 +0200103struct platform_device mxc_uart_device3 = {
Sascha Hauere3d13ff2008-07-05 10:02:48 +0200104 .name = "imx-uart",
105 .id = 3,
106 .resource = uart3,
107 .num_resources = ARRAY_SIZE(uart3),
108};
109
110static struct resource uart4[] = {
111 {
112 .start = UART5_BASE_ADDR,
113 .end = UART5_BASE_ADDR + 0x0B5,
114 .flags = IORESOURCE_MEM,
115 }, {
116 .start = MXC_INT_UART5,
117 .end = MXC_INT_UART5,
118 .flags = IORESOURCE_IRQ,
119 },
120};
121
Sascha Hauer5cf09422008-09-09 10:19:41 +0200122struct platform_device mxc_uart_device4 = {
Sascha Hauere3d13ff2008-07-05 10:02:48 +0200123 .name = "imx-uart",
124 .id = 4,
125 .resource = uart4,
126 .num_resources = ARRAY_SIZE(uart4),
127};
Sascha Hauer9536ff32009-02-06 15:38:51 +0100128#endif /* CONFIG_ARCH_MX31 */
Sascha Hauere3d13ff2008-07-05 10:02:48 +0200129
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200130/* GPIO port description */
131static struct mxc_gpio_port imx_gpio_ports[] = {
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200132 {
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200133 .chip.label = "gpio-0",
134 .base = IO_ADDRESS(GPIO1_BASE_ADDR),
135 .irq = MXC_INT_GPIO1,
Sascha Hauer9d631b82008-12-18 11:08:55 +0100136 .virtual_irq_start = MXC_GPIO_IRQ_START,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200137 }, {
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200138 .chip.label = "gpio-1",
139 .base = IO_ADDRESS(GPIO2_BASE_ADDR),
140 .irq = MXC_INT_GPIO2,
Sascha Hauer9d631b82008-12-18 11:08:55 +0100141 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200142 }, {
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200143 .chip.label = "gpio-2",
144 .base = IO_ADDRESS(GPIO3_BASE_ADDR),
145 .irq = MXC_INT_GPIO3,
Sascha Hauer9d631b82008-12-18 11:08:55 +0100146 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200147 }
148};
149
Uwe Kleine-König9a763bf2010-06-10 17:11:06 +0200150int __init imx3x_register_gpios(void)
Juergen Beisert07bd1a62008-07-05 10:02:49 +0200151{
152 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
153}
Sascha Hauera8405922008-12-01 14:15:39 -0800154
155static struct resource mxc_w1_master_resources[] = {
156 {
157 .start = OWIRE_BASE_ADDR,
158 .end = OWIRE_BASE_ADDR + SZ_4K - 1,
159 .flags = IORESOURCE_MEM,
160 },
161};
162
163struct platform_device mxc_w1_master_device = {
164 .name = "mxc_w1",
165 .id = 0,
166 .num_resources = ARRAY_SIZE(mxc_w1_master_resources),
167 .resource = mxc_w1_master_resources,
168};
Sascha Hauercb96cf12008-11-11 15:15:39 +0100169
Uwe Kleine-Königa2ceeef2010-06-16 12:23:11 +0200170#if defined(CONFIG_ARCH_MX35)
Sascha Hauercb96cf12008-11-11 15:15:39 +0100171static struct resource mxc_nand_resources[] = {
172 {
Sascha Hauer9536ff32009-02-06 15:38:51 +0100173 .start = 0, /* runtime dependent */
174 .end = 0,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200175 .flags = IORESOURCE_MEM,
Sascha Hauercb96cf12008-11-11 15:15:39 +0100176 }, {
177 .start = MXC_INT_NANDFC,
178 .end = MXC_INT_NANDFC,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200179 .flags = IORESOURCE_IRQ,
Sascha Hauercb96cf12008-11-11 15:15:39 +0100180 },
181};
182
183struct platform_device mxc_nand_device = {
184 .name = "mxc_nand",
185 .id = 0,
186 .num_resources = ARRAY_SIZE(mxc_nand_resources),
187 .resource = mxc_nand_resources,
188};
Uwe Kleine-Königa2ceeef2010-06-16 12:23:11 +0200189#endif
Mark Brown39d1dc02009-01-15 16:14:27 +0000190
191static struct resource mxc_i2c0_resources[] = {
192 {
193 .start = I2C_BASE_ADDR,
194 .end = I2C_BASE_ADDR + SZ_4K - 1,
195 .flags = IORESOURCE_MEM,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200196 }, {
Mark Brown39d1dc02009-01-15 16:14:27 +0000197 .start = MXC_INT_I2C,
198 .end = MXC_INT_I2C,
199 .flags = IORESOURCE_IRQ,
200 },
201};
202
203struct platform_device mxc_i2c_device0 = {
204 .name = "imx-i2c",
205 .id = 0,
206 .num_resources = ARRAY_SIZE(mxc_i2c0_resources),
207 .resource = mxc_i2c0_resources,
208};
209
210static struct resource mxc_i2c1_resources[] = {
211 {
212 .start = I2C2_BASE_ADDR,
213 .end = I2C2_BASE_ADDR + SZ_4K - 1,
214 .flags = IORESOURCE_MEM,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200215 }, {
Mark Brown39d1dc02009-01-15 16:14:27 +0000216 .start = MXC_INT_I2C2,
217 .end = MXC_INT_I2C2,
218 .flags = IORESOURCE_IRQ,
219 },
220};
221
222struct platform_device mxc_i2c_device1 = {
223 .name = "imx-i2c",
224 .id = 1,
225 .num_resources = ARRAY_SIZE(mxc_i2c1_resources),
226 .resource = mxc_i2c1_resources,
227};
228
229static struct resource mxc_i2c2_resources[] = {
230 {
231 .start = I2C3_BASE_ADDR,
232 .end = I2C3_BASE_ADDR + SZ_4K - 1,
233 .flags = IORESOURCE_MEM,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200234 }, {
Mark Brown39d1dc02009-01-15 16:14:27 +0000235 .start = MXC_INT_I2C3,
236 .end = MXC_INT_I2C3,
237 .flags = IORESOURCE_IRQ,
238 },
239};
240
241struct platform_device mxc_i2c_device2 = {
242 .name = "imx-i2c",
243 .id = 2,
244 .num_resources = ARRAY_SIZE(mxc_i2c2_resources),
245 .resource = mxc_i2c2_resources,
246};
Valentin Longchampca489f82009-02-16 12:47:52 +0100247
Sascha Hauer2adc1d62008-12-19 14:32:06 +0100248#ifdef CONFIG_ARCH_MX31
249static struct resource mxcsdhc0_resources[] = {
250 {
251 .start = MMC_SDHC1_BASE_ADDR,
252 .end = MMC_SDHC1_BASE_ADDR + SZ_16K - 1,
253 .flags = IORESOURCE_MEM,
254 }, {
255 .start = MXC_INT_MMC_SDHC1,
256 .end = MXC_INT_MMC_SDHC1,
257 .flags = IORESOURCE_IRQ,
258 },
259};
260
261static struct resource mxcsdhc1_resources[] = {
262 {
263 .start = MMC_SDHC2_BASE_ADDR,
264 .end = MMC_SDHC2_BASE_ADDR + SZ_16K - 1,
265 .flags = IORESOURCE_MEM,
266 }, {
267 .start = MXC_INT_MMC_SDHC2,
268 .end = MXC_INT_MMC_SDHC2,
269 .flags = IORESOURCE_IRQ,
270 },
271};
272
273struct platform_device mxcsdhc_device0 = {
274 .name = "mxc-mmc",
275 .id = 0,
276 .num_resources = ARRAY_SIZE(mxcsdhc0_resources),
277 .resource = mxcsdhc0_resources,
278};
279
280struct platform_device mxcsdhc_device1 = {
281 .name = "mxc-mmc",
282 .id = 1,
283 .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
284 .resource = mxcsdhc1_resources,
285};
Alan Carvalho de Assis45001e92009-04-02 12:38:41 -0300286
287static struct resource rnga_resources[] = {
288 {
289 .start = RNGA_BASE_ADDR,
290 .end = RNGA_BASE_ADDR + 0x28,
291 .flags = IORESOURCE_MEM,
292 },
293};
294
295struct platform_device mxc_rnga_device = {
296 .name = "mxc_rnga",
297 .id = -1,
298 .num_resources = 1,
299 .resource = rnga_resources,
300};
Sascha Hauer2adc1d62008-12-19 14:32:06 +0100301#endif /* CONFIG_ARCH_MX31 */
302
Valentin Longchampca489f82009-02-16 12:47:52 +0100303/* i.MX31 Image Processing Unit */
304
305/* The resource order is important! */
306static struct resource mx3_ipu_rsrc[] = {
307 {
308 .start = IPU_CTRL_BASE_ADDR,
309 .end = IPU_CTRL_BASE_ADDR + 0x5F,
310 .flags = IORESOURCE_MEM,
311 }, {
312 .start = IPU_CTRL_BASE_ADDR + 0x88,
313 .end = IPU_CTRL_BASE_ADDR + 0xB3,
314 .flags = IORESOURCE_MEM,
315 }, {
316 .start = MXC_INT_IPU_SYN,
317 .end = MXC_INT_IPU_SYN,
318 .flags = IORESOURCE_IRQ,
319 }, {
320 .start = MXC_INT_IPU_ERR,
321 .end = MXC_INT_IPU_ERR,
322 .flags = IORESOURCE_IRQ,
323 },
324};
325
326struct platform_device mx3_ipu = {
327 .name = "ipu-core",
328 .id = -1,
329 .num_resources = ARRAY_SIZE(mx3_ipu_rsrc),
330 .resource = mx3_ipu_rsrc,
331};
332
333static struct resource fb_resources[] = {
334 {
335 .start = IPU_CTRL_BASE_ADDR + 0xB4,
336 .end = IPU_CTRL_BASE_ADDR + 0x1BF,
337 .flags = IORESOURCE_MEM,
338 },
339};
340
341struct platform_device mx3_fb = {
342 .name = "mx3_sdc_fb",
343 .id = -1,
344 .num_resources = ARRAY_SIZE(fb_resources),
345 .resource = fb_resources,
346 .dev = {
Valentin Longchamp9c70e222009-05-07 11:51:42 +0200347 .coherent_dma_mask = DMA_BIT_MASK(32),
Valentin Longchampca489f82009-02-16 12:47:52 +0100348 },
349};
Sascha Hauer9536ff32009-02-06 15:38:51 +0100350
Valentin Longchamp9c70e222009-05-07 11:51:42 +0200351static struct resource camera_resources[] = {
352 {
353 .start = IPU_CTRL_BASE_ADDR + 0x60,
354 .end = IPU_CTRL_BASE_ADDR + 0x87,
355 .flags = IORESOURCE_MEM,
356 },
357};
358
359struct platform_device mx3_camera = {
360 .name = "mx3-camera",
361 .id = 0,
362 .num_resources = ARRAY_SIZE(camera_resources),
363 .resource = camera_resources,
364 .dev = {
365 .coherent_dma_mask = DMA_BIT_MASK(32),
366 },
367};
368
Guennadi Liakhovetskieb05bbe2009-05-04 13:13:52 +0200369static struct resource otg_resources[] = {
370 {
Sascha Hauer7bc07eb2009-04-17 16:52:25 +0200371 .start = MX31_OTG_BASE_ADDR,
372 .end = MX31_OTG_BASE_ADDR + 0x1ff,
Guennadi Liakhovetskieb05bbe2009-05-04 13:13:52 +0200373 .flags = IORESOURCE_MEM,
374 }, {
375 .start = MXC_INT_USB3,
376 .end = MXC_INT_USB3,
377 .flags = IORESOURCE_IRQ,
378 },
379};
380
381static u64 otg_dmamask = DMA_BIT_MASK(32);
382
383/* OTG gadget device */
384struct platform_device mxc_otg_udc_device = {
385 .name = "fsl-usb2-udc",
386 .id = -1,
387 .dev = {
388 .dma_mask = &otg_dmamask,
389 .coherent_dma_mask = DMA_BIT_MASK(32),
390 },
391 .resource = otg_resources,
392 .num_resources = ARRAY_SIZE(otg_resources),
393};
394
Daniel Mackc13a4822009-06-25 14:11:50 +0200395/* OTG host */
396struct platform_device mxc_otg_host = {
397 .name = "mxc-ehci",
398 .id = 0,
399 .dev = {
400 .coherent_dma_mask = 0xffffffff,
401 .dma_mask = &otg_dmamask,
402 },
403 .resource = otg_resources,
404 .num_resources = ARRAY_SIZE(otg_resources),
405};
406
407/* USB host 1 */
408
409static u64 usbh1_dmamask = ~(u32)0;
410
411static struct resource mxc_usbh1_resources[] = {
412 {
Sascha Hauer7bc07eb2009-04-17 16:52:25 +0200413 .start = MX31_OTG_BASE_ADDR + 0x200,
414 .end = MX31_OTG_BASE_ADDR + 0x3ff,
Daniel Mackc13a4822009-06-25 14:11:50 +0200415 .flags = IORESOURCE_MEM,
416 }, {
417 .start = MXC_INT_USB1,
418 .end = MXC_INT_USB1,
419 .flags = IORESOURCE_IRQ,
420 },
421};
422
423struct platform_device mxc_usbh1 = {
424 .name = "mxc-ehci",
425 .id = 1,
426 .dev = {
427 .coherent_dma_mask = 0xffffffff,
428 .dma_mask = &usbh1_dmamask,
429 },
430 .resource = mxc_usbh1_resources,
431 .num_resources = ARRAY_SIZE(mxc_usbh1_resources),
432};
433
434/* USB host 2 */
435static u64 usbh2_dmamask = ~(u32)0;
436
437static struct resource mxc_usbh2_resources[] = {
438 {
Sascha Hauer7bc07eb2009-04-17 16:52:25 +0200439 .start = MX31_OTG_BASE_ADDR + 0x400,
440 .end = MX31_OTG_BASE_ADDR + 0x5ff,
Daniel Mackc13a4822009-06-25 14:11:50 +0200441 .flags = IORESOURCE_MEM,
442 }, {
443 .start = MXC_INT_USB2,
444 .end = MXC_INT_USB2,
445 .flags = IORESOURCE_IRQ,
446 },
447};
448
449struct platform_device mxc_usbh2 = {
450 .name = "mxc-ehci",
451 .id = 2,
452 .dev = {
453 .coherent_dma_mask = 0xffffffff,
454 .dma_mask = &usbh2_dmamask,
455 },
456 .resource = mxc_usbh2_resources,
457 .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
458};
459
Sascha Hauerd37ba972008-12-19 14:32:15 +0100460/*
461 * SPI master controller
462 * 3 channels
463 */
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200464static struct resource mxc_spi_0_resources[] = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100465 {
466 .start = CSPI1_BASE_ADDR,
467 .end = CSPI1_BASE_ADDR + SZ_4K - 1,
468 .flags = IORESOURCE_MEM,
469 }, {
470 .start = MXC_INT_CSPI1,
471 .end = MXC_INT_CSPI1,
472 .flags = IORESOURCE_IRQ,
473 },
474};
475
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200476static struct resource mxc_spi_1_resources[] = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100477 {
478 .start = CSPI2_BASE_ADDR,
479 .end = CSPI2_BASE_ADDR + SZ_4K - 1,
480 .flags = IORESOURCE_MEM,
481 }, {
482 .start = MXC_INT_CSPI2,
483 .end = MXC_INT_CSPI2,
484 .flags = IORESOURCE_IRQ,
485 },
486};
487
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200488static struct resource mxc_spi_2_resources[] = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100489 {
490 .start = CSPI3_BASE_ADDR,
491 .end = CSPI3_BASE_ADDR + SZ_4K - 1,
492 .flags = IORESOURCE_MEM,
493 }, {
494 .start = MXC_INT_CSPI3,
495 .end = MXC_INT_CSPI3,
496 .flags = IORESOURCE_IRQ,
497 },
498};
499
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200500struct platform_device mxc_spi_device0 = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100501 .name = "spi_imx",
502 .id = 0,
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200503 .num_resources = ARRAY_SIZE(mxc_spi_0_resources),
504 .resource = mxc_spi_0_resources,
Sascha Hauerd37ba972008-12-19 14:32:15 +0100505};
506
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200507struct platform_device mxc_spi_device1 = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100508 .name = "spi_imx",
509 .id = 1,
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200510 .num_resources = ARRAY_SIZE(mxc_spi_1_resources),
511 .resource = mxc_spi_1_resources,
Sascha Hauerd37ba972008-12-19 14:32:15 +0100512};
513
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200514struct platform_device mxc_spi_device2 = {
Sascha Hauerd37ba972008-12-19 14:32:15 +0100515 .name = "spi_imx",
516 .id = 2,
Guennadi Liakhovetskid9e8b882009-10-05 16:49:12 +0200517 .num_resources = ARRAY_SIZE(mxc_spi_2_resources),
518 .resource = mxc_spi_2_resources,
Sascha Hauerd37ba972008-12-19 14:32:15 +0100519};
520
Sascha Hauer9536ff32009-02-06 15:38:51 +0100521#ifdef CONFIG_ARCH_MX35
522static struct resource mxc_fec_resources[] = {
523 {
524 .start = MXC_FEC_BASE_ADDR,
525 .end = MXC_FEC_BASE_ADDR + 0xfff,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200526 .flags = IORESOURCE_MEM,
Sascha Hauer9536ff32009-02-06 15:38:51 +0100527 }, {
528 .start = MXC_INT_FEC,
529 .end = MXC_INT_FEC,
Sascha Hauer3f4f54b2009-06-23 12:12:00 +0200530 .flags = IORESOURCE_IRQ,
Sascha Hauer9536ff32009-02-06 15:38:51 +0100531 },
532};
533
534struct platform_device mxc_fec_device = {
535 .name = "fec",
536 .id = 0,
537 .num_resources = ARRAY_SIZE(mxc_fec_resources),
538 .resource = mxc_fec_resources,
539};
540#endif
541
Sascha Hauerd8d982b2009-10-29 17:17:42 +0100542static struct resource imx_ssi_resources0[] = {
543 {
544 .start = SSI1_BASE_ADDR,
545 .end = SSI1_BASE_ADDR + 0xfff,
546 .flags = IORESOURCE_MEM,
547 }, {
548 .start = MX31_INT_SSI1,
549 .end = MX31_INT_SSI1,
550 .flags = IORESOURCE_IRQ,
551 },
552};
553
554static struct resource imx_ssi_resources1[] = {
555 {
556 .start = SSI2_BASE_ADDR,
557 .end = SSI2_BASE_ADDR + 0xfff,
558 .flags = IORESOURCE_MEM
559 }, {
560 .start = MX31_INT_SSI2,
561 .end = MX31_INT_SSI2,
562 .flags = IORESOURCE_IRQ,
563 },
564};
565
566struct platform_device imx_ssi_device0 = {
567 .name = "imx-ssi",
568 .id = 0,
569 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
570 .resource = imx_ssi_resources0,
571};
572
573struct platform_device imx_ssi_device1 = {
574 .name = "imx-ssi",
575 .id = 1,
576 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
577 .resource = imx_ssi_resources1,
578};
579
Vladimir Zapolskiya7dc12b2010-03-19 18:16:37 +0300580static struct resource imx_wdt_resources[] = {
581 {
582 .flags = IORESOURCE_MEM,
583 },
584};
585
586struct platform_device imx_wdt_device0 = {
Wolfram Sang6d38c1c2010-04-29 10:03:18 +0200587 .name = "imx2-wdt",
Vladimir Zapolskiya7dc12b2010-03-19 18:16:37 +0300588 .id = 0,
589 .num_resources = ARRAY_SIZE(imx_wdt_resources),
590 .resource = imx_wdt_resources,
591};
592
Vladimir Zapolskiyded518c2010-03-24 14:32:17 +0300593static struct resource imx_rtc_resources[] = {
594 {
595 .start = MX31_RTC_BASE_ADDR,
596 .end = MX31_RTC_BASE_ADDR + 0x3fff,
597 .flags = IORESOURCE_MEM,
598 },
599 {
600 .start = MX31_INT_RTC,
601 .flags = IORESOURCE_IRQ,
602 },
603};
604
605struct platform_device imx_rtc_device0 = {
606 .name = "mxc_rtc",
607 .id = -1,
608 .num_resources = ARRAY_SIZE(imx_rtc_resources),
609 .resource = imx_rtc_resources,
610};
611
Alberto Panizzob1e89952010-05-19 11:33:43 +0200612static struct resource imx_kpp_resources[] = {
613 {
614 .start = MX3x_KPP_BASE_ADDR,
615 .end = MX3x_KPP_BASE_ADDR + 0xf,
616 .flags = IORESOURCE_MEM
617 }, {
618 .start = MX3x_INT_KPP,
619 .end = MX3x_INT_KPP,
620 .flags = IORESOURCE_IRQ,
621 },
622};
623
624struct platform_device imx_kpp_device = {
625 .name = "imx-keypad",
626 .id = -1,
627 .num_resources = ARRAY_SIZE(imx_kpp_resources),
628 .resource = imx_kpp_resources,
629};
630
Vladimir Zapolskiya7dc12b2010-03-19 18:16:37 +0300631static int __init mx3_devices_init(void)
Sascha Hauer9536ff32009-02-06 15:38:51 +0100632{
Uwe Kleine-Königa2ceeef2010-06-16 12:23:11 +0200633#if defined(CONFIG_ARCH_MX31)
Sascha Hauer9536ff32009-02-06 15:38:51 +0100634 if (cpu_is_mx31()) {
Vladimir Zapolskiya7dc12b2010-03-19 18:16:37 +0300635 imx_wdt_resources[0].start = MX31_WDOG_BASE_ADDR;
636 imx_wdt_resources[0].end = MX31_WDOG_BASE_ADDR + 0x3fff;
Alan Carvalho de Assis45001e92009-04-02 12:38:41 -0300637 mxc_register_device(&mxc_rnga_device, NULL);
Sascha Hauer9536ff32009-02-06 15:38:51 +0100638 }
Uwe Kleine-Königa2ceeef2010-06-16 12:23:11 +0200639#endif
640#if defined(CONFIG_ARCH_MX35)
Sascha Hauer9536ff32009-02-06 15:38:51 +0100641 if (cpu_is_mx35()) {
642 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
Juergen Beisertfcebfc82009-10-02 11:25:45 +0200643 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff;
Sascha Hauer7bc07eb2009-04-17 16:52:25 +0200644 otg_resources[0].start = MX35_OTG_BASE_ADDR;
645 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
646 otg_resources[1].start = MXC_INT_USBOTG;
647 otg_resources[1].end = MXC_INT_USBOTG;
648 mxc_usbh1_resources[0].start = MX35_OTG_BASE_ADDR + 0x400;
649 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
650 mxc_usbh1_resources[1].start = MXC_INT_USBHS;
651 mxc_usbh1_resources[1].end = MXC_INT_USBHS;
Sascha Hauerd8d982b2009-10-29 17:17:42 +0100652 imx_ssi_resources0[1].start = MX35_INT_SSI1;
653 imx_ssi_resources0[1].end = MX35_INT_SSI1;
654 imx_ssi_resources1[1].start = MX35_INT_SSI2;
655 imx_ssi_resources1[1].end = MX35_INT_SSI2;
Vladimir Zapolskiya7dc12b2010-03-19 18:16:37 +0300656 imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR;
657 imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff;
Sascha Hauer9536ff32009-02-06 15:38:51 +0100658 }
Uwe Kleine-Königa2ceeef2010-06-16 12:23:11 +0200659#endif
Sascha Hauer9536ff32009-02-06 15:38:51 +0100660
661 return 0;
662}
663
664subsys_initcall(mx3_devices_init);