From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
Russell King <linux@arm.linux.org.uk>,
Shawn Guo <shawn.guo@freescale.com>,
Sascha Hauer <kernel@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
linux-arm-kernel@lists.infradead.org,
Lior Amsalem <alior@marvell.com>,
Tawfik Bayouk <tawfik@marvell.com>,
Nadav Haklai <nadavh@marvell.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] ARM: smp_scu: Add the enable standby operation
Date: Fri, 27 Jun 2014 00:43:26 +0200 [thread overview]
Message-ID: <1403822608-31158-4-git-send-email-gregory.clement@free-electrons.com> (raw)
In-Reply-To: <1403822608-31158-1-git-send-email-gregory.clement@free-electrons.com>
Quoting the ARM datasheet: "When set, SCU CLK is turned off when all
processors are in WFI mode, there is no pending request on the ACP, if
implemented, and there is no remaining activity in the SCU.
When SCU CLK is off, ARREADYS, AWREADYS and WREADYS on the ACP are
forced LOW. The clock is turned on when any processor leaves WFI mode,
or if there is a new request on the ACP."
This feature is currently used by imx6 SoC. This patch add this
operation inside smp_scu in order to centralized all the access to SCU
in the same place.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
arch/arm/include/asm/smp_scu.h | 2 ++
arch/arm/kernel/smp_scu.c | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index d9650dce48c7..d9694aa7aaf7 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -27,6 +27,7 @@ static inline unsigned long scu_a9_get_base(void)
unsigned int scu_get_core_count(void __iomem *);
int scu_power_mode(void __iomem *, unsigned int);
void scu_spec_linefills_enable(void __iomem *scu_base, bool enable);
+void scu_standby_enable(void __iomem *scu_base, bool enable);
#else
static inline unsigned int scu_get_core_count(void __iomem *scu_base)
{
@@ -38,6 +39,7 @@ static inline int scu_power_mode(void __iomem *scu_base, unsigned int mode)
}
static inline void scu_spec_linefills_enable(void __iomem *scu_base,
bool enable) {}
+static inline void scu_standby_enable(void __iomem *scu_base, bool enable) {}
#endif
#if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU)
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index 3fd21a495028..de68dbf8fc66 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -19,6 +19,7 @@
#define SCU_CTRL 0x00
#define SCU_CTRL_ENABLE BIT(1)
#define SCU_CTRL_SPEC_LINEFILLS BIT(3)
+#define SCU_CTRL_STANDBY_ENABLE BIT(5)
#define SCU_CONFIG 0x04
#define SCU_CPU_STATUS 0x08
#define SCU_INVALIDATE 0x0c
@@ -110,3 +111,22 @@ void scu_spec_linefills_enable(void __iomem *scu_base, bool enable)
writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
}
+
+/*
+ * When enabled, SCU CLK is turned off when all processors are in WFI
+ * mode. The clock is turned on when any processor leaves WFI mode.
+ *
+ */
+void scu_standby_enable(void __iomem *scu_base, bool enable)
+{
+ u32 scu_ctrl;
+
+ scu_ctrl = readl_relaxed(scu_base + SCU_CTRL);
+
+ if (enable)
+ scu_ctrl |= SCU_CTRL_STANDBY_ENABLE;
+ else
+ scu_ctrl &= ~SCU_CTRL_STANDBY_ENABLE;
+
+ writel_relaxed(scu_ctrl, scu_base + SCU_CTRL);
+}
--
1.8.1.2
next prev parent reply other threads:[~2014-06-26 22:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 22:43 [PATCH 0/5] ARM: Centralize the access to the SCU register Gregory CLEMENT
2014-06-26 22:43 ` [PATCH 1/5] ARM: smp_scu: Used defined value instead of literal constant Gregory CLEMENT
2014-06-26 22:55 ` Gregory CLEMENT
2014-06-27 12:08 ` Jason Cooper
2014-06-26 22:43 ` [PATCH 2/5] ARM: smp_scu: Add the enable speculative linefills operation Gregory CLEMENT
2014-06-28 15:02 ` Thomas Petazzoni
2014-06-30 12:21 ` Gregory CLEMENT
2014-06-26 22:43 ` Gregory CLEMENT [this message]
2014-06-26 22:43 ` [PATCH 4/5] ARM: mvebu: Enable SCU Speculative linefills to L2 for Armada 375/38x Gregory CLEMENT
2014-06-28 15:04 ` Thomas Petazzoni
2014-06-26 22:43 ` [PATCH 5/5] ARM: imx6q: Use the new function scu_standby_enable() Gregory CLEMENT
2014-06-26 22:56 ` [PATCH 0/5] ARM: Centralize the access to the SCU register Rob Herring
2014-06-26 23:01 ` Gregory CLEMENT
2014-07-01 7:42 ` Shawn Guo
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=1403822608-31158-4-git-send-email-gregory.clement@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=ezequiel.garcia@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nadavh@marvell.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shawn.guo@freescale.com \
--cc=tawfik@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
/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
all inboxes | Powered by JetHome®