diff options
Diffstat (limited to 'arch/arm/mach-imx/devices.c')
-rw-r--r-- | arch/arm/mach-imx/devices.c | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index b37280561a3f..ceae6413d4c6 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c | |||
@@ -11,6 +11,9 @@ | |||
11 | * | 11 | * |
12 | * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. | 12 | * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. |
13 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | 13 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de |
14 | * Copyright 2008 Sascha Hauer, kernel@pengutronix.de | ||
15 | * Copyright (c) 2008 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
16 | * Copyright (c) 2008 Darius Augulis <darius.augulis@teltonika.lt> | ||
14 | * | 17 | * |
15 | * This program is free software; you can redistribute it and/or | 18 | * This program is free software; you can redistribute it and/or |
16 | * modify it under the terms of the GNU General Public License | 19 | * modify it under the terms of the GNU General Public License |
@@ -41,6 +44,199 @@ | |||
41 | 44 | ||
42 | #include "devices.h" | 45 | #include "devices.h" |
43 | 46 | ||
47 | #if defined(CONFIG_ARCH_MX1) | ||
48 | static struct resource imx1_camera_resources[] = { | ||
49 | { | ||
50 | .start = 0x00224000, | ||
51 | .end = 0x00224010, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, { | ||
54 | .start = MX1_CSI_INT, | ||
55 | .end = MX1_CSI_INT, | ||
56 | .flags = IORESOURCE_IRQ, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static u64 imx1_camera_dmamask = DMA_BIT_MASK(32); | ||
61 | |||
62 | struct platform_device imx1_camera_device = { | ||
63 | .name = "mx1-camera", | ||
64 | .id = 0, /* This is used to put cameras on this interface */ | ||
65 | .dev = { | ||
66 | .dma_mask = &imx1_camera_dmamask, | ||
67 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
68 | }, | ||
69 | .resource = imx1_camera_resources, | ||
70 | .num_resources = ARRAY_SIZE(imx1_camera_resources), | ||
71 | }; | ||
72 | |||
73 | static struct resource imx_i2c_resources[] = { | ||
74 | { | ||
75 | .start = 0x00217000, | ||
76 | .end = 0x00217010, | ||
77 | .flags = IORESOURCE_MEM, | ||
78 | }, { | ||
79 | .start = MX1_I2C_INT, | ||
80 | .end = MX1_I2C_INT, | ||
81 | .flags = IORESOURCE_IRQ, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | struct platform_device imx_i2c_device0 = { | ||
86 | .name = "imx-i2c", | ||
87 | .id = 0, | ||
88 | .resource = imx_i2c_resources, | ||
89 | .num_resources = ARRAY_SIZE(imx_i2c_resources), | ||
90 | }; | ||
91 | |||
92 | #define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \ | ||
93 | static struct resource imx1_uart_resources ## n[] = { \ | ||
94 | { \ | ||
95 | .start = baseaddr, \ | ||
96 | .end = baseaddr + 0xd0, \ | ||
97 | .flags = IORESOURCE_MEM, \ | ||
98 | }, { \ | ||
99 | .start = irqrx, \ | ||
100 | .end = irqrx, \ | ||
101 | .flags = IORESOURCE_IRQ, \ | ||
102 | }, { \ | ||
103 | .start = irqtx, \ | ||
104 | .end = irqtx, \ | ||
105 | .flags = IORESOURCE_IRQ, \ | ||
106 | }, { \ | ||
107 | .start = irqrts, \ | ||
108 | .end = irqrts, \ | ||
109 | .flags = IORESOURCE_IRQ, \ | ||
110 | }, \ | ||
111 | }; \ | ||
112 | \ | ||
113 | struct platform_device imx1_uart_device ## n = { \ | ||
114 | .name = "imx-uart", \ | ||
115 | .id = n, \ | ||
116 | .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \ | ||
117 | .resource = imx1_uart_resources ## n, \ | ||
118 | } | ||
119 | |||
120 | DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS); | ||
121 | DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS); | ||
122 | |||
123 | static struct resource imx_rtc_resources[] = { | ||
124 | { | ||
125 | .start = 0x00204000, | ||
126 | .end = 0x00204024, | ||
127 | .flags = IORESOURCE_MEM, | ||
128 | }, { | ||
129 | .start = MX1_RTC_INT, | ||
130 | .end = MX1_RTC_INT, | ||
131 | .flags = IORESOURCE_IRQ, | ||
132 | }, { | ||
133 | .start = MX1_RTC_SAMINT, | ||
134 | .end = MX1_RTC_SAMINT, | ||
135 | .flags = IORESOURCE_IRQ, | ||
136 | }, | ||
137 | }; | ||
138 | |||
139 | struct platform_device imx_rtc_device = { | ||
140 | .name = "rtc-imx", | ||
141 | .id = 0, | ||
142 | .resource = imx_rtc_resources, | ||
143 | .num_resources = ARRAY_SIZE(imx_rtc_resources), | ||
144 | }; | ||
145 | |||
146 | static struct resource imx_wdt_resources[] = { | ||
147 | { | ||
148 | .start = 0x00201000, | ||
149 | .end = 0x00201008, | ||
150 | .flags = IORESOURCE_MEM, | ||
151 | }, { | ||
152 | .start = MX1_WDT_INT, | ||
153 | .end = MX1_WDT_INT, | ||
154 | .flags = IORESOURCE_IRQ, | ||
155 | }, | ||
156 | }; | ||
157 | |||
158 | struct platform_device imx_wdt_device = { | ||
159 | .name = "imx-wdt", | ||
160 | .id = 0, | ||
161 | .resource = imx_wdt_resources, | ||
162 | .num_resources = ARRAY_SIZE(imx_wdt_resources), | ||
163 | }; | ||
164 | |||
165 | static struct resource imx_usb_resources[] = { | ||
166 | { | ||
167 | .start = 0x00212000, | ||
168 | .end = 0x00212148, | ||
169 | .flags = IORESOURCE_MEM, | ||
170 | }, { | ||
171 | .start = MX1_USBD_INT0, | ||
172 | .end = MX1_USBD_INT0, | ||
173 | .flags = IORESOURCE_IRQ, | ||
174 | }, { | ||
175 | .start = MX1_USBD_INT1, | ||
176 | .end = MX1_USBD_INT1, | ||
177 | .flags = IORESOURCE_IRQ, | ||
178 | }, { | ||
179 | .start = MX1_USBD_INT2, | ||
180 | .end = MX1_USBD_INT2, | ||
181 | .flags = IORESOURCE_IRQ, | ||
182 | }, { | ||
183 | .start = MX1_USBD_INT3, | ||
184 | .end = MX1_USBD_INT3, | ||
185 | .flags = IORESOURCE_IRQ, | ||
186 | }, { | ||
187 | .start = MX1_USBD_INT4, | ||
188 | .end = MX1_USBD_INT4, | ||
189 | .flags = IORESOURCE_IRQ, | ||
190 | }, { | ||
191 | .start = MX1_USBD_INT5, | ||
192 | .end = MX1_USBD_INT5, | ||
193 | .flags = IORESOURCE_IRQ, | ||
194 | }, { | ||
195 | .start = MX1_USBD_INT6, | ||
196 | .end = MX1_USBD_INT6, | ||
197 | .flags = IORESOURCE_IRQ, | ||
198 | }, | ||
199 | }; | ||
200 | |||
201 | struct platform_device imx_usb_device = { | ||
202 | .name = "imx_udc", | ||
203 | .id = 0, | ||
204 | .num_resources = ARRAY_SIZE(imx_usb_resources), | ||
205 | .resource = imx_usb_resources, | ||
206 | }; | ||
207 | |||
208 | /* GPIO port description */ | ||
209 | static struct mxc_gpio_port imx_gpio_ports[] = { | ||
210 | { | ||
211 | .chip.label = "gpio-0", | ||
212 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR), | ||
213 | .irq = MX1_GPIO_INT_PORTA, | ||
214 | .virtual_irq_start = MXC_GPIO_IRQ_START, | ||
215 | }, { | ||
216 | .chip.label = "gpio-1", | ||
217 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x100), | ||
218 | .irq = MX1_GPIO_INT_PORTB, | ||
219 | .virtual_irq_start = MXC_GPIO_IRQ_START + 32, | ||
220 | }, { | ||
221 | .chip.label = "gpio-2", | ||
222 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x200), | ||
223 | .irq = MX1_GPIO_INT_PORTC, | ||
224 | .virtual_irq_start = MXC_GPIO_IRQ_START + 64, | ||
225 | }, { | ||
226 | .chip.label = "gpio-3", | ||
227 | .base = (void __iomem *)MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR + 0x300), | ||
228 | .irq = MX1_GPIO_INT_PORTD, | ||
229 | .virtual_irq_start = MXC_GPIO_IRQ_START + 96, | ||
230 | } | ||
231 | }; | ||
232 | |||
233 | int __init imx1_register_gpios(void) | ||
234 | { | ||
235 | return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); | ||
236 | } | ||
237 | #endif | ||
238 | |||
239 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) | ||
44 | /* | 240 | /* |
45 | * SPI master controller | 241 | * SPI master controller |
46 | * | 242 | * |
@@ -526,3 +722,4 @@ struct platform_device mx21_usbhc_device = { | |||
526 | .resource = mx21_usbhc_resources, | 722 | .resource = mx21_usbhc_resources, |
527 | }; | 723 | }; |
528 | #endif | 724 | #endif |
725 | #endif | ||