[PATCH 1/1] ARM: Add API to detect SCU base address from CP15
From: Hiroshi Doyu
Date: Mon Jan 14 2013 - 05:35:33 EST
Add API to detect SCU base address from CP15.
Signed-off-by: Hiroshi Doyu <hdoyu@xxxxxxxxxx>
---
arch/arm/include/asm/smp_scu.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 4eb6d00..6015ede 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -6,6 +6,20 @@
#define SCU_PM_POWEROFF 3
#ifndef __ASSEMBLER__
+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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/