[PATCH 1/4] riscv: dts: spacemit: k3: add clock tree
Yixun Lan
dlan at kernel.org
Sat Mar 14 01:52:52 PDT 2026
Hi Samuel,
On 20:44 Fri 13 Mar , Samuel Holland wrote:
> Hi Yixun,
>
> On 2026-03-04 1:36 AM, Yixun Lan wrote:
> > Add clock support to SpacemiT K3 SoC, the clock tree consist of several
> > blocks which are APBC, APMU, DCIU, MPUM.
> >
> > Signed-off-by: Yixun Lan <dlan at kernel.org>
> > ---
> > arch/riscv/boot/dts/spacemit/k3.dtsi | 75 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 75 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> > index b69cf81b5d55..e3d7f3102fd5 100644
> > --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> > +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> > @@ -4,6 +4,7 @@
> > * Copyright (c) 2026 Guodong Xu <guodong at riscstar.com>
> > */
> >
> > +#include <dt-bindings/clock/spacemit,k3-clocks.h>
> > #include <dt-bindings/interrupt-controller/irq.h>
> >
> > /dts-v1/;
> > @@ -398,6 +399,36 @@ core3 {
> > };
> > };
> >
> > + clocks {
> > + vctcxo_1m: clock-1m {
> > + compatible = "fixed-clock";
> > + clock-frequency = <1000000>;
> > + clock-output-names = "vctcxo_1m";
> > + #clock-cells = <0>;
> > + };
> > +
> > + vctcxo_24m: clock-24m {
> > + compatible = "fixed-clock";
> > + clock-frequency = <24000000>;
> > + clock-output-names = "vctcxo_24m";
> > + #clock-cells = <0>;
> > + };
> > +
> > + vctcxo_3m: clock-3m {
> > + compatible = "fixed-clock";
> > + clock-frequency = <3000000>;
> > + clock-output-names = "vctcxo_3m";
> > + #clock-cells = <0>;
> > + };
> > +
> > + osc_32k: clock-32k {
> > + compatible = "fixed-clock";
> > + clock-frequency = <32000>;
> > + clock-output-names = "osc_32k";
> > + #clock-cells = <0>;
> > + };
>
> Are these clocks provided by SoC or by the board? Usually there's a crystal
> external to the SoC that provides the root of the clock tree. If these clocks
> are provided by the board, they (or at least the clock-frequency property)
> should be in the board DT, not the SoC dtsi.
>
It's true, as a quick check, osc_32k provided by P1 PMU, while vctcxo_24m is
a crystal, vctcxo_1m and vctcxo_3m are also marked as external in the clock
tree, but I would confirm them later..
I agree to move them out of SoC dtsi file - k3.dtsi, while due to all boards share
the same clock topology, what if I creating a k3-clock.dtsi and making it shared
between all board dts file? to avoid massive DTS duplication
> Also, the /clocks node is out of order.
>
I will move osc_32k before vtccxo_1m, assuming it's the problem you
refered to?
> Regards,
> Samuel
--
Yixun Lan (dlan)
More information about the linux-riscv
mailing list