mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hiroshi Doyu <hdoyu@nvidia.com>
To: <linux-arm-kernel@lists.infradead.org>
Cc: <arnd@arndb.de>, <olof@lixom.net>, <santosh.shilimkar@ti.com>,
	Hiroshi Doyu <hdoyu@nvidia.com>,
	Russell King <linux@arm.linux.org.uk>,
	Stephen Warren <swarren@wwwdotorg.org>,
	<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Subject: [v3 1/2] ARM: Add API to detect SCU base address from CP15
Date: Tue, 22 Jan 2013 07:52:01 +0200	[thread overview]
Message-ID: <1358833924-24535-1-git-send-email-hdoyu@nvidia.com> (raw)

Add API to detect SCU base address from CP15.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
Update: Use Russell's suggestion,
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/143321.html
---
 arch/arm/include/asm/smp_scu.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d00..006f026 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -6,6 +6,23 @@
 #define SCU_PM_POWEROFF	3
 
 #ifndef __ASSEMBLER__
+
+#include <asm/cputype.h>
+
+static inline bool scu_a9_has_base(void)
+{
+	return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
+}
+
+static inline unsigned long scu_a9_get_base(void)
+{
+	unsigned long pa;
+
+	asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
+
+	return pa;
+}
+
 unsigned int scu_get_core_count(void __iomem *);
 void scu_enable(void __iomem *);
 int scu_power_mode(void __iomem *, unsigned int);
-- 
1.7.9.5


             reply	other threads:[~2013-01-22  5:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22  5:52 Hiroshi Doyu [this message]
2013-01-22  5:52 ` [v3 2/2] ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9 Hiroshi Doyu
2013-01-22  6:07   ` Santosh Shilimkar
2013-01-22 16:57     ` Stephen Warren
2013-01-22 17:04       ` Olof Johansson
2013-01-23  8:58         ` Santosh Shilimkar
2013-01-23 10:58           ` Hiroshi Doyu
2013-01-23 11:09             ` Santosh Shilimkar
2013-01-24  5:04           ` Stephen Warren
2013-01-24  5:56             ` Santosh Shilimkar
2013-01-24  6:42             ` Hiroshi Doyu
2013-01-28  7:18         ` Hiroshi Doyu
2013-01-28 14:47           ` Russell King - ARM Linux
2013-01-23  6:04       ` Hiroshi Doyu
2013-01-23  9:27         ` Hiroshi Doyu
2013-01-23 16:37           ` Stephen Warren
2013-01-22 18:35   ` Stephen Warren
2013-01-22 18:46     ` Will Deacon
2013-01-22 18:49       ` Stephen Warren
2013-01-28 18:03 ` [v3 1/2] ARM: Add API to detect SCU base address from CP15 Stephen Warren

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=1358833924-24535-1-git-send-email-hdoyu@nvidia.com \
    --to=hdoyu@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=santosh.shilimkar@ti.com \
    --cc=swarren@wwwdotorg.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

Powered by JetHome