Skip to content

Commit 1d3e3c4

Browse files
joseph-lo-nvtwthierryreding
authored andcommitted
clk: tegra: Remove the old emc_mux clock for Tegra210
Remove the old emc_mux clock and don't use the common EMC clock definition. This will be replaced by a new clock defined in the EMC driver. Signed-off-by: Joseph Lo <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 0ac65fc commit 1d3e3c4

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

drivers/clk/tegra/clk-tegra210.c

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,6 @@ static unsigned long tegra210_input_freq[] = {
319319
[8] = 12000000,
320320
};
321321

322-
static const char *mux_pllmcp_clkm[] = {
323-
"pll_m", "pll_c", "pll_p", "clk_m", "pll_m_ud", "pll_mb", "pll_mb",
324-
"pll_p",
325-
};
326-
#define mux_pllmcp_clkm_idx NULL
327-
328322
#define PLL_ENABLE (1 << 30)
329323

330324
#define PLLCX_MISC1_IDDQ (1 << 27)
@@ -2336,7 +2330,6 @@ static struct tegra_clk tegra210_clks[tegra_clk_max] __initdata = {
23362330
[tegra_clk_i2c2] = { .dt_id = TEGRA210_CLK_I2C2, .present = true },
23372331
[tegra_clk_uartc_8] = { .dt_id = TEGRA210_CLK_UARTC, .present = true },
23382332
[tegra_clk_mipi_cal] = { .dt_id = TEGRA210_CLK_MIPI_CAL, .present = true },
2339-
[tegra_clk_emc] = { .dt_id = TEGRA210_CLK_EMC, .present = true },
23402333
[tegra_clk_usb2] = { .dt_id = TEGRA210_CLK_USB2, .present = true },
23412334
[tegra_clk_bsev] = { .dt_id = TEGRA210_CLK_BSEV, .present = true },
23422335
[tegra_clk_uartd_8] = { .dt_id = TEGRA210_CLK_UARTD, .present = true },
@@ -2979,6 +2972,27 @@ static const char * const sor1_parents[] = {
29792972

29802973
static u32 sor1_parents_idx[] = { 0, 2, 5, 6 };
29812974

2975+
static const struct clk_div_table mc_div_table_tegra210[] = {
2976+
{ .val = 0, .div = 2 },
2977+
{ .val = 1, .div = 4 },
2978+
{ .val = 2, .div = 1 },
2979+
{ .val = 3, .div = 2 },
2980+
{ .val = 0, .div = 0 },
2981+
};
2982+
2983+
static void tegra210_clk_register_mc(const char *name,
2984+
const char *parent_name)
2985+
{
2986+
struct clk *clk;
2987+
2988+
clk = clk_register_divider_table(NULL, name, parent_name,
2989+
CLK_IS_CRITICAL,
2990+
clk_base + CLK_SOURCE_EMC,
2991+
15, 2, CLK_DIVIDER_READ_ONLY,
2992+
mc_div_table_tegra210, &emc_lock);
2993+
clks[TEGRA210_CLK_MC] = clk;
2994+
}
2995+
29822996
static const char * const sor1_out_parents[] = {
29832997
/*
29842998
* Bit 0 of the mux selects sor1_pad_clkout, irrespective of bit 1, so
@@ -3021,7 +3035,8 @@ static const char * const la_parents[] = {
30213035
static struct tegra_clk_periph tegra210_la =
30223036
TEGRA_CLK_PERIPH(29, 7, 9, 0, 8, 1, TEGRA_DIVIDER_ROUND_UP, 76, 0, NULL, NULL);
30233037

3024-
static __init void tegra210_periph_clk_init(void __iomem *clk_base,
3038+
static __init void tegra210_periph_clk_init(struct device_node *np,
3039+
void __iomem *clk_base,
30253040
void __iomem *pmc_base)
30263041
{
30273042
struct clk *clk;
@@ -3067,16 +3082,6 @@ static __init void tegra210_periph_clk_init(void __iomem *clk_base,
30673082
CLK_SOURCE_LA, 0);
30683083
clks[TEGRA210_CLK_LA] = clk;
30693084

3070-
/* emc mux */
3071-
clk = clk_register_mux(NULL, "emc_mux", mux_pllmcp_clkm,
3072-
ARRAY_SIZE(mux_pllmcp_clkm), 0,
3073-
clk_base + CLK_SOURCE_EMC,
3074-
29, 3, 0, &emc_lock);
3075-
3076-
clk = tegra_clk_register_mc("mc", "emc_mux", clk_base + CLK_SOURCE_EMC,
3077-
&emc_lock);
3078-
clks[TEGRA210_CLK_MC] = clk;
3079-
30803085
/* cml0 */
30813086
clk = clk_register_gate(NULL, "cml0", "pll_e", 0, clk_base + PLLE_AUX,
30823087
0, 0, &pll_e_lock);
@@ -3119,6 +3124,13 @@ static __init void tegra210_periph_clk_init(void __iomem *clk_base,
31193124
}
31203125

31213126
tegra_periph_clk_init(clk_base, pmc_base, tegra210_clks, &pll_p_params);
3127+
3128+
/* emc */
3129+
clk = tegra210_clk_register_emc(np, clk_base);
3130+
clks[TEGRA210_CLK_EMC] = clk;
3131+
3132+
/* mc */
3133+
tegra210_clk_register_mc("mc", "emc");
31223134
}
31233135

31243136
static void __init tegra210_pll_init(void __iomem *clk_base,
@@ -3717,7 +3729,7 @@ static void __init tegra210_clock_init(struct device_node *np)
37173729

37183730
tegra_fixed_clk_init(tegra210_clks);
37193731
tegra210_pll_init(clk_base, pmc_base);
3720-
tegra210_periph_clk_init(clk_base, pmc_base);
3732+
tegra210_periph_clk_init(np, clk_base, pmc_base);
37213733
tegra_audio_clk_init(clk_base, pmc_base, tegra210_clks,
37223734
tegra210_audio_plls,
37233735
ARRAY_SIZE(tegra210_audio_plls), 24576000);

0 commit comments

Comments
 (0)