Re: [PATCH v1 4/6] clk: starfive: Add JHB100 System-0 clock generator driver

From: Changhuang Liang

Date: Sun Nov 15 2026 - 21:09:44 EST


Hi, Jerome

Thanks for the review.

> > Add support for JHB100 System-0 clock generator (SYS0CRG).
> >
> > Signed-off-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> > ---
> > MAINTAINERS | 7 +
> > drivers/clk/starfive/Kconfig | 10 ++
> > drivers/clk/starfive/Makefile | 2 +
> > .../clk/starfive/clk-starfive-jhb100-sys0.c | 148 ++++++++++++++++++
> > 4 files changed, 167 insertions(+)
> > create mode 100644 drivers/clk/starfive/clk-starfive-jhb100-sys0.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS index
> > 93abbb315065..f66998e8eb64 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -26837,6 +26837,13 @@ F:
> Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yaml
> > F: drivers/phy/starfive/phy-jh7110-pcie.c
> > F: drivers/phy/starfive/phy-jh7110-usb.c
> >
> > +STARFIVE JHB100 CLOCK DRIVERS
> > +M: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> > +S: Supported
> > +F: Documentation/devicetree/bindings/clock/starfive,jhb1*.yaml
> > +F: drivers/clk/starfive/clk-starfive-jhb1*
> > +F: include/dt-bindings/clock/starfive,jhb1*.h
> > +
> > STARFIVE JHB100 EXTERNAL INTERRUPT CONTROLLER DRIVER
> > M: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> > S: Supported
> > diff --git a/drivers/clk/starfive/Kconfig
> > b/drivers/clk/starfive/Kconfig index 51716655554f..cb246ae12c08 100644
> > --- a/drivers/clk/starfive/Kconfig
> > +++ b/drivers/clk/starfive/Kconfig
> > @@ -72,3 +72,13 @@ config CLK_STARFIVE_JH7110_VOUT
> > help
> > Say yes here to support the Video-Output clock controller
> > on the StarFive JH7110 SoC.
> > +
> > +config CLK_STARFIVE_JHB100_SYS0
> > + bool "StarFive JHB100 system-0 clock support"
> > + depends on ARCH_STARFIVE || COMPILE_TEST
> > + select CLK_STARFIVE_JH71X0
> > + imply RESET_STARFIVE_JHB100
> > + default ARCH_STARFIVE
> > + help
> > + Say yes here to support the system-0 clock controller on the
> > + StarFive JHB100 SoC.
> > diff --git a/drivers/clk/starfive/Makefile
> > b/drivers/clk/starfive/Makefile index 199ac0f37a2f..d2ba83d7d02c
> > 100644
> > --- a/drivers/clk/starfive/Makefile
> > +++ b/drivers/clk/starfive/Makefile
> > @@ -10,3 +10,5 @@ obj-$(CONFIG_CLK_STARFIVE_JH7110_AON) +=
> clk-starfive-jh7110-aon.o
> > obj-$(CONFIG_CLK_STARFIVE_JH7110_STG) += clk-starfive-jh7110-stg.o
> > obj-$(CONFIG_CLK_STARFIVE_JH7110_ISP) += clk-starfive-jh7110-isp.o
> > obj-$(CONFIG_CLK_STARFIVE_JH7110_VOUT) +=
> clk-starfive-jh7110-vout.o
> > +
> > +obj-$(CONFIG_CLK_STARFIVE_JHB100_SYS0) +=
> clk-starfive-jhb100-sys0.o
> > diff --git a/drivers/clk/starfive/clk-starfive-jhb100-sys0.c
> > b/drivers/clk/starfive/clk-starfive-jhb100-sys0.c
> > new file mode 100644
> > index 000000000000..dd4d65f4e682
> > --- /dev/null
> > +++ b/drivers/clk/starfive/clk-starfive-jhb100-sys0.c
> > @@ -0,0 +1,148 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * StarFive JHB100 System-0 Clock Driver
> > + *
> > + * Copyright (C) 2024 StarFive Technology Co., Ltd.
> > + *
> > + * Author: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> > + *
> > + */
> > +
> > +#include <dt-bindings/clock/starfive,jhb100-crg.h>
> > +#include <linux/init.h>
> > +#include <linux/platform_device.h>
> > +
> > +#include "clk-starfive-jh71x0.h"
> > +
> > +/* external clocks */
> > +#define JHB100_SYS0CLK_OSC JH71X0_EXT_CLK(0)
> > +#define JHB100_SYS0CLK_PLL0 JH71X0_EXT_CLK(1)
> > +#define JHB100_SYS0CLK_PLL1 JH71X0_EXT_CLK(2)
> > +#define JHB100_SYS0CLK_PLL2 JH71X0_EXT_CLK(3)
> > +
> > +static const char * const jhb100_sys0_ext_clk[] = {
> > + "osc",
> > + "pll0",
> > + "pll1",
> > + "pll2",
> > +};
>
> These are the hackish part I was referring to.
>
> > +
> > +static const struct jh71x0_clk_data jhb100_sys0crg_clk_data[] = {
> > + /* bmcpcierp */
> > + JH71X0__DIV(JHB100_SYS0CLK_BMCPCIERP_NCNOC_MAIN,
> "bmcpcierp_ncnoc_main", 6,
> > + JHB100_SYS0CLK_PLL0),
> > + JH71X0__DIV(JHB100_SYS0CLK_BMCPCIERP_NCNOC_CFG,
> "bmcpcierp_ncnoc_cfg", 12,
> > + JHB100_SYS0CLK_PLL1),
> > + JH71X0__DIV(JHB100_SYS0CLK_PCIE_REF_CML, "pcie_ref_cml", 24,
> > + JHB100_SYS0CLK_PLL0),
> > + JH71X0_GATE(JHB100_SYS0CLK_BMCPCIERP_NCNOC_DATA_INIT,
> "bmcpcierp_ncnoc_data_init",
> > + 0, JHB100_SYS0CLK_BMCPCIERP_NCNOC_MAIN),
>
> I think the v6 that came before this had a bunch of critical clocks. None of
> those were critical after all ?
> You did test without passing clk_ignore_unused in the boot arguments ?

Yes, I tested it without passing clk_ignore_unused, and these should not become
critical clocks.

Best Regards,
Changhuang