aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter De Schrijver <[email protected]>2018-01-25 16:00:11 +0200
committerThierry Reding <[email protected]>2018-03-08 15:26:54 +0100
commitcbfc8d0a85aa72ad66227c69b08904143dc73bbb (patch)
treee960966788a66c4f6e9e4fc740d5de4c179b25b6
parent89e423c3f14c4a87d124e4a5437dc337b90b6f29 (diff)
clk: tegra: add fence_delay for clock registers
To ensure writes to clock registers have properly propagated through the clock control logic and state machines, we need to ensure the writes have been posted in the registers and wait for 1us after that. Signed-off-by: Peter De Schrijver <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Tested-by: Jon Hunter <[email protected]> Tested-by: Hector Martin <[email protected]> Tested-by: Andre Heider <[email protected]> Tested-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
-rw-r--r--drivers/clk/tegra/clk.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index 3b2763df51c2..ba7e20e6a82b 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -812,4 +812,11 @@ int tegra_pll_wait_for_lock(struct tegra_clk_pll *pll);
u16 tegra_pll_get_fixed_mdiv(struct clk_hw *hw, unsigned long input_rate);
int tegra_pll_p_div_to_hw(struct tegra_clk_pll *pll, u8 p_div);
+/* Combined read fence with delay */
+#define fence_udelay(delay, reg) \
+ do { \
+ readl(reg); \
+ udelay(delay); \
+ } while (0)
+
#endif /* TEGRA_CLK_H */