diff options
author | Heiko Stübner <heiko@sntech.de> | 2015-01-11 17:09:23 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2015-01-16 22:10:39 -0500 |
commit | c9b75d51c940c25587a2ad72ec7ec60490abfb6c (patch) | |
tree | 7f38d8ac95c2099c541d52a75c4f87dc9dac08bd | |
parent | 1dbb36bc7b9f648c489a5a2f73a5120a4ecab1ed (diff) |
ARM: rockchip: disable jtag/sdmmc autoswitching on rk3288
rk3288 SoCs have a function to automatically switch between jtag/sdmmc pinmux
settings depending on the card state. This collides with a lot of assumptions.
It only works when using the internal card-detect mechanism and breaks
horribly when using either the normal card-detect via the slot-gpio function
or via any other pin. Also there is of course no link between the mmc and jtag
on the software-side, so the jtag clocks may very well be disabled when the
card is ejected and the soc switches back to the jtag pinmux.
Leaving the switching function enabled did result in mmc timeouts and rcu
stalls thus hanging the system on 3.19-rc1. Therefore disable it in all cases,
as we expect the devicetree to explicitly select either mmc or jtag pinmuxes
anyway.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/arm/mach-rockchip/rockchip.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c index d226b71d21d5..a611f4852582 100644 --- a/arch/arm/mach-rockchip/rockchip.c +++ b/arch/arm/mach-rockchip/rockchip.c | |||
@@ -19,11 +19,37 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/of_platform.h> | 20 | #include <linux/of_platform.h> |
21 | #include <linux/irqchip.h> | 21 | #include <linux/irqchip.h> |
22 | #include <linux/clk-provider.h> | ||
23 | #include <linux/clocksource.h> | ||
24 | #include <linux/mfd/syscon.h> | ||
25 | #include <linux/regmap.h> | ||
22 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
24 | #include <asm/hardware/cache-l2x0.h> | 28 | #include <asm/hardware/cache-l2x0.h> |
25 | #include "core.h" | 29 | #include "core.h" |
26 | 30 | ||
31 | #define RK3288_GRF_SOC_CON0 0x244 | ||
32 | |||
33 | static void __init rockchip_timer_init(void) | ||
34 | { | ||
35 | if (of_machine_is_compatible("rockchip,rk3288")) { | ||
36 | struct regmap *grf; | ||
37 | |||
38 | /* | ||
39 | * Disable auto jtag/sdmmc switching that causes issues | ||
40 | * with the mmc controllers making them unreliable | ||
41 | */ | ||
42 | grf = syscon_regmap_lookup_by_compatible("rockchip,rk3288-grf"); | ||
43 | if (!IS_ERR(grf)) | ||
44 | regmap_write(grf, RK3288_GRF_SOC_CON0, 0x10000000); | ||
45 | else | ||
46 | pr_err("rockchip: could not get grf syscon\n"); | ||
47 | } | ||
48 | |||
49 | of_clk_init(NULL); | ||
50 | clocksource_of_init(); | ||
51 | } | ||
52 | |||
27 | static void __init rockchip_dt_init(void) | 53 | static void __init rockchip_dt_init(void) |
28 | { | 54 | { |
29 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 55 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
@@ -42,6 +68,7 @@ static const char * const rockchip_board_dt_compat[] = { | |||
42 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") | 68 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") |
43 | .l2c_aux_val = 0, | 69 | .l2c_aux_val = 0, |
44 | .l2c_aux_mask = ~0, | 70 | .l2c_aux_mask = ~0, |
71 | .init_time = rockchip_timer_init, | ||
45 | .dt_compat = rockchip_board_dt_compat, | 72 | .dt_compat = rockchip_board_dt_compat, |
46 | .init_machine = rockchip_dt_init, | 73 | .init_machine = rockchip_dt_init, |
47 | MACHINE_END | 74 | MACHINE_END |