159-cpu_fixes.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. --- a/arch/mips/include/asm/r4kcache.h
  2. +++ b/arch/mips/include/asm/r4kcache.h
  3. @@ -25,6 +25,38 @@
  4. extern void (*r4k_blast_dcache)(void);
  5. extern void (*r4k_blast_icache)(void);
  6. +#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
  7. +#include <asm/paccess.h>
  8. +#include <linux/ssb/ssb.h>
  9. +#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
  10. +
  11. +static inline unsigned long bcm4710_dummy_rreg(void)
  12. +{
  13. + return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
  14. +}
  15. +
  16. +#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
  17. +
  18. +static inline unsigned long bcm4710_fill_tlb(void *addr)
  19. +{
  20. + return *(unsigned long *)addr;
  21. +}
  22. +
  23. +#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
  24. +
  25. +static inline void bcm4710_protected_fill_tlb(void *addr)
  26. +{
  27. + unsigned long x;
  28. + get_dbe(x, (unsigned long *)addr);;
  29. +}
  30. +
  31. +#else
  32. +#define BCM4710_DUMMY_RREG()
  33. +
  34. +#define BCM4710_FILL_TLB(addr)
  35. +#define BCM4710_PROTECTED_FILL_TLB(addr)
  36. +#endif
  37. +
  38. /*
  39. * This macro return a properly sign-extended address suitable as base address
  40. * for indexed cache operations. Two issues here:
  41. @@ -98,6 +130,7 @@ static inline void flush_icache_line_ind
  42. static inline void flush_dcache_line_indexed(unsigned long addr)
  43. {
  44. __dflush_prologue
  45. + BCM4710_DUMMY_RREG();
  46. cache_op(Index_Writeback_Inv_D, addr);
  47. __dflush_epilogue
  48. }
  49. @@ -125,6 +158,7 @@ static inline void flush_icache_line(uns
  50. static inline void flush_dcache_line(unsigned long addr)
  51. {
  52. __dflush_prologue
  53. + BCM4710_DUMMY_RREG();
  54. cache_op(Hit_Writeback_Inv_D, addr);
  55. __dflush_epilogue
  56. }
  57. @@ -132,6 +166,7 @@ static inline void flush_dcache_line(uns
  58. static inline void invalidate_dcache_line(unsigned long addr)
  59. {
  60. __dflush_prologue
  61. + BCM4710_DUMMY_RREG();
  62. cache_op(Hit_Invalidate_D, addr);
  63. __dflush_epilogue
  64. }
  65. @@ -187,6 +222,7 @@ static inline void protected_flush_icach
  66. #ifdef CONFIG_EVA
  67. protected_cachee_op(Hit_Invalidate_I, addr);
  68. #else
  69. + BCM4710_DUMMY_RREG();
  70. protected_cache_op(Hit_Invalidate_I, addr);
  71. #endif
  72. break;
  73. @@ -201,6 +237,7 @@ static inline void protected_flush_icach
  74. */
  75. static inline void protected_writeback_dcache_line(unsigned long addr)
  76. {
  77. + BCM4710_DUMMY_RREG();
  78. #ifdef CONFIG_EVA
  79. protected_cachee_op(Hit_Writeback_Inv_D, addr);
  80. #else
  81. @@ -554,8 +591,51 @@ static inline void invalidate_tcache_pag
  82. : "r" (base), \
  83. "i" (op));
  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. @@ -567,6 +647,7 @@ static inline void extra##blast_##pfx##c
  134. \
  135. __##pfx##flush_prologue \
  136. \
  137. + war \
  138. for (ws = 0; ws < ws_end; ws += ws_inc) \
  139. for (addr = start; addr < end; addr += lsize * 32) \
  140. cache##lsize##_unroll32(addr|ws, indexop); \
  141. @@ -581,6 +662,7 @@ static inline void extra##blast_##pfx##c
  142. \
  143. __##pfx##flush_prologue \
  144. \
  145. + war \
  146. do { \
  147. cache##lsize##_unroll32(start, hitop); \
  148. start += lsize * 32; \
  149. @@ -599,6 +681,8 @@ static inline void extra##blast_##pfx##c
  150. current_cpu_data.desc.waybit; \
  151. unsigned long ws, addr; \
  152. \
  153. + war \
  154. + \
  155. __##pfx##flush_prologue \
  156. \
  157. for (ws = 0; ws < ws_end; ws += ws_inc) \
  158. @@ -608,26 +692,26 @@ static inline void extra##blast_##pfx##c
  159. __##pfx##flush_epilogue \
  160. }
  161. -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, )
  162. -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, )
  163. -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, )
  164. -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, )
  165. -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, )
  166. -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_)
  167. -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, )
  168. -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, )
  169. -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, )
  170. -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, )
  171. -__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, )
  172. -__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, )
  173. -__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, )
  174. -
  175. -__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, )
  176. -__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, )
  177. -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, )
  178. -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, )
  179. -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
  180. -__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
  181. +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , )
  182. +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);)
  183. +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , )
  184. +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , )
  185. +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);)
  186. +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);)
  187. +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , )
  188. +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , )
  189. +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);)
  190. +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , )
  191. +__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , )
  192. +__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , )
  193. +__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , )
  194. +
  195. +__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , )
  196. +__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , )
  197. +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , )
  198. +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , )
  199. +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , )
  200. +__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , )
  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. @@ -656,17 +740,19 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
  204. __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
  205. /* build blast_xxx_range, protected_blast_xxx_range */
  206. -#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \
  207. +#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2) \
  208. static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
  209. unsigned long end) \
  210. { \
  211. unsigned long lsize = cpu_##desc##_line_size(); \
  212. unsigned long addr = start & ~(lsize - 1); \
  213. unsigned long aend = (end - 1) & ~(lsize - 1); \
  214. + war \
  215. \
  216. __##pfx##flush_prologue \
  217. \
  218. while (1) { \
  219. + war2 \
  220. prot##cache_op(hitop, addr); \
  221. if (addr == aend) \
  222. break; \
  223. @@ -678,8 +764,8 @@ static inline void prot##extra##blast_##
  224. #ifndef CONFIG_EVA
  225. -__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
  226. -__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
  227. +__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
  228. +__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
  229. #else
  230. @@ -716,14 +802,14 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache
  231. __BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I)
  232. #endif
  233. -__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
  234. +__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
  235. __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
  236. - protected_, loongson2_)
  237. -__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
  238. -__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
  239. -__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
  240. + protected_, loongson2_, , )
  241. +__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
  242. +__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , )
  243. +__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , )
  244. /* blast_inv_dcache_range */
  245. -__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
  246. -__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , )
  247. +__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();)
  248. +__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , )
  249. #endif /* _ASM_R4KCACHE_H */
  250. --- a/arch/mips/include/asm/stackframe.h
  251. +++ b/arch/mips/include/asm/stackframe.h
  252. @@ -365,6 +365,10 @@
  253. .macro RESTORE_SP_AND_RET
  254. LONG_L sp, PT_R29(sp)
  255. .set arch=r4000
  256. +#ifdef CONFIG_BCM47XX
  257. + nop
  258. + nop
  259. +#endif
  260. eret
  261. .set mips0
  262. .endm
  263. --- a/arch/mips/kernel/genex.S
  264. +++ b/arch/mips/kernel/genex.S
  265. @@ -21,6 +21,19 @@
  266. #include <asm/war.h>
  267. #include <asm/thread_info.h>
  268. +#ifdef CONFIG_BCM47XX
  269. +# ifdef eret
  270. +# undef eret
  271. +# endif
  272. +# define eret \
  273. + .set push; \
  274. + .set noreorder; \
  275. + nop; \
  276. + nop; \
  277. + eret; \
  278. + .set pop;
  279. +#endif
  280. +
  281. __INIT
  282. /*
  283. @@ -32,6 +45,9 @@
  284. NESTED(except_vec3_generic, 0, sp)
  285. .set push
  286. .set noat
  287. +#ifdef CONFIG_BCM47XX
  288. + nop
  289. +#endif
  290. #if R5432_CP0_INTERRUPT_WAR
  291. mfc0 k0, CP0_INDEX
  292. #endif
  293. @@ -55,6 +71,9 @@ NESTED(except_vec3_r4000, 0, sp)
  294. .set push
  295. .set arch=r4000
  296. .set noat
  297. +#ifdef CONFIG_BCM47XX
  298. + nop
  299. +#endif
  300. mfc0 k1, CP0_CAUSE
  301. li k0, 31<<2
  302. andi k1, k1, 0x7c
  303. --- a/arch/mips/mm/c-r4k.c
  304. +++ b/arch/mips/mm/c-r4k.c
  305. @@ -39,6 +39,9 @@
  306. #include <asm/dma-coherence.h>
  307. #include <asm/mips-cm.h>
  308. +/* For enabling BCM4710 cache workarounds */
  309. +static int bcm4710 = 0;
  310. +
  311. /*
  312. * Bits describing what cache ops an IPI callback function may perform.
  313. *
  314. @@ -202,6 +205,9 @@ static void r4k_blast_dcache_user_page_s
  315. {
  316. unsigned long dc_lsize = cpu_dcache_line_size();
  317. + if (bcm4710)
  318. + r4k_blast_dcache_page = blast_dcache_page;
  319. + else
  320. if (dc_lsize == 0)
  321. r4k_blast_dcache_user_page = (void *)cache_noop;
  322. else if (dc_lsize == 16)
  323. @@ -220,6 +226,9 @@ static void r4k_blast_dcache_page_indexe
  324. {
  325. unsigned long dc_lsize = cpu_dcache_line_size();
  326. + if (bcm4710)
  327. + r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
  328. + else
  329. if (dc_lsize == 0)
  330. r4k_blast_dcache_page_indexed = (void *)cache_noop;
  331. else if (dc_lsize == 16)
  332. @@ -239,6 +248,9 @@ static void r4k_blast_dcache_setup(void)
  333. {
  334. unsigned long dc_lsize = cpu_dcache_line_size();
  335. + if (bcm4710)
  336. + r4k_blast_dcache = blast_dcache;
  337. + else
  338. if (dc_lsize == 0)
  339. r4k_blast_dcache = (void *)cache_noop;
  340. else if (dc_lsize == 16)
  341. @@ -882,6 +894,8 @@ static void local_r4k_flush_cache_sigtra
  342. unsigned long addr = (unsigned long) arg;
  343. R4600_HIT_CACHEOP_WAR_IMPL;
  344. + BCM4710_PROTECTED_FILL_TLB(addr);
  345. + BCM4710_PROTECTED_FILL_TLB(addr + 4);
  346. if (dc_lsize)
  347. protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
  348. if (!cpu_icache_snoops_remote_store && scache_size)
  349. @@ -1706,6 +1720,17 @@ static void coherency_setup(void)
  350. * silly idea of putting something else there ...
  351. */
  352. switch (current_cpu_type()) {
  353. + case CPU_BMIPS3300:
  354. + {
  355. + u32 cm;
  356. + cm = read_c0_diag();
  357. + /* Enable icache */
  358. + cm |= (1 << 31);
  359. + /* Enable dcache */
  360. + cm |= (1 << 30);
  361. + write_c0_diag(cm);
  362. + }
  363. + break;
  364. case CPU_R4000PC:
  365. case CPU_R4000SC:
  366. case CPU_R4000MC:
  367. @@ -1752,6 +1777,15 @@ void r4k_cache_init(void)
  368. extern void build_copy_page(void);
  369. struct cpuinfo_mips *c = &current_cpu_data;
  370. + /* Check if special workarounds are required */
  371. +#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
  372. + if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) {
  373. + printk("Enabling BCM4710A0 cache workarounds.\n");
  374. + bcm4710 = 1;
  375. + } else
  376. +#endif
  377. + bcm4710 = 0;
  378. +
  379. probe_pcache();
  380. setup_scache();
  381. @@ -1821,7 +1855,15 @@ void r4k_cache_init(void)
  382. */
  383. local_r4k___flush_cache_all(NULL);
  384. +#ifdef CONFIG_BCM47XX
  385. + {
  386. + static void (*_coherency_setup)(void);
  387. + _coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup);
  388. + _coherency_setup();
  389. + }
  390. +#else
  391. coherency_setup();
  392. +#endif
  393. board_cache_error_setup = r4k_cache_error_setup;
  394. /*
  395. --- a/arch/mips/mm/tlbex.c
  396. +++ b/arch/mips/mm/tlbex.c
  397. @@ -960,6 +960,9 @@ build_get_pgde32(u32 **p, unsigned int t
  398. uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
  399. uasm_i_addu(p, ptr, tmp, ptr);
  400. #else
  401. +#ifdef CONFIG_BCM47XX
  402. + uasm_i_nop(p);
  403. +#endif
  404. UASM_i_LA_mostly(p, ptr, pgdc);
  405. #endif
  406. uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
  407. @@ -1301,6 +1304,9 @@ static void build_r4000_tlb_refill_handl
  408. #ifdef CONFIG_64BIT
  409. build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
  410. #else
  411. +# ifdef CONFIG_BCM47XX
  412. + uasm_i_nop(&p);
  413. +# endif
  414. build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
  415. #endif
  416. @@ -1312,6 +1318,9 @@ static void build_r4000_tlb_refill_handl
  417. build_update_entries(&p, K0, K1);
  418. build_tlb_write_entry(&p, &l, &r, tlb_random);
  419. uasm_l_leave(&l, p);
  420. +#ifdef CONFIG_BCM47XX
  421. + uasm_i_nop(&p);
  422. +#endif
  423. uasm_i_eret(&p); /* return from trap */
  424. }
  425. #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
  426. @@ -1888,6 +1897,9 @@ build_r4000_tlbchange_handler_head(u32 *
  427. #ifdef CONFIG_64BIT
  428. build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
  429. #else
  430. +# ifdef CONFIG_BCM47XX
  431. + uasm_i_nop(p);
  432. +# endif
  433. build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
  434. #endif
  435. @@ -1934,6 +1946,9 @@ build_r4000_tlbchange_handler_tail(u32 *
  436. build_tlb_write_entry(p, l, r, tlb_indexed);
  437. uasm_l_leave(l, *p);
  438. build_restore_work_registers(p);
  439. +#ifdef CONFIG_BCM47XX
  440. + uasm_i_nop(p);
  441. +#endif
  442. uasm_i_eret(p); /* return from trap */
  443. #ifdef CONFIG_64BIT