public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Tegra: Fix MSELECT clock divisors for T30/T114.
@ 2013-04-03 23:17 Tom Warren
  2013-04-03 23:28 ` Stephen Warren
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Warren @ 2013-04-03 23:17 UTC (permalink / raw)
  To: u-boot

A comparison of registers between our internal NV U-Boot and
u-boot-tegra/next showed some discrepancies in the MSELECT
clock divisor programming. T20 doesn't have a MSELECT clk src reg.

Signed-off-by: Tom Warren <twarren@nvidia.com>
---
 arch/arm/cpu/arm720t/tegra114/cpu.c | 10 ++++------
 arch/arm/cpu/arm720t/tegra30/cpu.c  |  4 ++--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/arm/cpu/arm720t/tegra114/cpu.c b/arch/arm/cpu/arm720t/tegra114/cpu.c
index 6a94179..51ecff7 100644
--- a/arch/arm/cpu/arm720t/tegra114/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra114/cpu.c
@@ -170,15 +170,13 @@ void t114_init_clocks(void)
 	clock_set_enable(PERIPH_ID_MC1, 1);
 	clock_set_enable(PERIPH_ID_DVFS, 1);
 
-	/* Switch MSELECT clock to PLLP (00) */
-	clock_ll_set_source(PERIPH_ID_MSELECT, 0);
-
 	/*
-	 * Clock divider request for 102MHz would setup MSELECT clock as
-	 * 102MHz for PLLP base 408MHz
+	 * Set MSELECT clock source as PLLP (00), and ask for a clock
+	 * divider that would set the MSELECT clock at 102MHz for a
+	 * PLLP base of 408MHz.
 	 */
 	clock_ll_set_source_divisor(PERIPH_ID_MSELECT, 0,
-		(NVBL_PLLP_KHZ/102000));
+		CLK_DIVIDER(NVBL_PLLP_KHZ, 102000));
 
 	/* I2C5 (DVC) gets CLK_M and a divisor of 17 */
 	clock_ll_set_source_divisor(PERIPH_ID_I2C5, 3, 16);
diff --git a/arch/arm/cpu/arm720t/tegra30/cpu.c b/arch/arm/cpu/arm720t/tegra30/cpu.c
index dedcdd9..e162357 100644
--- a/arch/arm/cpu/arm720t/tegra30/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra30/cpu.c
@@ -110,8 +110,8 @@ void t30_init_clocks(void)
 	reset_set_enable(PERIPH_ID_MSELECT, 1);
 	clock_set_enable(PERIPH_ID_MSELECT, 1);
 
-	/* Switch MSELECT clock to PLLP (00) */
-	clock_ll_set_source(PERIPH_ID_MSELECT, 0);
+	/* Switch MSELECT clock to PLLP (00) and use a divisor of 2 */
+	clock_ll_set_source_divisor(PERIPH_ID_MSELECT, 0, 2);
 
 	/*
 	 * Our high-level clock routines are not available prior to
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] Tegra: Fix MSELECT clock divisors for T30/T114.
  2013-04-03 23:17 [U-Boot] [PATCH] Tegra: Fix MSELECT clock divisors for T30/T114 Tom Warren
@ 2013-04-03 23:28 ` Stephen Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2013-04-03 23:28 UTC (permalink / raw)
  To: u-boot

On 04/03/2013 05:17 PM, Tom Warren wrote:
> A comparison of registers between our internal NV U-Boot and
> u-boot-tegra/next showed some discrepancies in the MSELECT
> clock divisor programming. T20 doesn't have a MSELECT clk src reg.

I'm not familiar with this code/HW, but it seems OK at a quick glance, so,
Reviewed-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-03 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 23:17 [U-Boot] [PATCH] Tegra: Fix MSELECT clock divisors for T30/T114 Tom Warren
2013-04-03 23:28 ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox