Re: [PATCH 1/2] dt-bindings: clock: sun50i-h616: export the APB2 clock

From: James Hilliard

Date: Fri Nov 20 2026 - 03:17:06 EST


On Thu, Nov 19, 2026 at 10:02 PM Chen-Yu Tsai <wens@xxxxxxxxxx> wrote:
>
> On Thu, Oct 22, 2026 at 8:09 AM James Hilliard
> <james.hilliard1@xxxxxxxxx> wrote:
> >
> > UARTs use APB2 as their baud clock. Expose its existing clock ID so device
>
> And how did you discover this? How did you differentiate this from it just
> using a combined clock from the UART bus gate, which is also driven from
> APB2?

I got APB2 from section 9.2.3.5.2 of the H616 manual, which says
“SCLK is usually APB2.” I took that to mean the UART needed a separate
reference to APB2 in DT.

> I'm not adding this simply because you want / need a baud clk that you
> can set the rate on. That's the wrong way to go about this. You should
> just add CLK_SET_RATE_PARENT to the bus gates. And making the bus clocks
> variable is a whole different discussion.

I tried your suggestion on H616. With CLK_SET_RATE_PARENT on the UART
bus gates, I can change the baud rate using just the existing gate
clock. So I don't think we need to export CLK_APB2 for the UARTs.

>
>
> ChenYu
>
> > trees can describe it separately from the per-port bus gate. Keep the
> > existing clock numbering.
> >
> > Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
> > ---
> > include/dt-bindings/clock/sun50i-h616-ccu.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/dt-bindings/clock/sun50i-h616-ccu.h b/include/dt-bindings/clock/sun50i-h616-ccu.h
> > index 6889405f9fec..e3318772c92d 100644
> > --- a/include/dt-bindings/clock/sun50i-h616-ccu.h
> > +++ b/include/dt-bindings/clock/sun50i-h616-ccu.h
> > @@ -11,6 +11,7 @@
> > #define CLK_CPUX 21
> >
> > #define CLK_APB1 26
> > +#define CLK_APB2 27
> >
> > #define CLK_DE 29
> > #define CLK_BUS_DE 30
> >
> > --
> > 2.53.0
> >
> >