ARM: tegra11x: Define ncpu residency for 2 clusters
[linux-3.10.git] / arch / arm / mach-shmobile / board-kota2.c
index b6f0515..ef5ca0e 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/pinctrl/machine.h>
+#include <linux/pinctrl/pinconf-generic.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -433,6 +435,85 @@ static struct platform_device *kota2_devices[] __initdata = {
        &sdhi1_device,
 };
 
+static unsigned long pin_pullup_conf[] = {
+       PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
+};
+
+static const struct pinctrl_map kota2_pinctrl_map[] = {
+       /* KEYSC */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_in8", "keysc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_out04", "keysc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_out5", "keysc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_out6_0", "keysc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_out7_0", "keysc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                 "keysc_out8_0", "keysc"),
+       PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
+                                     "keysc_in8", pin_pullup_conf),
+       /* MMCIF */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+                                 "mmc0_data8_0", "mmc0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+                                 "mmc0_ctrl_0", "mmc0"),
+       PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+                                   "PORT279", pin_pullup_conf),
+       PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
+                                     "mmc0_data8_0", pin_pullup_conf),
+       /* SCIFA2 (UART2) */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
+                                 "scifa2_data_0", "scifa2"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
+                                 "scifa2_ctrl_0", "scifa2"),
+       /* SCIFA4 (UART1) */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+                                 "scifa4_data", "scifa4"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
+                                 "scifa4_ctrl", "scifa4"),
+       /* SCIFB (BT) */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
+                                 "scifb_data_0", "scifb"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
+                                 "scifb_clk_0", "scifb"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
+                                 "scifb_ctrl_0", "scifb"),
+       /* SDHI0 (microSD) */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                 "sdhi0_data4", "sdhi0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                 "sdhi0_ctrl", "sdhi0"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                 "sdhi0_cd", "sdhi0"),
+       PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                     "sdhi0_data4", pin_pullup_conf),
+       PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                   "PORT256", pin_pullup_conf),
+       PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
+                                   "PORT251", pin_pullup_conf),
+       /* SDHI1 (BCM4330) */
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
+                                 "sdhi1_data4", "sdhi1"),
+       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
+                                 "sdhi1_ctrl", "sdhi1"),
+       PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
+                                     "sdhi1_data4", pin_pullup_conf),
+       PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
+                                   "PORT263", pin_pullup_conf),
+       /* SMSC911X */
+       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
+                                 "bsc_data_0_7", "bsc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
+                                 "bsc_data_8_15", "bsc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
+                                 "bsc_cs5_a", "bsc"),
+       PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
+                                 "bsc_we0", "bsc"),
+};
+
 static void __init kota2_init(void)
 {
        regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
@@ -441,98 +522,17 @@ static void __init kota2_init(void)
                                     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
        regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
 
+       pinctrl_register_mappings(kota2_pinctrl_map,
+                                 ARRAY_SIZE(kota2_pinctrl_map));
        sh73a0_pinmux_init();
 
-       /* SCIFA2 (UART2) */
-       gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
-       gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
-       gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
-       gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
-
-       /* SCIFA4 (UART1) */
-       gpio_request(GPIO_FN_SCIFA4_TXD, NULL);
-       gpio_request(GPIO_FN_SCIFA4_RXD, NULL);
-       gpio_request(GPIO_FN_SCIFA4_RTS_, NULL);
-       gpio_request(GPIO_FN_SCIFA4_CTS_, NULL);
-
        /* SMSC911X */
-       gpio_request(GPIO_FN_D0_NAF0, NULL);
-       gpio_request(GPIO_FN_D1_NAF1, NULL);
-       gpio_request(GPIO_FN_D2_NAF2, NULL);
-       gpio_request(GPIO_FN_D3_NAF3, NULL);
-       gpio_request(GPIO_FN_D4_NAF4, NULL);
-       gpio_request(GPIO_FN_D5_NAF5, NULL);
-       gpio_request(GPIO_FN_D6_NAF6, NULL);
-       gpio_request(GPIO_FN_D7_NAF7, NULL);
-       gpio_request(GPIO_FN_D8_NAF8, NULL);
-       gpio_request(GPIO_FN_D9_NAF9, NULL);
-       gpio_request(GPIO_FN_D10_NAF10, NULL);
-       gpio_request(GPIO_FN_D11_NAF11, NULL);
-       gpio_request(GPIO_FN_D12_NAF12, NULL);
-       gpio_request(GPIO_FN_D13_NAF13, NULL);
-       gpio_request(GPIO_FN_D14_NAF14, NULL);
-       gpio_request(GPIO_FN_D15_NAF15, NULL);
-       gpio_request(GPIO_FN_CS5A_, NULL);
-       gpio_request(GPIO_FN_WE0__FWE, NULL);
        gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
        gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
 
-       /* KEYSC */
-       gpio_request(GPIO_FN_KEYIN0_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN1_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN2_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN3_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN4_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN5_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN6_PU, NULL);
-       gpio_request(GPIO_FN_KEYIN7_PU, NULL);
-       gpio_request(GPIO_FN_KEYOUT0, NULL);
-       gpio_request(GPIO_FN_KEYOUT1, NULL);
-       gpio_request(GPIO_FN_KEYOUT2, NULL);
-       gpio_request(GPIO_FN_KEYOUT3, NULL);
-       gpio_request(GPIO_FN_KEYOUT4, NULL);
-       gpio_request(GPIO_FN_KEYOUT5, NULL);
-       gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
-       gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
-       gpio_request(GPIO_FN_KEYOUT8, NULL);
-
        /* MMCIF */
-       gpio_request(GPIO_FN_MMCCLK0, NULL);
-       gpio_request(GPIO_FN_MMCD0_0, NULL);
-       gpio_request(GPIO_FN_MMCD0_1, NULL);
-       gpio_request(GPIO_FN_MMCD0_2, NULL);
-       gpio_request(GPIO_FN_MMCD0_3, NULL);
-       gpio_request(GPIO_FN_MMCD0_4, NULL);
-       gpio_request(GPIO_FN_MMCD0_5, NULL);
-       gpio_request(GPIO_FN_MMCD0_6, NULL);
-       gpio_request(GPIO_FN_MMCD0_7, NULL);
-       gpio_request(GPIO_FN_MMCCMD0, NULL);
        gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
 
-       /* SDHI0 (microSD) */
-       gpio_request(GPIO_FN_SDHICD0_PU, NULL);
-       gpio_request(GPIO_FN_SDHICMD0_PU, NULL);
-       gpio_request(GPIO_FN_SDHICLK0, NULL);
-       gpio_request(GPIO_FN_SDHID0_3_PU, NULL);
-       gpio_request(GPIO_FN_SDHID0_2_PU, NULL);
-       gpio_request(GPIO_FN_SDHID0_1_PU, NULL);
-       gpio_request(GPIO_FN_SDHID0_0_PU, NULL);
-
-       /* SCIFB (BT) */
-       gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL);
-       gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL);
-       gpio_request(GPIO_FN_PORT161_SCIFB_CTS_, NULL);
-       gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL);
-       gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL);
-
-       /* SDHI1 (BCM4330) */
-       gpio_request(GPIO_FN_SDHICLK1, NULL);
-       gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
-       gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
-       gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
-       gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
-       gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
-
 #ifdef CONFIG_CACHE_L2X0
        /* Early BRESP enable, Shared attribute override enable, 64K*8way */
        l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);