m53xxacr.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /****************************************************************************/
  2. /*
  3. * m53xxacr.h -- ColdFire version 3 core cache support
  4. *
  5. * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com>
  6. */
  7. /****************************************************************************/
  8. #ifndef m53xxacr_h
  9. #define m53xxacr_h
  10. /****************************************************************************/
  11. /*
  12. * All varients of the ColdFire using version 3 cores have a similar
  13. * cache setup. They have a unified instruction and data cache, with
  14. * configurable write-through or copy-back operation.
  15. */
  16. /*
  17. * Define the Cache Control register flags.
  18. */
  19. #define CACR_EC 0x80000000 /* Enable cache */
  20. #define CACR_ESB 0x20000000 /* Enable store buffer */
  21. #define CACR_DPI 0x10000000 /* Disable invalidation by CPUSHL */
  22. #define CACR_HLCK 0x08000000 /* Half cache lock mode */
  23. #define CACR_CINVA 0x01000000 /* Invalidate cache */
  24. #define CACR_DNFB 0x00000400 /* Inhibited fill buffer */
  25. #define CACR_DCM_WT 0x00000000 /* Cacheable write-through */
  26. #define CACR_DCM_CB 0x00000100 /* Cacheable copy-back */
  27. #define CACR_DCM_PRE 0x00000200 /* Cache inhibited, precise */
  28. #define CACR_DCM_IMPRE 0x00000300 /* Cache inhibited, imprecise */
  29. #define CACR_WPROTECT 0x00000020 /* Write protect*/
  30. #define CACR_EUSP 0x00000010 /* Eanble separate user a7 */
  31. /*
  32. * Define the Access Control register flags.
  33. */
  34. #define ACR_BASE_POS 24 /* Address Base (upper 8 bits) */
  35. #define ACR_MASK_POS 16 /* Address Mask (next 8 bits) */
  36. #define ACR_ENABLE 0x00008000 /* Enable this ACR */
  37. #define ACR_USER 0x00000000 /* Allow only user accesses */
  38. #define ACR_SUPER 0x00002000 /* Allow supervisor access only */
  39. #define ACR_ANY 0x00004000 /* Allow any access type */
  40. #define ACR_CM_WT 0x00000000 /* Cacheable, write-through */
  41. #define ACR_CM_CB 0x00000020 /* Cacheable, copy-back */
  42. #define ACR_CM_PRE 0x00000040 /* Cache inhibited, precise */
  43. #define ACR_CM_IMPRE 0x00000060 /* Cache inhibited, imprecise */
  44. #define ACR_WPROTECT 0x00000004 /* Write protect region */
  45. /*
  46. * Set the cache controller settings we will use. This default in the
  47. * CACR is cache inhibited, we use the ACR register to set cacheing
  48. * enabled on the regions we want (eg RAM).
  49. */
  50. #ifdef CONFIG_COLDFIRE_SW_A7
  51. #define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE)
  52. #else
  53. #define CACHE_MODE (CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP)
  54. #endif
  55. #define CACHE_INIT CACR_CINVA
  56. #define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \
  57. (0x000f0000) + \
  58. (ACR_ENABLE + ACR_ANY + ACR_CM_CB))
  59. #define ACR1_MODE 0
  60. /****************************************************************************/
  61. #endif /* m53xxsim_h */