diff options
Diffstat (limited to 'arch/arm/mach-mx5/devices.c')
-rw-r--r-- | arch/arm/mach-mx5/devices.c | 109 |
1 files changed, 107 insertions, 2 deletions
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index d6fd3961ade9..7130449aacdc 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com> | 2 | * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com> |
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
3 | * | 4 | * |
4 | * The code contained herein is licensed under the GNU General Public | 5 | * 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 | * License. You may obtain a copy of the GNU General Public License |
@@ -10,8 +11,11 @@ | |||
10 | */ | 11 | */ |
11 | 12 | ||
12 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | ||
15 | #include <linux/gpio.h> | ||
13 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
14 | #include <mach/imx-uart.h> | 17 | #include <mach/imx-uart.h> |
18 | #include <mach/irqs.h> | ||
15 | 19 | ||
16 | static struct resource uart0[] = { | 20 | static struct resource uart0[] = { |
17 | { | 21 | { |
@@ -89,8 +93,109 @@ struct platform_device mxc_fec_device = { | |||
89 | .resource = mxc_fec_resources, | 93 | .resource = mxc_fec_resources, |
90 | }; | 94 | }; |
91 | 95 | ||
92 | /* Dummy definition to allow compiling in AVIC and TZIC simultaneously */ | 96 | static u64 usb_dma_mask = DMA_BIT_MASK(32); |
97 | |||
98 | static struct resource usbotg_resources[] = { | ||
99 | { | ||
100 | .start = MX51_OTG_BASE_ADDR, | ||
101 | .end = MX51_OTG_BASE_ADDR + 0x1ff, | ||
102 | .flags = IORESOURCE_MEM, | ||
103 | }, | ||
104 | { | ||
105 | .start = MX51_MXC_INT_USB_OTG, | ||
106 | .flags = IORESOURCE_IRQ, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | /* OTG gadget device */ | ||
111 | struct platform_device mxc_usbdr_udc_device = { | ||
112 | .name = "fsl-usb2-udc", | ||
113 | .id = -1, | ||
114 | .num_resources = ARRAY_SIZE(usbotg_resources), | ||
115 | .resource = usbotg_resources, | ||
116 | .dev = { | ||
117 | .dma_mask = &usb_dma_mask, | ||
118 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
119 | }, | ||
120 | }; | ||
121 | |||
122 | struct platform_device mxc_usbdr_host_device = { | ||
123 | .name = "mxc-ehci", | ||
124 | .id = 0, | ||
125 | .num_resources = ARRAY_SIZE(usbotg_resources), | ||
126 | .resource = usbotg_resources, | ||
127 | .dev = { | ||
128 | .dma_mask = &usb_dma_mask, | ||
129 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
130 | }, | ||
131 | }; | ||
132 | |||
133 | static struct resource usbh1_resources[] = { | ||
134 | { | ||
135 | .start = MX51_OTG_BASE_ADDR + 0x200, | ||
136 | .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff, | ||
137 | .flags = IORESOURCE_MEM, | ||
138 | }, | ||
139 | { | ||
140 | .start = MX51_MXC_INT_USB_H1, | ||
141 | .flags = IORESOURCE_IRQ, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | struct platform_device mxc_usbh1_device = { | ||
146 | .name = "mxc-ehci", | ||
147 | .id = 1, | ||
148 | .num_resources = ARRAY_SIZE(usbh1_resources), | ||
149 | .resource = usbh1_resources, | ||
150 | .dev = { | ||
151 | .dma_mask = &usb_dma_mask, | ||
152 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
153 | }, | ||
154 | }; | ||
155 | |||
156 | static struct resource mxc_wdt_resources[] = { | ||
157 | { | ||
158 | .start = MX51_WDOG_BASE_ADDR, | ||
159 | .end = MX51_WDOG_BASE_ADDR + SZ_16K - 1, | ||
160 | .flags = IORESOURCE_MEM, | ||
161 | }, | ||
162 | }; | ||
163 | |||
164 | struct platform_device mxc_wdt = { | ||
165 | .name = "imx2-wdt", | ||
166 | .id = 0, | ||
167 | .num_resources = ARRAY_SIZE(mxc_wdt_resources), | ||
168 | .resource = mxc_wdt_resources, | ||
169 | }; | ||
170 | |||
171 | static struct mxc_gpio_port mxc_gpio_ports[] = { | ||
172 | { | ||
173 | .chip.label = "gpio-0", | ||
174 | .base = MX51_IO_ADDRESS(MX51_GPIO1_BASE_ADDR), | ||
175 | .irq = MX51_MXC_INT_GPIO1_LOW, | ||
176 | .virtual_irq_start = MXC_GPIO_IRQ_START | ||
177 | }, | ||
178 | { | ||
179 | .chip.label = "gpio-1", | ||
180 | .base = MX51_IO_ADDRESS(MX51_GPIO2_BASE_ADDR), | ||
181 | .irq = MX51_MXC_INT_GPIO2_LOW, | ||
182 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 1 | ||
183 | }, | ||
184 | { | ||
185 | .chip.label = "gpio-2", | ||
186 | .base = MX51_IO_ADDRESS(MX51_GPIO3_BASE_ADDR), | ||
187 | .irq = MX51_MXC_INT_GPIO3_LOW, | ||
188 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 2 | ||
189 | }, | ||
190 | { | ||
191 | .chip.label = "gpio-3", | ||
192 | .base = MX51_IO_ADDRESS(MX51_GPIO4_BASE_ADDR), | ||
193 | .irq = MX51_MXC_INT_GPIO4_LOW, | ||
194 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3 | ||
195 | }, | ||
196 | }; | ||
197 | |||
93 | int __init mxc_register_gpios(void) | 198 | int __init mxc_register_gpios(void) |
94 | { | 199 | { |
95 | return 0; | 200 | return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports)); |
96 | } | 201 | } |