aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-02-08 13:38:27 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-03-18 08:27:02 -0400
commitf017d0119f59d442506cf884c7a43a9d12799a4e (patch)
treee2407674cb17db6e83e7551c8bd9b5c7ff43c639
parent275cc1d4fcef076bb8f2ef01cf1540cd62b35eb9 (diff)
ARM: shmobile: SDHI and MMCIF interfaces to kzm9g-reference
Add SDHI0 and SDHI2 interfaces to kzm9g-reference. With no pinctrl DT support we cannot use GPIO card-detection and regulator switching. Also update the MMCIF DT node to use all 8 data lines and avoid redundant information in DT. Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> [ horms+renesas@verge.net.au: Updated for pinmux changes by Laurent Pinchart ] Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/boot/dts/sh73a0-kzm9g-reference.dts42
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g-reference.c36
2 files changed, 75 insertions, 3 deletions
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
index 06f52f98f90d..7fad4b9b2f43 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g-reference.dts
@@ -27,15 +27,51 @@
27 reg = <0x41000000 0x1e800000>; 27 reg = <0x41000000 0x1e800000>;
28 }; 28 };
29 29
30 fixedregulator1v8: fixedregulator@0 { 30 reg_1p8v: regulator@0 {
31 compatible = "regulator-fixed"; 31 compatible = "regulator-fixed";
32 regulator-name = "fixed-1.8V"; 32 regulator-name = "fixed-1.8V";
33 regulator-min-microvolt = <1800000>; 33 regulator-min-microvolt = <1800000>;
34 regulator-max-microvolt = <1800000>; 34 regulator-max-microvolt = <1800000>;
35 regulator-always-on;
36 regulator-boot-on;
37 };
38
39 reg_2p8v: regulator@1 {
40 compatible = "regulator-fixed";
41 regulator-name = "fixed-2.8V";
42 regulator-min-microvolt = <2800000>;
43 regulator-max-microvolt = <2800000>;
44 regulator-always-on;
45 regulator-boot-on;
46 };
47
48 sdhi0: sdhi@0xee100000 {
49 compatible = "renesas,shmobile-sdhi";
50 reg = <0xee100000 0x100>;
51 interrupt-parent = <&gic>;
52 interrupts = <0 83 4
53 0 84 4
54 0 85 4>;
55 vmmc-supply = <&reg_2p8v>;
56 bus-width = <4>;
57 toshiba,mmc-has-idle-wait;
58 };
59
60 sdhi2: sdhi@0xee140000 {
61 compatible = "renesas,shmobile-sdhi";
62 reg = <0xee140000 0x100>;
63 interrupt-parent = <&gic>;
64 interrupts = <0 104 4
65 0 105 4>;
66 vmmc-supply = <&reg_2p8v>;
67 bus-width = <4>;
68 broken-cd;
69 toshiba,mmc-wrprotect-disable;
70 toshiba,mmc-has-idle-wait;
35 }; 71 };
36}; 72};
37 73
38&mmcif { 74&mmcif {
39 vmmc-supply = <&fixedregulator1v8>; 75 bus-width = <8>;
40 vqmmc-supply = <&fixedregulator1v8>; 76 vmmc-supply = <&reg_1p8v>;
41}; 77};
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c
index add537c51b45..3056698d8bc8 100644
--- a/arch/arm/mach-shmobile/board-kzm9g-reference.c
+++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c
@@ -28,19 +28,48 @@
28#include <linux/input.h> 28#include <linux/input.h>
29#include <linux/of_platform.h> 29#include <linux/of_platform.h>
30#include <linux/pinctrl/machine.h> 30#include <linux/pinctrl/machine.h>
31#include <linux/pinctrl/pinconf-generic.h>
31#include <mach/sh73a0.h> 32#include <mach/sh73a0.h>
32#include <mach/common.h> 33#include <mach/common.h>
33#include <asm/hardware/cache-l2x0.h> 34#include <asm/hardware/cache-l2x0.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
36 37
38static unsigned long pin_pullup_conf[] = {
39 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
40};
41
37static const struct pinctrl_map kzm_pinctrl_map[] = { 42static const struct pinctrl_map kzm_pinctrl_map[] = {
38 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0", 43 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
39 "i2c3_1", "i2c3"), 44 "i2c3_1", "i2c3"),
45 /* MMCIF */
46 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
47 "mmc0_data8_0", "mmc0"),
48 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
49 "mmc0_ctrl_0", "mmc0"),
50 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
51 "PORT279", pin_pullup_conf),
52 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
53 "mmc0_data8_0", pin_pullup_conf),
54 /* SCIFA4 */
40 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0", 55 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
41 "scifa4_data", "scifa4"), 56 "scifa4_data", "scifa4"),
42 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0", 57 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
43 "scifa4_ctrl", "scifa4"), 58 "scifa4_ctrl", "scifa4"),
59 /* SDHI0 */
60 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
61 "sdhi0_data4", "sdhi0"),
62 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
63 "sdhi0_ctrl", "sdhi0"),
64 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
65 "sdhi0_cd", "sdhi0"),
66 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
67 "sdhi0_wp", "sdhi0"),
68 /* SDHI2 */
69 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
70 "sdhi2_data4", "sdhi2"),
71 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
72 "sdhi2_ctrl", "sdhi2"),
44}; 73};
45 74
46static void __init kzm_init(void) 75static void __init kzm_init(void)
@@ -49,6 +78,13 @@ static void __init kzm_init(void)
49 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map)); 78 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
50 sh73a0_pinmux_init(); 79 sh73a0_pinmux_init();
51 80
81 /* enable SD */
82 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
83 gpio_request_one(GPIO_PORT15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
84
85 gpio_request(GPIO_FN_SDHICLK2, NULL);
86 gpio_request_one(GPIO_PORT14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
87
52#ifdef CONFIG_CACHE_L2X0 88#ifdef CONFIG_CACHE_L2X0
53 /* Early BRESP enable, Shared attribute override enable, 64K*8way */ 89 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
54 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); 90 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);