94394252f78236cf2faf5129f8a7d8171cf725f3
[openwrt/staging/florian.git] / target / linux / lantiq / patches-3.2 / 0023-MIPS-lantiq-helper-functions-for-SoC-detection.patch
1 From ba0e580e5af68726cea08990891fc4abf1cfcde4 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Tue, 21 Feb 2012 14:25:03 +0100
4 Subject: [PATCH 23/73] MIPS: lantiq: helper functions for SoC detection
5
6 Add additional functions for runtime soc detection. We need these for the
7 serial driver.
8
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 ---
11 .../include/asm/mach-lantiq/falcon/lantiq_soc.h | 16 ++++++++++++++--
12 .../mips/include/asm/mach-lantiq/xway/lantiq_soc.h | 5 +++++
13 2 files changed, 19 insertions(+), 2 deletions(-)
14
15 --- a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
16 +++ b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
17 @@ -134,8 +134,20 @@ extern int ltq_gpio_mux_set(unsigned int
18 #define LTQ_EIU_BASE_ADDR 0
19 #define LTQ_EBU_PCC_ISTAT 0
20
21 -#define ltq_is_ar9() 0
22 -#define ltq_is_vr9() 0
23 +static inline int ltq_is_ar9(void)
24 +{
25 + return 0;
26 +}
27 +
28 +static inline int ltq_is_vr9(void)
29 +{
30 + return 0;
31 +}
32 +
33 +static inline int ltq_is_falcon(void)
34 +{
35 + return 1;
36 +}
37
38 #endif /* CONFIG_SOC_FALCON */
39 #endif /* _LTQ_XWAY_H__ */
40 --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
41 +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
42 @@ -164,5 +164,10 @@ static inline int ltq_is_vr9(void)
43 return (ltq_get_soc_type() == SOC_TYPE_VR9);
44 }
45
46 +static inline int ltq_is_falcon(void)
47 +{
48 + return 0;
49 +}
50 +
51 #endif /* CONFIG_SOC_TYPE_XWAY */
52 #endif /* _LTQ_XWAY_H__ */