Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa9ae8eb authored by Ian Molton's avatar Ian Molton
Browse files

Fix serial broken-ness on PXA250



PXA255 and 26x are the only PXA CPUs with HWUART. This patch prevents bogus
initialisation on other models.

Signed-off-by: default avatarIan Molton <spyro@f2s.com>
parent c0b8556f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -293,7 +293,7 @@ static int __init pxa25x_init(void)
	int i, ret = 0;
	int i, ret = 0;


	/* 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. */
	if (cpu_is_pxa25x())
	if (cpu_is_pxa255())
		clks_register(&pxa25x_hwuart_clk, 1);
		clks_register(&pxa25x_hwuart_clk, 1);


	if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
	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. */
	/* 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);
		ret = platform_device_register(&pxa_device_hwuart);


	clks_register(&gpio7_clk, 1);
	clks_register(&gpio7_clk, 1);
+12 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,12 @@
		_id == 0x212;				\
		_id == 0x212;				\
	})
	})


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

#define __cpu_is_pxa25x(id)				\
#define __cpu_is_pxa25x(id)				\
	({						\
	({						\
		unsigned int _id = (id) >> 4 & 0xfff;	\
		unsigned int _id = (id) >> 4 & 0xfff;	\
@@ -76,6 +82,7 @@
	})
	})
#else
#else
#define __cpu_is_pxa21x(id)	(0)
#define __cpu_is_pxa21x(id)	(0)
#define __cpu_is_pxa255(id)	(0)
#define __cpu_is_pxa25x(id)	(0)
#define __cpu_is_pxa25x(id)	(0)
#endif
#endif


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


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

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