diff options
author | Peter De-Schrijver <pdeschrijver@nvidia.com> | 2018-07-12 07:53:02 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-07-25 17:26:22 -0400 |
commit | c76a69e477b88f259bcc118129874011abcaae86 (patch) | |
tree | 4b4afa912eb95044ea1c799ac4d10c455c0512b4 | |
parent | 633e79650b4f0ed8cd26076a376b5372c413b0f8 (diff) |
clk: tegra: make sdmmc2 and sdmmc4 as sdmmc clocks
These clocks have low jitter paths to certain parents. To model these
correctly, use the sdmmc mux divider clock type.
Signed-off-by: Peter De-Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Aapo Vienamo <avienamo@nvidia.com>
Acked-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r-- | drivers/clk/tegra/clk-id.h | 2 | ||||
-rw-r--r-- | drivers/clk/tegra/clk-tegra-periph.c | 11 | ||||
-rw-r--r-- | drivers/clk/tegra/clk-tegra210.c | 14 |
3 files changed, 12 insertions, 15 deletions
diff --git a/drivers/clk/tegra/clk-id.h b/drivers/clk/tegra/clk-id.h index b616e33c5255..de466b4446da 100644 --- a/drivers/clk/tegra/clk-id.h +++ b/drivers/clk/tegra/clk-id.h | |||
@@ -227,13 +227,11 @@ enum clk_id { | |||
227 | tegra_clk_sdmmc1_9, | 227 | tegra_clk_sdmmc1_9, |
228 | tegra_clk_sdmmc2, | 228 | tegra_clk_sdmmc2, |
229 | tegra_clk_sdmmc2_8, | 229 | tegra_clk_sdmmc2_8, |
230 | tegra_clk_sdmmc2_9, | ||
231 | tegra_clk_sdmmc3, | 230 | tegra_clk_sdmmc3, |
232 | tegra_clk_sdmmc3_8, | 231 | tegra_clk_sdmmc3_8, |
233 | tegra_clk_sdmmc3_9, | 232 | tegra_clk_sdmmc3_9, |
234 | tegra_clk_sdmmc4, | 233 | tegra_clk_sdmmc4, |
235 | tegra_clk_sdmmc4_8, | 234 | tegra_clk_sdmmc4_8, |
236 | tegra_clk_sdmmc4_9, | ||
237 | tegra_clk_se, | 235 | tegra_clk_se, |
238 | tegra_clk_soc_therm, | 236 | tegra_clk_soc_therm, |
239 | tegra_clk_soc_therm_8, | 237 | tegra_clk_soc_therm_8, |
diff --git a/drivers/clk/tegra/clk-tegra-periph.c b/drivers/clk/tegra/clk-tegra-periph.c index 2acba2986bc6..38c4eb28c8bf 100644 --- a/drivers/clk/tegra/clk-tegra-periph.c +++ b/drivers/clk/tegra/clk-tegra-periph.c | |||
@@ -451,15 +451,6 @@ static u32 mux_pllp_pllc4_out2_pllc4_out1_clkm_pllc4_out0_idx[] = { | |||
451 | [0] = 0, [1] = 3, [2] = 4, [3] = 6, [4] = 7, | 451 | [0] = 0, [1] = 3, [2] = 4, [3] = 6, [4] = 7, |
452 | }; | 452 | }; |
453 | 453 | ||
454 | static const char *mux_pllp_clkm_pllc4_out2_out1_out0_lj[] = { | ||
455 | "pll_p", | ||
456 | "pll_c4_out2", "pll_c4_out0", /* LJ input */ | ||
457 | "pll_c4_out2", "pll_c4_out1", | ||
458 | "pll_c4_out1", /* LJ input */ | ||
459 | "clk_m", "pll_c4_out0" | ||
460 | }; | ||
461 | #define mux_pllp_clkm_pllc4_out2_out1_out0_lj_idx NULL | ||
462 | |||
463 | static const char *mux_pllp_pllc2_c_c3_clkm[] = { | 454 | static const char *mux_pllp_pllc2_c_c3_clkm[] = { |
464 | "pll_p", "pll_c2", "pll_c", "pll_c3", "clk_m" | 455 | "pll_p", "pll_c2", "pll_c", "pll_c3", "clk_m" |
465 | }; | 456 | }; |
@@ -686,9 +677,7 @@ static struct tegra_periph_init_data periph_clks[] = { | |||
686 | MUX("sdmmc3", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC3, 69, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc3), | 677 | MUX("sdmmc3", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC3, 69, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc3), |
687 | MUX("sdmmc4", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC4, 15, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc4), | 678 | MUX("sdmmc4", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC4, 15, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc4), |
688 | MUX8("sdmmc1", mux_pllp_pllc4_out2_pllc4_out1_clkm_pllc4_out0, CLK_SOURCE_SDMMC1, 14, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc1_9), | 679 | MUX8("sdmmc1", mux_pllp_pllc4_out2_pllc4_out1_clkm_pllc4_out0, CLK_SOURCE_SDMMC1, 14, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc1_9), |
689 | MUX8("sdmmc2", mux_pllp_clkm_pllc4_out2_out1_out0_lj, CLK_SOURCE_SDMMC2, 9, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc2_9), | ||
690 | MUX8("sdmmc3", mux_pllp_pllc4_out2_pllc4_out1_clkm_pllc4_out0, CLK_SOURCE_SDMMC3, 69, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc3_9), | 680 | MUX8("sdmmc3", mux_pllp_pllc4_out2_pllc4_out1_clkm_pllc4_out0, CLK_SOURCE_SDMMC3, 69, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc3_9), |
691 | MUX8("sdmmc4", mux_pllp_clkm_pllc4_out2_out1_out0_lj, CLK_SOURCE_SDMMC4, 15, TEGRA_PERIPH_ON_APB, tegra_clk_sdmmc4_9), | ||
692 | MUX("la", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_LA, 76, TEGRA_PERIPH_ON_APB, tegra_clk_la), | 681 | MUX("la", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_LA, 76, TEGRA_PERIPH_ON_APB, tegra_clk_la), |
693 | MUX("trace", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_TRACE, 77, TEGRA_PERIPH_ON_APB, tegra_clk_trace), | 682 | MUX("trace", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_TRACE, 77, TEGRA_PERIPH_ON_APB, tegra_clk_trace), |
694 | MUX("owr", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_OWR, 71, TEGRA_PERIPH_ON_APB, tegra_clk_owr), | 683 | MUX("owr", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_OWR, 71, TEGRA_PERIPH_ON_APB, tegra_clk_owr), |
diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index 5435d01c636a..9eb1cb14fce1 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #define CLK_SOURCE_EMC 0x19c | 44 | #define CLK_SOURCE_EMC 0x19c |
45 | #define CLK_SOURCE_SOR1 0x410 | 45 | #define CLK_SOURCE_SOR1 0x410 |
46 | #define CLK_SOURCE_LA 0x1f8 | 46 | #define CLK_SOURCE_LA 0x1f8 |
47 | #define CLK_SOURCE_SDMMC2 0x154 | ||
48 | #define CLK_SOURCE_SDMMC4 0x164 | ||
47 | 49 | ||
48 | #define PLLC_BASE 0x80 | 50 | #define PLLC_BASE 0x80 |
49 | #define PLLC_OUT 0x84 | 51 | #define PLLC_OUT 0x84 |
@@ -2286,11 +2288,9 @@ static struct tegra_clk tegra210_clks[tegra_clk_max] __initdata = { | |||
2286 | [tegra_clk_rtc] = { .dt_id = TEGRA210_CLK_RTC, .present = true }, | 2288 | [tegra_clk_rtc] = { .dt_id = TEGRA210_CLK_RTC, .present = true }, |
2287 | [tegra_clk_timer] = { .dt_id = TEGRA210_CLK_TIMER, .present = true }, | 2289 | [tegra_clk_timer] = { .dt_id = TEGRA210_CLK_TIMER, .present = true }, |
2288 | [tegra_clk_uarta_8] = { .dt_id = TEGRA210_CLK_UARTA, .present = true }, | 2290 | [tegra_clk_uarta_8] = { .dt_id = TEGRA210_CLK_UARTA, .present = true }, |
2289 | [tegra_clk_sdmmc2_9] = { .dt_id = TEGRA210_CLK_SDMMC2, .present = true }, | ||
2290 | [tegra_clk_i2s1] = { .dt_id = TEGRA210_CLK_I2S1, .present = true }, | 2291 | [tegra_clk_i2s1] = { .dt_id = TEGRA210_CLK_I2S1, .present = true }, |
2291 | [tegra_clk_i2c1] = { .dt_id = TEGRA210_CLK_I2C1, .present = true }, | 2292 | [tegra_clk_i2c1] = { .dt_id = TEGRA210_CLK_I2C1, .present = true }, |
2292 | [tegra_clk_sdmmc1_9] = { .dt_id = TEGRA210_CLK_SDMMC1, .present = true }, | 2293 | [tegra_clk_sdmmc1_9] = { .dt_id = TEGRA210_CLK_SDMMC1, .present = true }, |
2293 | [tegra_clk_sdmmc4_9] = { .dt_id = TEGRA210_CLK_SDMMC4, .present = true }, | ||
2294 | [tegra_clk_pwm] = { .dt_id = TEGRA210_CLK_PWM, .present = true }, | 2294 | [tegra_clk_pwm] = { .dt_id = TEGRA210_CLK_PWM, .present = true }, |
2295 | [tegra_clk_i2s2] = { .dt_id = TEGRA210_CLK_I2S2, .present = true }, | 2295 | [tegra_clk_i2s2] = { .dt_id = TEGRA210_CLK_I2S2, .present = true }, |
2296 | [tegra_clk_usbd] = { .dt_id = TEGRA210_CLK_USBD, .present = true }, | 2296 | [tegra_clk_usbd] = { .dt_id = TEGRA210_CLK_USBD, .present = true }, |
@@ -3030,6 +3030,16 @@ static __init void tegra210_periph_clk_init(void __iomem *clk_base, | |||
3030 | 0, NULL); | 3030 | 0, NULL); |
3031 | clks[TEGRA210_CLK_ACLK] = clk; | 3031 | clks[TEGRA210_CLK_ACLK] = clk; |
3032 | 3032 | ||
3033 | clk = tegra_clk_register_sdmmc_mux_div("sdmmc2", clk_base, | ||
3034 | CLK_SOURCE_SDMMC2, 9, | ||
3035 | TEGRA_DIVIDER_ROUND_UP, 0, NULL); | ||
3036 | clks[TEGRA210_CLK_SDMMC2] = clk; | ||
3037 | |||
3038 | clk = tegra_clk_register_sdmmc_mux_div("sdmmc4", clk_base, | ||
3039 | CLK_SOURCE_SDMMC4, 15, | ||
3040 | TEGRA_DIVIDER_ROUND_UP, 0, NULL); | ||
3041 | clks[TEGRA210_CLK_SDMMC4] = clk; | ||
3042 | |||
3033 | for (i = 0; i < ARRAY_SIZE(tegra210_periph); i++) { | 3043 | for (i = 0; i < ARRAY_SIZE(tegra210_periph); i++) { |
3034 | struct tegra_periph_init_data *init = &tegra210_periph[i]; | 3044 | struct tegra_periph_init_data *init = &tegra210_periph[i]; |
3035 | struct clk **clkp; | 3045 | struct clk **clkp; |