aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-05-15 05:26:49 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-12 09:28:04 -0400
commitb23170c01f6e4ea043df7cd9486c2488e01f3d60 (patch)
tree3357533ac2d0a889628f9290e045af920e051974
parent7a2b94bc39915041304578188441f0f21aa5532a (diff)
[ARM] pxa: introduce cpu_is_pxaXXX macros
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-pxa/generic.c6
-rw-r--r--include/asm-arm/arch-pxa/hardware.h36
2 files changed, 38 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 64b08b744f9f..147b7c40d9f9 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -448,16 +448,14 @@ static struct platform_device *devices[] __initdata = {
448 448
449static int __init pxa_init(void) 449static int __init pxa_init(void)
450{ 450{
451 int cpuid, ret; 451 int ret;
452 452
453 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 453 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
454 if (ret) 454 if (ret)
455 return ret; 455 return ret;
456 456
457 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ 457 /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
458 cpuid = read_cpuid(CPUID_ID); 458 if (cpu_is_pxa25x())
459 if (((cpuid >> 4) & 0xfff) == 0x2d0 ||
460 ((cpuid >> 4) & 0xfff) == 0x290)
461 ret = platform_device_register(&hwuart_device); 459 ret = platform_device_register(&hwuart_device);
462 460
463 return ret; 461 return ret;
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index e2bdc2fbede1..386121746417 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -62,6 +62,42 @@
62 62
63#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
64 64
65#define __cpu_is_pxa21x(id) \
66 ({ \
67 unsigned int _id = (id) >> 4 & 0xf3f; \
68 _id == 0x212; \
69 })
70
71#define __cpu_is_pxa25x(id) \
72 ({ \
73 unsigned int _id = (id) >> 4 & 0xfff; \
74 _id == 0x2d0 || _id == 0x290; \
75 })
76
77#define __cpu_is_pxa27x(id) \
78 ({ \
79 unsigned int _id = (id) >> 4 & 0xfff; \
80 _id == 0x411; \
81 })
82
83#define cpu_is_pxa21x() \
84 ({ \
85 unsigned int id = read_cpuid(CPUID_ID); \
86 __cpu_is_pxa21x(id); \
87 })
88
89#define cpu_is_pxa25x() \
90 ({ \
91 unsigned int id = read_cpuid(CPUID_ID); \
92 __cpu_is_pxa25x(id); \
93 })
94
95#define cpu_is_pxa27x() \
96 ({ \
97 unsigned int id = read_cpuid(CPUID_ID); \
98 __cpu_is_pxa27x(id); \
99 })
100
65/* 101/*
66 * Handy routine to set GPIO alternate functions 102 * Handy routine to set GPIO alternate functions
67 */ 103 */