mem_map.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. * Memory MAP
  3. * Common header file for blackfin BF561 of processors.
  4. */
  5. #ifndef _MEM_MAP_561_H_
  6. #define _MEM_MAP_561_H_
  7. #define COREMMR_BASE 0xFFE00000 /* Core MMRs */
  8. #define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  9. /* Async Memory Banks */
  10. #define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
  11. #define ASYNC_BANK3_SIZE 0x04000000 /* 64M */
  12. #define ASYNC_BANK2_BASE 0x28000000 /* Async Bank 2 */
  13. #define ASYNC_BANK2_SIZE 0x04000000 /* 64M */
  14. #define ASYNC_BANK1_BASE 0x24000000 /* Async Bank 1 */
  15. #define ASYNC_BANK1_SIZE 0x04000000 /* 64M */
  16. #define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
  17. #define ASYNC_BANK0_SIZE 0x04000000 /* 64M */
  18. /* Boot ROM Memory */
  19. #define BOOT_ROM_START 0xEF000000
  20. #define BOOT_ROM_LENGTH 0x800
  21. /* Level 1 Memory */
  22. #ifdef CONFIG_BFIN_ICACHE
  23. #define BFIN_ICACHESIZE (16*1024)
  24. #else
  25. #define BFIN_ICACHESIZE (0*1024)
  26. #endif
  27. /* Memory Map for ADSP-BF561 processors */
  28. #ifdef CONFIG_BF561
  29. #define COREA_L1_CODE_START 0xFFA00000
  30. #define COREA_L1_DATA_A_START 0xFF800000
  31. #define COREA_L1_DATA_B_START 0xFF900000
  32. #define COREB_L1_CODE_START 0xFF600000
  33. #define COREB_L1_DATA_A_START 0xFF400000
  34. #define COREB_L1_DATA_B_START 0xFF500000
  35. #define L1_CODE_START COREA_L1_CODE_START
  36. #define L1_DATA_A_START COREA_L1_DATA_A_START
  37. #define L1_DATA_B_START COREA_L1_DATA_B_START
  38. #define L1_CODE_LENGTH 0x4000
  39. #ifdef CONFIG_BFIN_DCACHE
  40. #ifdef CONFIG_BFIN_DCACHE_BANKA
  41. #define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
  42. #define L1_DATA_A_LENGTH (0x8000 - 0x4000)
  43. #define L1_DATA_B_LENGTH 0x8000
  44. #define BFIN_DCACHESIZE (16*1024)
  45. #define BFIN_DSUPBANKS 1
  46. #else
  47. #define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
  48. #define L1_DATA_A_LENGTH (0x8000 - 0x4000)
  49. #define L1_DATA_B_LENGTH (0x8000 - 0x4000)
  50. #define BFIN_DCACHESIZE (32*1024)
  51. #define BFIN_DSUPBANKS 2
  52. #endif
  53. #else
  54. #define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
  55. #define L1_DATA_A_LENGTH 0x8000
  56. #define L1_DATA_B_LENGTH 0x8000
  57. #define BFIN_DCACHESIZE (0*1024)
  58. #define BFIN_DSUPBANKS 0
  59. #endif /*CONFIG_BFIN_DCACHE*/
  60. #endif
  61. /* Level 2 Memory */
  62. #define L2_START 0xFEB00000
  63. #define L2_LENGTH 0x20000
  64. /* Scratch Pad Memory */
  65. #define COREA_L1_SCRATCH_START 0xFFB00000
  66. #define COREB_L1_SCRATCH_START 0xFF700000
  67. #define L1_SCRATCH_START COREA_L1_SCRATCH_START
  68. #define L1_SCRATCH_LENGTH 0x1000
  69. #ifdef __ASSEMBLY__
  70. /*
  71. * The following macros both return the address of the PDA for the
  72. * current core.
  73. *
  74. * In its first safe (and hairy) form, the macro neither clobbers any
  75. * register aside of the output Preg, nor uses the stack, since it
  76. * could be called with an invalid stack pointer, or the current stack
  77. * space being uncovered by any CPLB (e.g. early exception handling).
  78. *
  79. * The constraints on the second form are a bit relaxed, and the code
  80. * is allowed to use the specified Dreg for determining the PDA
  81. * address to be returned into Preg.
  82. */
  83. #ifdef CONFIG_SMP
  84. #define GET_PDA_SAFE(preg) \
  85. preg.l = lo(DSPID); \
  86. preg.h = hi(DSPID); \
  87. preg = [preg]; \
  88. preg = preg << 2; \
  89. preg = preg << 2; \
  90. preg = preg << 2; \
  91. preg = preg << 2; \
  92. preg = preg << 2; \
  93. preg = preg << 2; \
  94. preg = preg << 2; \
  95. preg = preg << 2; \
  96. preg = preg << 2; \
  97. preg = preg << 2; \
  98. preg = preg << 2; \
  99. preg = preg << 2; \
  100. if cc jump 2f; \
  101. cc = preg == 0x0; \
  102. preg.l = _cpu_pda; \
  103. preg.h = _cpu_pda; \
  104. if !cc jump 3f; \
  105. 1: \
  106. /* preg = 0x0; */ \
  107. cc = !cc; /* restore cc to 0 */ \
  108. jump 4f; \
  109. 2: \
  110. cc = preg == 0x0; \
  111. preg.l = _cpu_pda; \
  112. preg.h = _cpu_pda; \
  113. if cc jump 4f; \
  114. /* preg = 0x1000000; */ \
  115. cc = !cc; /* restore cc to 1 */ \
  116. 3: \
  117. preg = [preg]; \
  118. 4:
  119. #define GET_PDA(preg, dreg) \
  120. preg.l = lo(DSPID); \
  121. preg.h = hi(DSPID); \
  122. dreg = [preg]; \
  123. preg.l = _cpu_pda; \
  124. preg.h = _cpu_pda; \
  125. cc = bittst(dreg, 0); \
  126. if !cc jump 1f; \
  127. preg = [preg]; \
  128. 1: \
  129. #define GET_CPUID(preg, dreg) \
  130. preg.l = lo(DSPID); \
  131. preg.h = hi(DSPID); \
  132. dreg = [preg]; \
  133. dreg = ROT dreg BY -1; \
  134. dreg = CC;
  135. #else
  136. #define GET_PDA_SAFE(preg) \
  137. preg.l = _cpu_pda; \
  138. preg.h = _cpu_pda;
  139. #define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
  140. #endif /* CONFIG_SMP */
  141. #endif /* __ASSEMBLY__ */
  142. #endif /* _MEM_MAP_533_H_ */