drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c | 37 ++++----- drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 128 ++++++++++++++----------------- drivers/clk/sunxi-ng/ccu_div.h | 18 ++++- 3 files changed, 88 insertions(+), 95 deletions(-)
Sashiko pointed out two issues in my series adding clock driver support
for the Allwinner A733 SoC [1][2].
First, ccu_mp_set_rate() generates an invalid mask when an MP clock is
defined with a zero-width P divider, clearing unrelated register fields.
Second, ccu_mp_set_rate() does not handle CCU_FEATURE_UPDATE_BIT, so
divider changes are not latched by the hardware.
The affected A733 clocks were modeled after the existing A523 MBUS,
IOMMU, and DRAM clocks, which have the same issues. According to the
hardware description, these clocks only contain an M divider and should
be modeled as M-only clocks.
The A523 high-speed and PRCM timer clocks have the opposite problem.
They only contain a P divider but are modeled as MP clocks with a
zero-width M divider.
Add a feature-capable variant of the M-only clock macro and migrate the
affected A523 clocks to it. Convert the timer clocks to the existing
P-only clock type. The affected A733 clocks will use the new M-only
macro in the next revision of the A733 CCU series.
Tested on Radxa Cubie A5E with CLOCK_ALLOW_WRITE_DEBUGFS enabled:
# cat /sys/kernel/debug/clk/mbus/clk_rate
600000000
# devmem 0x02001540 32
0xC0000003
# echo 300000000 > /sys/kernel/debug/clk/mbus/clk_rate
Results without this series:
# cat /sys/kernel/debug/clk/mbus/clk_rate
600000000
# devmem 0x02001540 32
0x00000003
Results with this series:
# cat /sys/kernel/debug/clk/mbus/clk_rate
300000000
# devmem 0x02001540 32
0xC0000007
Link: https://lore.kernel.org/r/20260905164854.57BEF1F00A3A@smtp.kernel.org [1]
Link: https://lore.kernel.org/r/20260905164855.57E751F00A3D@smtp.kernel.org [2]
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Junhui Liu (4):
clk: sunxi-ng: div: Add feature support to M clock macro
clk: sunxi-ng: sun55i-a523-ccu: Use M-only clocks for MBUS, IOMMU and DRAM
clk: sunxi-ng: sun55i-a523-ccu: Use P-only clocks for high-speed timers
clk: sunxi-ng: sun55i-a523-r-ccu: Use P-only clocks for timers
drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c | 37 ++++-----
drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 128 ++++++++++++++-----------------
drivers/clk/sunxi-ng/ccu_div.h | 18 ++++-
3 files changed, 88 insertions(+), 95 deletions(-)
---
base-commit: 4d7d9486c04d917265f64c55bd23b2cc4fe7749c
change-id: 20260906-sunxi-clk-no-p-de3574e5823a
Best regards,
--
Junhui Liu <junhui.liu@pigmoral.tech>
On Sun, 06 Sep 2026 15:06:37 +0800, Junhui Liu wrote:
> Sashiko pointed out two issues in my series adding clock driver support
> for the Allwinner A733 SoC [1][2].
>
> First, ccu_mp_set_rate() generates an invalid mask when an MP clock is
> defined with a zero-width P divider, clearing unrelated register fields.
> Second, ccu_mp_set_rate() does not handle CCU_FEATURE_UPDATE_BIT, so
> divider changes are not latched by the hardware.
>
> [...]
Applied to sunxi/clk-for-7.4 in sunxi, thanks!
[1/4] clk: sunxi-ng: div: Add feature support to M clock macro
https://git.kernel.org/sunxi/linux/c/da543a093f65
[2/4] clk: sunxi-ng: sun55i-a523-ccu: Use M-only clocks for MBUS, IOMMU and DRAM
https://git.kernel.org/sunxi/linux/c/88735a2ffbea
[3/4] clk: sunxi-ng: sun55i-a523-ccu: Use P-only clocks for high-speed timers
https://git.kernel.org/sunxi/linux/c/4b41d0ffa9d9
[4/4] clk: sunxi-ng: sun55i-a523-r-ccu: Use P-only clocks for timers
https://git.kernel.org/sunxi/linux/c/b260db91603a
Best regards,
--
Chen-Yu Tsai <wens@kernel.org>
On Mon, Sep 14, 2026 at 12:16 AM Chen-Yu Tsai <wens@kernel.org> wrote: > > On Sun, 06 Sep 2026 15:06:37 +0800, Junhui Liu wrote: > > Sashiko pointed out two issues in my series adding clock driver support > > for the Allwinner A733 SoC [1][2]. > > > > First, ccu_mp_set_rate() generates an invalid mask when an MP clock is > > defined with a zero-width P divider, clearing unrelated register fields. > > Second, ccu_mp_set_rate() does not handle CCU_FEATURE_UPDATE_BIT, so > > divider changes are not latched by the hardware. > > > > [...] > > Applied to sunxi/clk-for-7.4 in sunxi, thanks! > > [1/4] clk: sunxi-ng: div: Add feature support to M clock macro > https://git.kernel.org/sunxi/linux/c/da543a093f65 > [2/4] clk: sunxi-ng: sun55i-a523-ccu: Use M-only clocks for MBUS, IOMMU and DRAM > https://git.kernel.org/sunxi/linux/c/88735a2ffbea > [3/4] clk: sunxi-ng: sun55i-a523-ccu: Use P-only clocks for high-speed timers > https://git.kernel.org/sunxi/linux/c/4b41d0ffa9d9 > [4/4] clk: sunxi-ng: sun55i-a523-r-ccu: Use P-only clocks for timers > https://git.kernel.org/sunxi/linux/c/b260db91603a After pushing things out, I realized that I based the topic branch on the wrong base commit. I rebased things and forced pushed, so the commit hashes here won't be correct. Rest assured that things have indeed been merged. > Best regards, > -- > Chen-Yu Tsai <wens@kernel.org> > >
© 2016 - 2026 Red Hat, Inc.