blob: 371ca8c8414c23dd3f696f530830fa9af3c70bbe [file] [log] [blame]
Amit Kucheriaa329b482010-02-04 12:21:53 -08001/*
2 * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com>
Dinh Nguyene24798e2010-04-22 16:28:42 +03003 * Copyright (C) 2010 Freescale Semiconductor, Inc.
Amit Kucheriaa329b482010-02-04 12:21:53 -08004 *
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#include <linux/platform_device.h>
Dinh Nguyenc53bdf12010-04-30 15:48:24 -050014#include <linux/dma-mapping.h>
Amit Kucheriaa329b482010-02-04 12:21:53 -080015#include <mach/hardware.h>
16#include <mach/imx-uart.h>
Dinh Nguyene24798e2010-04-22 16:28:42 +030017#include <mach/irqs.h>
Amit Kucheriaa329b482010-02-04 12:21:53 -080018
Dinh Nguyen71c2e512010-05-27 10:45:04 -050019static struct resource mxc_hsi2c_resources[] = {
20 {
21 .start = MX51_HSI2C_DMA_BASE_ADDR,
22 .end = MX51_HSI2C_DMA_BASE_ADDR + SZ_16K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 {
26 .start = MX51_MXC_INT_HS_I2C,
27 .end = MX51_MXC_INT_HS_I2C,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32struct platform_device mxc_hsi2c_device = {
33 .name = "imx-i2c",
34 .id = 2,
35 .num_resources = ARRAY_SIZE(mxc_hsi2c_resources),
36 .resource = mxc_hsi2c_resources
37};
38
Dinh Nguyenc53bdf12010-04-30 15:48:24 -050039static u64 usb_dma_mask = DMA_BIT_MASK(32);
40
41static struct resource usbotg_resources[] = {
42 {
43 .start = MX51_OTG_BASE_ADDR,
44 .end = MX51_OTG_BASE_ADDR + 0x1ff,
45 .flags = IORESOURCE_MEM,
46 },
47 {
48 .start = MX51_MXC_INT_USB_OTG,
49 .flags = IORESOURCE_IRQ,
50 },
51};
52
Dinh Nguyen2ba5a2c2010-05-10 13:45:59 -050053/* OTG gadget device */
54struct platform_device mxc_usbdr_udc_device = {
55 .name = "fsl-usb2-udc",
56 .id = -1,
57 .num_resources = ARRAY_SIZE(usbotg_resources),
58 .resource = usbotg_resources,
59 .dev = {
60 .dma_mask = &usb_dma_mask,
61 .coherent_dma_mask = DMA_BIT_MASK(32),
62 },
63};
64
Dinh Nguyenc53bdf12010-04-30 15:48:24 -050065struct platform_device mxc_usbdr_host_device = {
66 .name = "mxc-ehci",
67 .id = 0,
68 .num_resources = ARRAY_SIZE(usbotg_resources),
69 .resource = usbotg_resources,
70 .dev = {
71 .dma_mask = &usb_dma_mask,
72 .coherent_dma_mask = DMA_BIT_MASK(32),
73 },
74};
75
76static struct resource usbh1_resources[] = {
77 {
78 .start = MX51_OTG_BASE_ADDR + 0x200,
79 .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff,
80 .flags = IORESOURCE_MEM,
81 },
82 {
83 .start = MX51_MXC_INT_USB_H1,
84 .flags = IORESOURCE_IRQ,
85 },
86};
87
88struct platform_device mxc_usbh1_device = {
89 .name = "mxc-ehci",
90 .id = 1,
91 .num_resources = ARRAY_SIZE(usbh1_resources),
92 .resource = usbh1_resources,
93 .dev = {
94 .dma_mask = &usb_dma_mask,
95 .coherent_dma_mask = DMA_BIT_MASK(32),
96 },
97};
98
Arnaud Patard (Rtp)8305ed72010-12-20 16:48:57 +010099static struct resource usbh2_resources[] = {
100 {
101 .start = MX51_OTG_BASE_ADDR + 0x400,
102 .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .start = MX51_MXC_INT_USB_H2,
107 .flags = IORESOURCE_IRQ,
108 },
109};
110
111struct platform_device mxc_usbh2_device = {
112 .name = "mxc-ehci",
113 .id = 2,
114 .num_resources = ARRAY_SIZE(usbh2_resources),
115 .resource = usbh2_resources,
116 .dev = {
117 .dma_mask = &usb_dma_mask,
118 .coherent_dma_mask = DMA_BIT_MASK(32),
119 },
120};