mem.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * (C) Copyright 2006-2008
  3. * Texas Instruments, <www.ti.com>
  4. * Richard Woodruff <r-woodruff2@ti.com>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. #ifndef _MEM_H_
  25. #define _MEM_H_
  26. #define CS0 0x0
  27. #define CS1 0x1 /* mirror CS1 regs appear offset 0x30 from CS0 */
  28. #ifndef __ASSEMBLY__
  29. enum {
  30. STACKED = 0,
  31. IP_DDR = 1,
  32. COMBO_DDR = 2,
  33. IP_SDR = 3,
  34. };
  35. #endif /* __ASSEMBLY__ */
  36. #define EARLY_INIT 1
  37. /* Slower full frequency range default timings for x32 operation*/
  38. #define SDRC_SHARING 0x00000100
  39. #define SDRC_MR_0_SDR 0x00000031
  40. #define DLL_OFFSET 0
  41. #define DLL_WRITEDDRCLKX2DIS 1
  42. #define DLL_ENADLL 1
  43. #define DLL_LOCKDLL 0
  44. #define DLL_DLLPHASE_72 0
  45. #define DLL_DLLPHASE_90 1
  46. /* rkw - need to find of 90/72 degree recommendation for speed like before */
  47. #define SDP_SDRC_DLLAB_CTRL ((DLL_ENADLL << 3) | \
  48. (DLL_LOCKDLL << 2) | (DLL_DLLPHASE_90 << 1))
  49. /* Infineon part of 3430SDP (165MHz optimized) 6.06ns
  50. * ACTIMA
  51. * TDAL = Twr/Tck + Trp/tck = 15/6 + 18/6 = 2.5 + 3 = 5.5 -> 6
  52. * TDPL (Twr) = 15/6 = 2.5 -> 3
  53. * TRRD = 12/6 = 2
  54. * TRCD = 18/6 = 3
  55. * TRP = 18/6 = 3
  56. * TRAS = 42/6 = 7
  57. * TRC = 60/6 = 10
  58. * TRFC = 72/6 = 12
  59. * ACTIMB
  60. * TCKE = 2
  61. * XSR = 120/6 = 20
  62. */
  63. #define TDAL_165 6
  64. #define TDPL_165 3
  65. #define TRRD_165 2
  66. #define TRCD_165 3
  67. #define TRP_165 3
  68. #define TRAS_165 7
  69. #define TRC_165 10
  70. #define TRFC_165 21
  71. #define V_ACTIMA_165 ((TRFC_165 << 27) | (TRC_165 << 22) | \
  72. (TRAS_165 << 18) | (TRP_165 << 15) | \
  73. (TRCD_165 << 12) | (TRRD_165 << 9) | \
  74. (TDPL_165 << 6) | (TDAL_165))
  75. #define TWTR_165 1
  76. #define TCKE_165 1
  77. #define TXP_165 5
  78. #define XSR_165 23
  79. #define V_ACTIMB_165 (((TCKE_165 << 12) | (XSR_165 << 0)) | \
  80. (TXP_165 << 8) | (TWTR_165 << 16))
  81. /*
  82. * GPMC settings -
  83. * Definitions is as per the following format
  84. * #define <PART>_GPMC_CONFIG<x> <value>
  85. * Where:
  86. * PART is the part name e.g. STNOR - Intel Strata Flash
  87. * x is GPMC config registers from 1 to 6 (there will be 6 macros)
  88. * Value is corresponding value
  89. *
  90. * For every valid PRCM configuration there should be only one definition of
  91. * the same. if values are independent of the board, this definition will be
  92. * present in this file if values are dependent on the board, then this should
  93. * go into corresponding mem-boardName.h file
  94. *
  95. * Currently valid part Names are (PART):
  96. * STNOR - Intel Strata Flash
  97. * SMNAND - Samsung NAND
  98. * MPDB - H4 MPDB board
  99. * SBNOR - Sibley NOR
  100. * MNAND - Micron Large page x16 NAND
  101. * ONNAND - Samsung One NAND
  102. *
  103. * include/configs/file.h contains the defn - for all CS we are interested
  104. * #define OMAP34XX_GPMC_CSx PART
  105. * #define OMAP34XX_GPMC_CSx_SIZE Size
  106. * #define OMAP34XX_GPMC_CSx_MAP Map
  107. * Where:
  108. * x - CS number
  109. * PART - Part Name as defined above
  110. * SIZE - how big is the mapping to be
  111. * GPMC_SIZE_128M - 0x8
  112. * GPMC_SIZE_64M - 0xC
  113. * GPMC_SIZE_32M - 0xE
  114. * GPMC_SIZE_16M - 0xF
  115. * MAP - Map this CS to which address(GPMC address space)- Absolute address
  116. * >>24 before being used.
  117. */
  118. #define GPMC_SIZE_128M 0x8
  119. #define GPMC_SIZE_64M 0xC
  120. #define GPMC_SIZE_32M 0xE
  121. #define GPMC_SIZE_16M 0xF
  122. #define SMNAND_GPMC_CONFIG1 0x00000800
  123. #define SMNAND_GPMC_CONFIG2 0x00141400
  124. #define SMNAND_GPMC_CONFIG3 0x00141400
  125. #define SMNAND_GPMC_CONFIG4 0x0F010F01
  126. #define SMNAND_GPMC_CONFIG5 0x010C1414
  127. #define SMNAND_GPMC_CONFIG6 0x1F0F0A80
  128. #define SMNAND_GPMC_CONFIG7 0x00000C44
  129. #define M_NAND_GPMC_CONFIG1 0x00001800
  130. #define M_NAND_GPMC_CONFIG2 0x00141400
  131. #define M_NAND_GPMC_CONFIG3 0x00141400
  132. #define M_NAND_GPMC_CONFIG4 0x0F010F01
  133. #define M_NAND_GPMC_CONFIG5 0x010C1414
  134. #define M_NAND_GPMC_CONFIG6 0x1f0f0A80
  135. #define M_NAND_GPMC_CONFIG7 0x00000C44
  136. #define STNOR_GPMC_CONFIG1 0x3
  137. #define STNOR_GPMC_CONFIG2 0x00151501
  138. #define STNOR_GPMC_CONFIG3 0x00060602
  139. #define STNOR_GPMC_CONFIG4 0x11091109
  140. #define STNOR_GPMC_CONFIG5 0x01141F1F
  141. #define STNOR_GPMC_CONFIG6 0x000004c4
  142. #define SIBNOR_GPMC_CONFIG1 0x1200
  143. #define SIBNOR_GPMC_CONFIG2 0x001f1f00
  144. #define SIBNOR_GPMC_CONFIG3 0x00080802
  145. #define SIBNOR_GPMC_CONFIG4 0x1C091C09
  146. #define SIBNOR_GPMC_CONFIG5 0x01131F1F
  147. #define SIBNOR_GPMC_CONFIG6 0x1F0F03C2
  148. #define SDPV2_MPDB_GPMC_CONFIG1 0x00611200
  149. #define SDPV2_MPDB_GPMC_CONFIG2 0x001F1F01
  150. #define SDPV2_MPDB_GPMC_CONFIG3 0x00080803
  151. #define SDPV2_MPDB_GPMC_CONFIG4 0x1D091D09
  152. #define SDPV2_MPDB_GPMC_CONFIG5 0x041D1F1F
  153. #define SDPV2_MPDB_GPMC_CONFIG6 0x1D0904C4
  154. #define MPDB_GPMC_CONFIG1 0x00011000
  155. #define MPDB_GPMC_CONFIG2 0x001f1f01
  156. #define MPDB_GPMC_CONFIG3 0x00080803
  157. #define MPDB_GPMC_CONFIG4 0x1c0b1c0a
  158. #define MPDB_GPMC_CONFIG5 0x041f1F1F
  159. #define MPDB_GPMC_CONFIG6 0x1F0F04C4
  160. #define P2_GPMC_CONFIG1 0x0
  161. #define P2_GPMC_CONFIG2 0x0
  162. #define P2_GPMC_CONFIG3 0x0
  163. #define P2_GPMC_CONFIG4 0x0
  164. #define P2_GPMC_CONFIG5 0x0
  165. #define P2_GPMC_CONFIG6 0x0
  166. #define ONENAND_GPMC_CONFIG1 0x00001200
  167. #define ONENAND_GPMC_CONFIG2 0x000F0F01
  168. #define ONENAND_GPMC_CONFIG3 0x00030301
  169. #define ONENAND_GPMC_CONFIG4 0x0F040F04
  170. #define ONENAND_GPMC_CONFIG5 0x010F1010
  171. #define ONENAND_GPMC_CONFIG6 0x1F060000
  172. #define NET_GPMC_CONFIG1 0x00001000
  173. #define NET_GPMC_CONFIG2 0x001e1e01
  174. #define NET_GPMC_CONFIG3 0x00080300
  175. #define NET_GPMC_CONFIG4 0x1c091c09
  176. #define NET_GPMC_CONFIG5 0x04181f1f
  177. #define NET_GPMC_CONFIG6 0x00000FCF
  178. #define NET_GPMC_CONFIG7 0x00000f6c
  179. /* max number of GPMC Chip Selects */
  180. #define GPMC_MAX_CS 8
  181. /* max number of GPMC regs */
  182. #define GPMC_MAX_REG 7
  183. #define PISMO1_NOR 1
  184. #define PISMO1_NAND 2
  185. #define PISMO2_CS0 3
  186. #define PISMO2_CS1 4
  187. #define PISMO1_ONENAND 5
  188. #define DBG_MPDB 6
  189. #define PISMO2_NAND_CS0 7
  190. #define PISMO2_NAND_CS1 8
  191. /* make it readable for the gpmc_init */
  192. #define PISMO1_NOR_BASE FLASH_BASE
  193. #define PISMO1_NAND_BASE NAND_BASE
  194. #define PISMO2_CS0_BASE PISMO2_MAP1
  195. #define PISMO1_ONEN_BASE ONENAND_MAP
  196. #define DBG_MPDB_BASE DEBUG_BASE
  197. #endif /* endif _MEM_H_ */