linux-tegra.vger.kernel.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
       [not found] ` <1358833924-24535-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 20+ messages in thread
From: Hiroshi Doyu @ 2013-01-22  5:52 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: arnd-r2nGTMty4D4, olof-nZhT3qVonbNeoWH0uzbU5w,
	santosh.shilimkar-l0cyMroinI0, Hiroshi Doyu, Russell King,
	Stephen Warren, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

Add API to detect SCU base address from CP15.

Signed-off-by: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
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
     [not found]   ` <1358833924-24535-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-22  6:07     ` Santosh Shilimkar
     [not found]       ` <50FE2CA8.20100-l0cyMroinI0@public.gmane.org>
2013-01-22 16:57         ` Stephen Warren
     [not found]           ` <50FEC503.2080602-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-22 17:04             ` Olof Johansson
     [not found]               ` <CAOesGMgtaCkiv285TU_vbAokN5M2MrANQ9piDcyXu5YMmbQq3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-23  8:58                 ` Santosh Shilimkar
     [not found]                   ` <50FFA620.50008-l0cyMroinI0@public.gmane.org>
2013-01-23 10:58                     ` Hiroshi Doyu
     [not found]                       ` <20130123.125851.1450151123804323961.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-23 11:09                         ` Santosh Shilimkar
2013-01-24  5:04                     ` Stephen Warren
     [not found]                       ` <5100C0F7.9080101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
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
     [not found]               ` <20130123.112745.1104072242042163713.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-23 16:37                 ` Stephen Warren
2013-01-22 18:35   ` Stephen Warren
     [not found]     ` <50FEDC0B.7050604-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-22 18:46       ` Will Deacon
2013-01-22 18:49         ` Stephen Warren
     [not found] ` <1358833924-24535-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
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).