diff options
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/cm_bf533.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/cm_bf533.c | 138 |
1 files changed, 128 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c index 7fc3b860d4ae..fdcde61906dc 100644 --- a/arch/blackfin/mach-bf533/boards/cm_bf533.c +++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c | |||
@@ -71,7 +71,7 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
71 | }; | 71 | }; |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 74 | #if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
75 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | 75 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
76 | .enable_dma = 0, | 76 | .enable_dma = 0, |
77 | .bits_per_word = 16, | 77 | .bits_per_word = 16, |
@@ -110,7 +110,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
110 | }, | 110 | }, |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 113 | #if defined(CONFIG_SND_BLACKFIN_AD183X) || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
114 | { | 114 | { |
115 | .modalias = "ad1836", | 115 | .modalias = "ad1836", |
116 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 116 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
@@ -242,21 +242,50 @@ static struct platform_device smsc911x_device = { | |||
242 | #endif | 242 | #endif |
243 | 243 | ||
244 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 244 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
245 | static struct resource bfin_uart_resources[] = { | 245 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
246 | static struct resource bfin_uart0_resources[] = { | ||
246 | { | 247 | { |
247 | .start = 0xFFC00400, | 248 | .start = BFIN_UART_THR, |
248 | .end = 0xFFC004FF, | 249 | .end = BFIN_UART_GCTL+2, |
249 | .flags = IORESOURCE_MEM, | 250 | .flags = IORESOURCE_MEM, |
250 | }, | 251 | }, |
252 | { | ||
253 | .start = IRQ_UART0_RX, | ||
254 | .end = IRQ_UART0_RX + 1, | ||
255 | .flags = IORESOURCE_IRQ, | ||
256 | }, | ||
257 | { | ||
258 | .start = IRQ_UART0_ERROR, | ||
259 | .end = IRQ_UART0_ERROR, | ||
260 | .flags = IORESOURCE_IRQ, | ||
261 | }, | ||
262 | { | ||
263 | .start = CH_UART0_TX, | ||
264 | .end = CH_UART0_TX, | ||
265 | .flags = IORESOURCE_DMA, | ||
266 | }, | ||
267 | { | ||
268 | .start = CH_UART0_RX, | ||
269 | .end = CH_UART0_RX, | ||
270 | .flags = IORESOURCE_DMA, | ||
271 | }, | ||
272 | }; | ||
273 | |||
274 | unsigned short bfin_uart0_peripherals[] = { | ||
275 | P_UART0_TX, P_UART0_RX, 0 | ||
251 | }; | 276 | }; |
252 | 277 | ||
253 | static struct platform_device bfin_uart_device = { | 278 | static struct platform_device bfin_uart0_device = { |
254 | .name = "bfin-uart", | 279 | .name = "bfin-uart", |
255 | .id = 1, | 280 | .id = 0, |
256 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 281 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
257 | .resource = bfin_uart_resources, | 282 | .resource = bfin_uart0_resources, |
283 | .dev = { | ||
284 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
285 | }, | ||
258 | }; | 286 | }; |
259 | #endif | 287 | #endif |
288 | #endif | ||
260 | 289 | ||
261 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 290 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
262 | #ifdef CONFIG_BFIN_SIR0 | 291 | #ifdef CONFIG_BFIN_SIR0 |
@@ -288,16 +317,75 @@ static struct platform_device bfin_sir0_device = { | |||
288 | #endif | 317 | #endif |
289 | 318 | ||
290 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 319 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
320 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
321 | static struct resource bfin_sport0_uart_resources[] = { | ||
322 | { | ||
323 | .start = SPORT0_TCR1, | ||
324 | .end = SPORT0_MRCS3+4, | ||
325 | .flags = IORESOURCE_MEM, | ||
326 | }, | ||
327 | { | ||
328 | .start = IRQ_SPORT0_RX, | ||
329 | .end = IRQ_SPORT0_RX+1, | ||
330 | .flags = IORESOURCE_IRQ, | ||
331 | }, | ||
332 | { | ||
333 | .start = IRQ_SPORT0_ERROR, | ||
334 | .end = IRQ_SPORT0_ERROR, | ||
335 | .flags = IORESOURCE_IRQ, | ||
336 | }, | ||
337 | }; | ||
338 | |||
339 | unsigned short bfin_sport0_peripherals[] = { | ||
340 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
341 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
342 | }; | ||
343 | |||
291 | static struct platform_device bfin_sport0_uart_device = { | 344 | static struct platform_device bfin_sport0_uart_device = { |
292 | .name = "bfin-sport-uart", | 345 | .name = "bfin-sport-uart", |
293 | .id = 0, | 346 | .id = 0, |
347 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
348 | .resource = bfin_sport0_uart_resources, | ||
349 | .dev = { | ||
350 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
351 | }, | ||
352 | }; | ||
353 | #endif | ||
354 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
355 | static struct resource bfin_sport1_uart_resources[] = { | ||
356 | { | ||
357 | .start = SPORT1_TCR1, | ||
358 | .end = SPORT1_MRCS3+4, | ||
359 | .flags = IORESOURCE_MEM, | ||
360 | }, | ||
361 | { | ||
362 | .start = IRQ_SPORT1_RX, | ||
363 | .end = IRQ_SPORT1_RX+1, | ||
364 | .flags = IORESOURCE_IRQ, | ||
365 | }, | ||
366 | { | ||
367 | .start = IRQ_SPORT1_ERROR, | ||
368 | .end = IRQ_SPORT1_ERROR, | ||
369 | .flags = IORESOURCE_IRQ, | ||
370 | }, | ||
371 | }; | ||
372 | |||
373 | unsigned short bfin_sport1_peripherals[] = { | ||
374 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
375 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
294 | }; | 376 | }; |
295 | 377 | ||
296 | static struct platform_device bfin_sport1_uart_device = { | 378 | static struct platform_device bfin_sport1_uart_device = { |
297 | .name = "bfin-sport-uart", | 379 | .name = "bfin-sport-uart", |
298 | .id = 1, | 380 | .id = 1, |
381 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
382 | .resource = bfin_sport1_uart_resources, | ||
383 | .dev = { | ||
384 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
385 | }, | ||
299 | }; | 386 | }; |
300 | #endif | 387 | #endif |
388 | #endif | ||
301 | 389 | ||
302 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 390 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
303 | static struct resource isp1362_hcd_resources[] = { | 391 | static struct resource isp1362_hcd_resources[] = { |
@@ -432,7 +520,9 @@ static struct platform_device *cm_bf533_devices[] __initdata = { | |||
432 | &bfin_dpmc, | 520 | &bfin_dpmc, |
433 | 521 | ||
434 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 522 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
435 | &bfin_uart_device, | 523 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
524 | &bfin_uart0_device, | ||
525 | #endif | ||
436 | #endif | 526 | #endif |
437 | 527 | ||
438 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 528 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -442,9 +532,13 @@ static struct platform_device *cm_bf533_devices[] __initdata = { | |||
442 | #endif | 532 | #endif |
443 | 533 | ||
444 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | 534 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) |
535 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
445 | &bfin_sport0_uart_device, | 536 | &bfin_sport0_uart_device, |
537 | #endif | ||
538 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
446 | &bfin_sport1_uart_device, | 539 | &bfin_sport1_uart_device, |
447 | #endif | 540 | #endif |
541 | #endif | ||
448 | 542 | ||
449 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 543 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
450 | &rtc_device, | 544 | &rtc_device, |
@@ -486,3 +580,27 @@ static int __init cm_bf533_init(void) | |||
486 | } | 580 | } |
487 | 581 | ||
488 | arch_initcall(cm_bf533_init); | 582 | arch_initcall(cm_bf533_init); |
583 | |||
584 | static struct platform_device *cm_bf533_early_devices[] __initdata = { | ||
585 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
586 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
587 | &bfin_uart0_device, | ||
588 | #endif | ||
589 | #endif | ||
590 | |||
591 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
592 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
593 | &bfin_sport0_uart_device, | ||
594 | #endif | ||
595 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
596 | &bfin_sport1_uart_device, | ||
597 | #endif | ||
598 | #endif | ||
599 | }; | ||
600 | |||
601 | void __init native_machine_early_platform_add_devices(void) | ||
602 | { | ||
603 | printk(KERN_INFO "register early platform devices\n"); | ||
604 | early_platform_add_devices(cm_bf533_early_devices, | ||
605 | ARRAY_SIZE(cm_bf533_early_devices)); | ||
606 | } | ||