[PATCH RFC 4/4] clk: spacemit: k3: add the clock tree
Yixun Lan
dlan at gentoo.org
Wed Dec 17 23:41:10 PST 2025
Hi Yao,
On 03:38 Thu 11 Dec , Yao Zi wrote:
> On Thu, Dec 11, 2025 at 09:19:44AM +0800, Yixun Lan wrote:
> > Add clock support to SpacemiT K3 SoC, the clock tree consist of several
> > blocks which are APBC, APBS, APMU, DCIU, MPUM.
> >
> > Signed-off-by: Yixun Lan <dlan at gentoo.org>
> > ---
> > drivers/clk/spacemit/Kconfig | 6 +
> > drivers/clk/spacemit/Makefile | 11 +-
> > drivers/clk/spacemit/ccu-k3.c | 1641 ++++++++++++++++++++++++++++++++++++++
> > include/soc/spacemit/ccu.h | 18 +
> > include/soc/spacemit/k1-syscon.h | 12 +-
> > include/soc/spacemit/k3-syscon.h | 273 +++++++
> > 6 files changed, 1947 insertions(+), 14 deletions(-)
>
...
> > +
> > + return devm_add_action_or_reset(dev, spacemit_adev_unregister, adev);
> > +}
>
> This piece of code looks quiet similar to types/functions with the same
> names in ccu-k1.c. If I'm correct, could we separate the logic into a
> new file and avoid duplication?
>
make sense, will do
>
> k3_ccu_probe looks quote similar to k1_ccu_probe, too. The only
> difference is that k3_ccu_probe checks for spacemit,k3-pll instead of
> spacemit,k1-pll.
>
> We could share most of the probe code by writing a SoC-independent probe
> function,
>
> int spacemit_ccu_probe(struct platform_dev *pdev,
> const char *pll_compatible);
>
> and calling it in ccu-k1.c and ccu-k3.c with different pll_compatible.
>
ditto
thanks
--
Yixun Lan (dlan)
More information about the linux-riscv
mailing list