diff options
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/blackstamp.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/blackstamp.c | 134 |
1 files changed, 126 insertions, 8 deletions
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c index b580884848d4..842b4fa76ea9 100644 --- a/arch/blackfin/mach-bf533/boards/blackstamp.c +++ b/arch/blackfin/mach-bf533/boards/blackstamp.c | |||
@@ -195,21 +195,50 @@ static struct platform_device bfin_spi0_device = { | |||
195 | #endif /* spi master and devices */ | 195 | #endif /* spi master and devices */ |
196 | 196 | ||
197 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 197 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
198 | static struct resource bfin_uart_resources[] = { | 198 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
199 | static struct resource bfin_uart0_resources[] = { | ||
199 | { | 200 | { |
200 | .start = 0xFFC00400, | 201 | .start = BFIN_UART_THR, |
201 | .end = 0xFFC004FF, | 202 | .end = BFIN_UART_GCTL+2, |
202 | .flags = IORESOURCE_MEM, | 203 | .flags = IORESOURCE_MEM, |
203 | }, | 204 | }, |
205 | { | ||
206 | .start = IRQ_UART0_RX, | ||
207 | .end = IRQ_UART0_RX + 1, | ||
208 | .flags = IORESOURCE_IRQ, | ||
209 | }, | ||
210 | { | ||
211 | .start = IRQ_UART0_ERROR, | ||
212 | .end = IRQ_UART0_ERROR, | ||
213 | .flags = IORESOURCE_IRQ, | ||
214 | }, | ||
215 | { | ||
216 | .start = CH_UART0_TX, | ||
217 | .end = CH_UART0_TX, | ||
218 | .flags = IORESOURCE_DMA, | ||
219 | }, | ||
220 | { | ||
221 | .start = CH_UART0_RX, | ||
222 | .end = CH_UART0_RX, | ||
223 | .flags = IORESOURCE_DMA, | ||
224 | }, | ||
225 | }; | ||
226 | |||
227 | unsigned short bfin_uart0_peripherals[] = { | ||
228 | P_UART0_TX, P_UART0_RX, 0 | ||
204 | }; | 229 | }; |
205 | 230 | ||
206 | static struct platform_device bfin_uart_device = { | 231 | static struct platform_device bfin_uart0_device = { |
207 | .name = "bfin-uart", | 232 | .name = "bfin-uart", |
208 | .id = 1, | 233 | .id = 0, |
209 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 234 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
210 | .resource = bfin_uart_resources, | 235 | .resource = bfin_uart0_resources, |
236 | .dev = { | ||
237 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
238 | }, | ||
211 | }; | 239 | }; |
212 | #endif | 240 | #endif |
241 | #endif | ||
213 | 242 | ||
214 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 243 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
215 | #ifdef CONFIG_BFIN_SIR0 | 244 | #ifdef CONFIG_BFIN_SIR0 |
@@ -241,16 +270,75 @@ static struct platform_device bfin_sir0_device = { | |||
241 | #endif | 270 | #endif |
242 | 271 | ||
243 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 272 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
273 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
274 | static struct resource bfin_sport0_uart_resources[] = { | ||
275 | { | ||
276 | .start = SPORT0_TCR1, | ||
277 | .end = SPORT0_MRCS3+4, | ||
278 | .flags = IORESOURCE_MEM, | ||
279 | }, | ||
280 | { | ||
281 | .start = IRQ_SPORT0_RX, | ||
282 | .end = IRQ_SPORT0_RX+1, | ||
283 | .flags = IORESOURCE_IRQ, | ||
284 | }, | ||
285 | { | ||
286 | .start = IRQ_SPORT0_ERROR, | ||
287 | .end = IRQ_SPORT0_ERROR, | ||
288 | .flags = IORESOURCE_IRQ, | ||
289 | }, | ||
290 | }; | ||
291 | |||
292 | unsigned short bfin_sport0_peripherals[] = { | ||
293 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
294 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
295 | }; | ||
296 | |||
244 | static struct platform_device bfin_sport0_uart_device = { | 297 | static struct platform_device bfin_sport0_uart_device = { |
245 | .name = "bfin-sport-uart", | 298 | .name = "bfin-sport-uart", |
246 | .id = 0, | 299 | .id = 0, |
300 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
301 | .resource = bfin_sport0_uart_resources, | ||
302 | .dev = { | ||
303 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
304 | }, | ||
305 | }; | ||
306 | #endif | ||
307 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
308 | static struct resource bfin_sport1_uart_resources[] = { | ||
309 | { | ||
310 | .start = SPORT1_TCR1, | ||
311 | .end = SPORT1_MRCS3+4, | ||
312 | .flags = IORESOURCE_MEM, | ||
313 | }, | ||
314 | { | ||
315 | .start = IRQ_SPORT1_RX, | ||
316 | .end = IRQ_SPORT1_RX+1, | ||
317 | .flags = IORESOURCE_IRQ, | ||
318 | }, | ||
319 | { | ||
320 | .start = IRQ_SPORT1_ERROR, | ||
321 | .end = IRQ_SPORT1_ERROR, | ||
322 | .flags = IORESOURCE_IRQ, | ||
323 | }, | ||
324 | }; | ||
325 | |||
326 | unsigned short bfin_sport1_peripherals[] = { | ||
327 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
328 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
247 | }; | 329 | }; |
248 | 330 | ||
249 | static struct platform_device bfin_sport1_uart_device = { | 331 | static struct platform_device bfin_sport1_uart_device = { |
250 | .name = "bfin-sport-uart", | 332 | .name = "bfin-sport-uart", |
251 | .id = 1, | 333 | .id = 1, |
334 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
335 | .resource = bfin_sport1_uart_resources, | ||
336 | .dev = { | ||
337 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
338 | }, | ||
252 | }; | 339 | }; |
253 | #endif | 340 | #endif |
341 | #endif | ||
254 | 342 | ||
255 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 343 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
256 | #include <linux/input.h> | 344 | #include <linux/input.h> |
@@ -344,7 +432,9 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
344 | #endif | 432 | #endif |
345 | 433 | ||
346 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 434 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
347 | &bfin_uart_device, | 435 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
436 | &bfin_uart0_device, | ||
437 | #endif | ||
348 | #endif | 438 | #endif |
349 | 439 | ||
350 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 440 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -354,9 +444,13 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
354 | #endif | 444 | #endif |
355 | 445 | ||
356 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 446 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
447 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
357 | &bfin_sport0_uart_device, | 448 | &bfin_sport0_uart_device, |
449 | #endif | ||
450 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
358 | &bfin_sport1_uart_device, | 451 | &bfin_sport1_uart_device, |
359 | #endif | 452 | #endif |
453 | #endif | ||
360 | 454 | ||
361 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 455 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
362 | &bfin_device_gpiokeys, | 456 | &bfin_device_gpiokeys, |
@@ -392,3 +486,27 @@ static int __init blackstamp_init(void) | |||
392 | } | 486 | } |
393 | 487 | ||
394 | arch_initcall(blackstamp_init); | 488 | arch_initcall(blackstamp_init); |
489 | |||
490 | static struct platform_device *stamp_early_devices[] __initdata = { | ||
491 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
492 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
493 | &bfin_uart0_device, | ||
494 | #endif | ||
495 | #endif | ||
496 | |||
497 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
498 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
499 | &bfin_sport0_uart_device, | ||
500 | #endif | ||
501 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
502 | &bfin_sport1_uart_device, | ||
503 | #endif | ||
504 | #endif | ||
505 | }; | ||
506 | |||
507 | void __init native_machine_early_platform_add_devices(void) | ||
508 | { | ||
509 | printk(KERN_INFO "register early platform devices\n"); | ||
510 | early_platform_add_devices(stamp_early_devices, | ||
511 | ARRAY_SIZE(stamp_early_devices)); | ||
512 | } | ||