From: Philipp Zabel <p.zabel@pengutronix.de>
To: Alex Elder <elder@riscstar.com>,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
mturquette@baylibre.com, sboyd@kernel.org,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, alex@ghiti.fr, dlan@gentoo.org
Cc: heylenay@4d2.org, inochiama@outlook.com, guodong@riscstar.com,
devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
spacemit@lists.linux.dev, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 5/6] reset: spacemit: define three more CCUs
Date: Thu, 08 May 2025 11:11:35 +0200 [thread overview]
Message-ID: <a3febd3718397d7cf067e2ae637c2d633388f89f.camel@pengutronix.de> (raw)
In-Reply-To: <20250506210638.2800228-6-elder@riscstar.com>
On Di, 2025-05-06 at 16:06 -0500, Alex Elder wrote:
> Three more CCUs on the SpacemiT K1 SoC implement only resets, not clocks.
> Define these resets so they can be used.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> drivers/clk/spacemit/ccu-k1.c | 24 ++++++++++++++++
> drivers/reset/spacemit/k1.c | 54 +++++++++++++++++++++++++++++++++++
> include/soc/spacemit/ccu_k1.h | 30 +++++++++++++++++++
> 3 files changed, 108 insertions(+)
>
> diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c
> index 6b1845e899e5f..bddc83aff23cd 100644
> --- a/drivers/clk/spacemit/ccu-k1.c
> +++ b/drivers/clk/spacemit/ccu-k1.c
> @@ -939,6 +939,18 @@ static const struct spacemit_ccu_data k1_ccu_apmu_data = {
> .num = ARRAY_SIZE(k1_ccu_apmu_hws),
> };
>
> +static const struct spacemit_ccu_data k1_ccu_rcpu_data = {
The /* No clocks in the RCPU CCU */ comment belongs here, instead of in
the reset driver.
I wonder though, if these units have no clocks, why are they called
CCUs? It doesn't make much sense to me to add their compatibles to the
ccu-k1 driver only to load the reset aux driver. Why not just add a
platform driver next to the aux driver in reset-spacemit.ko for these
three?
> + .reset_name = "rcpu-reset",
> +};
> +
> +static const struct spacemit_ccu_data k1_ccu_rcpu2_data = {
> + .reset_name = "rcpu2-reset",
> +};
> +
> +static const struct spacemit_ccu_data k1_ccu_apbc2_data = {
> + .reset_name = "apbc2-reset",
> +};
> +
> static int spacemit_ccu_register(struct device *dev,
> struct regmap *regmap,
> struct regmap *lock_regmap,
> @@ -1106,6 +1118,18 @@ static const struct of_device_id of_k1_ccu_match[] = {
> .compatible = "spacemit,k1-syscon-apmu",
> .data = &k1_ccu_apmu_data,
> },
> + {
> + .compatible = "spacemit,k1-syscon-rcpu",
> + .data = &k1_ccu_rcpu_data,
> + },
> + {
> + .compatible = "spacemit,k1-syscon-rcpu2",
> + .data = &k1_ccu_rcpu2_data,
> + },
> + {
> + .compatible = "spacemit,k1-syscon-apbc2",
> + .data = &k1_ccu_apbc2_data,
> + },
> { }
> };
> MODULE_DEVICE_TABLE(of, of_k1_ccu_match);
> diff --git a/drivers/reset/spacemit/k1.c b/drivers/reset/spacemit/k1.c
> index 19a34f151b214..27434a1928261 100644
> --- a/drivers/reset/spacemit/k1.c
> +++ b/drivers/reset/spacemit/k1.c
> @@ -137,6 +137,57 @@ static const struct ccu_reset_controller_data k1_apmu_reset_data = {
> .count = ARRAY_SIZE(apmu_resets),
> };
>
> +static const struct ccu_reset_data rcpu_resets[] = {
> + [RESET_RCPU_SSP0] = RESET_DATA(RCPU_SSP0_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_I2C0] = RESET_DATA(RCPU_I2C0_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_UART1] = RESET_DATA(RCPU_UART1_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_IR] = RESET_DATA(RCPU_CAN_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_CAN] = RESET_DATA(RCPU_IR_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_UART0] = RESET_DATA(RCPU_UART0_CLK_RST, 0, BIT(0)),
> + [RESET_RCPU_HDMI_AUDIO] = RESET_DATA(AUDIO_HDMI_CLK_CTRL, 0, BIT(0)),
> +};
> +
> +static const struct ccu_reset_controller_data k1_rcpu_reset_data = {
> + /* No clocks in the RCPU CCU */
This information is not useful in the reset driver.
regards
Philipp
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-05-08 9:36 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 21:06 [PATCH v6 0/6] clk: spacemit: add K1 reset support Alex Elder
2025-05-06 21:06 ` [PATCH v6 1/6] dt-bindings: soc: spacemit: define spacemit,k1-ccu resets Alex Elder
2025-05-07 22:35 ` Yixun Lan
2025-05-08 2:19 ` Alex Elder
2025-05-08 12:02 ` Krzysztof Kozlowski
2025-05-08 12:17 ` Alex Elder
2025-05-08 12:36 ` Krzysztof Kozlowski
2025-05-08 12:42 ` Alex Elder
2025-05-08 12:40 ` Yixun Lan
2025-05-06 21:06 ` [PATCH v6 2/6] soc: spacemit: create a header for clock/reset registers Alex Elder
2025-05-08 4:16 ` Haylen Chu
2025-05-08 11:40 ` Alex Elder
2025-05-06 21:06 ` [PATCH v6 3/6] clk: spacemit: set up reset auxiliary devices Alex Elder
2025-05-08 4:09 ` kernel test robot
2025-05-08 4:46 ` Haylen Chu
2025-05-08 20:04 ` Alex Elder
2025-05-08 20:17 ` Alex Elder
2025-05-06 21:06 ` [PATCH v6 4/6] reset: spacemit: add support for SpacemiT CCU resets Alex Elder
2025-05-08 5:38 ` Haylen Chu
2025-05-08 11:55 ` Alex Elder
2025-05-08 12:47 ` Haylen Chu
2025-05-08 9:01 ` Philipp Zabel
2025-05-08 12:05 ` Alex Elder
2025-05-06 21:06 ` [PATCH v6 5/6] reset: spacemit: define three more CCUs Alex Elder
2025-05-08 9:11 ` Philipp Zabel [this message]
2025-05-08 12:29 ` Alex Elder
2025-05-06 21:06 ` [PATCH v6 6/6] riscv: dts: spacemit: add reset support for the K1 SoC Alex Elder
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=a3febd3718397d7cf067e2ae637c2d633388f89f.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=elder@riscstar.com \
--cc=guodong@riscstar.com \
--cc=heylenay@4d2.org \
--cc=inochiama@outlook.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=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox