From: Jerome Brunet <jbrunet@baylibre.com>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Brian Masney <bmasney@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Emil Renner Berthing <kernel@esmil.dk>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>,
Hal Feng <hal.feng@starfivetech.com>
Subject: Re: [PATCH v6 05/15] clk: starfive: Add JHB100 System-0 clock generator driver
Date: Tue, 13 Oct 2026 11:05:26 +0200 [thread overview]
Message-ID: <1jzewiezs9.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <ZQ4PR01MB1202DE124DED06ECEC948B89F29E2@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>
On mar. 13 oct. 2026 at 05:29, Changhuang Liang <changhuang.liang@starfivetech.com> wrote:
> Hi, Jerome
>
>> > Add support for JHB100 System-0 clock generator (SYS0CRG).
>> >
>> > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
>> > ---
>> > MAINTAINERS | 7 +
>> > drivers/clk/starfive/Kconfig | 10 ++
>> > drivers/clk/starfive/Makefile | 2 +
>> > .../clk/starfive/clk-starfive-jhb100-sys0.c | 156 ++++++++++++++++++
>> > 4 files changed, 175 insertions(+)
>> > create mode 100644 drivers/clk/starfive/clk-starfive-jhb100-sys0.c
>> >
>> > diff --git a/MAINTAINERS b/MAINTAINERS index
>> > 66d6c15f1dd2..dff8b819f83e 100644
>> > --- a/MAINTAINERS
>> > +++ b/MAINTAINERS
>> > @@ -26217,6 +26217,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@starfivetech.com>
>> > +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@starfivetech.com>
>> > S: Supported
>> > diff --git a/drivers/clk/starfive/Kconfig
>> > b/drivers/clk/starfive/Kconfig index 51716655554f..cd5b7754403e 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
>> > + select RESET_STARFIVE_JHB100 if RESET_CONTROLLER
>>
>> just imply RESET_STARFIVE_JHB100 ?
>>
>> It can be disabled if RESET_CONTROLLER is not set, so it is kind of weak
>> already.
>>
>> > + 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..edab54f228ad
>> > --- /dev/null
>> > +++ b/drivers/clk/starfive/clk-starfive-jhb100-sys0.c
>> > @@ -0,0 +1,156 @@
>> > +// SPDX-License-Identifier: GPL-2.0
>> > +/*
>> > + * StarFive JHB100 System-0 Clock Driver
>> > + *
>> > + * Copyright (C) 2024 StarFive Technology Co., Ltd.
>> > + *
>> > + * Author: Changhuang Liang <changhuang.liang@starfivetech.com>
>> > + *
>> > + */
>> > +
>> > +#include <dt-bindings/clock/starfive,jhb100-crg.h>
>> > +#include <linux/init.h>
>> > +#include <linux/platform_device.h>
>> > +
>> > +#include "clk-starfive-jh71x0.h"
>> > +
>> > +#define JHB100_SYS0CLK_NUM_CLKS
>> (JHB100_SYS0CLK_GPU1_NCNOC_INIT + 1)
>> > +
>> > +/* external clocks */
>> > +#define JHB100_SYS0CLK_OSC
>> (JHB100_SYS0CLK_NUM_CLKS + 0)
>> > +#define JHB100_SYS0CLK_PLL0
>> (JHB100_SYS0CLK_NUM_CLKS + 1)
>> > +#define JHB100_SYS0CLK_PLL1
>> (JHB100_SYS0CLK_NUM_CLKS + 2)
>> > +#define JHB100_SYS0CLK_PLL2
>> (JHB100_SYS0CLK_NUM_CLKS + 3)
>>
>> Does this mean that if the you ever find out you've forgot an internal clock
>> (which does happen fairly often) the whole external block will shift ?
>>
>
> Later, I will introduce the following macros to define the external clock, which can avoid this problem.
>
> #define JH71X0_EXT_CLK_FLAG BIT(15)
> #define JH71X0_EXT_CLK(_n) (JH71X0_EXT_CLK_FLAG | (_n))
>
hummm okay ... still seems hackish to me.
>
--
Jerome
next prev parent reply other threads:[~2026-10-13 9:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 12:33 [PATCH v6 00/15] Add basic clocks and resets for JHB100 SoC Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 01/15] clk: starfive: jh7110-sys: Fix memory leak in reset controller register Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 02/15] clk: starfive: jh71x0: Move reset controller registration to jh71x0 common code Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-08 12:33 ` [PATCH v6 03/15] reset: starfive: jh7110: Match auxiliary device names to jh71x0 clk driver Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-08 12:33 ` [PATCH v6 04/15] clk: starfive: jh71x0: Add generic CRG probe helper Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-08 12:33 ` [PATCH v6 05/15] clk: starfive: Add JHB100 System-0 clock generator driver Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-13 5:29 ` Changhuang Liang
2026-10-13 9:05 ` Jerome Brunet [this message]
2026-10-08 12:33 ` [PATCH v6 06/15] clk: starfive: Add JHB100 System-1 " Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-08 12:33 ` [PATCH v6 07/15] clk: starfive: Add JHB100 System-2 " Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-08 12:33 ` [PATCH v6 08/15] clk: starfive: Introduce idiv ops for inverted divider clocks Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-14 3:16 ` Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 09/15] clk: starfive: Expand the storage of clock parent index Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 10/15] clk: starfive: Add StarFive JHB100 Peripheral-0 clock driver Changhuang Liang
2026-10-12 10:21 ` Jerome Brunet
2026-10-14 2:13 ` Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 11/15] clk: starfive: Add StarFive JHB100 Peripheral-1 " Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 12/15] clk: starfive: Add StarFive JHB100 Peripheral-2 " Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 13/15] clk: starfive: Add StarFive JHB100 Peripheral-3 " Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 14/15] reset: starfive: jh71x0: Support discontiguous reset IDs Changhuang Liang
2026-10-08 12:33 ` [PATCH v6 15/15] reset: starfive: Add StarFive JHB100 reset driver Changhuang Liang
2026-10-12 10:21 ` [PATCH v6 00/15] Add basic clocks and resets for JHB100 SoC Jerome Brunet
2026-10-12 19:03 ` Conor Dooley
2026-10-12 19:16 ` Jerome Brunet
2026-10-13 5:15 ` Changhuang Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1jzewiezs9.fsf@starbuckisacylon.baylibre.com \
--to=jbrunet@baylibre.com \
--cc=bmasney@redhat.com \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=hal.feng@starfivetech.com \
--cc=jbrunet+clk@baylibre.com \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®