Fix serial broken-ness on PXA250
authorIan Molton <spyro@f2s.com>
Wed, 25 Jun 2008 21:17:16 +0000 (22:17 +0100)
committerIan Molton <spyro@f2s.com>
Thu, 10 Jul 2008 09:28:36 +0000 (10:28 +0100)
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>
arch/arm/mach-pxa/pxa25x.c
include/asm-arm/arch-pxa/hardware.h

index 4cd50e3005e90d6e538e3d8f412db149b8cc2169..90b441f5df5abc445559d8b3546c3cb1906c5615 100644 (file)
@@ -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()) {
@@ -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);
index d9af6dabc89956c35981bbc8736fa8da68edb015..b6a8317c2ec4e03eb0895c7389df3852d9781016 100644 (file)
                _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;   \
@@ -76,6 +82,7 @@
        })
 #else
 #define __cpu_is_pxa21x(id)    (0)
+#define __cpu_is_pxa255(id)    (0)
 #define __cpu_is_pxa25x(id)    (0)
 #endif
 
                __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());       \