diff options
Diffstat (limited to 'arch/blackfin/mach-bf537/boards/pnav10.c')
-rw-r--r-- | arch/blackfin/mach-bf537/boards/pnav10.c | 169 |
1 files changed, 105 insertions, 64 deletions
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c index 4e0afda472ab..812e8f991601 100644 --- a/arch/blackfin/mach-bf537/boards/pnav10.c +++ b/arch/blackfin/mach-bf537/boards/pnav10.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <asm/dma.h> | 17 | #include <asm/dma.h> |
18 | #include <asm/bfin5xx_spi.h> | 18 | #include <asm/bfin5xx_spi.h> |
19 | #include <asm/portmux.h> | 19 | #include <asm/portmux.h> |
20 | #include <linux/usb/sl811.h> | ||
21 | 20 | ||
22 | #include <linux/spi/ad7877.h> | 21 | #include <linux/spi/ad7877.h> |
23 | 22 | ||
@@ -99,51 +98,6 @@ static struct platform_device smc91x_device = { | |||
99 | }; | 98 | }; |
100 | #endif | 99 | #endif |
101 | 100 | ||
102 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
103 | static struct resource sl811_hcd_resources[] = { | ||
104 | { | ||
105 | .start = 0x20340000, | ||
106 | .end = 0x20340000, | ||
107 | .flags = IORESOURCE_MEM, | ||
108 | }, { | ||
109 | .start = 0x20340004, | ||
110 | .end = 0x20340004, | ||
111 | .flags = IORESOURCE_MEM, | ||
112 | }, { | ||
113 | .start = CONFIG_USB_SL811_BFIN_IRQ, | ||
114 | .end = CONFIG_USB_SL811_BFIN_IRQ, | ||
115 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
120 | void sl811_port_power(struct device *dev, int is_on) | ||
121 | { | ||
122 | gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS"); | ||
123 | gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on); | ||
124 | |||
125 | } | ||
126 | #endif | ||
127 | |||
128 | static struct sl811_platform_data sl811_priv = { | ||
129 | .potpg = 10, | ||
130 | .power = 250, /* == 500mA */ | ||
131 | #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) | ||
132 | .port_power = &sl811_port_power, | ||
133 | #endif | ||
134 | }; | ||
135 | |||
136 | static struct platform_device sl811_hcd_device = { | ||
137 | .name = "sl811-hcd", | ||
138 | .id = 0, | ||
139 | .dev = { | ||
140 | .platform_data = &sl811_priv, | ||
141 | }, | ||
142 | .num_resources = ARRAY_SIZE(sl811_hcd_resources), | ||
143 | .resource = sl811_hcd_resources, | ||
144 | }; | ||
145 | #endif | ||
146 | |||
147 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 101 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
148 | static struct platform_device bfin_mii_bus = { | 102 | static struct platform_device bfin_mii_bus = { |
149 | .name = "bfin_mii_bus", | 103 | .name = "bfin_mii_bus", |
@@ -221,8 +175,8 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = { | |||
221 | }; | 175 | }; |
222 | #endif | 176 | #endif |
223 | 177 | ||
224 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 178 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ |
225 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 179 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
226 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { | 180 | static struct bfin5xx_spi_chip ad1836_spi_chip_info = { |
227 | .enable_dma = 0, | 181 | .enable_dma = 0, |
228 | .bits_per_word = 16, | 182 | .bits_per_word = 16, |
@@ -284,8 +238,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
284 | }, | 238 | }, |
285 | #endif | 239 | #endif |
286 | 240 | ||
287 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 241 | #if defined(CONFIG_SND_BLACKFIN_AD183X) \ |
288 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 242 | || defined(CONFIG_SND_BLACKFIN_AD183X_MODULE) |
289 | { | 243 | { |
290 | .modalias = "ad1836", | 244 | .modalias = "ad1836", |
291 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 245 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
@@ -362,25 +316,93 @@ static struct platform_device bfin_fb_device = { | |||
362 | #endif | 316 | #endif |
363 | 317 | ||
364 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 318 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
365 | static struct resource bfin_uart_resources[] = { | 319 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
320 | static struct resource bfin_uart0_resources[] = { | ||
366 | { | 321 | { |
367 | .start = 0xFFC00400, | 322 | .start = UART0_THR, |
368 | .end = 0xFFC004FF, | 323 | .end = UART0_GCTL+2, |
369 | .flags = IORESOURCE_MEM, | 324 | .flags = IORESOURCE_MEM, |
370 | }, { | 325 | }, |
371 | .start = 0xFFC02000, | 326 | { |
372 | .end = 0xFFC020FF, | 327 | .start = IRQ_UART0_RX, |
328 | .end = IRQ_UART0_RX+1, | ||
329 | .flags = IORESOURCE_IRQ, | ||
330 | }, | ||
331 | { | ||
332 | .start = IRQ_UART0_ERROR, | ||
333 | .end = IRQ_UART0_ERROR, | ||
334 | .flags = IORESOURCE_IRQ, | ||
335 | }, | ||
336 | { | ||
337 | .start = CH_UART0_TX, | ||
338 | .end = CH_UART0_TX, | ||
339 | .flags = IORESOURCE_DMA, | ||
340 | }, | ||
341 | { | ||
342 | .start = CH_UART0_RX, | ||
343 | .end = CH_UART0_RX, | ||
344 | .flags = IORESOURCE_DMA, | ||
345 | }, | ||
346 | }; | ||
347 | |||
348 | unsigned short bfin_uart0_peripherals[] = { | ||
349 | P_UART0_TX, P_UART0_RX, 0 | ||
350 | }; | ||
351 | |||
352 | static struct platform_device bfin_uart0_device = { | ||
353 | .name = "bfin-uart", | ||
354 | .id = 0, | ||
355 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
356 | .resource = bfin_uart0_resources, | ||
357 | .dev = { | ||
358 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
359 | }, | ||
360 | }; | ||
361 | #endif | ||
362 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
363 | static struct resource bfin_uart1_resources[] = { | ||
364 | { | ||
365 | .start = UART1_THR, | ||
366 | .end = UART1_GCTL+2, | ||
373 | .flags = IORESOURCE_MEM, | 367 | .flags = IORESOURCE_MEM, |
374 | }, | 368 | }, |
369 | { | ||
370 | .start = IRQ_UART1_RX, | ||
371 | .end = IRQ_UART1_RX+1, | ||
372 | .flags = IORESOURCE_IRQ, | ||
373 | }, | ||
374 | { | ||
375 | .start = IRQ_UART1_ERROR, | ||
376 | .end = IRQ_UART1_ERROR, | ||
377 | .flags = IORESOURCE_IRQ, | ||
378 | }, | ||
379 | { | ||
380 | .start = CH_UART1_TX, | ||
381 | .end = CH_UART1_TX, | ||
382 | .flags = IORESOURCE_DMA, | ||
383 | }, | ||
384 | { | ||
385 | .start = CH_UART1_RX, | ||
386 | .end = CH_UART1_RX, | ||
387 | .flags = IORESOURCE_DMA, | ||
388 | }, | ||
389 | }; | ||
390 | |||
391 | unsigned short bfin_uart1_peripherals[] = { | ||
392 | P_UART1_TX, P_UART1_RX, 0 | ||
375 | }; | 393 | }; |
376 | 394 | ||
377 | static struct platform_device bfin_uart_device = { | 395 | static struct platform_device bfin_uart1_device = { |
378 | .name = "bfin-uart", | 396 | .name = "bfin-uart", |
379 | .id = 1, | 397 | .id = 1, |
380 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 398 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), |
381 | .resource = bfin_uart_resources, | 399 | .resource = bfin_uart1_resources, |
400 | .dev = { | ||
401 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
402 | }, | ||
382 | }; | 403 | }; |
383 | #endif | 404 | #endif |
405 | #endif | ||
384 | 406 | ||
385 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 407 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
386 | #ifdef CONFIG_BFIN_SIR0 | 408 | #ifdef CONFIG_BFIN_SIR0 |
@@ -446,10 +468,6 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
446 | &rtc_device, | 468 | &rtc_device, |
447 | #endif | 469 | #endif |
448 | 470 | ||
449 | #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) | ||
450 | &sl811_hcd_device, | ||
451 | #endif | ||
452 | |||
453 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 471 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
454 | &smc91x_device, | 472 | &smc91x_device, |
455 | #endif | 473 | #endif |
@@ -472,7 +490,12 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
472 | #endif | 490 | #endif |
473 | 491 | ||
474 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 492 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
475 | &bfin_uart_device, | 493 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
494 | &bfin_uart0_device, | ||
495 | #endif | ||
496 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
497 | &bfin_uart1_device, | ||
498 | #endif | ||
476 | #endif | 499 | #endif |
477 | 500 | ||
478 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 501 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -498,6 +521,24 @@ static int __init pnav_init(void) | |||
498 | 521 | ||
499 | arch_initcall(pnav_init); | 522 | arch_initcall(pnav_init); |
500 | 523 | ||
524 | static struct platform_device *stamp_early_devices[] __initdata = { | ||
525 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
526 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
527 | &bfin_uart0_device, | ||
528 | #endif | ||
529 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
530 | &bfin_uart1_device, | ||
531 | #endif | ||
532 | #endif | ||
533 | }; | ||
534 | |||
535 | void __init native_machine_early_platform_add_devices(void) | ||
536 | { | ||
537 | printk(KERN_INFO "register early platform devices\n"); | ||
538 | early_platform_add_devices(stamp_early_devices, | ||
539 | ARRAY_SIZE(stamp_early_devices)); | ||
540 | } | ||
541 | |||
501 | void bfin_get_ether_addr(char *addr) | 542 | void bfin_get_ether_addr(char *addr) |
502 | { | 543 | { |
503 | random_ether_addr(addr); | 544 | random_ether_addr(addr); |