mem.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * (C) Copyright 2004
  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 _OMAP24XX_MEM_H_
  25. #define _OMAP24XX_MEM_H_
  26. #define SDRC_CS0_OSET 0x0
  27. #define SDRC_CS1_OSET 0x30 /* mirror CS1 regs appear offset 0x30 from CS0 */
  28. #ifndef __ASSEMBLY__
  29. /* struct's for holding data tables for current boards, they are getting used
  30. early in init when NO global access are there */
  31. struct sdrc_data_s {
  32. u32 sdrc_sharing;
  33. u32 sdrc_mdcfg_0_ddr;
  34. u32 sdrc_mdcfg_0_sdr;
  35. u32 sdrc_actim_ctrla_0;
  36. u32 sdrc_actim_ctrlb_0;
  37. u32 sdrc_rfr_ctrl;
  38. u32 sdrc_mr_0_ddr;
  39. u32 sdrc_mr_0_sdr;
  40. u32 sdrc_dllab_ctrl;
  41. } /*__attribute__ ((packed))*/;
  42. typedef struct sdrc_data_s sdrc_data_t;
  43. typedef enum {
  44. STACKED = 0,
  45. IP_DDR = 1,
  46. COMBO_DDR = 2,
  47. IP_SDR = 3,
  48. } mem_t;
  49. #endif
  50. /* Slower full frequency range default timings for x32 operation*/
  51. #define H4_2420_SDRC_SHARING 0x00000100
  52. #define H4_2420_SDRC_MDCFG_0_SDR 0x00D04010 /* discrete sdr module */
  53. #define H4_2420_SDRC_MR_0_SDR 0x00000031
  54. #define H4_2420_SDRC_MDCFG_0_DDR 0x01702011 /* descrite ddr module */
  55. #define H4_2420_COMBO_MDCFG_0_DDR 0x00801011 /* combo module */
  56. #define H4_2420_SDRC_MR_0_DDR 0x00000032
  57. #define H4_2422_SDRC_SHARING 0x00004b00
  58. #define H4_2422_SDRC_MDCFG_0_DDR 0x00801011 /* stacked ddr on 2422 */
  59. #define H4_2422_SDRC_MR_0_DDR 0x00000032
  60. /* ES1 work around timings */
  61. #define H4_242x_SDRC_ACTIM_CTRLA_0_ES1 0x9bead909 /* 165Mhz for use with 100/133 */
  62. #define H4_242x_SDRC_ACTIM_CTRLB_0_ES1 0x00000020
  63. #define H4_242x_SDRC_RFR_CTRL_ES1 0x00002401 /* use over refresh for ES1 */
  64. /* optimized timings good for current shipping parts */
  65. #define H4_242X_SDRC_ACTIM_CTRLA_0_100MHz 0x5A59B485
  66. #define H4_242X_SDRC_ACTIM_CTRLB_0_100MHz 0x0000000e
  67. #define H4_242X_SDRC_ACTIM_CTRLA_0_133MHz 0x8BA6E6C8 /* temp warn 0 settings */
  68. #define H4_242X_SDRC_ACTIM_CTRLB_0_133MHz 0x00000010 /* temp warn 0 settings */
  69. #define H4_242X_SDRC_RFR_CTRL_100MHz 0x0002da01
  70. #define H4_242X_SDRC_RFR_CTRL_133MHz 0x0003de01
  71. #define H4_242x_SDRC_DLLAB_CTRL_100MHz 0x0000980E /* 72deg, allow DPLLout*1 to work (combo)*/
  72. #define H4_242x_SDRC_DLLAB_CTRL_133MHz 0x0000690E /* 72deg, for ES2 */
  73. #ifdef PRCM_CONFIG_II
  74. # define H4_2420_SDRC_ACTIM_CTRLA_0 H4_242X_SDRC_ACTIM_CTRLA_0_100MHz
  75. # define H4_2420_SDRC_ACTIM_CTRLB_0 H4_242X_SDRC_ACTIM_CTRLB_0_100MHz
  76. # define H4_2420_SDRC_RFR_CTRL H4_242X_SDRC_RFR_CTRL_100MHz
  77. # define H4_2420_SDRC_DLLAB_CTRL H4_242x_SDRC_DLLAB_CTRL_100MHz
  78. # define H4_2422_SDRC_ACTIM_CTRLA_0 H4_242X_SDRC_ACTIM_CTRLA_0_100MHz
  79. # define H4_2422_SDRC_ACTIM_CTRLB_0 H4_242X_SDRC_ACTIM_CTRLB_0_100MHz
  80. # define H4_2422_SDRC_RFR_CTRL H4_242X_SDRC_RFR_CTRL_100MHz
  81. # define H4_2422_SDRC_DLLAB_CTRL H4_242x_SDRC_DLLAB_CTRL_100MHz
  82. #elif PRCM_CONFIG_III
  83. # define H4_2420_SDRC_ACTIM_CTRLA_0 H4_242X_SDRC_ACTIM_CTRLA_0_133MHz
  84. # define H4_2420_SDRC_ACTIM_CTRLB_0 H4_242X_SDRC_ACTIM_CTRLB_0_133MHz
  85. # define H4_2420_SDRC_RFR_CTRL H4_242X_SDRC_RFR_CTRL_133MHz
  86. # define H4_2420_SDRC_DLLAB_CTRL H4_242x_SDRC_DLLAB_CTRL_133MHz
  87. # define H4_2422_SDRC_ACTIM_CTRLA_0 H4_242X_SDRC_ACTIM_CTRLA_0_100MHz
  88. # define H4_2422_SDRC_ACTIM_CTRLB_0 H4_242X_SDRC_ACTIM_CTRLB_0_100MHz
  89. # define H4_2422_SDRC_RFR_CTRL H4_242X_SDRC_RFR_CTRL_100MHz
  90. # define H4_2422_SDRC_DLLAB_CTRL H4_242x_SDRC_DLLAB_CTRL_100MHz
  91. #endif
  92. /* GPMC settings */
  93. #ifdef PRCM_CONFIG_II /* L3 at 100MHz */
  94. # ifdef CONFIG_SYS_NAND_BOOT
  95. # define H4_24XX_GPMC_CONFIG1_0 0x0
  96. # define H4_24XX_GPMC_CONFIG2_0 0x00141400
  97. # define H4_24XX_GPMC_CONFIG3_0 0x00141400
  98. # define H4_24XX_GPMC_CONFIG4_0 0x0F010F01
  99. # define H4_24XX_GPMC_CONFIG5_0 0x010C1414
  100. # define H4_24XX_GPMC_CONFIG6_0 0x00000A80
  101. # else /* else NOR */
  102. # define H4_24XX_GPMC_CONFIG1_0 0x3
  103. # define H4_24XX_GPMC_CONFIG2_0 0x000f0f01
  104. # define H4_24XX_GPMC_CONFIG3_0 0x00050502
  105. # define H4_24XX_GPMC_CONFIG4_0 0x0C060C06
  106. # define H4_24XX_GPMC_CONFIG5_0 0x01131F1F
  107. # endif /* endif CONFIG_SYS_NAND_BOOT */
  108. # define H4_24XX_GPMC_CONFIG7_0 (0x00000C40|(H4_CS0_BASE >> 24))
  109. # define H4_24XX_GPMC_CONFIG1_1 0x00011000
  110. # define H4_24XX_GPMC_CONFIG2_1 0x001F1F00
  111. # define H4_24XX_GPMC_CONFIG3_1 0x00080802
  112. # define H4_24XX_GPMC_CONFIG4_1 0x1C091C09
  113. # define H4_24XX_GPMC_CONFIG5_1 0x031A1F1F
  114. # define H4_24XX_GPMC_CONFIG6_1 0x000003C2
  115. # define H4_24XX_GPMC_CONFIG7_1 (0x00000F40|(H4_CS1_BASE >> 24))
  116. #endif /* endif PRCM_CONFIG_II */
  117. #ifdef PRCM_CONFIG_III /* L3 at 133MHz */
  118. # ifdef CONFIG_SYS_NAND_BOOT
  119. # define H4_24XX_GPMC_CONFIG1_0 0x0
  120. # define H4_24XX_GPMC_CONFIG2_0 0x00141400
  121. # define H4_24XX_GPMC_CONFIG3_0 0x00141400
  122. # define H4_24XX_GPMC_CONFIG4_0 0x0F010F01
  123. # define H4_24XX_GPMC_CONFIG5_0 0x010C1414
  124. # define H4_24XX_GPMC_CONFIG6_0 0x00000A80
  125. # else /* NOR boot */
  126. # define H4_24XX_GPMC_CONFIG1_0 0x3
  127. # define H4_24XX_GPMC_CONFIG2_0 0x00151501
  128. # define H4_24XX_GPMC_CONFIG3_0 0x00060602
  129. # define H4_24XX_GPMC_CONFIG4_0 0x10081008
  130. # define H4_24XX_GPMC_CONFIG5_0 0x01131F1F
  131. # define H4_24XX_GPMC_CONFIG6_0 0x000004c4
  132. # endif /* endif CONFIG_SYS_NAND_BOOT */
  133. # define H4_24XX_GPMC_CONFIG7_0 (0x00000C40|(H4_CS0_BASE >> 24))
  134. # define H4_24XX_GPMC_CONFIG1_1 0x00011000
  135. # define H4_24XX_GPMC_CONFIG2_1 0x001f1f01
  136. # define H4_24XX_GPMC_CONFIG3_1 0x00080803
  137. # define H4_24XX_GPMC_CONFIG4_1 0x1C091C09
  138. # define H4_24XX_GPMC_CONFIG5_1 0x041f1F1F
  139. # define H4_24XX_GPMC_CONFIG6_1 0x000004C4
  140. # define H4_24XX_GPMC_CONFIG7_1 (0x00000F40|(H4_CS1_BASE >> 24))
  141. #endif /* endif CONFIG_SYS_PRCM_III */
  142. #endif /* endif _OMAP24XX_MEM_H_ */