cacheflush.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _M68KNOMMU_CACHEFLUSH_H
  2. #define _M68KNOMMU_CACHEFLUSH_H
  3. /*
  4. * (C) Copyright 2000-2002, Greg Ungerer <gerg@snapgear.com>
  5. */
  6. #include <linux/mm.h>
  7. #define flush_cache_all() __flush_cache_all()
  8. #define flush_cache_mm(mm) do { } while (0)
  9. #define flush_cache_range(vma, start, end) do { } while (0)
  10. #define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
  11. #define flush_dcache_range(start,len) do { } while (0)
  12. #define flush_dcache_page(page) do { } while (0)
  13. #define flush_dcache_mmap_lock(mapping) do { } while (0)
  14. #define flush_dcache_mmap_unlock(mapping) do { } while (0)
  15. #define flush_icache_range(start,len) __flush_cache_all()
  16. #define flush_icache_page(vma,pg) do { } while (0)
  17. #define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
  18. #define flush_cache_vmap(start, end) flush_cache_all()
  19. #define flush_cache_vunmap(start, end) flush_cache_all()
  20. #define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  21. memcpy(dst, src, len)
  22. #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  23. memcpy(dst, src, len)
  24. extern inline void __flush_cache_all(void)
  25. {
  26. #ifdef CONFIG_M5407
  27. /*
  28. * Use cpushl to push and invalidate all cache lines.
  29. * Gas doesn't seem to know how to generate the ColdFire
  30. * cpushl instruction... Oh well, bit stuff it for now.
  31. */
  32. __asm__ __volatile__ (
  33. "nop\n\t"
  34. "clrl %%d0\n\t"
  35. "1:\n\t"
  36. "movel %%d0,%%a0\n\t"
  37. "2:\n\t"
  38. ".word 0xf468\n\t"
  39. "addl #0x10,%%a0\n\t"
  40. "cmpl #0x00000800,%%a0\n\t"
  41. "blt 2b\n\t"
  42. "addql #1,%%d0\n\t"
  43. "cmpil #4,%%d0\n\t"
  44. "bne 1b\n\t"
  45. "movel #0xb6088500,%%d0\n\t"
  46. "movec %%d0,%%CACR\n\t"
  47. : : : "d0", "a0" );
  48. #endif /* CONFIG_M5407 */
  49. #ifdef CONFIG_M5272
  50. __asm__ __volatile__ (
  51. "movel #0x01000000, %%d0\n\t"
  52. "movec %%d0, %%CACR\n\t"
  53. "nop\n\t"
  54. "movel #0x80000100, %%d0\n\t"
  55. "movec %%d0, %%CACR\n\t"
  56. "nop\n\t"
  57. : : : "d0" );
  58. #endif /* CONFIG_M5272 */
  59. #if 0 /* CONFIG_M5249 */
  60. __asm__ __volatile__ (
  61. "movel #0x01000000, %%d0\n\t"
  62. "movec %%d0, %%CACR\n\t"
  63. "nop\n\t"
  64. "movel #0xa0000200, %%d0\n\t"
  65. "movec %%d0, %%CACR\n\t"
  66. "nop\n\t"
  67. : : : "d0" );
  68. #endif /* CONFIG_M5249 */
  69. }
  70. #endif /* _M68KNOMMU_CACHEFLUSH_H */