aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-05-06 05:35:42 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-05-17 05:44:40 -0400
commit6fae9cdafc92ae9958a3a45dd68205f72e3ad900 (patch)
tree5418c689d187b7559dbb5fd308d6431dafa77c4a
parent4477ca45fb368880bf77b10ed3b24b03f0cc82da (diff)
ARM: ARMv7-M: implement read_cpuid_ext
On v7-M the extended cpuid registers are not available from CP15 but they are memory mapped in the System Control Space. There isn't an equivalent available for CPUID_{CACHETYPE,TCM,TLBTYPE,MPIDR}. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/include/asm/cputype.h38
-rw-r--r--arch/arm/mm/proc-v7m.S2
2 files changed, 35 insertions, 5 deletions
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 4eb94a3add3c..ec635ff32f49 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -10,6 +10,22 @@
10#define CPUID_TLBTYPE 3 10#define CPUID_TLBTYPE 3
11#define CPUID_MPIDR 5 11#define CPUID_MPIDR 5
12 12
13#ifdef CONFIG_CPU_V7M
14#define CPUID_EXT_PFR0 0x40
15#define CPUID_EXT_PFR1 0x44
16#define CPUID_EXT_DFR0 0x48
17#define CPUID_EXT_AFR0 0x4c
18#define CPUID_EXT_MMFR0 0x50
19#define CPUID_EXT_MMFR1 0x54
20#define CPUID_EXT_MMFR2 0x58
21#define CPUID_EXT_MMFR3 0x5c
22#define CPUID_EXT_ISAR0 0x60
23#define CPUID_EXT_ISAR1 0x64
24#define CPUID_EXT_ISAR2 0x68
25#define CPUID_EXT_ISAR3 0x6c
26#define CPUID_EXT_ISAR4 0x70
27#define CPUID_EXT_ISAR5 0x74
28#else
13#define CPUID_EXT_PFR0 "c1, 0" 29#define CPUID_EXT_PFR0 "c1, 0"
14#define CPUID_EXT_PFR1 "c1, 1" 30#define CPUID_EXT_PFR1 "c1, 1"
15#define CPUID_EXT_DFR0 "c1, 2" 31#define CPUID_EXT_DFR0 "c1, 2"
@@ -24,6 +40,7 @@
24#define CPUID_EXT_ISAR3 "c2, 3" 40#define CPUID_EXT_ISAR3 "c2, 3"
25#define CPUID_EXT_ISAR4 "c2, 4" 41#define CPUID_EXT_ISAR4 "c2, 4"
26#define CPUID_EXT_ISAR5 "c2, 5" 42#define CPUID_EXT_ISAR5 "c2, 5"
43#endif
27 44
28#define MPIDR_SMP_BITMASK (0x3 << 30) 45#define MPIDR_SMP_BITMASK (0x3 << 30)
29#define MPIDR_SMP_VALUE (0x2 << 30) 46#define MPIDR_SMP_VALUE (0x2 << 30)
@@ -79,7 +96,23 @@ extern unsigned int processor_id;
79 __val; \ 96 __val; \
80 }) 97 })
81 98
82#else /* ifdef CONFIG_CPU_CP15 */ 99#elif defined(CONFIG_CPU_V7M)
100
101#include <asm/io.h>
102#include <asm/v7m.h>
103
104#define read_cpuid(reg) \
105 ({ \
106 WARN_ON_ONCE(1); \
107 0; \
108 })
109
110static inline unsigned int __attribute_const__ read_cpuid_ext(unsigned offset)
111{
112 return readl(BASEADDR_V7M_SCB + offset);
113}
114
115#else /* ifdef CONFIG_CPU_CP15 / elif defined (CONFIG_CPU_V7M) */
83 116
84/* 117/*
85 * read_cpuid and read_cpuid_ext should only ever be called on machines that 118 * read_cpuid and read_cpuid_ext should only ever be called on machines that
@@ -108,9 +141,6 @@ static inline unsigned int __attribute_const__ read_cpuid_id(void)
108 141
109#elif defined(CONFIG_CPU_V7M) 142#elif defined(CONFIG_CPU_V7M)
110 143
111#include <asm/io.h>
112#include <asm/v7m.h>
113
114static inline unsigned int __attribute_const__ read_cpuid_id(void) 144static inline unsigned int __attribute_const__ read_cpuid_id(void)
115{ 145{
116 return readl(BASEADDR_V7M_SCB + V7M_SCB_CPUID); 146 return readl(BASEADDR_V7M_SCB + V7M_SCB_CPUID);
diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S
index 000499cfceb3..0c93588fcb91 100644
--- a/arch/arm/mm/proc-v7m.S
+++ b/arch/arm/mm/proc-v7m.S
@@ -144,7 +144,7 @@ __v7m_proc_info:
144 b __v7m_setup @ proc_info_list.__cpu_flush 144 b __v7m_setup @ proc_info_list.__cpu_flush
145 .long cpu_arch_name 145 .long cpu_arch_name
146 .long cpu_elf_name 146 .long cpu_elf_name
147 .long HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_IDIVT 147 .long HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT
148 .long cpu_v7m_name 148 .long cpu_v7m_name
149 .long v7m_processor_functions @ proc_info_list.proc 149 .long v7m_processor_functions @ proc_info_list.proc
150 .long 0 @ proc_info_list.tlb 150 .long 0 @ proc_info_list.tlb