mpu.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * MPU Masks
  3. */
  4. #ifndef __BFIN_PERIPHERAL_MPU__
  5. #define __BFIN_PERIPHERAL_MPU__
  6. /*
  7. * DMEM_CONTROL Register
  8. */
  9. /* ** Bit Positions */
  10. #define ENDM_P 0x00 /* (doesn't really exist) Enable Data Memory L1 */
  11. #define DMCTL_ENDM_P ENDM_P /* "" (older define) */
  12. #define ENDCPLB_P 0x01 /* Enable DCPLBS */
  13. #define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */
  14. #define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */
  15. #define DMCTL_DMC0_P DMC0_P /* "" (older define) */
  16. #define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */
  17. #define DMCTL_DMC1_P DMC1_P /* "" (older define) */
  18. #define DCBS_P 0x04 /* L1 Data Cache Bank Select */
  19. #define PORT_PREF0_P 0x12 /* DAG0 Port Preference */
  20. #define PORT_PREF1_P 0x13 /* DAG1 Port Preference */
  21. /* ** Masks */
  22. #define ENDM 0x00000001 /* (doesn't really exist) Enable Data Memory L1 */
  23. #define ENDCPLB 0x00000002 /* Enable DCPLB */
  24. #define ASRAM_BSRAM 0x00000000
  25. #define ACACHE_BSRAM 0x00000008
  26. #define ACACHE_BCACHE 0x0000000C
  27. #define DCBS 0x00000010 /* L1 Data Cache Bank Select */
  28. #define PORT_PREF0 0x00001000 /* DAG0 Port Preference */
  29. #define PORT_PREF1 0x00002000 /* DAG1 Port Preference */
  30. /* IMEM_CONTROL Register */
  31. /* ** Bit Positions */
  32. #define ENIM_P 0x00 /* Enable L1 Code Memory */
  33. #define IMCTL_ENIM_P 0x00 /* "" (older define) */
  34. #define ENICPLB_P 0x01 /* Enable ICPLB */
  35. #define IMCTL_ENICPLB_P 0x01 /* "" (older define) */
  36. #define IMC_P 0x02 /* Enable */
  37. #define IMCTL_IMC_P 0x02 /* Configure L1 code memory as cache (0=SRAM) */
  38. #define ILOC0_P 0x03 /* Lock Way 0 */
  39. #define ILOC1_P 0x04 /* Lock Way 1 */
  40. #define ILOC2_P 0x05 /* Lock Way 2 */
  41. #define ILOC3_P 0x06 /* Lock Way 3 */
  42. #define LRUPRIORST_P 0x0D /* Least Recently Used Replacement Priority */
  43. /* ** Masks */
  44. #define ENIM 0x00000001 /* Enable L1 Code Memory */
  45. #define ENICPLB 0x00000002 /* Enable ICPLB */
  46. #define IMC 0x00000004 /* Configure L1 code memory as cache (0=SRAM) */
  47. #define ILOC0 0x00000008 /* Lock Way 0 */
  48. #define ILOC1 0x00000010 /* Lock Way 1 */
  49. #define ILOC2 0x00000020 /* Lock Way 2 */
  50. #define ILOC3 0x00000040 /* Lock Way 3 */
  51. #define LRUPRIORST 0x00002000 /* Least Recently Used Replacement Priority */
  52. /* DCPLB_DATA and ICPLB_DATA Registers */
  53. /* ** Bit Positions */
  54. #define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */
  55. #define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry locked */
  56. #define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access allowed (user mode) */
  57. /* ** Masks */
  58. #define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */
  59. #define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry locked */
  60. #define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access allowed (user mode) */
  61. #define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */
  62. #define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
  63. #define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
  64. #define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
  65. #define PAGE_SIZE_MASK 0x00030000 /* the bits for the page_size field */
  66. #define PAGE_SIZE_SHIFT 16
  67. #define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not mapped to L1 */
  68. #define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high priority port */
  69. #define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable in L1 */
  70. /* ICPLB_DATA only */
  71. #define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line, 1=priority for non-replacement */
  72. /* DCPLB_DATA only */
  73. #define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write access allowed (user mode) */
  74. #define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write access allowed (supervisor mode) */
  75. #define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */
  76. #define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on write-through writes, */
  77. /* 1= allocate cache lines on write-through writes. */
  78. #define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */
  79. /* ITEST_COMMAND and DTEST_COMMAND Registers */
  80. /* ** Masks */
  81. #define TEST_READ 0x00000000 /* Read Access */
  82. #define TEST_WRITE 0x00000002 /* Write Access */
  83. #define TEST_TAG 0x00000000 /* Access TAG */
  84. #define TEST_DATA 0x00000004 /* Access DATA */
  85. #define TEST_DW0 0x00000000 /* Select Double Word 0 */
  86. #define TEST_DW1 0x00000008 /* Select Double Word 1 */
  87. #define TEST_DW2 0x00000010 /* Select Double Word 2 */
  88. #define TEST_DW3 0x00000018 /* Select Double Word 3 */
  89. #define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */
  90. #define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */
  91. #define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */
  92. #define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */
  93. #define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */
  94. #define TEST_WAY0 0x00000000 /* Access Way0 */
  95. #define TEST_WAY1 0x04000000 /* Access Way1 */
  96. /* ** ITEST_COMMAND only */
  97. #define TEST_WAY2 0x08000000 /* Access Way2 */
  98. #define TEST_WAY3 0x0C000000 /* Access Way3 */
  99. /* ** DTEST_COMMAND only */
  100. #define TEST_BNKSELA 0x00000000 /* Access SuperBank A */
  101. #define TEST_BNKSELB 0x00800000 /* Access SuperBank B */
  102. #endif