Linux 2.6.31.6
[linux/fpc-iii.git] / arch / arm / mach-mx1 / devices.c
blob76d1ffb4807980fadade7ca3c905d30a86af9523
1 /*
2 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Sascha Hauer, kernel@pengutronix.de
4 * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
5 * Copyright (c) 2008 Darius Augulis <darius.augulis@teltonika.lt>
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.
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,
19 * Boston, MA 02110-1301, USA.
22 #include <linux/kernel.h>
23 #include <linux/init.h>
24 #include <linux/platform_device.h>
25 #include <linux/gpio.h>
26 #include <mach/irqs.h>
27 #include <mach/hardware.h>
29 #include "devices.h"
31 static struct resource imx_csi_resources[] = {
32 [0] = {
33 .start = 0x00224000,
34 .end = 0x00224010,
35 .flags = IORESOURCE_MEM,
37 [1] = {
38 .start = CSI_INT,
39 .end = CSI_INT,
40 .flags = IORESOURCE_IRQ,
44 static u64 imx_csi_dmamask = 0xffffffffUL;
46 struct platform_device imx_csi_device = {
47 .name = "mx1-camera",
48 .id = 0, /* This is used to put cameras on this interface */
49 .dev = {
50 .dma_mask = &imx_csi_dmamask,
51 .coherent_dma_mask = 0xffffffff,
53 .resource = imx_csi_resources,
54 .num_resources = ARRAY_SIZE(imx_csi_resources),
57 static struct resource imx_i2c_resources[] = {
58 [0] = {
59 .start = 0x00217000,
60 .end = 0x00217010,
61 .flags = IORESOURCE_MEM,
63 [1] = {
64 .start = I2C_INT,
65 .end = I2C_INT,
66 .flags = IORESOURCE_IRQ,
70 struct platform_device imx_i2c_device = {
71 .name = "imx-i2c",
72 .id = 0,
73 .resource = imx_i2c_resources,
74 .num_resources = ARRAY_SIZE(imx_i2c_resources),
77 static struct resource imx_uart1_resources[] = {
78 [0] = {
79 .start = UART1_BASE_ADDR,
80 .end = UART1_BASE_ADDR + 0xD0,
81 .flags = IORESOURCE_MEM,
83 [1] = {
84 .start = UART1_MINT_RX,
85 .end = UART1_MINT_RX,
86 .flags = IORESOURCE_IRQ,
88 [2] = {
89 .start = UART1_MINT_TX,
90 .end = UART1_MINT_TX,
91 .flags = IORESOURCE_IRQ,
93 [3] = {
94 .start = UART1_MINT_RTS,
95 .end = UART1_MINT_RTS,
96 .flags = IORESOURCE_IRQ,
100 struct platform_device imx_uart1_device = {
101 .name = "imx-uart",
102 .id = 0,
103 .num_resources = ARRAY_SIZE(imx_uart1_resources),
104 .resource = imx_uart1_resources,
107 static struct resource imx_uart2_resources[] = {
108 [0] = {
109 .start = UART2_BASE_ADDR,
110 .end = UART2_BASE_ADDR + 0xD0,
111 .flags = IORESOURCE_MEM,
113 [1] = {
114 .start = UART2_MINT_RX,
115 .end = UART2_MINT_RX,
116 .flags = IORESOURCE_IRQ,
118 [2] = {
119 .start = UART2_MINT_TX,
120 .end = UART2_MINT_TX,
121 .flags = IORESOURCE_IRQ,
123 [3] = {
124 .start = UART2_MINT_RTS,
125 .end = UART2_MINT_RTS,
126 .flags = IORESOURCE_IRQ,
130 struct platform_device imx_uart2_device = {
131 .name = "imx-uart",
132 .id = 1,
133 .num_resources = ARRAY_SIZE(imx_uart2_resources),
134 .resource = imx_uart2_resources,
137 static struct resource imx_rtc_resources[] = {
138 [0] = {
139 .start = 0x00204000,
140 .end = 0x00204024,
141 .flags = IORESOURCE_MEM,
143 [1] = {
144 .start = RTC_INT,
145 .end = RTC_INT,
146 .flags = IORESOURCE_IRQ,
148 [2] = {
149 .start = RTC_SAMINT,
150 .end = RTC_SAMINT,
151 .flags = IORESOURCE_IRQ,
155 struct platform_device imx_rtc_device = {
156 .name = "rtc-imx",
157 .id = 0,
158 .resource = imx_rtc_resources,
159 .num_resources = ARRAY_SIZE(imx_rtc_resources),
162 static struct resource imx_wdt_resources[] = {
163 [0] = {
164 .start = 0x00201000,
165 .end = 0x00201008,
166 .flags = IORESOURCE_MEM,
168 [1] = {
169 .start = WDT_INT,
170 .end = WDT_INT,
171 .flags = IORESOURCE_IRQ,
175 struct platform_device imx_wdt_device = {
176 .name = "imx-wdt",
177 .id = 0,
178 .resource = imx_wdt_resources,
179 .num_resources = ARRAY_SIZE(imx_wdt_resources),
182 static struct resource imx_usb_resources[] = {
183 [0] = {
184 .start = 0x00212000,
185 .end = 0x00212148,
186 .flags = IORESOURCE_MEM,
188 [1] = {
189 .start = USBD_INT0,
190 .end = USBD_INT0,
191 .flags = IORESOURCE_IRQ,
193 [2] = {
194 .start = USBD_INT1,
195 .end = USBD_INT1,
196 .flags = IORESOURCE_IRQ,
198 [3] = {
199 .start = USBD_INT2,
200 .end = USBD_INT2,
201 .flags = IORESOURCE_IRQ,
203 [4] = {
204 .start = USBD_INT3,
205 .end = USBD_INT3,
206 .flags = IORESOURCE_IRQ,
208 [5] = {
209 .start = USBD_INT4,
210 .end = USBD_INT4,
211 .flags = IORESOURCE_IRQ,
213 [6] = {
214 .start = USBD_INT5,
215 .end = USBD_INT5,
216 .flags = IORESOURCE_IRQ,
218 [7] = {
219 .start = USBD_INT6,
220 .end = USBD_INT6,
221 .flags = IORESOURCE_IRQ,
225 struct platform_device imx_usb_device = {
226 .name = "imx_udc",
227 .id = 0,
228 .num_resources = ARRAY_SIZE(imx_usb_resources),
229 .resource = imx_usb_resources,
232 /* GPIO port description */
233 static struct mxc_gpio_port imx_gpio_ports[] = {
234 [0] = {
235 .chip.label = "gpio-0",
236 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR),
237 .irq = GPIO_INT_PORTA,
238 .virtual_irq_start = MXC_GPIO_IRQ_START
240 [1] = {
241 .chip.label = "gpio-1",
242 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
243 .irq = GPIO_INT_PORTB,
244 .virtual_irq_start = MXC_GPIO_IRQ_START + 32
246 [2] = {
247 .chip.label = "gpio-2",
248 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
249 .irq = GPIO_INT_PORTC,
250 .virtual_irq_start = MXC_GPIO_IRQ_START + 64
252 [3] = {
253 .chip.label = "gpio-3",
254 .base = (void __iomem *)IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
255 .irq = GPIO_INT_PORTD,
256 .virtual_irq_start = MXC_GPIO_IRQ_START + 96
260 int __init mxc_register_gpios(void)
262 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));