Commit b23170c0 authored by Russell King's avatar Russell King Committed by Russell King

[ARM] pxa: introduce cpu_is_pxaXXX macros

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 7a2b94bc
...@@ -448,16 +448,14 @@ static struct platform_device *devices[] __initdata = { ...@@ -448,16 +448,14 @@ static struct platform_device *devices[] __initdata = {
static int __init pxa_init(void) static int __init pxa_init(void)
{ {
int cpuid, ret; int ret;
ret = platform_add_devices(devices, ARRAY_SIZE(devices)); ret = platform_add_devices(devices, ARRAY_SIZE(devices));
if (ret) if (ret)
return ret; return ret;
/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
cpuid = read_cpuid(CPUID_ID); if (cpu_is_pxa25x())
if (((cpuid >> 4) & 0xfff) == 0x2d0 ||
((cpuid >> 4) & 0xfff) == 0x290)
ret = platform_device_register(&hwuart_device); ret = platform_device_register(&hwuart_device);
return ret; return ret;
......
...@@ -62,6 +62,42 @@ ...@@ -62,6 +62,42 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#define __cpu_is_pxa21x(id) \
({ \
unsigned int _id = (id) >> 4 & 0xf3f; \
_id == 0x212; \
})
#define __cpu_is_pxa25x(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x2d0 || _id == 0x290; \
})
#define __cpu_is_pxa27x(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x411; \
})
#define cpu_is_pxa21x() \
({ \
unsigned int id = read_cpuid(CPUID_ID); \
__cpu_is_pxa21x(id); \
})
#define cpu_is_pxa25x() \
({ \
unsigned int id = read_cpuid(CPUID_ID); \
__cpu_is_pxa25x(id); \
})
#define cpu_is_pxa27x() \
({ \
unsigned int id = read_cpuid(CPUID_ID); \
__cpu_is_pxa27x(id); \
})
/* /*
* Handy routine to set GPIO alternate functions * Handy routine to set GPIO alternate functions
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment