ARM: dts: stm32: Fix and expand PLL configuration comments
authorMarek Vasut <marex@denx.de>
Tue, 11 Oct 2022 20:42:44 +0000 (22:42 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Tue, 18 Oct 2022 06:36:10 +0000 (08:36 +0200)
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.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
arch/arm/dts/stm32mp15xx-dhcom-u-boot.dtsi
arch/arm/dts/stm32mp15xx-dhcor-u-boot.dtsi

index 8a7156c..b72a2f6 100644 (file)
                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";
                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>;
index 19f4221..25a288b 100644 (file)
                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";
                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>;