Skip to contentSkip to conversation

Tegra114: Fix PLLX M, N, P init settings

PATCH Superseded Thierry Reding 3 participants 4 messages Sep 20, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Tegra114: Fix PLLX M, N, P init settings

From: Jimmy Zhang <[email protected]>

The M, N and P width have been changed from Tegra30. The maximum value for N is limited to 255. So, the tegra_pll_x_table for Tegra114 should be set accordingly.

---
 arch/arm/cpu/arm720t/tegra-common/cpu.c | 36 +++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)
arch/arm/cpu/arm720t/tegra-common/cpu.c +30 -6
index 9294611..2c50034 100644
@@ -50,7 +50,13 @@ int get_num_cpus(void)
  */
 struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	/* T20: 1 GHz */
-	/*  n,  m, p, cpcon */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
+	 /*  n,  m, p, cpcon */
 	{{ 1000, 13, 0, 12},	/* OSC 13M */
 	 { 625,  12, 0, 8},	/* OSC 19.2M */
 	 { 1000, 12, 0, 12},	/* OSC 12M */
@@ -58,6 +64,12 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	},
 
 	/* T25: 1.2 GHz */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
 	{{ 923, 10, 0, 12},
 	 { 750, 12, 0, 8},
 	 { 600,  6, 0, 12},
@@ -65,17 +77,29 @@ struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	},
 
 	/* T30: 1.4 GHz */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
 	{{ 862, 8, 0, 8},
 	 { 583, 8, 0, 4},
 	 { 700, 6, 0, 8},
 	 { 700, 13, 0, 8},
 	},
 
-	/* T114: 1.4 GHz */
-	{{ 862, 8, 0, 8},
-	 { 583, 8, 0, 4},
-	 { 696, 12, 0, 8},
-	 { 700, 13, 0, 8},
+	/* T114: 1.9 GHz    */
+	/*
+	 * Field Bits Width
+	 *  n    15:8   8
+	 *  m     7:0   8
+	 *  p    23:20  4
+	 */
+	{{ 108, 1, 1, 8},	/* actual: 702.0 MHz */
+	 { 73, 1, 1, 4},	/* actual: 700.8 MHz */
+	 { 116, 1, 1, 8},	/* actual: 696.0 MHz */
+	 { 108, 2, 1, 8},	/* actual: 702.0 MHz */
 	},
 };
 
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/1 Tegra114: Fix PLLX M, N, P init settings

Thierry,

Quoted 93 lines

-----Original Message-----
From: Thierry Reding [mailto:thierry.reding at gmail.com]
Sent: Friday, September 20, 2013 5:41 AM
To: Tom Warren
Cc: u-boot at lists.denx.de
Subject: [PATCH] Tegra114: Fix PLLX M, N, P init settings

From: Jimmy Zhang <[email protected]>

The M, N and P width have been changed from Tegra30. The maximum value for N is limited to 255. So, the tegra_pll_x_table for Tegra114 should be set accordingly.

---
 arch/arm/cpu/arm720t/tegra-common/cpu.c | 36
+++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)
arch/arm/cpu/arm720t/tegra-common/cpu.c +7 -1
index 9294611..2c50034 100644
@@ -50,7 +50,13 @@ int get_num_cpus(void)
  */
 struct clk_pll_table
 tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	/* T20: 1 GHz */
-	/*  n,  m, p, cpcon */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
+	 /*  n,  m, p, cpcon */
 	{{ 1000, 13, 0, 12},	/* OSC 13M */
 	 { 625,  12, 0, 8},	/* OSC 19.2M */
arch/arm/cpu/arm720t/tegra-common/cpu.c +6 -0
 	 { 1000, 12, 0, 12},	/* OSC 12M */
@@ -58,6 +64,12 @@ struct clk_pll_table
 tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	},
 
 	/* T25: 1.2 GHz */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
 	{{ 923, 10, 0, 12},
 	 { 750, 12, 0, 8},
arch/arm/cpu/arm720t/tegra-common/cpu.c +17 -6
 	 { 600,  6, 0, 12},
@@ -65,17 +77,29 @@ struct clk_pll_table
 tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	},
 
 	/* T30: 1.4 GHz */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3
+	 */
 	{{ 862, 8, 0, 8},
 	 { 583, 8, 0, 4},
 	 { 700, 6, 0, 8},
 	 { 700, 13, 0, 8},
 	},
 
-	/* T114: 1.4 GHz */
-	{{ 862, 8, 0, 8},
-	 { 583, 8, 0, 4},
-	 { 696, 12, 0, 8},
-	 { 700, 13, 0, 8},
+	/* T114: 1.9 GHz    */
+	/*
+	 * Field Bits Width
+	 *  n    15:8   8
+	 *  m     7:0   8
+	 *  p    23:20  4
+	 */
+	{{ 108, 1, 1, 8},	/* actual: 702.0 MHz */
+	 { 73, 1, 1, 4},	/* actual: 700.8 MHz */
+	 { 116, 1, 1, 8},	/* actual: 696.0 MHz */
+	 { 108, 2, 1, 8},	/* actual: 702.0 MHz */
 	},
 };
 
--
Quoted 1 line

1.8.4

LGTM. Thanks for doing this.

--
nvpublic

#2 lore raw

PATCH 1/1 Tegra114: Fix PLLX M, N, P init settings

In reply to Thierry Reding
Quoted 7 lines · Thierry Reding

From: Jimmy Zhang <[email protected]>

The M, N and P width have been changed from Tegra30. The maximum value for N is limited to 255. So, the tegra_pll_x_table for Tegra114 should be set accordingly.

arch/arm/cpu/arm720t/tegra-common/cpu.c int get_num_cpus(void) · line 57

Quoted 9 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +5 -1
 
 struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {
 	/* T20: 1 GHz */
-	/*  n,  m, p, cpcon */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3

It'd be nice to document the cpcon field size/position here too.

Nit: The various comments aren't consistent in their alignment (i.e. width left/right justified, some bits values don't line up with others, etc.)

arch/arm/cpu/arm720t/tegra-common/cpu.c int get_num_cpus(void) · line 62

Quoted 5 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -0
+	 */
+	 /*  n,  m, p, cpcon */
 	{{ 1000, 13, 0, 12},	/* OSC 13M */
 	 { 625,  12, 0, 8},	/* OSC 19.2M */
 	 { 1000, 12, 0, 12},	/* OSC 12M */

It might be useful to label all the table entries with the OSC frequency that they apply to. But, perhaps that could be a different patch.

arch/arm/cpu/arm720t/tegra-common/cpu.c struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = { · line 92

Quoted 6 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +1 -5
-	/* T114: 1.4 GHz */
-	{{ 862, 8, 0, 8},
-	 { 583, 8, 0, 4},
-	 { 696, 12, 0, 8},
-	 { 700, 13, 0, 8},
+	/* T114: 1.9 GHz    */

What does "1.9 GHz" mean here? Is that the/a max frequency the chip supports? If so, it seems like a single value can't be accurate, since max frequency is SKU-specific. As such, I wonder if it's even worth including a number here?

I assume that the new table entries set up the same frequencies as what was intended before; it's just that the old values were calculated incorrectly. In other words, this patch is a bug-fix, not a change.

Quoted 10 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +10 -0
+	/*
+	 * Field Bits Width
+	 *  n    15:8   8
+	 *  m     7:0   8
+	 *  p    23:20  4
+	 */
+	{{ 108, 1, 1, 8},	/* actual: 702.0 MHz */
+	 { 73, 1, 1, 4},	/* actual: 700.8 MHz */
+	 { 116, 1, 1, 8},	/* actual: 696.0 MHz */
+	 { 108, 2, 1, 8},	/* actual: 702.0 MHz */
#3 lore raw

PATCH 1/1 Tegra114: Fix PLLX M, N, P init settings

Including Jimmy, since he wrote this patch originally.

Quoted 20 lines

-----Original Message-----
From: Stephen Warren [mailto:swarren at wwwdotorg.org]
Sent: Friday, September 20, 2013 9:19 AM
To: Thierry Reding
Cc: Tom Warren; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH] Tegra114: Fix PLLX M, N, P init settings

Quoted 3 lines · Thierry Reding

From: Jimmy Zhang <[email protected]>

The M, N and P width have been changed from Tegra30. The maximum

value

arch/arm/cpu/arm720t/tegra-common/cpu.c

Quoted 7 lines

for N is limited to 255. So, the tegra_pll_x_table for Tegra114 should be set accordingly.

arch/arm/cpu/arm720t/tegra-common/cpu.c +0 -0
 
 struct clk_pll_table

tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = {

Quoted 9 lines

arch/arm/cpu/arm720t/tegra-common/cpu.c int get_num_cpus(void) · line 57

Quoted 7 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +5 -1
 	/* T20: 1 GHz */
-	/*  n,  m, p, cpcon */
+	/*
+	 * Field Bits Width
+	 *  n    17:8  10
+	 *  m     4:0   5
+	 *  p    22:20  3

It'd be nice to document the cpcon field size/position here too.

CPCON is always bits 11:8. Unfortunately, it appears CPCON is gone from PLLX_MISC on T114, or at least it's not documented in the TRM. It was there in T30.

Quoted 30 lines

Nit: The various comments aren't consistent in their alignment (i.e. width left/right justified, some bits values don't line up with others, etc.)

arch/arm/cpu/arm720t/tegra-common/cpu.c int get_num_cpus(void) · line 62

Quoted 5 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +2 -0
+	 */
+	 /*  n,  m, p, cpcon */
 	{{ 1000, 13, 0, 12},	/* OSC 13M */
 	 { 625,  12, 0, 8},	/* OSC 19.2M */
 	 { 1000, 12, 0, 12},	/* OSC 12M */

It might be useful to label all the table entries with the OSC frequency that they apply to. But, perhaps that could be a different patch.

arch/arm/cpu/arm720t/tegra-common/cpu.c struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = { · line 92

Quoted 6 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +1 -5
-	/* T114: 1.4 GHz */
-	{{ 862, 8, 0, 8},
-	 { 583, 8, 0, 4},
-	 { 696, 12, 0, 8},
-	 { 700, 13, 0, 8},
+	/* T114: 1.9 GHz    */

What does "1.9 GHz" mean here? Is that the/a max frequency the chip supports? If so, it seems like a single value can't be accurate, since max frequency is SKU-specific. As such, I wonder if it's even worth including a number here?

I assume that the new table entries set up the same frequencies as what was intended before; it's just that the old values were calculated incorrectly. In other words, this patch is a bug-fix, not a change.

Quoted 10 lines

arch/arm/cpu/arm720t/tegra-common/cpu.c struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_CNT][CLOCK_OSC_FREQ_COUNT] = { · line 102

Quoted 10 lines
arch/arm/cpu/arm720t/tegra-common/cpu.c +10 -0
+	/*
+	 * Field Bits Width
+	 *  n    15:8   8
+	 *  m     7:0   8
+	 *  p    23:20  4
+	 */
+	{{ 108, 1, 1, 8},	/* actual: 702.0 MHz */
+	 { 73, 1, 1, 4},	/* actual: 700.8 MHz */
+	 { 116, 1, 1, 8},	/* actual: 696.0 MHz */
+	 { 108, 2, 1, 8},	/* actual: 702.0 MHz */

--
nvpublic