git: 4898d754d759 - main - aw_ccu: h6: Fix the width of the N factor of the PLLs

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Thu, 12 Nov 2026 09:51:28 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=4898d754d759a37576561e53194fcf4569143dca

commit 4898d754d759a37576561e53194fcf4569143dca
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-10 14:52:03 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-12 09:47:29 +0000

    aw_ccu: h6: Fix the width of the N factor of the PLLs
    
    The N factor of the PLLs is 8 bits wide, bits 15:8 of their register,
    and not 7 as it was defined.  A PLL with N above 128 was read with a
    wrong rate, and the factor could not be set above this value.
    
    No PLL has such a rate today, so nothing changes for now.
    
    Tested on: H6
---
 sys/dev/clk/allwinner/ccu_h6.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/sys/dev/clk/allwinner/ccu_h6.c b/sys/dev/clk/allwinner/ccu_h6.c
index 5d344a36a50b..c1f947ae75af 100644
--- a/sys/dev/clk/allwinner/ccu_h6.c
+++ b/sys/dev/clk/allwinner/ccu_h6.c
@@ -173,7 +173,7 @@ NP_CLK(pll_cpux_clk,
     CLK_PLL_CPUX,				/* id */
     "pll_cpux", pll_cpux_parents,		/* name, parents */
     0x00,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 2, 0, 0,					/* p factor */
     31,						/* gate */
     28, 1000,					/* lock */
@@ -184,7 +184,7 @@ NMM_CLK(pll_ddr0_clk,
     CLK_PLL_DDR0,				/* id */
     "pll_ddr0", pll_ddr0_parents,		/* name, parents */
     0x10,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -196,7 +196,7 @@ NMM_CLK(pll_peri0_4x_clk,
     CLK_PLL_PERIPH0_4X,				/* id */
     "pll_periph0_4x", pll_peri0_4x_parents,	/* name, parents */
     0x20,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -226,7 +226,7 @@ NMM_CLK(pll_peri1_4x_clk,
     CLK_PLL_PERIPH1_4X,				/* id */
     "pll_periph1_4x", pll_peri1_4x_parents,	/* name, parents */
     0x28,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -256,7 +256,7 @@ NMM_CLK(pll_gpu_clk,
     CLK_PLL_GPU,				/* id */
     "pll_gpu", pll_gpu_parents,			/* name, parents */
     0x30,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -268,7 +268,7 @@ NMM_CLK(pll_video0_4x_clk,
     CLK_PLL_VIDEO0_4X,				/* id */
     "pll_video0_4x", pll_video0_4x_parents,	/* name, parents */
     0x40,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -289,7 +289,7 @@ NMM_CLK(pll_video1_4x_clk,
     CLK_PLL_VIDEO1_4X,				/* id */
     "pll_video1_4x", pll_video1_4x_parents,	/* name, parents */
     0x48,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -310,7 +310,7 @@ NMM_CLK(pll_ve_clk,
     CLK_PLL_VE,					/* id */
     "pll_ve", pll_ve_parents,			/* name, parents */
     0x58,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -322,7 +322,7 @@ NMM_CLK(pll_de_clk,
     CLK_PLL_DE,					/* id */
     "pll_de", pll_de_parents,			/* name, parents */
     0x60,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
@@ -334,7 +334,7 @@ NMM_CLK(pll_hsic_clk,
     CLK_PLL_HSIC,				/* id */
     "pll_hsic", pll_hsic_parents,		/* name, parents */
     0x70,					/* offset */
-    8, 7, 0, 0,					/* n factor */
+    8, 8, 0, 0,					/* n factor */
     0, 1, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */