git: e5a6d69f62bb - main - aw_ccu: h6: Do not use the output divider of the video PLLs

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

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

commit e5a6d69f62bb6d8c7735caab72d1b42b51e2d66a
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-10 16:19:52 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-12 09:47:30 +0000

    aw_ccu: h6: Do not use the output divider of the video PLLs
    
    The bit 0 of the video PLLs is an output divider that is only used for
    testing.  According to the H6 manual the rate of these PLLs is 24MHz*N/M
    with M the bit 1, and it is 1188MHz at reset, when this divider is set.
    
    It was used as a divider anyway, so the rates of the video PLLs were
    half of the real ones, 594MHz at reset.  Do not use it.
    
    Tested on: H6
---
 sys/dev/clk/allwinner/ccu_h6.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sys/dev/clk/allwinner/ccu_h6.c b/sys/dev/clk/allwinner/ccu_h6.c
index 5aa2cea62fbd..61dca3c0eb37 100644
--- a/sys/dev/clk/allwinner/ccu_h6.c
+++ b/sys/dev/clk/allwinner/ccu_h6.c
@@ -275,13 +275,18 @@ NMM_CLK(pll_gpu_clk,
     28, 1000,					/* lock */
     AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK);		/* flags */
 
+/*
+ * The output divider of the video PLLs, bit 0, is only used for testing and
+ * is not a part of their rate, which is 1188MHz at reset when it is set.  It
+ * is not used.
+ */
 static const char *pll_video0_4x_parents[] = {"osc24M"};
 NMM_CLK(pll_video0_4x_clk,
     CLK_PLL_VIDEO0_4X,				/* id */
     "pll_video0_4x", pll_video0_4x_parents,	/* name, parents */
     0x40,					/* offset */
     8, 8, 0, AW_CLK_FACTOR_MIN_VALUE, 12,	/* n factor */
-    0, 1, 0, 0,					/* m0 factor */
+    0, 0, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
     28, 1000,					/* lock */
@@ -302,7 +307,7 @@ NMM_CLK(pll_video1_4x_clk,
     "pll_video1_4x", pll_video1_4x_parents,	/* name, parents */
     0x48,					/* offset */
     8, 8, 0, AW_CLK_FACTOR_MIN_VALUE, 12,	/* n factor */
-    0, 1, 0, 0,					/* m0 factor */
+    0, 0, 0, 0,					/* m0 factor */
     1, 1, 0, 0,					/* m1 factor */
     31,						/* gate */
     28, 1000,					/* lock */