All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCH v3 3/5] clk: at91: sckc: optimize boot time
Date: Tue, 20 Sep 2016 22:58:31 +0200	[thread overview]
Message-ID: <20160920205833.19638-4-alexandre.belloni@free-electrons.com> (raw)
In-Reply-To: <20160920205833.19638-1-alexandre.belloni@free-electrons.com>

Assume that if the oscillator is enabled (OSC32EN bit is present), the
delay has already elapsed as the bootloader probably waited for the
oscillator to settle. This could waste up to 1.2s.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/clk/at91/sckc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 60d8225715a2..b1265f2cdae7 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -69,7 +69,7 @@ static int clk_slow_osc_prepare(struct clk_hw *hw)
 	void __iomem *sckcr = osc->sckcr;
 	u32 tmp = readl(sckcr);
 
-	if (tmp & AT91_SCKC_OSC32BYP)
+	if (tmp & (AT91_SCKC_OSC32BYP | AT91_SCKC_OSC32EN))
 		return 0;
 
 	writel(tmp | AT91_SCKC_OSC32EN, sckcr);
-- 
2.9.3

WARNING: multiple messages have this Message-ID (diff)
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/5] clk: at91: sckc: optimize boot time
Date: Tue, 20 Sep 2016 22:58:31 +0200	[thread overview]
Message-ID: <20160920205833.19638-4-alexandre.belloni@free-electrons.com> (raw)
In-Reply-To: <20160920205833.19638-1-alexandre.belloni@free-electrons.com>

Assume that if the oscillator is enabled (OSC32EN bit is present), the
delay has already elapsed as the bootloader probably waited for the
oscillator to settle. This could waste up to 1.2s.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/clk/at91/sckc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/at91/sckc.c b/drivers/clk/at91/sckc.c
index 60d8225715a2..b1265f2cdae7 100644
--- a/drivers/clk/at91/sckc.c
+++ b/drivers/clk/at91/sckc.c
@@ -69,7 +69,7 @@ static int clk_slow_osc_prepare(struct clk_hw *hw)
 	void __iomem *sckcr = osc->sckcr;
 	u32 tmp = readl(sckcr);
 
-	if (tmp & AT91_SCKC_OSC32BYP)
+	if (tmp & (AT91_SCKC_OSC32BYP | AT91_SCKC_OSC32EN))
 		return 0;
 
 	writel(tmp | AT91_SCKC_OSC32EN, sckcr);
-- 
2.9.3

  parent reply	other threads:[~2016-09-20 20:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 20:58 [PATCH v3 0/5] AT91: sckc improvements Alexandre Belloni
2016-09-20 20:58 ` Alexandre Belloni
2016-09-20 20:58 ` [PATCH v3 1/5] clk: at91: move slow clock controller clocks to sckc.c Alexandre Belloni
2016-09-20 20:58   ` Alexandre Belloni
2016-09-21  0:02   ` Stephen Boyd
2016-09-21  0:02     ` Stephen Boyd
2016-09-21  8:03     ` Alexandre Belloni
2016-09-21  8:03       ` Alexandre Belloni
2016-09-20 20:58 ` [PATCH v3 2/5] clk: at91: Add sama5d4 sckc support Alexandre Belloni
2016-09-20 20:58   ` Alexandre Belloni
2016-09-21  0:04   ` Stephen Boyd
2016-09-21  0:04     ` Stephen Boyd
2016-09-20 20:58 ` Alexandre Belloni [this message]
2016-09-20 20:58   ` [PATCH v3 3/5] clk: at91: sckc: optimize boot time Alexandre Belloni
2016-09-21  0:04   ` Stephen Boyd
2016-09-21  0:04     ` Stephen Boyd
2016-09-20 20:58 ` [PATCH v3 4/5] ARM: dts: at91: sama5d4: use proper sckc compatible Alexandre Belloni
2016-09-20 20:58   ` Alexandre Belloni
2016-09-20 20:58 ` [PATCH v3 5/5] ARM: dts: at91: sama5d2: use correct " Alexandre Belloni
2016-09-20 20:58   ` Alexandre Belloni

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=20160920205833.19638-4-alexandre.belloni@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.