From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: jonathanh@nvidia.com, linux-tegra@vger.kernel.org,
linux-clk@vger.kernel.org
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Subject: [PATCH v4 2/4] clk: tegra: add fence_delay for clock registers
Date: Thu, 25 Jan 2018 16:00:11 +0200 [thread overview]
Message-ID: <1516888813-32180-3-git-send-email-pdeschrijver@nvidia.com> (raw)
In-Reply-To: <1516888813-32180-1-git-send-email-pdeschrijver@nvidia.com>
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 <pdeschrijver@nvidia.com>
---
drivers/clk/tegra/clk.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index 3b2763d..ba7e20e 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -812,4 +812,11 @@ static inline struct clk *tegra_clk_register_emc(void __iomem *base,
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 */
--
1.9.1
next prev parent reply other threads:[~2018-01-25 14:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 14:00 [PATCH v4 0/4] MBIST work around (WAR) for Tegra210 Peter De Schrijver
[not found] ` <1516888813-32180-1-git-send-email-pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2018-01-25 14:00 ` [PATCH v4 1/4] clk: tegra: Add la clock " Peter De Schrijver
2018-01-25 14:00 ` [PATCH v4 3/4] clk: tegra: MBIST work around " Peter De Schrijver
2018-01-26 9:37 ` [PATCH v4 0/4] MBIST work around (WAR) " Jon Hunter
2018-02-12 16:17 ` Hector Martin 'marcan'
2018-01-25 14:00 ` Peter De Schrijver [this message]
2018-01-25 14:00 ` [PATCH v4 4/4] soc/tegra: pmc: MBIST work around " Peter De Schrijver
2018-02-12 12:05 ` [PATCH v4 0/4] MBIST work around (WAR) " Mikko Perttunen
[not found] ` <a40f0593-24d8-a91e-9f8c-f7eafc379591-/1wQRMveznE@public.gmane.org>
2018-02-12 12:34 ` Peter De Schrijver
2018-02-13 9:32 ` Mikko Perttunen
2018-02-12 16:09 ` Thierry Reding
2018-02-13 5:54 ` Andre Heider
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=1516888813-32180-3-git-send-email-pdeschrijver@nvidia.com \
--to=pdeschrijver@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-tegra@vger.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