ARM: tegra: fix PLLD/D2 relates configurations
Subsystems (3)
cover ARM: tegra: fix PLLD/D2 relates configurations
Fix PLLD2 info table entry on Tegra124 and Tegra210 which unlike on Tegra114 and lower does not match PLLD.
Take in account PLLD/D2 enable bit on clock_set_rate call. Those two seems to be only which have this bit.
Svyatoslav Ryhel (2):
ARM: tegra: clock: take in account PLLD/D2 enable bit on
clock_set_rate
ARM: tegra: clock: fix PLLD2 info table entry on Tegra124 and Tegra210
arch/arm/mach-tegra/clock.c | 6 ++++++ arch/arm/mach-tegra/tegra124/clock.c | 4 ++-- arch/arm/mach-tegra/tegra210/clock.c | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 ARM: tegra: clock: take in account PLLD/D2 enable bit on clock_set_rate
PLLD and PLLD2 clocks possess a unique enable bit within their miscellaneous register. Take this into account when using clock_set_rate function.
--- arch/arm/mach-tegra/clock.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/mach-tegra/clock.c +6 -0
@@ -703,6 +703,12 @@ int clock_set_rate(enum clock_id clkid, u32 n, u32 m, u32 p, u32 cpcon)else writel (base_reg, &simple_pll->pll_base); +/* PLLD and PLLD2 are only clocks which have ENABLE bit */ +if (clkid ==CLOCK_ID_DISPLAY ) +setbits_le32 (&pll->pll_misc,BIT (PLLD_CLKENABLE )); +if (clkid ==CLOCK_ID_DISPLAY2 ) +setbits_le32 (&simple_pll->pll_misc,BIT (PLLD_CLKENABLE )); +/* * Changing clocks was never intended in the U-Boot for Tegra. * If a clock is changed after clock_init() the parent rate is wrong.
Signature · 1 line
2.43.0
PATCH 2/2 ARM: tegra: clock: fix PLLD2 info table entry on Tegra124 and Tegra210
In reply to Svyatoslav RyhelHistorically, PLLD2 mirrored PLLD's layout on Tegra30 and 114. However, with the introduction of Tegra124, this changed. This layout alteration was not considered, and it now requires a corrective action to prevent future complications.
--- arch/arm/mach-tegra/tegra124/clock.c | 4 ++-- arch/arm/mach-tegra/tegra210/clock.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-tegra/tegra124/clock.c +2 -2
@@ -598,8 +598,8 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = { .lock_ena = 9, .lock_det = 11, .kcp_shift = 6, .kcp_mask = 3, .kvco_shift = 0, .kvco_mask = 1 }, /* PLLE */ { .m_shift = 0, .m_mask = 0x0F, .n_shift = 8, .n_mask = 0x3FF, .p_shift = 20, .p_mask = 0x07, .lock_ena = 18, .lock_det = 27, .kcp_shift = 8, .kcp_mask = 0xF, .kvco_shift = 4, .kvco_mask = 0xF }, /* PLLS (RESERVED) */ - { .m_shift = 0, .m_mask = 0x1F, .n_shift = 8, .n_mask = 0x3FF, .p_shift = 20, .p_mask = 0x07, - .lock_ena = 22, .lock_det = 27, .kcp_shift = 8, .kcp_mask = 0xF, .kvco_shift = 4, .kvco_mask = 0xF }, /* PLLD2 */ + { .m_shift = 0, .m_mask = 0xFF, .n_shift = 8, .n_mask = 0xFF, .p_shift = 20, .p_mask = 0xF, + .lock_ena = 30, .lock_det = 27, .kcp_shift = 25, .kcp_mask = 3, .kvco_shift = 24, .kvco_mask = 1 }, /* PLLD2 */ { .m_shift = 0, .m_mask = 0xFF, .n_shift = 8, .n_mask = 0xFF, .p_shift = 20, .p_mask = 0xF, .lock_ena = 30, .lock_det = 27, .kcp_shift = 25, .kcp_mask = 3, .kvco_shift = 24, .kvco_mask = 1 }, /* PLLDP */ };
arch/arm/mach-tegra/tegra210/clock.c +2 -2
@@ -668,8 +668,8 @@ struct clk_pll_info tegra_pll_info_table[CLOCK_ID_PLL_COUNT] = { .lock_ena = 9, .lock_det = 11, .kcp_shift = 6, .kcp_mask = 3, .kvco_shift = 0, .kvco_mask = 1 }, /* PLLE */ { .m_shift = 0, .m_mask = 0, .n_shift = 0, .n_mask = 0, .p_shift = 0, .p_mask = 0, .lock_ena = 0, .lock_det = 0, .kcp_shift = 0, .kcp_mask = 0, .kvco_shift = 0, .kvco_mask = 0 }, /* PLLS (gone)*/ - { .m_shift = 0, .m_mask = 0x1F, .n_shift = 8, .n_mask = 0x3FF, .p_shift = 20, .p_mask = 0x07, - .lock_ena = 22, .lock_det = 27, .kcp_shift = 8, .kcp_mask = 0xF, .kvco_shift = 4, .kvco_mask = 0xF }, /* PLLD2 */ + { .m_shift = 0, .m_mask = 0xFF, .n_shift = 8, .n_mask = 0xFF, .p_shift = 19, .p_mask = 0x1F, + .lock_ena = 30, .lock_det = 27, .kcp_shift = 25, .kcp_mask = 3, .kvco_shift = 24, .kvco_mask = 1 }, /* PLLD2 */ { .m_shift = 0, .m_mask = 0xFF, .n_shift = 8, .n_mask = 0xFF, .p_shift = 19, .p_mask = 0x1F, .lock_ena = 30, .lock_det = 27, .kcp_shift = 25, .kcp_mask = 3, .kvco_shift = 24, .kvco_mask = 1 }, /* PLLDP */ };
Signature · 1 line
2.43.0