Devicetree
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Junhui Liu <junhui.liu@pigmoral.tech>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-riscv@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 4/6] reset: anlogic: add support for Anlogic DR1V90 resets
Date: Tue, 28 Oct 2025 09:17:57 +0100	[thread overview]
Message-ID: <36d28431c41ec9ed86487135d81e50b136ee0fae.camel@pengutronix.de> (raw)
In-Reply-To: <20251026-dr1v90-cru-v2-4-43b67acd6ddd@pigmoral.tech>

On So, 2025-10-26 at 22:00 +0800, Junhui Liu wrote:
> Add reset controller support for the Anlogic DR1V90 SoC, which is an
> auxiliary device associated with the Clock and Reset Unit (CRU). All
> resets are active-low.
> 
> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
> ---
>  drivers/reset/Kconfig        |   9 +++
>  drivers/reset/Makefile       |   1 +
>  drivers/reset/reset-dr1v90.c | 135 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 145 insertions(+)
> 
[...]
> diff --git a/drivers/reset/reset-dr1v90.c b/drivers/reset/reset-dr1v90.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..eb9064e3ab454fb39adc1ad426f458e39bb6169e
> --- /dev/null
> +++ b/drivers/reset/reset-dr1v90.c
> @@ -0,0 +1,135 @@
[...]
> +static const struct dr1v90_reset_map dr1v90_resets[] = {
> +	[RESET_OCM]		= { 0x74, BIT(4)},
[...]
> +	[RESET_NIC_HP0]		= { 0x78, BIT(0)},
[...]
> +	[RESET_USB0]		= { 0x7C, BIT(0)},

The registers 0x74, 0x78, and 0x7C are exclusively used for resets?

[...]
> +};
> +
> +static int dr1v90_reset_control_update(struct reset_controller_dev *rcdev,
> +				       unsigned long id, bool assert)
> +{
> +	struct dr1v90_reset_controller *rstc = to_dr1v90_reset_controller(rcdev);
> +	u32 offset = dr1v90_resets[id].offset;
> +	u32 bit = dr1v90_resets[id].bit;
> +	u32 reg;
> +
> +	reg = readl(rstc->base + offset);
> +	if (assert)
> +		reg &= ~bit;
> +	else
> +		reg |= bit;
> +	writel(reg, rstc->base + offset);

There should be a lock around this read-modify-write access.

regards
Philipp

  reply	other threads:[~2025-10-28  8:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-26 14:00 [PATCH v2 0/6] clk/reset: anlogic: add support for DR1V90 SoC Junhui Liu
2025-10-26 14:00 ` [PATCH v2 1/6] clk: correct clk_div_mask() return value for width == 32 Junhui Liu
2025-10-26 14:00 ` [PATCH v2 2/6] dt-bindings: clock: add Anlogic DR1V90 CRU Junhui Liu
2025-10-26 14:00 ` [PATCH v2 3/6] clk: anlogic: add cru support for Anlogic DR1V90 SoC Junhui Liu
2025-10-26 14:00 ` [PATCH v2 4/6] reset: anlogic: add support for Anlogic DR1V90 resets Junhui Liu
2025-10-28  8:17   ` Philipp Zabel [this message]
2025-10-28 11:29     ` Junhui Liu
2025-10-26 14:00 ` [PATCH v2 5/6] riscv: dts: anlogic: add clocks and CRU for DR1V90 Junhui Liu
2025-10-26 14:00 ` [PATCH v2 6/6] MAINTAINERS: Add entry for Anlogic DR1V90 SoC drivers Junhui Liu
2025-10-27  1:22 ` [PATCH v2 0/6] clk/reset: anlogic: add support for DR1V90 SoC Troy Mitchell
2025-10-27  1:39   ` Junhui Liu
2025-10-27  1:46     ` Troy Mitchell

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=36d28431c41ec9ed86487135d81e50b136ee0fae.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=junhui.liu@pigmoral.tech \
    --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=pjw@kernel.org \
    --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