aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoreric miao <eric.y.miao@gmail.com>2007-09-11 22:13:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-10-12 16:15:28 -0400
commitcd272ab01141c908ccccb068e6d38b7fcd3240ac (patch)
treef08ce5ec02da04d15b647b3bc7541f6799cd373c /include
parentfa0b62513b7cb55b6764b794b63c6f583b26e813 (diff)
[ARM] pxa: add PXA3 cpu_is_xxx() macros
Extracted from patch by Eric Miao, this adds the cpu_is_xxx() macros for identifying PXA3 SoCs. Signed-off-by: eric miao <eric.y.miao@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-pxa/hardware.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 538a34e39e92..fc20d72d4844 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -80,6 +80,24 @@
80 _id == 0x411; \ 80 _id == 0x411; \
81 }) 81 })
82 82
83#define __cpu_is_pxa300(id) \
84 ({ \
85 unsigned int _id = (id) >> 4 & 0xfff; \
86 _id == 0x688; \
87 })
88
89#define __cpu_is_pxa310(id) \
90 ({ \
91 unsigned int _id = (id) >> 4 & 0xfff; \
92 _id == 0x689; \
93 })
94
95#define __cpu_is_pxa320(id) \
96 ({ \
97 unsigned int _id = (id) >> 4 & 0xfff; \
98 _id == 0x603 || _id == 0x682; \
99 })
100
83#define cpu_is_pxa21x() \ 101#define cpu_is_pxa21x() \
84 ({ \ 102 ({ \
85 unsigned int id = read_cpuid(CPUID_ID); \ 103 unsigned int id = read_cpuid(CPUID_ID); \
@@ -98,6 +116,53 @@
98 __cpu_is_pxa27x(id); \ 116 __cpu_is_pxa27x(id); \
99 }) 117 })
100 118
119#define cpu_is_pxa300() \
120 ({ \
121 unsigned int id = read_cpuid(CPUID_ID); \
122 __cpu_is_pxa300(id); \
123 })
124
125#define cpu_is_pxa310() \
126 ({ \
127 unsigned int id = read_cpuid(CPUID_ID); \
128 __cpu_is_pxa310(id); \
129 })
130
131#define cpu_is_pxa320() \
132 ({ \
133 unsigned int id = read_cpuid(CPUID_ID); \
134 __cpu_is_pxa320(id); \
135 })
136
137/*
138 * CPUID Core Generation Bit
139 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
140 * == 0x3 for pxa300/pxa310/pxa320
141 */
142#define __cpu_is_pxa2xx(id) \
143 ({ \
144 unsigned int _id = (id) >> 13 & 0x7; \
145 _id <= 0x2; \
146 })
147
148#define __cpu_is_pxa3xx(id) \
149 ({ \
150 unsigned int _id = (id) >> 13 & 0x7; \
151 _id == 0x3; \
152 })
153
154#define cpu_is_pxa2xx() \
155 ({ \
156 unsigned int id = read_cpuid(CPUID_ID); \
157 __cpu_is_pxa2xx(id); \
158 })
159
160#define cpu_is_pxa3xx() \
161 ({ \
162 unsigned int id = read_cpuid(CPUID_ID); \
163 __cpu_is_pxa3xx(id); \
164 })
165
101/* 166/*
102 * Handy routine to set GPIO alternate functions 167 * Handy routine to set GPIO alternate functions
103 */ 168 */