cache-sh5.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * arch/sh/mm/cache-sh5.c
  3. *
  4. * Copyright (C) 2000, 2001 Paolo Alberelli
  5. * Copyright (C) 2002 Benedict Gaster
  6. * Copyright (C) 2003 Richard Curnow
  7. * Copyright (C) 2003 - 2008 Paul Mundt
  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/mman.h>
  15. #include <linux/mm.h>
  16. #include <asm/tlb.h>
  17. #include <asm/processor.h>
  18. #include <asm/cache.h>
  19. #include <asm/pgalloc.h>
  20. #include <asm/uaccess.h>
  21. #include <asm/mmu_context.h>
  22. extern void __weak sh4__flush_region_init(void);
  23. /* Wired TLB entry for the D-cache */
  24. static unsigned long long dtlb_cache_slot;
  25. /*
  26. * The following group of functions deal with mapping and unmapping a
  27. * temporary page into a DTLB slot that has been set aside for exclusive
  28. * use.
  29. */
  30. static inline void
  31. sh64_setup_dtlb_cache_slot(unsigned long eaddr, unsigned long asid,
  32. unsigned long paddr)
  33. {
  34. sh64_setup_tlb_slot(dtlb_cache_slot, eaddr, asid, paddr);
  35. }
  36. static inline void sh64_teardown_dtlb_cache_slot(void)
  37. {
  38. sh64_teardown_tlb_slot(dtlb_cache_slot);
  39. }
  40. static inline void sh64_icache_inv_all(void)
  41. {
  42. unsigned long long addr, flag, data;
  43. addr = ICCR0;
  44. flag = ICCR0_ICI;
  45. data = 0;
  46. /* Without %1 it gets unexplicably wrong */
  47. __asm__ __volatile__ (
  48. "getcfg %3, 0, %0\n\t"
  49. "or %0, %2, %0\n\t"
  50. "putcfg %3, 0, %0\n\t"
  51. "synci"
  52. : "=&r" (data)
  53. : "0" (data), "r" (flag), "r" (addr));
  54. }
  55. static void sh64_icache_inv_kernel_range(unsigned long start, unsigned long end)
  56. {
  57. /* Invalidate range of addresses [start,end] from the I-cache, where
  58. * the addresses lie in the kernel superpage. */
  59. unsigned long long ullend, addr, aligned_start;
  60. aligned_start = (unsigned long long)(signed long long)(signed long) start;
  61. addr = L1_CACHE_ALIGN(aligned_start);
  62. ullend = (unsigned long long) (signed long long) (signed long) end;
  63. while (addr <= ullend) {
  64. __asm__ __volatile__ ("icbi %0, 0" : : "r" (addr));
  65. addr += L1_CACHE_BYTES;
  66. }
  67. }
  68. static void sh64_icache_inv_user_page(struct vm_area_struct *vma, unsigned long eaddr)
  69. {
  70. /* If we get called, we know that vma->vm_flags contains VM_EXEC.
  71. Also, eaddr is page-aligned. */
  72. unsigned int cpu = smp_processor_id();
  73. unsigned long long addr, end_addr;
  74. unsigned long running_asid, vma_asid;
  75. addr = eaddr;
  76. end_addr = addr + PAGE_SIZE;
  77. /* Check whether we can use the current ASID for the I-cache
  78. invalidation. For example, if we're called via
  79. access_process_vm->flush_cache_page->here, (e.g. when reading from
  80. /proc), 'running_asid' will be that of the reader, not of the
  81. victim.
  82. Also, note the risk that we might get pre-empted between the ASID
  83. compare and blocking IRQs, and before we regain control, the
  84. pid->ASID mapping changes. However, the whole cache will get
  85. invalidated when the mapping is renewed, so the worst that can
  86. happen is that the loop below ends up invalidating somebody else's
  87. cache entries.
  88. */
  89. running_asid = get_asid();
  90. vma_asid = cpu_asid(cpu, vma->vm_mm);
  91. if (running_asid != vma_asid)
  92. switch_and_save_asid(vma_asid);
  93. while (addr < end_addr) {
  94. /* Worth unrolling a little */
  95. __asm__ __volatile__("icbi %0, 0" : : "r" (addr));
  96. __asm__ __volatile__("icbi %0, 32" : : "r" (addr));
  97. __asm__ __volatile__("icbi %0, 64" : : "r" (addr));
  98. __asm__ __volatile__("icbi %0, 96" : : "r" (addr));
  99. addr += 128;
  100. }
  101. if (running_asid != vma_asid)
  102. switch_and_save_asid(running_asid);
  103. }
  104. static void sh64_icache_inv_user_page_range(struct mm_struct *mm,
  105. unsigned long start, unsigned long end)
  106. {
  107. /* Used for invalidating big chunks of I-cache, i.e. assume the range
  108. is whole pages. If 'start' or 'end' is not page aligned, the code
  109. is conservative and invalidates to the ends of the enclosing pages.
  110. This is functionally OK, just a performance loss. */
  111. /* See the comments below in sh64_dcache_purge_user_range() regarding
  112. the choice of algorithm. However, for the I-cache option (2) isn't
  113. available because there are no physical tags so aliases can't be
  114. resolved. The icbi instruction has to be used through the user
  115. mapping. Because icbi is cheaper than ocbp on a cache hit, it
  116. would be cheaper to use the selective code for a large range than is
  117. possible with the D-cache. Just assume 64 for now as a working
  118. figure.
  119. */
  120. int n_pages;
  121. if (!mm)
  122. return;
  123. n_pages = ((end - start) >> PAGE_SHIFT);
  124. if (n_pages >= 64) {
  125. sh64_icache_inv_all();
  126. } else {
  127. unsigned long aligned_start;
  128. unsigned long eaddr;
  129. unsigned long after_last_page_start;
  130. unsigned long mm_asid, current_asid;
  131. mm_asid = cpu_asid(smp_processor_id(), mm);
  132. current_asid = get_asid();
  133. if (mm_asid != current_asid)
  134. switch_and_save_asid(mm_asid);
  135. aligned_start = start & PAGE_MASK;
  136. after_last_page_start = PAGE_SIZE + ((end - 1) & PAGE_MASK);
  137. while (aligned_start < after_last_page_start) {
  138. struct vm_area_struct *vma;
  139. unsigned long vma_end;
  140. vma = find_vma(mm, aligned_start);
  141. if (!vma || (aligned_start <= vma->vm_end)) {
  142. /* Avoid getting stuck in an error condition */
  143. aligned_start += PAGE_SIZE;
  144. continue;
  145. }
  146. vma_end = vma->vm_end;
  147. if (vma->vm_flags & VM_EXEC) {
  148. /* Executable */
  149. eaddr = aligned_start;
  150. while (eaddr < vma_end) {
  151. sh64_icache_inv_user_page(vma, eaddr);
  152. eaddr += PAGE_SIZE;
  153. }
  154. }
  155. aligned_start = vma->vm_end; /* Skip to start of next region */
  156. }
  157. if (mm_asid != current_asid)
  158. switch_and_save_asid(current_asid);
  159. }
  160. }
  161. static void sh64_icache_inv_current_user_range(unsigned long start, unsigned long end)
  162. {
  163. /* The icbi instruction never raises ITLBMISS. i.e. if there's not a
  164. cache hit on the virtual tag the instruction ends there, without a
  165. TLB lookup. */
  166. unsigned long long aligned_start;
  167. unsigned long long ull_end;
  168. unsigned long long addr;
  169. ull_end = end;
  170. /* Just invalidate over the range using the natural addresses. TLB
  171. miss handling will be OK (TBC). Since it's for the current process,
  172. either we're already in the right ASID context, or the ASIDs have
  173. been recycled since we were last active in which case we might just
  174. invalidate another processes I-cache entries : no worries, just a
  175. performance drop for him. */
  176. aligned_start = L1_CACHE_ALIGN(start);
  177. addr = aligned_start;
  178. while (addr < ull_end) {
  179. __asm__ __volatile__ ("icbi %0, 0" : : "r" (addr));
  180. __asm__ __volatile__ ("nop");
  181. __asm__ __volatile__ ("nop");
  182. addr += L1_CACHE_BYTES;
  183. }
  184. }
  185. /* Buffer used as the target of alloco instructions to purge data from cache
  186. sets by natural eviction. -- RPC */
  187. #define DUMMY_ALLOCO_AREA_SIZE ((L1_CACHE_BYTES << 10) + (1024 * 4))
  188. static unsigned char dummy_alloco_area[DUMMY_ALLOCO_AREA_SIZE] __cacheline_aligned = { 0, };
  189. static void inline sh64_dcache_purge_sets(int sets_to_purge_base, int n_sets)
  190. {
  191. /* Purge all ways in a particular block of sets, specified by the base
  192. set number and number of sets. Can handle wrap-around, if that's
  193. needed. */
  194. int dummy_buffer_base_set;
  195. unsigned long long eaddr, eaddr0, eaddr1;
  196. int j;
  197. int set_offset;
  198. dummy_buffer_base_set = ((int)&dummy_alloco_area &
  199. cpu_data->dcache.entry_mask) >>
  200. cpu_data->dcache.entry_shift;
  201. set_offset = sets_to_purge_base - dummy_buffer_base_set;
  202. for (j = 0; j < n_sets; j++, set_offset++) {
  203. set_offset &= (cpu_data->dcache.sets - 1);
  204. eaddr0 = (unsigned long long)dummy_alloco_area +
  205. (set_offset << cpu_data->dcache.entry_shift);
  206. /*
  207. * Do one alloco which hits the required set per cache
  208. * way. For write-back mode, this will purge the #ways
  209. * resident lines. There's little point unrolling this
  210. * loop because the allocos stall more if they're too
  211. * close together.
  212. */
  213. eaddr1 = eaddr0 + cpu_data->dcache.way_size *
  214. cpu_data->dcache.ways;
  215. for (eaddr = eaddr0; eaddr < eaddr1;
  216. eaddr += cpu_data->dcache.way_size) {
  217. __asm__ __volatile__ ("alloco %0, 0" : : "r" (eaddr));
  218. __asm__ __volatile__ ("synco"); /* TAKum03020 */
  219. }
  220. eaddr1 = eaddr0 + cpu_data->dcache.way_size *
  221. cpu_data->dcache.ways;
  222. for (eaddr = eaddr0; eaddr < eaddr1;
  223. eaddr += cpu_data->dcache.way_size) {
  224. /*
  225. * Load from each address. Required because
  226. * alloco is a NOP if the cache is write-through.
  227. */
  228. if (test_bit(SH_CACHE_MODE_WT, &(cpu_data->dcache.flags)))
  229. __raw_readb((unsigned long)eaddr);
  230. }
  231. }
  232. /*
  233. * Don't use OCBI to invalidate the lines. That costs cycles
  234. * directly. If the dummy block is just left resident, it will
  235. * naturally get evicted as required.
  236. */
  237. }
  238. /*
  239. * Purge the entire contents of the dcache. The most efficient way to
  240. * achieve this is to use alloco instructions on a region of unused
  241. * memory equal in size to the cache, thereby causing the current
  242. * contents to be discarded by natural eviction. The alternative, namely
  243. * reading every tag, setting up a mapping for the corresponding page and
  244. * doing an OCBP for the line, would be much more expensive.
  245. */
  246. static void sh64_dcache_purge_all(void)
  247. {
  248. sh64_dcache_purge_sets(0, cpu_data->dcache.sets);
  249. }
  250. /* Assumes this address (+ (2**n_synbits) pages up from it) aren't used for
  251. anything else in the kernel */
  252. #define MAGIC_PAGE0_START 0xffffffffec000000ULL
  253. /* Purge the physical page 'paddr' from the cache. It's known that any
  254. * cache lines requiring attention have the same page colour as the the
  255. * address 'eaddr'.
  256. *
  257. * This relies on the fact that the D-cache matches on physical tags when
  258. * no virtual tag matches. So we create an alias for the original page
  259. * and purge through that. (Alternatively, we could have done this by
  260. * switching ASID to match the original mapping and purged through that,
  261. * but that involves ASID switching cost + probably a TLBMISS + refill
  262. * anyway.)
  263. */
  264. static void sh64_dcache_purge_coloured_phy_page(unsigned long paddr,
  265. unsigned long eaddr)
  266. {
  267. unsigned long long magic_page_start;
  268. unsigned long long magic_eaddr, magic_eaddr_end;
  269. magic_page_start = MAGIC_PAGE0_START + (eaddr & CACHE_OC_SYN_MASK);
  270. /* As long as the kernel is not pre-emptible, this doesn't need to be
  271. under cli/sti. */
  272. sh64_setup_dtlb_cache_slot(magic_page_start, get_asid(), paddr);
  273. magic_eaddr = magic_page_start;
  274. magic_eaddr_end = magic_eaddr + PAGE_SIZE;
  275. while (magic_eaddr < magic_eaddr_end) {
  276. /* Little point in unrolling this loop - the OCBPs are blocking
  277. and won't go any quicker (i.e. the loop overhead is parallel
  278. to part of the OCBP execution.) */
  279. __asm__ __volatile__ ("ocbp %0, 0" : : "r" (magic_eaddr));
  280. magic_eaddr += L1_CACHE_BYTES;
  281. }
  282. sh64_teardown_dtlb_cache_slot();
  283. }
  284. /*
  285. * Purge a page given its physical start address, by creating a temporary
  286. * 1 page mapping and purging across that. Even if we know the virtual
  287. * address (& vma or mm) of the page, the method here is more elegant
  288. * because it avoids issues of coping with page faults on the purge
  289. * instructions (i.e. no special-case code required in the critical path
  290. * in the TLB miss handling).
  291. */
  292. static void sh64_dcache_purge_phy_page(unsigned long paddr)
  293. {
  294. unsigned long long eaddr_start, eaddr, eaddr_end;
  295. int i;
  296. /* As long as the kernel is not pre-emptible, this doesn't need to be
  297. under cli/sti. */
  298. eaddr_start = MAGIC_PAGE0_START;
  299. for (i = 0; i < (1 << CACHE_OC_N_SYNBITS); i++) {
  300. sh64_setup_dtlb_cache_slot(eaddr_start, get_asid(), paddr);
  301. eaddr = eaddr_start;
  302. eaddr_end = eaddr + PAGE_SIZE;
  303. while (eaddr < eaddr_end) {
  304. __asm__ __volatile__ ("ocbp %0, 0" : : "r" (eaddr));
  305. eaddr += L1_CACHE_BYTES;
  306. }
  307. sh64_teardown_dtlb_cache_slot();
  308. eaddr_start += PAGE_SIZE;
  309. }
  310. }
  311. static void sh64_dcache_purge_user_pages(struct mm_struct *mm,
  312. unsigned long addr, unsigned long end)
  313. {
  314. pgd_t *pgd;
  315. pud_t *pud;
  316. pmd_t *pmd;
  317. pte_t *pte;
  318. pte_t entry;
  319. spinlock_t *ptl;
  320. unsigned long paddr;
  321. if (!mm)
  322. return; /* No way to find physical address of page */
  323. pgd = pgd_offset(mm, addr);
  324. if (pgd_bad(*pgd))
  325. return;
  326. pud = pud_offset(pgd, addr);
  327. if (pud_none(*pud) || pud_bad(*pud))
  328. return;
  329. pmd = pmd_offset(pud, addr);
  330. if (pmd_none(*pmd) || pmd_bad(*pmd))
  331. return;
  332. pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
  333. do {
  334. entry = *pte;
  335. if (pte_none(entry) || !pte_present(entry))
  336. continue;
  337. paddr = pte_val(entry) & PAGE_MASK;
  338. sh64_dcache_purge_coloured_phy_page(paddr, addr);
  339. } while (pte++, addr += PAGE_SIZE, addr != end);
  340. pte_unmap_unlock(pte - 1, ptl);
  341. }
  342. /*
  343. * There are at least 5 choices for the implementation of this, with
  344. * pros (+), cons(-), comments(*):
  345. *
  346. * 1. ocbp each line in the range through the original user's ASID
  347. * + no lines spuriously evicted
  348. * - tlbmiss handling (must either handle faults on demand => extra
  349. * special-case code in tlbmiss critical path), or map the page in
  350. * advance (=> flush_tlb_range in advance to avoid multiple hits)
  351. * - ASID switching
  352. * - expensive for large ranges
  353. *
  354. * 2. temporarily map each page in the range to a special effective
  355. * address and ocbp through the temporary mapping; relies on the
  356. * fact that SH-5 OCB* always do TLB lookup and match on ptags (they
  357. * never look at the etags)
  358. * + no spurious evictions
  359. * - expensive for large ranges
  360. * * surely cheaper than (1)
  361. *
  362. * 3. walk all the lines in the cache, check the tags, if a match
  363. * occurs create a page mapping to ocbp the line through
  364. * + no spurious evictions
  365. * - tag inspection overhead
  366. * - (especially for small ranges)
  367. * - potential cost of setting up/tearing down page mapping for
  368. * every line that matches the range
  369. * * cost partly independent of range size
  370. *
  371. * 4. walk all the lines in the cache, check the tags, if a match
  372. * occurs use 4 * alloco to purge the line (+3 other probably
  373. * innocent victims) by natural eviction
  374. * + no tlb mapping overheads
  375. * - spurious evictions
  376. * - tag inspection overhead
  377. *
  378. * 5. implement like flush_cache_all
  379. * + no tag inspection overhead
  380. * - spurious evictions
  381. * - bad for small ranges
  382. *
  383. * (1) can be ruled out as more expensive than (2). (2) appears best
  384. * for small ranges. The choice between (3), (4) and (5) for large
  385. * ranges and the range size for the large/small boundary need
  386. * benchmarking to determine.
  387. *
  388. * For now use approach (2) for small ranges and (5) for large ones.
  389. */
  390. static void sh64_dcache_purge_user_range(struct mm_struct *mm,
  391. unsigned long start, unsigned long end)
  392. {
  393. int n_pages = ((end - start) >> PAGE_SHIFT);
  394. if (n_pages >= 64 || ((start ^ (end - 1)) & PMD_MASK)) {
  395. sh64_dcache_purge_all();
  396. } else {
  397. /* Small range, covered by a single page table page */
  398. start &= PAGE_MASK; /* should already be so */
  399. end = PAGE_ALIGN(end); /* should already be so */
  400. sh64_dcache_purge_user_pages(mm, start, end);
  401. }
  402. }
  403. /*
  404. * Invalidate the entire contents of both caches, after writing back to
  405. * memory any dirty data from the D-cache.
  406. */
  407. static void sh5_flush_cache_all(void *unused)
  408. {
  409. sh64_dcache_purge_all();
  410. sh64_icache_inv_all();
  411. }
  412. /*
  413. * Invalidate an entire user-address space from both caches, after
  414. * writing back dirty data (e.g. for shared mmap etc).
  415. *
  416. * This could be coded selectively by inspecting all the tags then
  417. * doing 4*alloco on any set containing a match (as for
  418. * flush_cache_range), but fork/exit/execve (where this is called from)
  419. * are expensive anyway.
  420. *
  421. * Have to do a purge here, despite the comments re I-cache below.
  422. * There could be odd-coloured dirty data associated with the mm still
  423. * in the cache - if this gets written out through natural eviction
  424. * after the kernel has reused the page there will be chaos.
  425. *
  426. * The mm being torn down won't ever be active again, so any Icache
  427. * lines tagged with its ASID won't be visible for the rest of the
  428. * lifetime of this ASID cycle. Before the ASID gets reused, there
  429. * will be a flush_cache_all. Hence we don't need to touch the
  430. * I-cache. This is similar to the lack of action needed in
  431. * flush_tlb_mm - see fault.c.
  432. */
  433. static void sh5_flush_cache_mm(void *unused)
  434. {
  435. sh64_dcache_purge_all();
  436. }
  437. /*
  438. * Invalidate (from both caches) the range [start,end) of virtual
  439. * addresses from the user address space specified by mm, after writing
  440. * back any dirty data.
  441. *
  442. * Note, 'end' is 1 byte beyond the end of the range to flush.
  443. */
  444. static void sh5_flush_cache_range(void *args)
  445. {
  446. struct flusher_data *data = args;
  447. struct vm_area_struct *vma;
  448. unsigned long start, end;
  449. vma = data->vma;
  450. start = data->addr1;
  451. end = data->addr2;
  452. sh64_dcache_purge_user_range(vma->vm_mm, start, end);
  453. sh64_icache_inv_user_page_range(vma->vm_mm, start, end);
  454. }
  455. /*
  456. * Invalidate any entries in either cache for the vma within the user
  457. * address space vma->vm_mm for the page starting at virtual address
  458. * 'eaddr'. This seems to be used primarily in breaking COW. Note,
  459. * the I-cache must be searched too in case the page in question is
  460. * both writable and being executed from (e.g. stack trampolines.)
  461. *
  462. * Note, this is called with pte lock held.
  463. */
  464. static void sh5_flush_cache_page(void *args)
  465. {
  466. struct flusher_data *data = args;
  467. struct vm_area_struct *vma;
  468. unsigned long eaddr, pfn;
  469. vma = data->vma;
  470. eaddr = data->addr1;
  471. pfn = data->addr2;
  472. sh64_dcache_purge_phy_page(pfn << PAGE_SHIFT);
  473. if (vma->vm_flags & VM_EXEC)
  474. sh64_icache_inv_user_page(vma, eaddr);
  475. }
  476. static void sh5_flush_dcache_page(void *page)
  477. {
  478. sh64_dcache_purge_phy_page(page_to_phys(page));
  479. wmb();
  480. }
  481. /*
  482. * Flush the range [start,end] of kernel virtual adddress space from
  483. * the I-cache. The corresponding range must be purged from the
  484. * D-cache also because the SH-5 doesn't have cache snooping between
  485. * the caches. The addresses will be visible through the superpage
  486. * mapping, therefore it's guaranteed that there no cache entries for
  487. * the range in cache sets of the wrong colour.
  488. */
  489. static void sh5_flush_icache_range(void *args)
  490. {
  491. struct flusher_data *data = args;
  492. unsigned long start, end;
  493. start = data->addr1;
  494. end = data->addr2;
  495. __flush_purge_region((void *)start, end);
  496. wmb();
  497. sh64_icache_inv_kernel_range(start, end);
  498. }
  499. /*
  500. * For the address range [start,end), write back the data from the
  501. * D-cache and invalidate the corresponding region of the I-cache for the
  502. * current process. Used to flush signal trampolines on the stack to
  503. * make them executable.
  504. */
  505. static void sh5_flush_cache_sigtramp(void *vaddr)
  506. {
  507. unsigned long end = (unsigned long)vaddr + L1_CACHE_BYTES;
  508. __flush_wback_region(vaddr, L1_CACHE_BYTES);
  509. wmb();
  510. sh64_icache_inv_current_user_range((unsigned long)vaddr, end);
  511. }
  512. void __init sh5_cache_init(void)
  513. {
  514. local_flush_cache_all = sh5_flush_cache_all;
  515. local_flush_cache_mm = sh5_flush_cache_mm;
  516. local_flush_cache_dup_mm = sh5_flush_cache_mm;
  517. local_flush_cache_page = sh5_flush_cache_page;
  518. local_flush_cache_range = sh5_flush_cache_range;
  519. local_flush_dcache_page = sh5_flush_dcache_page;
  520. local_flush_icache_range = sh5_flush_icache_range;
  521. local_flush_cache_sigtramp = sh5_flush_cache_sigtramp;
  522. /* Reserve a slot for dcache colouring in the DTLB */
  523. dtlb_cache_slot = sh64_get_wired_dtlb_entry();
  524. sh4__flush_region_init();
  525. }