bcm47xx: Refresh patches
[openwrt/staging/hauke.git] / target / linux / bcm47xx / patches-5.15 / 159-cpu_fixes.patch
1 --- a/arch/mips/include/asm/r4kcache.h
2 +++ b/arch/mips/include/asm/r4kcache.h
3 @@ -27,6 +27,38 @@
4 extern void (*r4k_blast_dcache)(void);
5 extern void (*r4k_blast_icache)(void);
6
7 +#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
8 +#include <asm/paccess.h>
9 +#include <linux/ssb/ssb.h>
10 +#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
11 +
12 +static inline unsigned long bcm4710_dummy_rreg(void)
13 +{
14 + return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
15 +}
16 +
17 +#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
18 +
19 +static inline unsigned long bcm4710_fill_tlb(void *addr)
20 +{
21 + return *(unsigned long *)addr;
22 +}
23 +
24 +#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
25 +
26 +static inline void bcm4710_protected_fill_tlb(void *addr)
27 +{
28 + unsigned long x;
29 + get_dbe(x, (unsigned long *)addr);;
30 +}
31 +
32 +#else
33 +#define BCM4710_DUMMY_RREG()
34 +
35 +#define BCM4710_FILL_TLB(addr)
36 +#define BCM4710_PROTECTED_FILL_TLB(addr)
37 +#endif
38 +
39 /*
40 * This macro return a properly sign-extended address suitable as base address
41 * for indexed cache operations. Two issues here:
42 @@ -60,6 +92,7 @@ static inline void flush_icache_line_ind
43
44 static inline void flush_dcache_line_indexed(unsigned long addr)
45 {
46 + BCM4710_DUMMY_RREG();
47 cache_op(Index_Writeback_Inv_D, addr);
48 }
49
50 @@ -83,11 +116,13 @@ static inline void flush_icache_line(uns
51
52 static inline void flush_dcache_line(unsigned long addr)
53 {
54 + BCM4710_DUMMY_RREG();
55 cache_op(Hit_Writeback_Inv_D, addr);
56 }
57
58 static inline void invalidate_dcache_line(unsigned long addr)
59 {
60 + BCM4710_DUMMY_RREG();
61 cache_op(Hit_Invalidate_D, addr);
62 }
63
64 @@ -160,6 +195,7 @@ static inline int protected_flush_icache
65 return protected_cache_op(Hit_Invalidate_I_Loongson2, addr);
66
67 default:
68 + BCM4710_DUMMY_RREG();
69 return protected_cache_op(Hit_Invalidate_I, addr);
70 }
71 }
72 @@ -172,6 +208,7 @@ static inline int protected_flush_icache
73 */
74 static inline int protected_writeback_dcache_line(unsigned long addr)
75 {
76 + BCM4710_DUMMY_RREG();
77 return protected_cache_op(Hit_Writeback_Inv_D, addr);
78 }
79
80 @@ -193,8 +230,51 @@ static inline void invalidate_tcache_pag
81 unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize))); \
82 } while (0)
83
84 +static inline void blast_dcache(void)
85 +{
86 + unsigned long start = KSEG0;
87 + unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways;
88 + unsigned long end = (start + dcache_size);
89 +
90 + do {
91 + BCM4710_DUMMY_RREG();
92 + cache_op(Index_Writeback_Inv_D, start);
93 + start += current_cpu_data.dcache.linesz;
94 + } while(start < end);
95 +}
96 +
97 +static inline void blast_dcache_page(unsigned long page)
98 +{
99 + unsigned long start = page;
100 + unsigned long end = start + PAGE_SIZE;
101 +
102 + BCM4710_FILL_TLB(start);
103 + do {
104 + BCM4710_DUMMY_RREG();
105 + cache_op(Hit_Writeback_Inv_D, start);
106 + start += current_cpu_data.dcache.linesz;
107 + } while(start < end);
108 +}
109 +
110 +static inline void blast_dcache_page_indexed(unsigned long page)
111 +{
112 + unsigned long start = page;
113 + unsigned long end = start + PAGE_SIZE;
114 + unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
115 + unsigned long ws_end = current_cpu_data.dcache.ways <<
116 + current_cpu_data.dcache.waybit;
117 + unsigned long ws, addr;
118 + for (ws = 0; ws < ws_end; ws += ws_inc) {
119 + start = page + ws;
120 + for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) {
121 + BCM4710_DUMMY_RREG();
122 + cache_op(Index_Writeback_Inv_D, addr);
123 + }
124 + }
125 +}
126 +
127 /* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
128 -#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \
129 +#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra, war) \
130 static inline void extra##blast_##pfx##cache##lsize(void) \
131 { \
132 unsigned long start = INDEX_BASE; \
133 @@ -204,6 +284,7 @@ static inline void extra##blast_##pfx##c
134 current_cpu_data.desc.waybit; \
135 unsigned long ws, addr; \
136 \
137 + war \
138 for (ws = 0; ws < ws_end; ws += ws_inc) \
139 for (addr = start; addr < end; addr += lsize * 32) \
140 cache_unroll(32, kernel_cache, indexop, \
141 @@ -215,6 +296,7 @@ static inline void extra##blast_##pfx##c
142 unsigned long start = page; \
143 unsigned long end = page + PAGE_SIZE; \
144 \
145 + war \
146 do { \
147 cache_unroll(32, kernel_cache, hitop, start, lsize); \
148 start += lsize * 32; \
149 @@ -231,32 +313,33 @@ static inline void extra##blast_##pfx##c
150 current_cpu_data.desc.waybit; \
151 unsigned long ws, addr; \
152 \
153 + war \
154 for (ws = 0; ws < ws_end; ws += ws_inc) \
155 for (addr = start; addr < end; addr += lsize * 32) \
156 cache_unroll(32, kernel_cache, indexop, \
157 addr | ws, lsize); \
158 }
159
160 -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, )
161 -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, )
162 -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, )
163 -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, )
164 -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, )
165 -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_)
166 -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, )
167 -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, )
168 -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, )
169 -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, )
170 -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, )
171 -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, )
172 -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, )
173 -
174 -__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, )
175 -__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, )
176 -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, )
177 -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, )
178 -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
179 -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
180 +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , )
181 +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);)
182 +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , )
183 +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , )
184 +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);)
185 +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);)
186 +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , )
187 +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , )
188 +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);)
189 +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , )
190 +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , )
191 +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , )
192 +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , )
193 +
194 +__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , )
195 +__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , )
196 +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , )
197 +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , )
198 +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , )
199 +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , )
200
201 #define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
202 static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
203 @@ -281,65 +364,36 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
204 __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
205
206 /* build blast_xxx_range, protected_blast_xxx_range */
207 -#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \
208 +#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2) \
209 static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
210 unsigned long end) \
211 { \
212 unsigned long lsize = cpu_##desc##_line_size(); \
213 - unsigned long lsize_2 = lsize * 2; \
214 - unsigned long lsize_3 = lsize * 3; \
215 - unsigned long lsize_4 = lsize * 4; \
216 - unsigned long lsize_5 = lsize * 5; \
217 - unsigned long lsize_6 = lsize * 6; \
218 - unsigned long lsize_7 = lsize * 7; \
219 - unsigned long lsize_8 = lsize * 8; \
220 unsigned long addr = start & ~(lsize - 1); \
221 - unsigned long aend = (end + lsize - 1) & ~(lsize - 1); \
222 - int lines = (aend - addr) / lsize; \
223 - \
224 - while (lines >= 8) { \
225 - prot##cache_op(hitop, addr); \
226 - prot##cache_op(hitop, addr + lsize); \
227 - prot##cache_op(hitop, addr + lsize_2); \
228 - prot##cache_op(hitop, addr + lsize_3); \
229 - prot##cache_op(hitop, addr + lsize_4); \
230 - prot##cache_op(hitop, addr + lsize_5); \
231 - prot##cache_op(hitop, addr + lsize_6); \
232 - prot##cache_op(hitop, addr + lsize_7); \
233 - addr += lsize_8; \
234 - lines -= 8; \
235 - } \
236 + unsigned long aend = (end - 1) & ~(lsize - 1); \
237 \
238 - if (lines & 0x4) { \
239 - prot##cache_op(hitop, addr); \
240 - prot##cache_op(hitop, addr + lsize); \
241 - prot##cache_op(hitop, addr + lsize_2); \
242 - prot##cache_op(hitop, addr + lsize_3); \
243 - addr += lsize_4; \
244 - } \
245 - \
246 - if (lines & 0x2) { \
247 - prot##cache_op(hitop, addr); \
248 - prot##cache_op(hitop, addr + lsize); \
249 - addr += lsize_2; \
250 - } \
251 + war \
252 \
253 - if (lines & 0x1) { \
254 + while (1) { \
255 + war2 \
256 prot##cache_op(hitop, addr); \
257 + if (addr == aend) \
258 + break; \
259 + addr += lsize; \
260 } \
261 }
262
263 -__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
264 -__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
265 -__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
266 +__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
267 +__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
268 +__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
269 __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
270 - protected_, loongson2_)
271 -__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
272 -__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
273 -__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
274 + protected_, loongson2_, , )
275 +__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
276 +__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , )
277 +__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , )
278 /* blast_inv_dcache_range */
279 -__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
280 -__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , )
281 +__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();)
282 +__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , )
283
284 /* Currently, this is very specific to Loongson-3 */
285 #define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize) \
286 --- a/arch/mips/include/asm/stackframe.h
287 +++ b/arch/mips/include/asm/stackframe.h
288 @@ -429,6 +429,10 @@
289 #else
290 .set push
291 .set arch=r4000
292 +#ifdef CONFIG_BCM47XX
293 + nop
294 + nop
295 +#endif
296 eret
297 .set pop
298 #endif
299 --- a/arch/mips/kernel/genex.S
300 +++ b/arch/mips/kernel/genex.S
301 @@ -22,6 +22,19 @@
302 #include <asm/war.h>
303 #include <asm/thread_info.h>
304
305 +#ifdef CONFIG_BCM47XX
306 +# ifdef eret
307 +# undef eret
308 +# endif
309 +# define eret \
310 + .set push; \
311 + .set noreorder; \
312 + nop; \
313 + nop; \
314 + eret; \
315 + .set pop;
316 +#endif
317 +
318 __INIT
319
320 /*
321 @@ -33,6 +46,9 @@
322 NESTED(except_vec3_generic, 0, sp)
323 .set push
324 .set noat
325 +#ifdef CONFIG_BCM47XX
326 + nop
327 +#endif
328 mfc0 k1, CP0_CAUSE
329 andi k1, k1, 0x7c
330 #ifdef CONFIG_64BIT
331 @@ -53,6 +69,9 @@ NESTED(except_vec3_r4000, 0, sp)
332 .set push
333 .set arch=r4000
334 .set noat
335 +#ifdef CONFIG_BCM47XX
336 + nop
337 +#endif
338 mfc0 k1, CP0_CAUSE
339 li k0, 31<<2
340 andi k1, k1, 0x7c
341 --- a/arch/mips/mm/c-r4k.c
342 +++ b/arch/mips/mm/c-r4k.c
343 @@ -38,6 +38,9 @@
344 #include <asm/traps.h>
345 #include <asm/mips-cps.h>
346
347 +/* For enabling BCM4710 cache workarounds */
348 +static int bcm4710 = 0;
349 +
350 /*
351 * Bits describing what cache ops an SMP callback function may perform.
352 *
353 @@ -190,6 +193,9 @@ static void r4k_blast_dcache_user_page_s
354 {
355 unsigned long dc_lsize = cpu_dcache_line_size();
356
357 + if (bcm4710)
358 + r4k_blast_dcache_page = blast_dcache_page;
359 + else
360 if (dc_lsize == 0)
361 r4k_blast_dcache_user_page = (void *)cache_noop;
362 else if (dc_lsize == 16)
363 @@ -208,6 +214,9 @@ static void r4k_blast_dcache_page_indexe
364 {
365 unsigned long dc_lsize = cpu_dcache_line_size();
366
367 + if (bcm4710)
368 + r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
369 + else
370 if (dc_lsize == 0)
371 r4k_blast_dcache_page_indexed = (void *)cache_noop;
372 else if (dc_lsize == 16)
373 @@ -227,6 +236,9 @@ static void r4k_blast_dcache_setup(void)
374 {
375 unsigned long dc_lsize = cpu_dcache_line_size();
376
377 + if (bcm4710)
378 + r4k_blast_dcache = blast_dcache;
379 + else
380 if (dc_lsize == 0)
381 r4k_blast_dcache = (void *)cache_noop;
382 else if (dc_lsize == 16)
383 @@ -1826,6 +1838,17 @@ static void coherency_setup(void)
384 * silly idea of putting something else there ...
385 */
386 switch (current_cpu_type()) {
387 + case CPU_BMIPS3300:
388 + {
389 + u32 cm;
390 + cm = read_c0_diag();
391 + /* Enable icache */
392 + cm |= (1 << 31);
393 + /* Enable dcache */
394 + cm |= (1 << 30);
395 + write_c0_diag(cm);
396 + }
397 + break;
398 case CPU_R4000PC:
399 case CPU_R4000SC:
400 case CPU_R4000MC:
401 @@ -1872,6 +1895,15 @@ void r4k_cache_init(void)
402 extern void build_copy_page(void);
403 struct cpuinfo_mips *c = &current_cpu_data;
404
405 + /* Check if special workarounds are required */
406 +#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
407 + if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) {
408 + printk("Enabling BCM4710A0 cache workarounds.\n");
409 + bcm4710 = 1;
410 + } else
411 +#endif
412 + bcm4710 = 0;
413 +
414 probe_pcache();
415 probe_vcache();
416 setup_scache();
417 @@ -1944,7 +1976,15 @@ void r4k_cache_init(void)
418 */
419 local_r4k___flush_cache_all(NULL);
420
421 +#ifdef CONFIG_BCM47XX
422 + {
423 + static void (*_coherency_setup)(void);
424 + _coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup);
425 + _coherency_setup();
426 + }
427 +#else
428 coherency_setup();
429 +#endif
430 board_cache_error_setup = r4k_cache_error_setup;
431
432 /*
433 --- a/arch/mips/mm/tlbex.c
434 +++ b/arch/mips/mm/tlbex.c
435 @@ -985,6 +985,9 @@ void build_get_pgde32(u32 **p, unsigned
436 uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
437 uasm_i_addu(p, ptr, tmp, ptr);
438 #else
439 +#ifdef CONFIG_BCM47XX
440 + uasm_i_nop(p);
441 +#endif
442 UASM_i_LA_mostly(p, ptr, pgdc);
443 #endif
444 uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
445 @@ -1347,6 +1350,9 @@ static void build_r4000_tlb_refill_handl
446 #ifdef CONFIG_64BIT
447 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
448 #else
449 +# ifdef CONFIG_BCM47XX
450 + uasm_i_nop(&p);
451 +# endif
452 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
453 #endif
454
455 @@ -1358,6 +1364,9 @@ static void build_r4000_tlb_refill_handl
456 build_update_entries(&p, K0, K1);
457 build_tlb_write_entry(&p, &l, &r, tlb_random);
458 uasm_l_leave(&l, p);
459 +#ifdef CONFIG_BCM47XX
460 + uasm_i_nop(&p);
461 +#endif
462 uasm_i_eret(&p); /* return from trap */
463 }
464 #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
465 @@ -2059,6 +2068,9 @@ build_r4000_tlbchange_handler_head(u32 *
466 #ifdef CONFIG_64BIT
467 build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
468 #else
469 +# ifdef CONFIG_BCM47XX
470 + uasm_i_nop(p);
471 +# endif
472 build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
473 #endif
474
475 @@ -2105,6 +2117,9 @@ build_r4000_tlbchange_handler_tail(u32 *
476 build_tlb_write_entry(p, l, r, tlb_indexed);
477 uasm_l_leave(l, *p);
478 build_restore_work_registers(p);
479 +#ifdef CONFIG_BCM47XX
480 + uasm_i_nop(p);
481 +#endif
482 uasm_i_eret(p); /* return from trap */
483
484 #ifdef CONFIG_64BIT