Skip to content

Commit

Permalink
Fix serial broken-ness on PXA250
Browse files Browse the repository at this point in the history
PXA255 and 26x are the only PXA CPUs with HWUART. This patch prevents bogus
initialisation on other models.

Signed-off-by: Ian Molton <spyro@f2s.com>
  • Loading branch information
Ian Molton committed Jul 10, 2008
1 parent c0b8556 commit aa9ae8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/pxa25x.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static int __init pxa25x_init(void)
int i, ret = 0;

/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
if (cpu_is_pxa25x())
if (cpu_is_pxa255())
clks_register(&pxa25x_hwuart_clk, 1);

if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
Expand All @@ -317,7 +317,7 @@ static int __init pxa25x_init(void)
}

/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
if (cpu_is_pxa25x())
if (cpu_is_pxa255())
ret = platform_device_register(&pxa_device_hwuart);

clks_register(&gpio7_clk, 1);
Expand Down
12 changes: 12 additions & 0 deletions include/asm-arm/arch-pxa/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,20 @@
_id == 0x212; \
})

#define __cpu_is_pxa255(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x2d0; \
})

#define __cpu_is_pxa25x(id) \
({ \
unsigned int _id = (id) >> 4 & 0xfff; \
_id == 0x2d0 || _id == 0x290; \
})
#else
#define __cpu_is_pxa21x(id) (0)
#define __cpu_is_pxa255(id) (0)
#define __cpu_is_pxa25x(id) (0)
#endif

Expand Down Expand Up @@ -124,6 +131,11 @@
__cpu_is_pxa21x(read_cpuid_id()); \
})

#define cpu_is_pxa255() \
({ \
__cpu_is_pxa255(read_cpuid_id()); \
})

#define cpu_is_pxa25x() \
({ \
__cpu_is_pxa25x(read_cpuid_id()); \
Expand Down

0 comments on commit aa9ae8e

Please sign in to comment.