All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Yixun Lan <dlan@gentoo.org>, Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Haylen Chu <heylenay@4d2.org>, Guodong Xu <guodong@riscstar.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/5] clk: spacemit: k3: add the clock tree
Date: Fri, 26 Dec 2025 11:39:56 +0000	[thread overview]
Message-ID: <aU50DIe9qMneb0GT@pie> (raw)
In-Reply-To: <20251226-k3-clk-v3-5-602ce93bb6c3@gentoo.org>

On Fri, Dec 26, 2025 at 07:01:20PM +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@gentoo.org>
> ---
>  drivers/clk/spacemit/Kconfig      |    6 +
>  drivers/clk/spacemit/Makefile     |    3 +
>  drivers/clk/spacemit/ccu-k3.c     | 1482 +++++++++++++++++++++++++++++++++++++
>  drivers/clk/spacemit/ccu_common.c |    3 +-
>  4 files changed, 1493 insertions(+), 1 deletion(-)

...

> diff --git a/drivers/clk/spacemit/ccu_common.c b/drivers/clk/spacemit/ccu_common.c
> index f1a837aafb46..5132f73be68d 100644
> --- a/drivers/clk/spacemit/ccu_common.c
> +++ b/drivers/clk/spacemit/ccu_common.c
> @@ -144,7 +144,8 @@ int spacemit_ccu_probe(struct platform_device *pdev)
>  	 * are in APBS region. Reference to MPMU syscon is required to check PLL
>  	 * status.
>  	 */
> -	if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll")) {
> +	if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll") ||
> +		of_device_is_compatible(dev->of_node, "spacemit,k3-pll")) {

To me it's better to add a argument to spacemit_ccu_probe to specify the
compatible of PLL, so we don't need to modify ccu_common.c each time a
new SoC is introduced, and the condition won't be pretty long in the
future.

It isn't a serious issue for now, and I think this piece of code is
acceptable.

>  		struct device_node *mpmu = of_parse_phandle(dev->of_node,
>  							    "spacemit,mpmu", 0);
>  		if (!mpmu)

Regards,
Yao Zi

WARNING: multiple messages have this Message-ID (diff)
From: Yao Zi <me@ziyao.cc>
To: Yixun Lan <dlan@gentoo.org>, Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Haylen Chu <heylenay@4d2.org>, Guodong Xu <guodong@riscstar.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/5] clk: spacemit: k3: add the clock tree
Date: Fri, 26 Dec 2025 11:39:56 +0000	[thread overview]
Message-ID: <aU50DIe9qMneb0GT@pie> (raw)
In-Reply-To: <20251226-k3-clk-v3-5-602ce93bb6c3@gentoo.org>

On Fri, Dec 26, 2025 at 07:01:20PM +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@gentoo.org>
> ---
>  drivers/clk/spacemit/Kconfig      |    6 +
>  drivers/clk/spacemit/Makefile     |    3 +
>  drivers/clk/spacemit/ccu-k3.c     | 1482 +++++++++++++++++++++++++++++++++++++
>  drivers/clk/spacemit/ccu_common.c |    3 +-
>  4 files changed, 1493 insertions(+), 1 deletion(-)

...

> diff --git a/drivers/clk/spacemit/ccu_common.c b/drivers/clk/spacemit/ccu_common.c
> index f1a837aafb46..5132f73be68d 100644
> --- a/drivers/clk/spacemit/ccu_common.c
> +++ b/drivers/clk/spacemit/ccu_common.c
> @@ -144,7 +144,8 @@ int spacemit_ccu_probe(struct platform_device *pdev)
>  	 * are in APBS region. Reference to MPMU syscon is required to check PLL
>  	 * status.
>  	 */
> -	if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll")) {
> +	if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll") ||
> +		of_device_is_compatible(dev->of_node, "spacemit,k3-pll")) {

To me it's better to add a argument to spacemit_ccu_probe to specify the
compatible of PLL, so we don't need to modify ccu_common.c each time a
new SoC is introduced, and the condition won't be pretty long in the
future.

It isn't a serious issue for now, and I think this piece of code is
acceptable.

>  		struct device_node *mpmu = of_parse_phandle(dev->of_node,
>  							    "spacemit,mpmu", 0);
>  		if (!mpmu)

Regards,
Yao Zi

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-12-26 11:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-26 11:01 [PATCH v3 0/5] Add clock support for SpacemiT K3 SoC Yixun Lan
2025-12-26 11:01 ` Yixun Lan
2025-12-26 11:01 ` [PATCH v3 1/5] dt-bindings: soc: spacemit: add k3 syscon compatible Yixun Lan
2025-12-26 11:01   ` Yixun Lan
2025-12-27 11:25   ` Krzysztof Kozlowski
2025-12-27 11:25     ` Krzysztof Kozlowski
2025-12-27 18:52     ` Yixun Lan
2025-12-27 18:52       ` Yixun Lan
2025-12-26 11:01 ` [PATCH v3 2/5] clk: spacemit: ccu_mix: add inverted enable gate clock Yixun Lan
2025-12-26 11:01   ` Yixun Lan
2025-12-26 11:01 ` [PATCH v3 3/5] clk: spacemit: ccu_pll: add plla type clock Yixun Lan
2025-12-26 11:01   ` Yixun Lan
2025-12-26 11:01 ` [PATCH v3 4/5] clk: spacemit: k3: extract common header Yixun Lan
2025-12-26 11:01   ` Yixun Lan
2025-12-26 11:01 ` [PATCH v3 5/5] clk: spacemit: k3: add the clock tree Yixun Lan
2025-12-26 11:01   ` Yixun Lan
2025-12-26 11:39   ` Yao Zi [this message]
2025-12-26 11:39     ` Yao Zi
2025-12-26 12:18     ` Yixun Lan
2025-12-26 12:18       ` Yixun Lan

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=aU50DIe9qMneb0GT@pie \
    --to=me@ziyao.cc \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=guodong@riscstar.com \
    --cc=heylenay@4d2.org \
    --cc=inochiama@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=spacemit@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.