linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [v3 1/2] ARM: Add API to detect SCU base address from CP15
@ 2013-01-22  5:52 Hiroshi Doyu
  2013-01-22  5:52 ` [v3 2/2] ARM: tegra: Skip scu_enable(scu_base) if not Cortex A9 Hiroshi Doyu
  2013-01-28 18:03 ` [v3 1/2] ARM: Add API to detect SCU base address from CP15 Stephen Warren
  0 siblings, 2 replies; 20+ messages in thread
From: Hiroshi Doyu @ 2013-01-22  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-01-28 18:03 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22  5:52 [v3 1/2] ARM: Add API to detect SCU base address from CP15 Hiroshi Doyu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).