Skip to contentSkip to conversation

ARM: dts: stm32: Fix and expand PLL configuration comments

PATCH In review Marek Vasut 3 participants 3 messages Oct 11, 2022 – Oct 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: stm32: Fix and expand PLL configuration comments

Fix the frequencies listed in PLL configuration comments to match the actual frequencies programmed into hardware. Furthermore, add a comment which explains how those frequencies are calculated, so it won't be necessary to look it up all over the datasheet and make more mistakes in the calculation in the future.

Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
 arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 17 ++++++++++++++++-
 arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi | 17 ++++++++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)
arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi +16 -1
index 8a7156c93bf..b72a2f63f16 100644
@@ -190,6 +190,21 @@
 		CLK_LPTIM45_LSE
 	>;
 
+	/*
+	 * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >;
+	 * frac = < f >;
+	 *
+	 * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled
+	 * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN
+	 * m ... for PLL1,2: m=2 ; for PLL3,4: m=1
+	 * XTAL = 24 MHz
+	 *
+	 * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) )
+	 *   P = VCO / (P + 1)
+	 *   Q = VCO / (Q + 1)
+	 *   R = VCO / (R + 1)
+	 */
+
 	/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
 	pll2: st,pll@1 {
 		compatible = "st,stm32mp1-pll";
@@ -208,7 +223,7 @@
 		u-boot,dm-pre-reloc;
 	};
 
-	/* VCO = 600.0 MHz => P = 50, Q = 50, R = 50 */
+	/* VCO = 600.0 MHz => P = 100, Q = 50, R = 50 */
 	pll4: st,pll@3 {
 		compatible = "st,stm32mp1-pll";
 		reg = <3>;
arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi +16 -1
index 19f4221f876..25a288b0475 100644
@@ -144,6 +144,21 @@
 		CLK_LPTIM45_LSE
 	>;
 
+	/*
+	 * cfg = < DIVM1 DIVN P Q R PQR(p,q,r) >;
+	 * frac = < f >;
+	 *
+	 * PRQ(p,q,r) ... for p,q,r: 0-output disabled / 1-output enabled
+	 * DIVN ... actually multiplier, but RCC_PLL1CFGR1 calls the field DIVN
+	 * m ... for PLL1,2: m=2 ; for PLL3,4: m=1
+	 * XTAL = 24 MHz
+	 *
+	 * VCO = ( XTAL / (DIVM1 + 1) ) * m * ( DIVN + 1 + ( f / 8192 ) )
+	 *   P = VCO / (P + 1)
+	 *   Q = VCO / (Q + 1)
+	 *   R = VCO / (R + 1)
+	 */
+
 	/* VCO = 1066.0 MHz => P = 266 (AXI), Q = 533 (GPU), R = 533 (DDR) */
 	pll2: st,pll@1 {
 		compatible = "st,stm32mp1-pll";
@@ -162,7 +177,7 @@
 		u-boot,dm-pre-reloc;
 	};
 
-	/* VCO = 600.0 MHz => P = 99, Q = 74, R = 99 */
+	/* VCO = 594.0 MHz => P = 99, Q = 74, R = 99 */
 	pll4: st,pll@3 {
 		compatible = "st,stm32mp1-pll";
 		reg = <3>;
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 6 lines · Marek Vasut

Fix the frequencies listed in PLL configuration comments to match the actual frequencies programmed into hardware. Furthermore, add a comment which explains how those frequencies are calculated, so it won't be necessary to look it up all over the datasheet and make more mistakes in the calculation in the future.

Quoted 8 lines
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>
---
  arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 17 ++++++++++++++++-
  arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi | 17 ++++++++++++++++-
  2 files changed, 32 insertions(+), 2 deletions(-)

Thanks
Patrick

#2 lore raw
Quoted 18 lines · Patrick DELAUNAY

Hi,

Quoted 6 lines · Marek Vasut

Fix the frequencies listed in PLL configuration comments to match the actual frequencies programmed into hardware. Furthermore, add a comment which explains how those frequencies are calculated, so it won't be necessary to look it up all over the datasheet and make more mistakes in the calculation in the future.

Quoted 8 lines
Cc Patrice Chotard <[email protected]>
Cc Patrick Delaunay <[email protected]>

---
  arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi | 17 ++++++++++++++++- arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi | 17 ++++++++++++++++-

  2 files changed, 32 insertions(+), 2 deletions(-)
Quoted 4 lines

Thanks
Patrick

Applied on u-boot-stm32/master

Thanks
Patrice