mem.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * (C) Copyright 2005-2007
  3. * Samsung Electronics,
  4. * Kyungmin Park <kyungmin.park@samsung.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 _APOLLON_OMAP24XX_MEM_H_
  25. #define _APOLLON_OMAP24XX_MEM_H_
  26. /* Slower full frequency range default timings for x32 operation*/
  27. #define APOLLON_2420_SDRC_SHARING 0x00000100
  28. #define APOLLON_2420_SDRC_MDCFG_0_DDR 0x00d04011
  29. #define APOLLON_2420_SDRC_MR_0_DDR 0x00000032
  30. /* optimized timings good for current shipping parts */
  31. #define APOLLON_242X_SDRC_ACTIM_CTRLA_0_100MHz 0x4A59B485
  32. #define APOLLON_242X_SDRC_ACTIM_CTRLB_0_100MHz 0x0000000C
  33. #define APOLLON_242X_SDRC_ACTIM_CTRLA_0_166MHz 0x7BA35907
  34. #define APOLLON_242X_SDRC_ACTIM_CTRLB_0_166MHz 0x00000013
  35. #define APOLLON_242X_SDRC_RFR_CTRL_100MHz 0x00030001
  36. #define APOLLON_242X_SDRC_RFR_CTRL_166MHz 0x00044C01
  37. #define APOLLON_242x_SDRC_DLLAB_CTRL_100MHz 0x00007306
  38. #define APOLLON_242x_SDRC_DLLAB_CTRL_166MHz 0x00000506
  39. #ifdef PRCM_CONFIG_I
  40. #define APOLLON_2420_SDRC_ACTIM_CTRLA_0 APOLLON_242X_SDRC_ACTIM_CTRLA_0_166MHz
  41. #define APOLLON_2420_SDRC_ACTIM_CTRLB_0 APOLLON_242X_SDRC_ACTIM_CTRLB_0_166MHz
  42. #define APOLLON_2420_SDRC_RFR_CTRL APOLLON_242X_SDRC_RFR_CTRL_166MHz
  43. #define APOLLON_2420_SDRC_DLLAB_CTRL APOLLON_242x_SDRC_DLLAB_CTRL_166MHz
  44. #elif PRCM_CONFIG_II
  45. #define APOLLON_2420_SDRC_ACTIM_CTRLA_0 APOLLON_242X_SDRC_ACTIM_CTRLA_0_100MHz
  46. #define APOLLON_2420_SDRC_ACTIM_CTRLB_0 APOLLON_242X_SDRC_ACTIM_CTRLB_0_100MHz
  47. #define APOLLON_2420_SDRC_RFR_CTRL APOLLON_242X_SDRC_RFR_CTRL_100MHz
  48. #define APOLLON_2420_SDRC_DLLAB_CTRL APOLLON_242x_SDRC_DLLAB_CTRL_100MHz
  49. #endif
  50. /* GPMC settings */
  51. #ifdef PRCM_CONFIG_I /* L3 at 165MHz */
  52. /* CS0: OneNAND */
  53. # define APOLLON_24XX_GPMC_CONFIG1_0 0x00000001
  54. # define APOLLON_24XX_GPMC_CONFIG2_0 0x000c1000
  55. # define APOLLON_24XX_GPMC_CONFIG3_0 0x00030400
  56. # define APOLLON_24XX_GPMC_CONFIG4_0 0x0b841006
  57. # define APOLLON_24XX_GPMC_CONFIG5_0 0x020f0c11
  58. # define APOLLON_24XX_GPMC_CONFIG6_0 0x00000000
  59. # define APOLLON_24XX_GPMC_CONFIG7_0 (0x00000e40|(APOLLON_CS0_BASE >> 24))
  60. /* CS1: Ethernet */
  61. # define APOLLON_24XX_GPMC_CONFIG1_1 0x00011203
  62. # define APOLLON_24XX_GPMC_CONFIG2_1 0x001F1F01
  63. # define APOLLON_24XX_GPMC_CONFIG3_1 0x00080803
  64. # define APOLLON_24XX_GPMC_CONFIG4_1 0x1C0b1C0a
  65. # define APOLLON_24XX_GPMC_CONFIG5_1 0x041F1F1F
  66. # define APOLLON_24XX_GPMC_CONFIG6_1 0x000004C4
  67. # define APOLLON_24XX_GPMC_CONFIG7_1 (0x00000F40|(APOLLON_CS1_BASE >> 24))
  68. /* CS2: OneNAND */
  69. /* It's same as CS0 */
  70. # define APOLLON_24XX_GPMC_CONFIG7_2 (0x00000e40|(APOLLON_CS2_BASE >> 24))
  71. /* CS3: NOR */
  72. #ifdef ASYNC_NOR
  73. # define APOLLON_24XX_GPMC_CONFIG1_3 0x00021201
  74. # define APOLLON_24XX_GPMC_CONFIG2_3 0x00121601
  75. # define APOLLON_24XX_GPMC_CONFIG3_3 0x00040401
  76. # define APOLLON_24XX_GPMC_CONFIG4_3 0x12061605
  77. # define APOLLON_24XX_GPMC_CONFIG5_3 0x01151317
  78. #else
  79. # define SYNC_NOR_VALUE 0x24aaa
  80. # define APOLLON_24XX_GPMC_CONFIG1_3 0xe5011211
  81. # define APOLLON_24XX_GPMC_CONFIG2_3 0x00090b01
  82. # define APOLLON_24XX_GPMC_CONFIG3_3 0x00020201
  83. # define APOLLON_24XX_GPMC_CONFIG4_3 0x09030b03
  84. # define APOLLON_24XX_GPMC_CONFIG5_3 0x010a0a0c
  85. #endif /* ASYNC_NOR */
  86. # define APOLLON_24XX_GPMC_CONFIG6_3 0x00000000
  87. # define APOLLON_24XX_GPMC_CONFIG7_3 (0x00000e40|(APOLLON_CS3_BASE >> 24))
  88. #endif /* endif PRCM_CONFIG_I */
  89. #ifdef PRCM_CONFIG_II /* L3 at 100MHz */
  90. /* CS0: OneNAND */
  91. # define APOLLON_24XX_GPMC_CONFIG1_0 0x00000001
  92. # define APOLLON_24XX_GPMC_CONFIG2_0 0x00081080
  93. # define APOLLON_24XX_GPMC_CONFIG3_0 0x00030300
  94. # define APOLLON_24XX_GPMC_CONFIG4_0 0x08041004
  95. # define APOLLON_24XX_GPMC_CONFIG5_0 0x020b0910
  96. # define APOLLON_24XX_GPMC_CONFIG6_0 0x00000000
  97. # define APOLLON_24XX_GPMC_CONFIG7_0 (0x00000C40|(APOLLON_CS0_BASE >> 24))
  98. /* CS1: ethernet */
  99. # define APOLLON_24XX_GPMC_CONFIG1_1 0x00401203
  100. # define APOLLON_24XX_GPMC_CONFIG2_1 0x001F1F01
  101. # define APOLLON_24XX_GPMC_CONFIG3_1 0x00080803
  102. # define APOLLON_24XX_GPMC_CONFIG4_1 0x1C091C09
  103. # define APOLLON_24XX_GPMC_CONFIG5_1 0x041F1F1F
  104. # define APOLLON_24XX_GPMC_CONFIG6_1 0x000004C4
  105. # define APOLLON_24XX_GPMC_CONFIG7_1 (0x00000F40|(APOLLON_CS1_BASE >> 24))
  106. /* CS2: OneNAND */
  107. /* It's same as CS0 */
  108. # define APOLLON_24XX_GPMC_CONFIG7_2 (0x00000e40|(APOLLON_CS2_BASE >> 24))
  109. /* CS3: NOR */
  110. #define ASYNC_NOR
  111. #ifdef ASYNC_NOR
  112. # define APOLLON_24XX_GPMC_CONFIG1_3 0x00021201
  113. # define APOLLON_24XX_GPMC_CONFIG2_3 0x00121601
  114. # define APOLLON_24XX_GPMC_CONFIG3_3 0x00040401
  115. # define APOLLON_24XX_GPMC_CONFIG4_3 0x12061605
  116. # define APOLLON_24XX_GPMC_CONFIG5_3 0x01151317
  117. #else
  118. # define SYNC_NOR_VALUE 0x24aaa
  119. # define APOLLON_24XX_GPMC_CONFIG1_3 0xe1001202
  120. # define APOLLON_24XX_GPMC_CONFIG2_3 0x00151501
  121. # define APOLLON_24XX_GPMC_CONFIG3_3 0x00050501
  122. # define APOLLON_24XX_GPMC_CONFIG4_3 0x0e070e07
  123. # define APOLLON_24XX_GPMC_CONFIG5_3 0x01131F1F
  124. #endif /* ASYNC_NOR */
  125. # define APOLLON_24XX_GPMC_CONFIG6_3 0x00000000
  126. # define APOLLON_24XX_GPMC_CONFIG7_3 (0x00000C40|(APOLLON_CS3_BASE >> 24))
  127. #endif /* endif PRCM_CONFIG_II */
  128. #ifdef PRCM_CONFIG_III /* L3 at 133MHz */
  129. # ifdef CFG_NAND_BOOT
  130. # define APOLLON_24XX_GPMC_CONFIG1_0 0x0
  131. # define APOLLON_24XX_GPMC_CONFIG2_0 0x00141400
  132. # define APOLLON_24XX_GPMC_CONFIG3_0 0x00141400
  133. # define APOLLON_24XX_GPMC_CONFIG4_0 0x0F010F01
  134. # define APOLLON_24XX_GPMC_CONFIG5_0 0x010C1414
  135. # define APOLLON_24XX_GPMC_CONFIG6_0 0x00000A80
  136. # else /* NOR boot */
  137. # define APOLLON_24XX_GPMC_CONFIG1_0 0x3
  138. # define APOLLON_24XX_GPMC_CONFIG2_0 0x00151501
  139. # define APOLLON_24XX_GPMC_CONFIG3_0 0x00060602
  140. # define APOLLON_24XX_GPMC_CONFIG4_0 0x10081008
  141. # define APOLLON_24XX_GPMC_CONFIG5_0 0x01131F1F
  142. # define APOLLON_24XX_GPMC_CONFIG6_0 0x000004c4
  143. # endif /* endif CFG_NAND_BOOT */
  144. # define APOLLON_24XX_GPMC_CONFIG7_0 (0x00000C40|(APOLLON_CS0_BASE >> 24))
  145. # define APOLLON_24XX_GPMC_CONFIG1_1 0x00011000
  146. # define APOLLON_24XX_GPMC_CONFIG2_1 0x001f1f01
  147. # define APOLLON_24XX_GPMC_CONFIG3_1 0x00080803
  148. # define APOLLON_24XX_GPMC_CONFIG4_1 0x1C091C09
  149. # define APOLLON_24XX_GPMC_CONFIG5_1 0x041f1F1F
  150. # define APOLLON_24XX_GPMC_CONFIG6_1 0x000004C4
  151. # define APOLLON_24XX_GPMC_CONFIG7_1 (0x00000F40|(APOLLON_CS1_BASE >> 24))
  152. #endif /* endif CFG_PRCM_III */
  153. #endif /* endif _APOLLON_OMAP24XX_MEM_H_ */