summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-ast2600.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2023-03-02 08:58:33 +0800
committerStephen Boyd <sboyd@kernel.org>2023-03-06 14:11:29 -0800
commit1ef491e29cdb26ca60898bc2c853a944d7fe1117 (patch)
treea92c76c5aae32342eda60e3d632388a6dd65d03d /drivers/clk/clk-ast2600.c
parent1f15e0486b6e29d7b327d3150215ddec31fca679 (diff)
downloadlinux-stable-1ef491e29cdb26ca60898bc2c853a944d7fe1117.tar.gz
linux-stable-1ef491e29cdb26ca60898bc2c853a944d7fe1117.tar.bz2
linux-stable-1ef491e29cdb26ca60898bc2c853a944d7fe1117.zip
clk: ast2600: Add comment about combined clock + reset handling
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> Link: https://lore.kernel.org/r/20230302005834.13171-6-jk@codeconstruct.com.au Reviewed-by: Joel Stanley <joel@jms.id.au> Tested-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-ast2600.c')
-rw-r--r--drivers/clk/clk-ast2600.c21
1 files changed, 21 insertions, 0 deletions
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