From 436cb774c71d815ce1ada2d44b0a1956c430fa5b 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 028f6538052f..c19a3a79969e 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -25,6 +25,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 = { @@ -121,6 +136,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, }, {