From: Jeremy Kerr <jk@codeconstruct.com.au>
To: devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org,
linux-clk@vger.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Michael Turquette <mturquette@baylibre.com>,
Rob Herring <robh+dt@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
Dylan Hung <dylan_hung@aspeedtech.com>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>
Subject: [PATCH v5 5/6] clk: ast2600: Add comment about combined clock + reset handling
Date: Thu, 2 Mar 2023 08:58:33 +0800 [thread overview]
Message-ID: <20230302005834.13171-6-jk@codeconstruct.com.au> (raw)
In-Reply-To: <20230302005834.13171-1-jk@codeconstruct.com.au>
Add a little description about how reset lines can be implicit with
clock enable/disable. This is mostly based on the commit message
from the original submission in 15ed8ce5f8.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
---
drivers/clk/clk-ast2600.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c
index 09f26ab5f9af..a094a2601a37 100644
--- a/drivers/clk/clk-ast2600.c
+++ b/drivers/clk/clk-ast2600.c
@@ -73,6 +73,27 @@ static void __iomem *scu_g6_base;
static u8 soc_rev;
/*
+ * The majority of the clocks in the system are gates paired with a reset
+ * controller that holds the IP in reset; this is represented by the @reset_idx
+ * member of entries here.
+ *
+ * This borrows from clk_hw_register_gate, but registers two 'gates', one
+ * to control the clock enable register and the other to control the reset
+ * IP. This allows us to enforce the ordering:
+ *
+ * 1. Place IP in reset
+ * 2. Enable clock
+ * 3. Delay
+ * 4. Release reset
+ *
+ * Consequently, if reset_idx is set, reset control is implicit: the clock
+ * consumer does not need its own reset handling, as enabling the clock will
+ * also deassert reset.
+ *
+ * There are some gates that do not have an associated reset; these are
+ * handled by using -1 as the index for the reset, and the consumer must
+ * explictly assert/deassert reset lines as required.
+ *
* Clocks marked with CLK_IS_CRITICAL:
*
* ref0 and ref1 are essential for the SoC to operate
--
2.39.1
next prev parent reply other threads:[~2023-03-02 0:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 0:58 [PATCH v5 0/6] Add definitions for AST2600 i3c clocks Jeremy Kerr
2023-03-02 0:58 ` [PATCH v5 1/6] clk: ast2600: allow empty entries in aspeed_g6_gates Jeremy Kerr
2023-03-06 22:18 ` Stephen Boyd
2023-03-02 0:58 ` [PATCH v5 2/6] dt-bindings: clock: ast2600: Add top-level I3C clock Jeremy Kerr
2023-03-06 22:18 ` Stephen Boyd
2023-03-02 0:58 ` [PATCH v5 3/6] clk: ast2600: Add full configs for I3C clocks Jeremy Kerr
2023-03-02 3:23 ` Joel Stanley
2023-03-06 22:18 ` Stephen Boyd
2023-03-02 0:58 ` [PATCH v5 4/6] dt-bindings: clock: ast2600: remove IC36 & I3C7 clock definitions Jeremy Kerr
2023-03-06 22:18 ` Stephen Boyd
2023-03-02 0:58 ` Jeremy Kerr [this message]
2023-03-02 3:30 ` [PATCH v5 5/6] clk: ast2600: Add comment about combined clock + reset handling Joel Stanley
2023-03-06 22:18 ` Stephen Boyd
2023-03-02 0:58 ` [PATCH v5 6/6] dt-bindings: clock: ast2600: Expand comment on reset definitions Jeremy Kerr
2023-03-02 3:27 ` Joel Stanley
2023-03-02 7:35 ` Krzysztof Kozlowski
2023-03-06 22:19 ` Stephen Boyd
2023-03-02 4:37 ` [PATCH v5 0/6] Add definitions for AST2600 i3c clocks Joel Stanley
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=20230302005834.13171-6-jk@codeconstruct.com.au \
--to=jk@codeconstruct.com.au \
--cc=andrew@aj.id.au \
--cc=devicetree@vger.kernel.org \
--cc=dylan_hung@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).