git: c1dbf3f51352 - main - aw_ccu: h6: Use the 1x PLL_PERIPH as parents of the MMC clocks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 Nov 2026 09:51:53 UTC
The branch main has been updated by manu:
URL: https://cgit.FreeBSD.org/src/commit/?id=c1dbf3f5135205ddcd3056e08a1477f366f28cea
commit c1dbf3f5135205ddcd3056e08a1477f366f28cea
Author: Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-09 19:30:39 +0000
Commit: Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-12 09:50:24 +0000
aw_ccu: h6: Use the 1x PLL_PERIPH as parents of the MMC clocks
The MMC clocks of the H6 have the doubled outputs of the PLL_PERIPH0
and PLL_PERIPH1 as inputs of their mux, followed by a fixed post divider
of 2 that the driver does not know about. The rate it computed was
twice the real one: on a Pine H64 the SD card requested at 50MHz and the
eMMC at 52MHz ran at half of that, and transfers at about half the speed
they should reach. U-Boot does the same compensation, as it pretends
the parent is the 1x PLL.
Name the 1x PLLs as parents, like the H3 driver does. The position in
the mux is the same.
Tested on: H6
---
sys/dev/clk/allwinner/ccu_h6.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/dev/clk/allwinner/ccu_h6.c b/sys/dev/clk/allwinner/ccu_h6.c
index 7bc3335023e3..a9f1e638b0c8 100644
--- a/sys/dev/clk/allwinner/ccu_h6.c
+++ b/sys/dev/clk/allwinner/ccu_h6.c
@@ -638,7 +638,12 @@ NM_CLK(apb2_clk,
/* Missing MBUS clock */
-static const char *mod_parents[] = {"osc24M", "pll_periph0_2x", "pll_periph1_2x"};
+/*
+ * The mux of the module clocks takes the doubled PLL_PERIPH outputs, but they
+ * have a fixed post divider of 2 that is not modeled: use the 1x PLLs, which
+ * gives the same rate with the same mux selection.
+ */
+static const char *mod_parents[] = {"osc24M", "pll_periph0", "pll_periph1"};
NM_CLK(mmc0_clk,
CLK_MMC0, "mmc0", mod_parents, /* id, name, parents */
0x830, /* offset */