From 10e85e8d4c6ba6ce6dd37eb695b5802ba79f22ff Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 21 Feb 2019 14:27:29 +0800 Subject: [PATCH] soc: rockchip: grf: postpone 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 11c836069a34..a7f1321706d5 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 = { @@ -122,6 +137,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, }, {