diff options
Diffstat (limited to 'arch/arm/mach-davinci/board-da830-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-da830-evm.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index dc19870b23cd..212d97084bd7 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c | |||
@@ -33,9 +33,6 @@ | |||
33 | #define DA830_EVM_PHY_MASK 0x0 | 33 | #define DA830_EVM_PHY_MASK 0x0 |
34 | #define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ | 34 | #define DA830_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ |
35 | 35 | ||
36 | #define DA830_EMIF25_ASYNC_DATA_CE3_BASE 0x62000000 | ||
37 | #define DA830_EMIF25_CONTROL_BASE 0x68000000 | ||
38 | |||
39 | /* | 36 | /* |
40 | * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4]. | 37 | * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4]. |
41 | */ | 38 | */ |
@@ -157,7 +154,7 @@ static __init void da830_evm_usb_init(void) | |||
157 | __func__, ret); | 154 | __func__, ret); |
158 | } | 155 | } |
159 | 156 | ||
160 | ret = da8xx_pinmux_setup(da830_evm_usb11_pins); | 157 | ret = davinci_cfg_reg_list(da830_evm_usb11_pins); |
161 | if (ret) { | 158 | if (ret) { |
162 | pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", | 159 | pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", |
163 | __func__, ret); | 160 | __func__, ret); |
@@ -229,15 +226,22 @@ static const short da830_evm_mmc_sd_pins[] = { | |||
229 | }; | 226 | }; |
230 | 227 | ||
231 | #define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1) | 228 | #define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1) |
229 | #define DA830_MMCSD_CD_PIN GPIO_TO_PIN(2, 2) | ||
232 | 230 | ||
233 | static int da830_evm_mmc_get_ro(int index) | 231 | static int da830_evm_mmc_get_ro(int index) |
234 | { | 232 | { |
235 | return gpio_get_value(DA830_MMCSD_WP_PIN); | 233 | return gpio_get_value(DA830_MMCSD_WP_PIN); |
236 | } | 234 | } |
237 | 235 | ||
236 | static int da830_evm_mmc_get_cd(int index) | ||
237 | { | ||
238 | return !gpio_get_value(DA830_MMCSD_CD_PIN); | ||
239 | } | ||
240 | |||
238 | static struct davinci_mmc_config da830_evm_mmc_config = { | 241 | static struct davinci_mmc_config da830_evm_mmc_config = { |
239 | .get_ro = da830_evm_mmc_get_ro, | 242 | .get_ro = da830_evm_mmc_get_ro, |
240 | .wires = 4, | 243 | .get_cd = da830_evm_mmc_get_cd, |
244 | .wires = 8, | ||
241 | .max_freq = 50000000, | 245 | .max_freq = 50000000, |
242 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | 246 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, |
243 | .version = MMC_CTLR_VERSION_2, | 247 | .version = MMC_CTLR_VERSION_2, |
@@ -247,7 +251,7 @@ static inline void da830_evm_init_mmc(void) | |||
247 | { | 251 | { |
248 | int ret; | 252 | int ret; |
249 | 253 | ||
250 | ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins); | 254 | ret = davinci_cfg_reg_list(da830_evm_mmc_sd_pins); |
251 | if (ret) { | 255 | if (ret) { |
252 | pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", | 256 | pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", |
253 | ret); | 257 | ret); |
@@ -262,6 +266,14 @@ static inline void da830_evm_init_mmc(void) | |||
262 | } | 266 | } |
263 | gpio_direction_input(DA830_MMCSD_WP_PIN); | 267 | gpio_direction_input(DA830_MMCSD_WP_PIN); |
264 | 268 | ||
269 | ret = gpio_request(DA830_MMCSD_CD_PIN, "MMC CD\n"); | ||
270 | if (ret) { | ||
271 | pr_warning("da830_evm_init: can not open GPIO %d\n", | ||
272 | DA830_MMCSD_CD_PIN); | ||
273 | return; | ||
274 | } | ||
275 | gpio_direction_input(DA830_MMCSD_CD_PIN); | ||
276 | |||
265 | ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); | 277 | ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); |
266 | if (ret) { | 278 | if (ret) { |
267 | pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", | 279 | pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", |
@@ -360,13 +372,13 @@ static struct davinci_nand_pdata da830_evm_nand_pdata = { | |||
360 | 372 | ||
361 | static struct resource da830_evm_nand_resources[] = { | 373 | static struct resource da830_evm_nand_resources[] = { |
362 | [0] = { /* First memory resource is NAND I/O window */ | 374 | [0] = { /* First memory resource is NAND I/O window */ |
363 | .start = DA830_EMIF25_ASYNC_DATA_CE3_BASE, | 375 | .start = DA8XX_AEMIF_CS3_BASE, |
364 | .end = DA830_EMIF25_ASYNC_DATA_CE3_BASE + PAGE_SIZE - 1, | 376 | .end = DA8XX_AEMIF_CS3_BASE + PAGE_SIZE - 1, |
365 | .flags = IORESOURCE_MEM, | 377 | .flags = IORESOURCE_MEM, |
366 | }, | 378 | }, |
367 | [1] = { /* Second memory resource is AEMIF control registers */ | 379 | [1] = { /* Second memory resource is AEMIF control registers */ |
368 | .start = DA830_EMIF25_CONTROL_BASE, | 380 | .start = DA8XX_AEMIF_CTL_BASE, |
369 | .end = DA830_EMIF25_CONTROL_BASE + SZ_32K - 1, | 381 | .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, |
370 | .flags = IORESOURCE_MEM, | 382 | .flags = IORESOURCE_MEM, |
371 | }, | 383 | }, |
372 | }; | 384 | }; |
@@ -392,7 +404,7 @@ static inline void da830_evm_init_nand(int mux_mode) | |||
392 | return; | 404 | return; |
393 | } | 405 | } |
394 | 406 | ||
395 | ret = da8xx_pinmux_setup(da830_evm_emif25_pins); | 407 | ret = davinci_cfg_reg_list(da830_evm_emif25_pins); |
396 | if (ret) | 408 | if (ret) |
397 | pr_warning("da830_evm_init: emif25 mux setup failed: %d\n", | 409 | pr_warning("da830_evm_init: emif25 mux setup failed: %d\n", |
398 | ret); | 410 | ret); |
@@ -412,7 +424,7 @@ static inline void da830_evm_init_lcdc(int mux_mode) | |||
412 | { | 424 | { |
413 | int ret; | 425 | int ret; |
414 | 426 | ||
415 | ret = da8xx_pinmux_setup(da830_lcdcntl_pins); | 427 | ret = davinci_cfg_reg_list(da830_lcdcntl_pins); |
416 | if (ret) | 428 | if (ret) |
417 | pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", | 429 | pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", |
418 | ret); | 430 | ret); |
@@ -492,7 +504,7 @@ static __init void da830_evm_init(void) | |||
492 | pr_warning("da830_evm_init: edma registration failed: %d\n", | 504 | pr_warning("da830_evm_init: edma registration failed: %d\n", |
493 | ret); | 505 | ret); |
494 | 506 | ||
495 | ret = da8xx_pinmux_setup(da830_i2c0_pins); | 507 | ret = davinci_cfg_reg_list(da830_i2c0_pins); |
496 | if (ret) | 508 | if (ret) |
497 | pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n", | 509 | pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n", |
498 | ret); | 510 | ret); |
@@ -508,7 +520,7 @@ static __init void da830_evm_init(void) | |||
508 | soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY; | 520 | soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY; |
509 | soc_info->emac_pdata->rmii_en = 1; | 521 | soc_info->emac_pdata->rmii_en = 1; |
510 | 522 | ||
511 | ret = da8xx_pinmux_setup(da830_cpgmac_pins); | 523 | ret = davinci_cfg_reg_list(da830_cpgmac_pins); |
512 | if (ret) | 524 | if (ret) |
513 | pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n", | 525 | pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n", |
514 | ret); | 526 | ret); |
@@ -527,7 +539,7 @@ static __init void da830_evm_init(void) | |||
527 | i2c_register_board_info(1, da830_evm_i2c_devices, | 539 | i2c_register_board_info(1, da830_evm_i2c_devices, |
528 | ARRAY_SIZE(da830_evm_i2c_devices)); | 540 | ARRAY_SIZE(da830_evm_i2c_devices)); |
529 | 541 | ||
530 | ret = da8xx_pinmux_setup(da830_evm_mcasp1_pins); | 542 | ret = davinci_cfg_reg_list(da830_evm_mcasp1_pins); |
531 | if (ret) | 543 | if (ret) |
532 | pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", | 544 | pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", |
533 | ret); | 545 | ret); |
@@ -549,14 +561,6 @@ static int __init da830_evm_console_init(void) | |||
549 | console_initcall(da830_evm_console_init); | 561 | console_initcall(da830_evm_console_init); |
550 | #endif | 562 | #endif |
551 | 563 | ||
552 | static __init void da830_evm_irq_init(void) | ||
553 | { | ||
554 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
555 | |||
556 | cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA830_N_CP_INTC_IRQ, | ||
557 | soc_info->intc_irq_prios); | ||
558 | } | ||
559 | |||
560 | static void __init da830_evm_map_io(void) | 564 | static void __init da830_evm_map_io(void) |
561 | { | 565 | { |
562 | da830_init(); | 566 | da830_init(); |
@@ -567,7 +571,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137 EVM") | |||
567 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, | 571 | .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc, |
568 | .boot_params = (DA8XX_DDR_BASE + 0x100), | 572 | .boot_params = (DA8XX_DDR_BASE + 0x100), |
569 | .map_io = da830_evm_map_io, | 573 | .map_io = da830_evm_map_io, |
570 | .init_irq = da830_evm_irq_init, | 574 | .init_irq = cp_intc_init, |
571 | .timer = &davinci_timer, | 575 | .timer = &davinci_timer, |
572 | .init_machine = da830_evm_init, | 576 | .init_machine = da830_evm_init, |
573 | MACHINE_END | 577 | MACHINE_END |