cache-sh4.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. /*
  2. * arch/sh/mm/cache-sh4.c
  3. *
  4. * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
  5. * Copyright (C) 2001 - 2007 Paul Mundt
  6. * Copyright (C) 2003 Richard Curnow
  7. * Copyright (c) 2007 STMicroelectronics (R&D) Ltd.
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file "COPYING" in the main directory of this archive
  11. * for more details.
  12. */
  13. #include <linux/init.h>
  14. #include <linux/mm.h>
  15. #include <linux/io.h>
  16. #include <linux/mutex.h>
  17. #include <linux/fs.h>
  18. #include <asm/mmu_context.h>
  19. #include <asm/cacheflush.h>
  20. /*
  21. * The maximum number of pages we support up to when doing ranged dcache
  22. * flushing. Anything exceeding this will simply flush the dcache in its
  23. * entirety.
  24. */
  25. #define MAX_DCACHE_PAGES 64 /* XXX: Tune for ways */
  26. #define MAX_ICACHE_PAGES 32
  27. static void __flush_cache_4096(unsigned long addr, unsigned long phys,
  28. unsigned long exec_offset);
  29. /*
  30. * This is initialised here to ensure that it is not placed in the BSS. If
  31. * that were to happen, note that cache_init gets called before the BSS is
  32. * cleared, so this would get nulled out which would be hopeless.
  33. */
  34. static void (*__flush_dcache_segment_fn)(unsigned long, unsigned long) =
  35. (void (*)(unsigned long, unsigned long))0xdeadbeef;
  36. /*
  37. * Write back the range of D-cache, and purge the I-cache.
  38. *
  39. * Called from kernel/module.c:sys_init_module and routine for a.out format,
  40. * signal handler code and kprobes code
  41. */
  42. static void sh4_flush_icache_range(void *args)
  43. {
  44. struct flusher_data *data = args;
  45. unsigned long start, end;
  46. unsigned long flags, v;
  47. int i;
  48. start = data->addr1;
  49. end = data->addr2;
  50. /* If there are too many pages then just blow away the caches */
  51. if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) {
  52. local_flush_cache_all(NULL);
  53. return;
  54. }
  55. /*
  56. * Selectively flush d-cache then invalidate the i-cache.
  57. * This is inefficient, so only use this for small ranges.
  58. */
  59. start &= ~(L1_CACHE_BYTES-1);
  60. end += L1_CACHE_BYTES-1;
  61. end &= ~(L1_CACHE_BYTES-1);
  62. local_irq_save(flags);
  63. jump_to_uncached();
  64. for (v = start; v < end; v += L1_CACHE_BYTES) {
  65. unsigned long icacheaddr;
  66. __ocbwb(v);
  67. icacheaddr = CACHE_IC_ADDRESS_ARRAY | (v &
  68. cpu_data->icache.entry_mask);
  69. /* Clear i-cache line valid-bit */
  70. for (i = 0; i < cpu_data->icache.ways; i++) {
  71. __raw_writel(0, icacheaddr);
  72. icacheaddr += cpu_data->icache.way_incr;
  73. }
  74. }
  75. back_to_cached();
  76. local_irq_restore(flags);
  77. }
  78. static inline void flush_cache_4096(unsigned long start,
  79. unsigned long phys)
  80. {
  81. unsigned long flags, exec_offset = 0;
  82. /*
  83. * All types of SH-4 require PC to be in P2 to operate on the I-cache.
  84. * Some types of SH-4 require PC to be in P2 to operate on the D-cache.
  85. */
  86. if ((boot_cpu_data.flags & CPU_HAS_P2_FLUSH_BUG) ||
  87. (start < CACHE_OC_ADDRESS_ARRAY))
  88. exec_offset = 0x20000000;
  89. local_irq_save(flags);
  90. __flush_cache_4096(start | SH_CACHE_ASSOC,
  91. P1SEGADDR(phys), exec_offset);
  92. local_irq_restore(flags);
  93. }
  94. /*
  95. * Write back & invalidate the D-cache of the page.
  96. * (To avoid "alias" issues)
  97. */
  98. static void sh4_flush_dcache_page(void *arg)
  99. {
  100. struct page *page = arg;
  101. #ifndef CONFIG_SMP
  102. struct address_space *mapping = page_mapping(page);
  103. if (mapping && !mapping_mapped(mapping))
  104. set_bit(PG_dcache_dirty, &page->flags);
  105. else
  106. #endif
  107. {
  108. unsigned long phys = PHYSADDR(page_address(page));
  109. unsigned long addr = CACHE_OC_ADDRESS_ARRAY;
  110. int i, n;
  111. /* Loop all the D-cache */
  112. n = boot_cpu_data.dcache.n_aliases;
  113. for (i = 0; i < n; i++, addr += 4096)
  114. flush_cache_4096(addr, phys);
  115. }
  116. wmb();
  117. }
  118. /* TODO: Selective icache invalidation through IC address array.. */
  119. static void __uses_jump_to_uncached flush_icache_all(void)
  120. {
  121. unsigned long flags, ccr;
  122. local_irq_save(flags);
  123. jump_to_uncached();
  124. /* Flush I-cache */
  125. ccr = ctrl_inl(CCR);
  126. ccr |= CCR_CACHE_ICI;
  127. ctrl_outl(ccr, CCR);
  128. /*
  129. * back_to_cached() will take care of the barrier for us, don't add
  130. * another one!
  131. */
  132. back_to_cached();
  133. local_irq_restore(flags);
  134. }
  135. static inline void flush_dcache_all(void)
  136. {
  137. (*__flush_dcache_segment_fn)(0UL, boot_cpu_data.dcache.way_size);
  138. wmb();
  139. }
  140. static void sh4_flush_cache_all(void *unused)
  141. {
  142. flush_dcache_all();
  143. flush_icache_all();
  144. }
  145. /*
  146. * Note : (RPC) since the caches are physically tagged, the only point
  147. * of flush_cache_mm for SH-4 is to get rid of aliases from the
  148. * D-cache. The assumption elsewhere, e.g. flush_cache_range, is that
  149. * lines can stay resident so long as the virtual address they were
  150. * accessed with (hence cache set) is in accord with the physical
  151. * address (i.e. tag). It's no different here.
  152. *
  153. * Caller takes mm->mmap_sem.
  154. */
  155. static void sh4_flush_cache_mm(void *arg)
  156. {
  157. struct mm_struct *mm = arg;
  158. if (cpu_context(smp_processor_id(), mm) == NO_CONTEXT)
  159. return;
  160. flush_dcache_all();
  161. }
  162. /*
  163. * Write back and invalidate I/D-caches for the page.
  164. *
  165. * ADDR: Virtual Address (U0 address)
  166. * PFN: Physical page number
  167. */
  168. static void sh4_flush_cache_page(void *args)
  169. {
  170. struct flusher_data *data = args;
  171. struct vm_area_struct *vma;
  172. unsigned long address, pfn, phys;
  173. unsigned int alias_mask;
  174. vma = data->vma;
  175. address = data->addr1;
  176. pfn = data->addr2;
  177. phys = pfn << PAGE_SHIFT;
  178. if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
  179. return;
  180. alias_mask = boot_cpu_data.dcache.alias_mask;
  181. /* We only need to flush D-cache when we have alias */
  182. if ((address^phys) & alias_mask) {
  183. /* Loop 4K of the D-cache */
  184. flush_cache_4096(
  185. CACHE_OC_ADDRESS_ARRAY | (address & alias_mask),
  186. phys);
  187. /* Loop another 4K of the D-cache */
  188. flush_cache_4096(
  189. CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask),
  190. phys);
  191. }
  192. alias_mask = boot_cpu_data.icache.alias_mask;
  193. if (vma->vm_flags & VM_EXEC) {
  194. /*
  195. * Evict entries from the portion of the cache from which code
  196. * may have been executed at this address (virtual). There's
  197. * no need to evict from the portion corresponding to the
  198. * physical address as for the D-cache, because we know the
  199. * kernel has never executed the code through its identity
  200. * translation.
  201. */
  202. flush_cache_4096(
  203. CACHE_IC_ADDRESS_ARRAY | (address & alias_mask),
  204. phys);
  205. }
  206. }
  207. /*
  208. * Write back and invalidate D-caches.
  209. *
  210. * START, END: Virtual Address (U0 address)
  211. *
  212. * NOTE: We need to flush the _physical_ page entry.
  213. * Flushing the cache lines for U0 only isn't enough.
  214. * We need to flush for P1 too, which may contain aliases.
  215. */
  216. static void sh4_flush_cache_range(void *args)
  217. {
  218. struct flusher_data *data = args;
  219. struct vm_area_struct *vma;
  220. unsigned long start, end;
  221. vma = data->vma;
  222. start = data->addr1;
  223. end = data->addr2;
  224. if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
  225. return;
  226. /*
  227. * If cache is only 4k-per-way, there are never any 'aliases'. Since
  228. * the cache is physically tagged, the data can just be left in there.
  229. */
  230. if (boot_cpu_data.dcache.n_aliases == 0)
  231. return;
  232. flush_dcache_all();
  233. if (vma->vm_flags & VM_EXEC)
  234. flush_icache_all();
  235. }
  236. /**
  237. * __flush_cache_4096
  238. *
  239. * @addr: address in memory mapped cache array
  240. * @phys: P1 address to flush (has to match tags if addr has 'A' bit
  241. * set i.e. associative write)
  242. * @exec_offset: set to 0x20000000 if flush has to be executed from P2
  243. * region else 0x0
  244. *
  245. * The offset into the cache array implied by 'addr' selects the
  246. * 'colour' of the virtual address range that will be flushed. The
  247. * operation (purge/write-back) is selected by the lower 2 bits of
  248. * 'phys'.
  249. */
  250. static void __flush_cache_4096(unsigned long addr, unsigned long phys,
  251. unsigned long exec_offset)
  252. {
  253. int way_count;
  254. unsigned long base_addr = addr;
  255. struct cache_info *dcache;
  256. unsigned long way_incr;
  257. unsigned long a, ea, p;
  258. unsigned long temp_pc;
  259. dcache = &boot_cpu_data.dcache;
  260. /* Write this way for better assembly. */
  261. way_count = dcache->ways;
  262. way_incr = dcache->way_incr;
  263. /*
  264. * Apply exec_offset (i.e. branch to P2 if required.).
  265. *
  266. * FIXME:
  267. *
  268. * If I write "=r" for the (temp_pc), it puts this in r6 hence
  269. * trashing exec_offset before it's been added on - why? Hence
  270. * "=&r" as a 'workaround'
  271. */
  272. asm volatile("mov.l 1f, %0\n\t"
  273. "add %1, %0\n\t"
  274. "jmp @%0\n\t"
  275. "nop\n\t"
  276. ".balign 4\n\t"
  277. "1: .long 2f\n\t"
  278. "2:\n" : "=&r" (temp_pc) : "r" (exec_offset));
  279. /*
  280. * We know there will be >=1 iteration, so write as do-while to avoid
  281. * pointless nead-of-loop check for 0 iterations.
  282. */
  283. do {
  284. ea = base_addr + PAGE_SIZE;
  285. a = base_addr;
  286. p = phys;
  287. do {
  288. *(volatile unsigned long *)a = p;
  289. /*
  290. * Next line: intentionally not p+32, saves an add, p
  291. * will do since only the cache tag bits need to
  292. * match.
  293. */
  294. *(volatile unsigned long *)(a+32) = p;
  295. a += 64;
  296. p += 64;
  297. } while (a < ea);
  298. base_addr += way_incr;
  299. } while (--way_count != 0);
  300. }
  301. /*
  302. * Break the 1, 2 and 4 way variants of this out into separate functions to
  303. * avoid nearly all the overhead of having the conditional stuff in the function
  304. * bodies (+ the 1 and 2 way cases avoid saving any registers too).
  305. *
  306. * We want to eliminate unnecessary bus transactions, so this code uses
  307. * a non-obvious technique.
  308. *
  309. * Loop over a cache way sized block of, one cache line at a time. For each
  310. * line, use movca.a to cause the current cache line contents to be written
  311. * back, but without reading anything from main memory. However this has the
  312. * side effect that the cache is now caching that memory location. So follow
  313. * this with a cache invalidate to mark the cache line invalid. And do all
  314. * this with interrupts disabled, to avoid the cache line being accidently
  315. * evicted while it is holding garbage.
  316. *
  317. * This also breaks in a number of circumstances:
  318. * - if there are modifications to the region of memory just above
  319. * empty_zero_page (for example because a breakpoint has been placed
  320. * there), then these can be lost.
  321. *
  322. * This is because the the memory address which the cache temporarily
  323. * caches in the above description is empty_zero_page. So the
  324. * movca.l hits the cache (it is assumed that it misses, or at least
  325. * isn't dirty), modifies the line and then invalidates it, losing the
  326. * required change.
  327. *
  328. * - If caches are disabled or configured in write-through mode, then
  329. * the movca.l writes garbage directly into memory.
  330. */
  331. static void __flush_dcache_segment_writethrough(unsigned long start,
  332. unsigned long extent_per_way)
  333. {
  334. unsigned long addr;
  335. int i;
  336. addr = CACHE_OC_ADDRESS_ARRAY | (start & cpu_data->dcache.entry_mask);
  337. while (extent_per_way) {
  338. for (i = 0; i < cpu_data->dcache.ways; i++)
  339. __raw_writel(0, addr + cpu_data->dcache.way_incr * i);
  340. addr += cpu_data->dcache.linesz;
  341. extent_per_way -= cpu_data->dcache.linesz;
  342. }
  343. }
  344. static void __flush_dcache_segment_1way(unsigned long start,
  345. unsigned long extent_per_way)
  346. {
  347. unsigned long orig_sr, sr_with_bl;
  348. unsigned long base_addr;
  349. unsigned long way_incr, linesz, way_size;
  350. struct cache_info *dcache;
  351. register unsigned long a0, a0e;
  352. asm volatile("stc sr, %0" : "=r" (orig_sr));
  353. sr_with_bl = orig_sr | (1<<28);
  354. base_addr = ((unsigned long)&empty_zero_page[0]);
  355. /*
  356. * The previous code aligned base_addr to 16k, i.e. the way_size of all
  357. * existing SH-4 D-caches. Whilst I don't see a need to have this
  358. * aligned to any better than the cache line size (which it will be
  359. * anyway by construction), let's align it to at least the way_size of
  360. * any existing or conceivable SH-4 D-cache. -- RPC
  361. */
  362. base_addr = ((base_addr >> 16) << 16);
  363. base_addr |= start;
  364. dcache = &boot_cpu_data.dcache;
  365. linesz = dcache->linesz;
  366. way_incr = dcache->way_incr;
  367. way_size = dcache->way_size;
  368. a0 = base_addr;
  369. a0e = base_addr + extent_per_way;
  370. do {
  371. asm volatile("ldc %0, sr" : : "r" (sr_with_bl));
  372. asm volatile("movca.l r0, @%0\n\t"
  373. "ocbi @%0" : : "r" (a0));
  374. a0 += linesz;
  375. asm volatile("movca.l r0, @%0\n\t"
  376. "ocbi @%0" : : "r" (a0));
  377. a0 += linesz;
  378. asm volatile("movca.l r0, @%0\n\t"
  379. "ocbi @%0" : : "r" (a0));
  380. a0 += linesz;
  381. asm volatile("movca.l r0, @%0\n\t"
  382. "ocbi @%0" : : "r" (a0));
  383. asm volatile("ldc %0, sr" : : "r" (orig_sr));
  384. a0 += linesz;
  385. } while (a0 < a0e);
  386. }
  387. static void __flush_dcache_segment_2way(unsigned long start,
  388. unsigned long extent_per_way)
  389. {
  390. unsigned long orig_sr, sr_with_bl;
  391. unsigned long base_addr;
  392. unsigned long way_incr, linesz, way_size;
  393. struct cache_info *dcache;
  394. register unsigned long a0, a1, a0e;
  395. asm volatile("stc sr, %0" : "=r" (orig_sr));
  396. sr_with_bl = orig_sr | (1<<28);
  397. base_addr = ((unsigned long)&empty_zero_page[0]);
  398. /* See comment under 1-way above */
  399. base_addr = ((base_addr >> 16) << 16);
  400. base_addr |= start;
  401. dcache = &boot_cpu_data.dcache;
  402. linesz = dcache->linesz;
  403. way_incr = dcache->way_incr;
  404. way_size = dcache->way_size;
  405. a0 = base_addr;
  406. a1 = a0 + way_incr;
  407. a0e = base_addr + extent_per_way;
  408. do {
  409. asm volatile("ldc %0, sr" : : "r" (sr_with_bl));
  410. asm volatile("movca.l r0, @%0\n\t"
  411. "movca.l r0, @%1\n\t"
  412. "ocbi @%0\n\t"
  413. "ocbi @%1" : :
  414. "r" (a0), "r" (a1));
  415. a0 += linesz;
  416. a1 += linesz;
  417. asm volatile("movca.l r0, @%0\n\t"
  418. "movca.l r0, @%1\n\t"
  419. "ocbi @%0\n\t"
  420. "ocbi @%1" : :
  421. "r" (a0), "r" (a1));
  422. a0 += linesz;
  423. a1 += linesz;
  424. asm volatile("movca.l r0, @%0\n\t"
  425. "movca.l r0, @%1\n\t"
  426. "ocbi @%0\n\t"
  427. "ocbi @%1" : :
  428. "r" (a0), "r" (a1));
  429. a0 += linesz;
  430. a1 += linesz;
  431. asm volatile("movca.l r0, @%0\n\t"
  432. "movca.l r0, @%1\n\t"
  433. "ocbi @%0\n\t"
  434. "ocbi @%1" : :
  435. "r" (a0), "r" (a1));
  436. asm volatile("ldc %0, sr" : : "r" (orig_sr));
  437. a0 += linesz;
  438. a1 += linesz;
  439. } while (a0 < a0e);
  440. }
  441. static void __flush_dcache_segment_4way(unsigned long start,
  442. unsigned long extent_per_way)
  443. {
  444. unsigned long orig_sr, sr_with_bl;
  445. unsigned long base_addr;
  446. unsigned long way_incr, linesz, way_size;
  447. struct cache_info *dcache;
  448. register unsigned long a0, a1, a2, a3, a0e;
  449. asm volatile("stc sr, %0" : "=r" (orig_sr));
  450. sr_with_bl = orig_sr | (1<<28);
  451. base_addr = ((unsigned long)&empty_zero_page[0]);
  452. /* See comment under 1-way above */
  453. base_addr = ((base_addr >> 16) << 16);
  454. base_addr |= start;
  455. dcache = &boot_cpu_data.dcache;
  456. linesz = dcache->linesz;
  457. way_incr = dcache->way_incr;
  458. way_size = dcache->way_size;
  459. a0 = base_addr;
  460. a1 = a0 + way_incr;
  461. a2 = a1 + way_incr;
  462. a3 = a2 + way_incr;
  463. a0e = base_addr + extent_per_way;
  464. do {
  465. asm volatile("ldc %0, sr" : : "r" (sr_with_bl));
  466. asm volatile("movca.l r0, @%0\n\t"
  467. "movca.l r0, @%1\n\t"
  468. "movca.l r0, @%2\n\t"
  469. "movca.l r0, @%3\n\t"
  470. "ocbi @%0\n\t"
  471. "ocbi @%1\n\t"
  472. "ocbi @%2\n\t"
  473. "ocbi @%3\n\t" : :
  474. "r" (a0), "r" (a1), "r" (a2), "r" (a3));
  475. a0 += linesz;
  476. a1 += linesz;
  477. a2 += linesz;
  478. a3 += linesz;
  479. asm volatile("movca.l r0, @%0\n\t"
  480. "movca.l r0, @%1\n\t"
  481. "movca.l r0, @%2\n\t"
  482. "movca.l r0, @%3\n\t"
  483. "ocbi @%0\n\t"
  484. "ocbi @%1\n\t"
  485. "ocbi @%2\n\t"
  486. "ocbi @%3\n\t" : :
  487. "r" (a0), "r" (a1), "r" (a2), "r" (a3));
  488. a0 += linesz;
  489. a1 += linesz;
  490. a2 += linesz;
  491. a3 += linesz;
  492. asm volatile("movca.l r0, @%0\n\t"
  493. "movca.l r0, @%1\n\t"
  494. "movca.l r0, @%2\n\t"
  495. "movca.l r0, @%3\n\t"
  496. "ocbi @%0\n\t"
  497. "ocbi @%1\n\t"
  498. "ocbi @%2\n\t"
  499. "ocbi @%3\n\t" : :
  500. "r" (a0), "r" (a1), "r" (a2), "r" (a3));
  501. a0 += linesz;
  502. a1 += linesz;
  503. a2 += linesz;
  504. a3 += linesz;
  505. asm volatile("movca.l r0, @%0\n\t"
  506. "movca.l r0, @%1\n\t"
  507. "movca.l r0, @%2\n\t"
  508. "movca.l r0, @%3\n\t"
  509. "ocbi @%0\n\t"
  510. "ocbi @%1\n\t"
  511. "ocbi @%2\n\t"
  512. "ocbi @%3\n\t" : :
  513. "r" (a0), "r" (a1), "r" (a2), "r" (a3));
  514. asm volatile("ldc %0, sr" : : "r" (orig_sr));
  515. a0 += linesz;
  516. a1 += linesz;
  517. a2 += linesz;
  518. a3 += linesz;
  519. } while (a0 < a0e);
  520. }
  521. extern void __weak sh4__flush_region_init(void);
  522. /*
  523. * SH-4 has virtually indexed and physically tagged cache.
  524. */
  525. void __init sh4_cache_init(void)
  526. {
  527. unsigned int wt_enabled = !!(__raw_readl(CCR) & CCR_CACHE_WT);
  528. printk("PVR=%08x CVR=%08x PRR=%08x\n",
  529. ctrl_inl(CCN_PVR),
  530. ctrl_inl(CCN_CVR),
  531. ctrl_inl(CCN_PRR));
  532. if (wt_enabled)
  533. __flush_dcache_segment_fn = __flush_dcache_segment_writethrough;
  534. else {
  535. switch (boot_cpu_data.dcache.ways) {
  536. case 1:
  537. __flush_dcache_segment_fn = __flush_dcache_segment_1way;
  538. break;
  539. case 2:
  540. __flush_dcache_segment_fn = __flush_dcache_segment_2way;
  541. break;
  542. case 4:
  543. __flush_dcache_segment_fn = __flush_dcache_segment_4way;
  544. break;
  545. default:
  546. panic("unknown number of cache ways\n");
  547. break;
  548. }
  549. }
  550. local_flush_icache_range = sh4_flush_icache_range;
  551. local_flush_dcache_page = sh4_flush_dcache_page;
  552. local_flush_cache_all = sh4_flush_cache_all;
  553. local_flush_cache_mm = sh4_flush_cache_mm;
  554. local_flush_cache_dup_mm = sh4_flush_cache_mm;
  555. local_flush_cache_page = sh4_flush_cache_page;
  556. local_flush_cache_range = sh4_flush_cache_range;
  557. sh4__flush_region_init();
  558. }