All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ARM: Add API to detect SCU base address from CP15
@ 2013-01-18 10:59 Hiroshi Doyu
  2013-01-18 12:54 ` Santosh Shilimkar
       [not found] ` <1358506755-13705-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Hiroshi Doyu @ 2013-01-18 10:59 UTC (permalink / raw)
  To: linux-arm-kernel

Add API to detect SCU base address from CP15.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
NOTE:
This wasn't delivered to linux-arm-kernel at lists.infradead.org, resending....

For usage: http://patchwork.ozlabs.org/patch/212013/
---
 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..f619eef 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 phys_addr_t scu_get_base(void)
+{
+	phys_addr_t pa;
+	unsigned long part_number = read_cpuid_part_number();
+
+	switch (part_number) {
+	case ARM_CPU_PART_CORTEX_A9:
+		/* Get SCU physical base */
+		asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
+		return pa;
+	default:
+		return 0;
+	}
+}
 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] 12+ messages in thread

end of thread, other threads:[~2013-01-31 16:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 10:59 [PATCH 1/1] ARM: Add API to detect SCU base address from CP15 Hiroshi Doyu
2013-01-18 12:54 ` Santosh Shilimkar
2013-01-18 14:29   ` Hiroshi Doyu
2013-01-18 14:33     ` Santosh Shilimkar
     [not found] ` <1358506755-13705-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-18 16:53   ` Stephen Warren
2013-01-18 16:53     ` Stephen Warren
     [not found]     ` <50F97E19.8070607-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-01-21  7:42       ` [v2 " Hiroshi Doyu
2013-01-21  7:42         ` Hiroshi Doyu
     [not found]         ` <1358754175-15484-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-01-21 15:31           ` Russell King - ARM Linux
2013-01-21 15:31             ` Russell King - ARM Linux
2013-01-31 16:39           ` Hiroshi Doyu
2013-01-31 16:39             ` Hiroshi Doyu

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.