ar71xx: update to 3.10.1
[openwrt/openwrt.git] / target / linux / ramips / patches-3.8 / 0030-MIPS-ralink-add-cpu-feature-overrides.h.patch
1 From 8a7cac5e324f044f3970d686d79e3489260f6d21 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Wed, 10 Apr 2013 09:19:07 +0200
4 Subject: [PATCH 30/79] MIPS: ralink: add cpu-feature-overrides.h
5
6 Add cpu-feature-overrides.h for RT288x, RT305x and RT3883.
7
8 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
9 Signed-off-by: John Crispin <blogic@openwrt.org>
10 Patchwork: http://patchwork.linux-mips.org/patch/5175/
11 ---
12 .../asm/mach-ralink/rt288x/cpu-feature-overrides.h | 56 ++++++++++++++++++++
13 .../asm/mach-ralink/rt305x/cpu-feature-overrides.h | 56 ++++++++++++++++++++
14 .../asm/mach-ralink/rt3883/cpu-feature-overrides.h | 55 +++++++++++++++++++
15 arch/mips/ralink/Platform | 3 ++
16 4 files changed, 170 insertions(+)
17 create mode 100644 arch/mips/include/asm/mach-ralink/rt288x/cpu-feature-overrides.h
18 create mode 100644 arch/mips/include/asm/mach-ralink/rt305x/cpu-feature-overrides.h
19 create mode 100644 arch/mips/include/asm/mach-ralink/rt3883/cpu-feature-overrides.h
20
21 diff --git a/arch/mips/include/asm/mach-ralink/rt288x/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ralink/rt288x/cpu-feature-overrides.h
22 new file mode 100644
23 index 0000000..72fc106
24 --- /dev/null
25 +++ b/arch/mips/include/asm/mach-ralink/rt288x/cpu-feature-overrides.h
26 @@ -0,0 +1,56 @@
27 +/*
28 + * Ralink RT288x specific CPU feature overrides
29 + *
30 + * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
31 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
32 + *
33 + * This file was derived from: include/asm-mips/cpu-features.h
34 + * Copyright (C) 2003, 2004 Ralf Baechle
35 + * Copyright (C) 2004 Maciej W. Rozycki
36 + *
37 + * This program is free software; you can redistribute it and/or modify it
38 + * under the terms of the GNU General Public License version 2 as published
39 + * by the Free Software Foundation.
40 + *
41 + */
42 +#ifndef _RT288X_CPU_FEATURE_OVERRIDES_H
43 +#define _RT288X_CPU_FEATURE_OVERRIDES_H
44 +
45 +#define cpu_has_tlb 1
46 +#define cpu_has_4kex 1
47 +#define cpu_has_3k_cache 0
48 +#define cpu_has_4k_cache 1
49 +#define cpu_has_tx39_cache 0
50 +#define cpu_has_sb1_cache 0
51 +#define cpu_has_fpu 0
52 +#define cpu_has_32fpr 0
53 +#define cpu_has_counter 1
54 +#define cpu_has_watch 1
55 +#define cpu_has_divec 1
56 +
57 +#define cpu_has_prefetch 1
58 +#define cpu_has_ejtag 1
59 +#define cpu_has_llsc 1
60 +
61 +#define cpu_has_mips16 1
62 +#define cpu_has_mdmx 0
63 +#define cpu_has_mips3d 0
64 +#define cpu_has_smartmips 0
65 +
66 +#define cpu_has_mips32r1 1
67 +#define cpu_has_mips32r2 1
68 +#define cpu_has_mips64r1 0
69 +#define cpu_has_mips64r2 0
70 +
71 +#define cpu_has_dsp 0
72 +#define cpu_has_mipsmt 0
73 +
74 +#define cpu_has_64bits 0
75 +#define cpu_has_64bit_zero_reg 0
76 +#define cpu_has_64bit_gp_regs 0
77 +#define cpu_has_64bit_addresses 0
78 +
79 +#define cpu_dcache_line_size() 16
80 +#define cpu_icache_line_size() 16
81 +
82 +#endif /* _RT288X_CPU_FEATURE_OVERRIDES_H */
83 diff --git a/arch/mips/include/asm/mach-ralink/rt305x/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ralink/rt305x/cpu-feature-overrides.h
84 new file mode 100644
85 index 0000000..917c286
86 --- /dev/null
87 +++ b/arch/mips/include/asm/mach-ralink/rt305x/cpu-feature-overrides.h
88 @@ -0,0 +1,56 @@
89 +/*
90 + * Ralink RT305x specific CPU feature overrides
91 + *
92 + * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
93 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
94 + *
95 + * This file was derived from: include/asm-mips/cpu-features.h
96 + * Copyright (C) 2003, 2004 Ralf Baechle
97 + * Copyright (C) 2004 Maciej W. Rozycki
98 + *
99 + * This program is free software; you can redistribute it and/or modify it
100 + * under the terms of the GNU General Public License version 2 as published
101 + * by the Free Software Foundation.
102 + *
103 + */
104 +#ifndef _RT305X_CPU_FEATURE_OVERRIDES_H
105 +#define _RT305X_CPU_FEATURE_OVERRIDES_H
106 +
107 +#define cpu_has_tlb 1
108 +#define cpu_has_4kex 1
109 +#define cpu_has_3k_cache 0
110 +#define cpu_has_4k_cache 1
111 +#define cpu_has_tx39_cache 0
112 +#define cpu_has_sb1_cache 0
113 +#define cpu_has_fpu 0
114 +#define cpu_has_32fpr 0
115 +#define cpu_has_counter 1
116 +#define cpu_has_watch 1
117 +#define cpu_has_divec 1
118 +
119 +#define cpu_has_prefetch 1
120 +#define cpu_has_ejtag 1
121 +#define cpu_has_llsc 1
122 +
123 +#define cpu_has_mips16 1
124 +#define cpu_has_mdmx 0
125 +#define cpu_has_mips3d 0
126 +#define cpu_has_smartmips 0
127 +
128 +#define cpu_has_mips32r1 1
129 +#define cpu_has_mips32r2 1
130 +#define cpu_has_mips64r1 0
131 +#define cpu_has_mips64r2 0
132 +
133 +#define cpu_has_dsp 1
134 +#define cpu_has_mipsmt 0
135 +
136 +#define cpu_has_64bits 0
137 +#define cpu_has_64bit_zero_reg 0
138 +#define cpu_has_64bit_gp_regs 0
139 +#define cpu_has_64bit_addresses 0
140 +
141 +#define cpu_dcache_line_size() 32
142 +#define cpu_icache_line_size() 32
143 +
144 +#endif /* _RT305X_CPU_FEATURE_OVERRIDES_H */
145 diff --git a/arch/mips/include/asm/mach-ralink/rt3883/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ralink/rt3883/cpu-feature-overrides.h
146 new file mode 100644
147 index 0000000..181fbf4
148 --- /dev/null
149 +++ b/arch/mips/include/asm/mach-ralink/rt3883/cpu-feature-overrides.h
150 @@ -0,0 +1,55 @@
151 +/*
152 + * Ralink RT3662/RT3883 specific CPU feature overrides
153 + *
154 + * Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org>
155 + *
156 + * This file was derived from: include/asm-mips/cpu-features.h
157 + * Copyright (C) 2003, 2004 Ralf Baechle
158 + * Copyright (C) 2004 Maciej W. Rozycki
159 + *
160 + * This program is free software; you can redistribute it and/or modify it
161 + * under the terms of the GNU General Public License version 2 as published
162 + * by the Free Software Foundation.
163 + *
164 + */
165 +#ifndef _RT3883_CPU_FEATURE_OVERRIDES_H
166 +#define _RT3883_CPU_FEATURE_OVERRIDES_H
167 +
168 +#define cpu_has_tlb 1
169 +#define cpu_has_4kex 1
170 +#define cpu_has_3k_cache 0
171 +#define cpu_has_4k_cache 1
172 +#define cpu_has_tx39_cache 0
173 +#define cpu_has_sb1_cache 0
174 +#define cpu_has_fpu 0
175 +#define cpu_has_32fpr 0
176 +#define cpu_has_counter 1
177 +#define cpu_has_watch 1
178 +#define cpu_has_divec 1
179 +
180 +#define cpu_has_prefetch 1
181 +#define cpu_has_ejtag 1
182 +#define cpu_has_llsc 1
183 +
184 +#define cpu_has_mips16 1
185 +#define cpu_has_mdmx 0
186 +#define cpu_has_mips3d 0
187 +#define cpu_has_smartmips 0
188 +
189 +#define cpu_has_mips32r1 1
190 +#define cpu_has_mips32r2 1
191 +#define cpu_has_mips64r1 0
192 +#define cpu_has_mips64r2 0
193 +
194 +#define cpu_has_dsp 1
195 +#define cpu_has_mipsmt 0
196 +
197 +#define cpu_has_64bits 0
198 +#define cpu_has_64bit_zero_reg 0
199 +#define cpu_has_64bit_gp_regs 0
200 +#define cpu_has_64bit_addresses 0
201 +
202 +#define cpu_dcache_line_size() 32
203 +#define cpu_icache_line_size() 32
204 +
205 +#endif /* _RT3883_CPU_FEATURE_OVERRIDES_H */
206 diff --git a/arch/mips/ralink/Platform b/arch/mips/ralink/Platform
207 index b2cbf16..cda4b66 100644
208 --- a/arch/mips/ralink/Platform
209 +++ b/arch/mips/ralink/Platform
210 @@ -8,16 +8,19 @@ cflags-$(CONFIG_RALINK) += -I$(srctree)/arch/mips/include/asm/mach-ralink
211 # Ralink RT288x
212 #
213 load-$(CONFIG_SOC_RT288X) += 0xffffffff88000000
214 +cflags-$(CONFIG_SOC_RT288X) += -I$(srctree)/arch/mips/include/asm/mach-ralink/rt288x
215
216 #
217 # Ralink RT305x
218 #
219 load-$(CONFIG_SOC_RT305X) += 0xffffffff80000000
220 +cflags-$(CONFIG_SOC_RT305X) += -I$(srctree)/arch/mips/include/asm/mach-ralink/rt305x
221
222 #
223 # Ralink RT3883
224 #
225 load-$(CONFIG_SOC_RT3883) += 0xffffffff80000000
226 +cflags-$(CONFIG_SOC_RT3883) += -I$(srctree)/arch/mips/include/asm/mach-ralink/rt3883
227
228 #
229 # Ralink MT7620
230 --
231 1.7.10.4
232