From ef6433360d84e9a71f7a19f528849db3a7dfeb39 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Mon, 26 Feb 2018 08:56:58 +0800 Subject: [PATCH] soc: rockchip: grf: disable jtag switching for PX30 Soc PX30_GRF_SOC_CON5 is intended for postponing the auto switch of pinmux from SDMMC to JTAG after removing the SD cards. However, the default value is too small to meet the actual requirement. Increase this value to 5 seconds currently. Change-Id: I18fafe07822b81d9cd448ab71c1f0e49a75db357 Signed-off-by: Shawn Lin --- drivers/soc/rockchip/grf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 96882ffde67e..1e0c1265cdc5 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -28,6 +28,21 @@ struct rockchip_grf_info { int num_values; }; +#define PX30_GRF_SOC_CON5 0x414 + +static const struct rockchip_grf_value px30_defaults[] __initconst = { + /* + * Postponing auto jtag/sdmmc switching by 5 seconds. + * The counter value is calculated based on 24MHz clock. + */ + { "jtag switching delay", PX30_GRF_SOC_CON5, 0x7270E00}, +}; + +static const struct rockchip_grf_info px30_grf __initconst = { + .values = px30_defaults, + .num_values = ARRAY_SIZE(px30_defaults), +}; + #define RK3036_GRF_SOC_CON0 0x140 static const struct rockchip_grf_value rk3036_defaults[] __initconst = { @@ -111,6 +126,9 @@ static const struct rockchip_grf_info rk3399_grf __initconst = { static const struct of_device_id rockchip_grf_dt_match[] __initconst = { { + .compatible = "rockchip,px30-grf", + .data = (void *)&px30_grf, + }, { .compatible = "rockchip,rk3036-grf", .data = (void *)&rk3036_grf, }, {