2
0

159-cpu_fixes.patch 16 KB

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