8fbb2c2c8a89a6afc87388b1ca98f918ea3493dd
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.2 / 0024-MIPS-lantiq-helper-functions-for-SoC-detection.patch
1 From 8b47a5997efb253459fa62acce9c52202cbec9da 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 24/70] 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 diff --git a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
16 index a5dc06a..0aa1f16 100644
17 --- a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
18 +++ b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
19 @@ -134,8 +134,20 @@ extern int ltq_gpio_mux_set(unsigned int pin, unsigned int mux);
20 #define LTQ_EIU_BASE_ADDR 0
21 #define LTQ_EBU_PCC_ISTAT 0
22
23 -#define ltq_is_ar9() 0
24 -#define ltq_is_vr9() 0
25 +static inline int ltq_is_ar9(void)
26 +{
27 + return 0;
28 +}
29 +
30 +static inline int ltq_is_vr9(void)
31 +{
32 + return 0;
33 +}
34 +
35 +static inline int ltq_is_falcon(void)
36 +{
37 + return 1;
38 +}
39
40 #endif /* CONFIG_SOC_FALCON */
41 #endif /* _LTQ_XWAY_H__ */
42 diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
43 index 6c5b705..45e480c 100644
44 --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
45 +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
46 @@ -164,5 +164,10 @@ static inline int ltq_is_vr9(void)
47 return (ltq_get_soc_type() == SOC_TYPE_VR9);
48 }
49
50 +static inline int ltq_is_falcon(void)
51 +{
52 + return 0;
53 +}
54 +
55 #endif /* CONFIG_SOC_TYPE_XWAY */
56 #endif /* _LTQ_XWAY_H__ */
57 --
58 1.7.7.1
59