Skip to content

Commit 1ef491e

Browse files
jk-ozlabsbebarino
authored andcommitted
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 15ed8ce. 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>
1 parent 1f15e04 commit 1ef491e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

drivers/clk/clk-ast2600.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@ static void __iomem *scu_g6_base;
7373
static u8 soc_rev;
7474

7575
/*
76+
* The majority of the clocks in the system are gates paired with a reset
77+
* controller that holds the IP in reset; this is represented by the @reset_idx
78+
* member of entries here.
79+
*
80+
* This borrows from clk_hw_register_gate, but registers two 'gates', one
81+
* to control the clock enable register and the other to control the reset
82+
* IP. This allows us to enforce the ordering:
83+
*
84+
* 1. Place IP in reset
85+
* 2. Enable clock
86+
* 3. Delay
87+
* 4. Release reset
88+
*
89+
* Consequently, if reset_idx is set, reset control is implicit: the clock
90+
* consumer does not need its own reset handling, as enabling the clock will
91+
* also deassert reset.
92+
*
93+
* There are some gates that do not have an associated reset; these are
94+
* handled by using -1 as the index for the reset, and the consumer must
95+
* explictly assert/deassert reset lines as required.
96+
*
7697
* Clocks marked with CLK_IS_CRITICAL:
7798
*
7899
* ref0 and ref1 are essential for the SoC to operate

0 commit comments

Comments
 (0)