aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ag5evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-ag5evm.c')
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c172
1 files changed, 88 insertions, 84 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 8ff53a19c48c..c7540710906f 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -23,6 +23,8 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/pinctrl/machine.h>
27#include <linux/pinctrl/pinconf-generic.h>
26#include <linux/platform_device.h> 28#include <linux/platform_device.h>
27#include <linux/delay.h> 29#include <linux/delay.h>
28#include <linux/io.h> 30#include <linux/io.h>
@@ -304,9 +306,9 @@ static int lcd_backlight_set_brightness(int brightness)
304 306
305 if (brightness == 0) { 307 if (brightness == 0) {
306 /* Reset the chip */ 308 /* Reset the chip */
307 gpio_set_value(GPIO_PORT235, 0); 309 gpio_set_value(235, 0);
308 mdelay(24); 310 mdelay(24);
309 gpio_set_value(GPIO_PORT235, 1); 311 gpio_set_value(235, 1);
310 return 0; 312 return 0;
311 } 313 }
312 314
@@ -406,7 +408,7 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
406 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD, 408 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
407 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 409 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
408 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 410 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
409 .cd_gpio = GPIO_PORT251, 411 .cd_gpio = 251,
410}; 412};
411 413
412static struct resource sdhi0_resources[] = { 414static struct resource sdhi0_resources[] = {
@@ -461,7 +463,7 @@ static struct regulator_init_data cn4_power_init_data = {
461static struct fixed_voltage_config cn4_power_info = { 463static struct fixed_voltage_config cn4_power_info = {
462 .supply_name = "CN4 SD/MMC Vdd", 464 .supply_name = "CN4 SD/MMC Vdd",
463 .microvolts = 3300000, 465 .microvolts = 3300000,
464 .gpio = GPIO_PORT114, 466 .gpio = 114,
465 .enable_high = 1, 467 .enable_high = 1,
466 .init_data = &cn4_power_init_data, 468 .init_data = &cn4_power_init_data,
467}; 469};
@@ -479,10 +481,10 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
479 static int power_gpio = -EINVAL; 481 static int power_gpio = -EINVAL;
480 482
481 if (power_gpio < 0) { 483 if (power_gpio < 0) {
482 int ret = gpio_request_one(GPIO_PORT114, GPIOF_OUT_INIT_LOW, 484 int ret = gpio_request_one(114, GPIOF_OUT_INIT_LOW,
483 "sdhi1_power"); 485 "sdhi1_power");
484 if (!ret) 486 if (!ret)
485 power_gpio = GPIO_PORT114; 487 power_gpio = 114;
486 } 488 }
487 489
488 /* 490 /*
@@ -493,7 +495,7 @@ static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
493 * regulator driver. We have to live with the race in case the driver 495 * regulator driver. We have to live with the race in case the driver
494 * gets unloaded and the GPIO freed between these two steps. 496 * gets unloaded and the GPIO freed between these two steps.
495 */ 497 */
496 gpio_set_value(GPIO_PORT114, state); 498 gpio_set_value(114, state);
497} 499}
498 500
499static struct sh_mobile_sdhi_info sh_sdhi1_info = { 501static struct sh_mobile_sdhi_info sh_sdhi1_info = {
@@ -550,6 +552,77 @@ static struct platform_device *ag5evm_devices[] __initdata = {
550 &sdhi1_device, 552 &sdhi1_device,
551}; 553};
552 554
555static unsigned long pin_pullup_conf[] = {
556 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
557};
558
559static const struct pinctrl_map ag5evm_pinctrl_map[] = {
560 /* FSIA */
561 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
562 "fsia_mclk_in", "fsia"),
563 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
564 "fsia_sclk_in", "fsia"),
565 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
566 "fsia_data_in", "fsia"),
567 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
568 "fsia_data_out", "fsia"),
569 /* I2C2 & I2C3 */
570 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.2", "pfc-sh73a0",
571 "i2c2_0", "i2c2"),
572 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
573 "i2c3_0", "i2c3"),
574 /* IrDA */
575 PIN_MAP_MUX_GROUP_DEFAULT("sh_irda.0", "pfc-sh73a0",
576 "irda_0", "irda"),
577 /* KEYSC */
578 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
579 "keysc_in8", "keysc"),
580 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
581 "keysc_out04", "keysc"),
582 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
583 "keysc_out5", "keysc"),
584 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
585 "keysc_out6_0", "keysc"),
586 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
587 "keysc_out7_0", "keysc"),
588 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
589 "keysc_out8_0", "keysc"),
590 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
591 "keysc_out9_2", "keysc"),
592 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
593 "keysc_in8", pin_pullup_conf),
594 /* MMCIF */
595 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
596 "mmc0_data8_0", "mmc0"),
597 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
598 "mmc0_ctrl_0", "mmc0"),
599 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
600 "PORT279", pin_pullup_conf),
601 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
602 "mmc0_data8_0", pin_pullup_conf),
603 /* SCIFA2 */
604 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
605 "scifa2_data_0", "scifa2"),
606 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
607 "scifa2_ctrl_0", "scifa2"),
608 /* SDHI0 (CN15 [SD I/F]) */
609 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
610 "sdhi0_data4", "sdhi0"),
611 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
612 "sdhi0_ctrl", "sdhi0"),
613 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
614 "sdhi0_wp", "sdhi0"),
615 /* SDHI1 (CN4 [WLAN I/F]) */
616 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
617 "sdhi1_data4", "sdhi1"),
618 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
619 "sdhi1_ctrl", "sdhi1"),
620 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
621 "sdhi1_data4", pin_pullup_conf),
622 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
623 "PORT263", pin_pullup_conf),
624};
625
553static void __init ag5evm_init(void) 626static void __init ag5evm_init(void)
554{ 627{
555 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers, 628 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
@@ -558,96 +631,27 @@ static void __init ag5evm_init(void)
558 ARRAY_SIZE(fixed2v8_power_consumers), 3300000); 631 ARRAY_SIZE(fixed2v8_power_consumers), 3300000);
559 regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 632 regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
560 633
634 pinctrl_register_mappings(ag5evm_pinctrl_map,
635 ARRAY_SIZE(ag5evm_pinctrl_map));
561 sh73a0_pinmux_init(); 636 sh73a0_pinmux_init();
562 637
563 /* enable SCIFA2 */
564 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
565 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
566 gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
567 gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
568
569 /* enable KEYSC */
570 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
571 gpio_request(GPIO_FN_KEYIN1_PU, NULL);
572 gpio_request(GPIO_FN_KEYIN2_PU, NULL);
573 gpio_request(GPIO_FN_KEYIN3_PU, NULL);
574 gpio_request(GPIO_FN_KEYIN4_PU, NULL);
575 gpio_request(GPIO_FN_KEYIN5_PU, NULL);
576 gpio_request(GPIO_FN_KEYIN6_PU, NULL);
577 gpio_request(GPIO_FN_KEYIN7_PU, NULL);
578 gpio_request(GPIO_FN_KEYOUT0, NULL);
579 gpio_request(GPIO_FN_KEYOUT1, NULL);
580 gpio_request(GPIO_FN_KEYOUT2, NULL);
581 gpio_request(GPIO_FN_KEYOUT3, NULL);
582 gpio_request(GPIO_FN_KEYOUT4, NULL);
583 gpio_request(GPIO_FN_KEYOUT5, NULL);
584 gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
585 gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
586 gpio_request(GPIO_FN_KEYOUT8, NULL);
587 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
588
589 /* enable I2C channel 2 and 3 */
590 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
591 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
592 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
593 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
594
595 /* enable MMCIF */ 638 /* enable MMCIF */
596 gpio_request(GPIO_FN_MMCCLK0, NULL); 639 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
597 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
598 gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
599 gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
600 gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
601 gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
602 gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
603 gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
604 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
605 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
606 gpio_request_one(GPIO_PORT208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
607 640
608 /* enable SMSC911X */ 641 /* enable SMSC911X */
609 gpio_request_one(GPIO_PORT144, GPIOF_IN, NULL); /* PINTA2 */ 642 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
610 gpio_request_one(GPIO_PORT145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */ 643 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
611
612 /* FSI A */
613 gpio_request(GPIO_FN_FSIACK, NULL);
614 gpio_request(GPIO_FN_FSIAILR, NULL);
615 gpio_request(GPIO_FN_FSIAIBT, NULL);
616 gpio_request(GPIO_FN_FSIAISLD, NULL);
617 gpio_request(GPIO_FN_FSIAOSLD, NULL);
618
619 /* IrDA */
620 gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
621 gpio_request(GPIO_FN_PORT242_IRDA_IN, NULL);
622 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
623 644
624 /* LCD panel */ 645 /* LCD panel */
625 gpio_request_one(GPIO_PORT217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ 646 gpio_request_one(217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
626 mdelay(1); 647 mdelay(1);
627 gpio_set_value(GPIO_PORT217, 1); 648 gpio_set_value(217, 1);
628 mdelay(100); 649 mdelay(100);
629 650
630 /* LCD backlight controller */ 651 /* LCD backlight controller */
631 gpio_request_one(GPIO_PORT235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */ 652 gpio_request_one(235, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
632 lcd_backlight_set_brightness(0); 653 lcd_backlight_set_brightness(0);
633 654
634 /* enable SDHI0 on CN15 [SD I/F] */
635 gpio_request(GPIO_FN_SDHIWP0, NULL);
636 gpio_request(GPIO_FN_SDHICMD0, NULL);
637 gpio_request(GPIO_FN_SDHICLK0, NULL);
638 gpio_request(GPIO_FN_SDHID0_3, NULL);
639 gpio_request(GPIO_FN_SDHID0_2, NULL);
640 gpio_request(GPIO_FN_SDHID0_1, NULL);
641 gpio_request(GPIO_FN_SDHID0_0, NULL);
642
643 /* enable SDHI1 on CN4 [WLAN I/F] */
644 gpio_request(GPIO_FN_SDHICLK1, NULL);
645 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
646 gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
647 gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
648 gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
649 gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
650
651#ifdef CONFIG_CACHE_L2X0 655#ifdef CONFIG_CACHE_L2X0
652 /* Shared attribute override enable, 64K*8way */ 656 /* Shared attribute override enable, 64K*8way */
653 l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff); 657 l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);