at91_sdramc.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. #ifndef _ARCH_ARM_AT91_SDRAMC_H_
  2. #define _ARCH_ARM_AT91_SDRAMC_H_
  3. /*
  4. * Copyright (C) 2006 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
  23. * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. */
  34. /*!
  35. * \file arch/arm/at91_sdramc.h
  36. * \brief AT91 SDRAM controller.
  37. *
  38. * \verbatim
  39. *
  40. * $Log: at91_sdramc.h,v $
  41. * Revision 1.1 2006/08/31 19:10:38 haraldkipp
  42. * New peripheral register definitions for the AT91SAM9260.
  43. *
  44. *
  45. * \endverbatim
  46. */
  47. /*!
  48. * \addtogroup xgNutArchArmAt91Sdramc
  49. */
  50. /*@{*/
  51. /*! \name SDRAM Controller Mode Register */
  52. /*@{*/
  53. #define SDRAMC_MR_OFF 0x00000000 /*!< \brief Mode register offset. */
  54. #define SDRAMC_MR (SDRAMC_BASE + SDRAMC_MR_OFF) /*!< \brief Mode register address. */
  55. #define SDRAMC_MODE 0x00000007 /*!< \brief Command mode mask. */
  56. #define SDRAMC_MODE_NORMAL 0x00000000 /*!< \brief Normal mode. */
  57. #define SDRAMC_MODE_NOP 0x00000001 /*!< \brief Issues a NOP command when accessed. */
  58. #define SDRAMC_MODE_PRCGALL 0x00000002 /*!< \brief Issues an "All Banks Precharge" command when accessed. */
  59. #define SDRAMC_MODE_LMR 0x00000003 /*!< \brief Issues a "Load Mode Register" command when accessed. */
  60. #define SDRAMC_MODE_RFSH 0x00000004 /*!< \brief Issues a "Auto Refresh" command when accessed. */
  61. #define SDRAMC_MODE_EXT_LMR 0x00000005 /*!< \brief Issues a "Extended Load Mode Register" command when accessed. */
  62. #define SDRAMC_MODE_DEEP 0x00000006 /*!< \brief Enters deep power down mode. */
  63. /*@}*/
  64. /*! \name SDRAM Controller Refresh Timer Register */
  65. /*@{*/
  66. #define SDRAMC_TR_OFF 0x00000004 /*!< \brief Refresh timer register offset. */
  67. #define SDRAMC_TR (SDRAMC_BASE + SDRAMC_TR_OFF) /*!< \brief Refresh timer register address. */
  68. #define SDRAMC_COUNT 0x00000FFF /*!< \brief Refresh timer count mask. */
  69. /*@}*/
  70. /*! \name SDRAM Controller Configuration Register */
  71. /*@{*/
  72. #define SDRAMC_CR_OFF 0x00000008 /*!< \brief Configuration register offset. */
  73. #define SDRAMC_CR (SDRAMC_BASE + SDRAMC_CR_OFF) /*!< \brief Configuration register address. */
  74. #define SDRAMC_NC 0x00000003 /*!< \brief Number of column bits. */
  75. #define SDRAMC_NC_8 0x00000000 /*!< \brief 8 column bits. */
  76. #define SDRAMC_NC_9 0x00000001 /*!< \brief 9 column bits. */
  77. #define SDRAMC_NC_10 0x00000002 /*!< \brief 10 column bits. */
  78. #define SDRAMC_NC_11 0x00000003 /*!< \brief 11 column bits. */
  79. #define SDRAMC_NR 0x0000000C /*!< \brief Number of row bits. */
  80. #define SDRAMC_NR_11 0x00000000 /*!< \brief 11 row bits. */
  81. #define SDRAMC_NR_12 0x00000004 /*!< \brief 12 row bits. */
  82. #define SDRAMC_NR_13 0x00000008 /*!< \brief 13 row bits. */
  83. #define SDRAMC_NB 0x00000010 /*!< \brief 4 banks. */
  84. #define SDRAMC_CAS 0x00000060 /*!< \brief CAS latency. */
  85. #define SDRAMC_CAS_1 0x00000020 /*!< \brief CAS latency of 1 cycle. */
  86. #define SDRAMC_CAS_2 0x00000040 /*!< \brief CAS latency of 2 cycles. */
  87. #define SDRAMC_CAS_3 0x00000060 /*!< \brief CAS latency of 3 cycles. */
  88. #define SDRAMC_DBW 0x00000080 /*!< \brief 16-bit data bus. */
  89. #define SDRAMC_TWR 0x00000F00 /*!< \brief Write recovery delay. */
  90. #define SDRAMC_TWR_LSB 8 /*!< \brief Write recovery delay. */
  91. #define SDRAMC_TRC 0x0000F000 /*!< \brief Row cycle delay. */
  92. #define SDRAMC_TRC_LSB 12 /*!< \brief Row cycle delay. */
  93. #define SDRAMC_TRP 0x000F0000 /*!< \brief Row precharge delay. */
  94. #define SDRAMC_TRP_LSB 16 /*!< \brief Row precharge delay. */
  95. #define SDRAMC_TRCD 0x00F00000 /*!< \brief Row to column delay. */
  96. #define SDRAMC_TRCD_LSB 20 /*!< \brief Row to column delay. */
  97. #define SDRAMC_TRAS 0x0F000000 /*!< \brief Active to precharge delay. */
  98. #define SDRAMC_TRAS_LSB 24 /*!< \brief Active to precharge delay. */
  99. #define SDRAMC_TXSR 0xF0000000 /*!< \brief Exit self refresh to active delay. */
  100. #define SDRAMC_TXSR_LSB 28 /*!< \brief Exit self refresh to active delay. */
  101. /*@}*/
  102. /*! \name SDRAM Controller Low Power Register */
  103. /*@{*/
  104. #define SDRAMC_LPR_OFF 0x00000010 /*!< \brief Low power register offset. */
  105. #define SDRAMC_LPR (SDRAMC_BASE + SDRAMC_LPR_OFF) /*!< \brief Low power register address. */
  106. #define SDRAMC_LPCB 0x00000003 /*!< \brief Low power configuration mask. */
  107. #define SDRAMC_LPCB_DISABLE 0x00000000 /*!< \brief Low power feature disabled. */
  108. #define SDRAMC_LPCB_SELF_REFRESH 0x00000001 /*!< \brief Enable self refresh. */
  109. #define SDRAMC_LPCB_POWER_DOWN 0x00000002 /*!< \brief Issues a "Power Down" command when accessed.. */
  110. #define SDRAMC_LPCB_DEEP_POWER_DOWN 0x00000003 /*!< \brief Enters deep power down mode. */
  111. #define SDRAMC_PASR 0x00000070 /*!< \brief Partial array self-refresh mask. */
  112. #define SDRAMC_PASR_LSB 4 /*!< \brief Partial array self-refresh LSB. */
  113. #define SDRAMC_TCSR 0x00000300 /*!< \brief Temperature compensated self-refresh mask. */
  114. #define SDRAMC_TCSR_LSB 8 /*!< \brief Temperature compensated self-refresh LSB. */
  115. #define SDRAMC_DS 0x00000C00 /*!< \brief Drive strength mask. */
  116. #define SDRAMC_DS_LSB 10 /*!< \brief Drive strength LSB. */
  117. #define SDRAMC_TIMEOUT 0x00003000 /*!< \brief Mask of time to define when low-power mode is enabled. */
  118. #define SDRAMC_TIMEOUT_0 0x00000000 /*!< \brief Activate immediately. */
  119. #define SDRAMC_TIMEOUT_64 0x00001000 /*!< \brief Activate after 64 clock cycles after the end of the last transfer. */
  120. #define SDRAMC_TIMEOUT_128 0x00002000 /*!< \brief Activate after 64 clock cycles after the end of the last transfer. */
  121. /*@}*/
  122. /*! \name SDRAM Controller Interrupt Registers */
  123. /*@{*/
  124. #define SDRAMC_IER_OFF 0x00000014 /*!< \brief Interrupt enable register offset. */
  125. #define SDRAMC_IER (SDRAMC_BASE + SDRAMC_IER_OFF) /*!< \brief Interrupt enable register address. */
  126. #define SDRAMC_IDR_OFF 0x00000018 /*!< \brief Interrupt disable register offset. */
  127. #define SDRAMC_IDR (SDRAMC_BASE + SDRAMC_IDR_OFF) /*!< \brief Interrupt disable register address. */
  128. #define SDRAMC_IMR_OFF 0x0000001C /*!< \brief Interrupt mask register offset. */
  129. #define SDRAMC_IMR (SDRAMC_BASE + SDRAMC_IMR_OFF) /*!< \brief Interrupt mask register address. */
  130. #define SDRAMC_ISR_OFF 0x00000020 /*!< \brief Interrupt status register offset. */
  131. #define SDRAMC_ISR (SDRAMC_BASE + SDRAMC_ISR_OFF) /*!< \brief Interrupt status register address. */
  132. #define SDRAMC_RES 0x00000001 /*!< \brief Refresh error status. */
  133. /*@}*/
  134. /*! \name SDRAM Controller Memory Device Register */
  135. /*@{*/
  136. #define SDRAMC_MDR_OFF 0x00000024 /*!< \brief Memory device register offset. */
  137. #define SDRAMC_MDR (SDRAMC_BASE + SDRAMC_MDR_OFF) /*!< \brief Memory device register address. */
  138. #define SDRAMC_MD 0x00000003 /*!< \brief Memory device type mask. */
  139. #define SDRAMC_MD 0x00000003 /*!< \brief Memory device type mask. */
  140. #define SDRAMC_MD_SDRAM 0x00000000 /*!< \brief SDRAM. */
  141. #define SDRAMC_MD_LPSDRAM 0x00000001 /*!< \brief Low power SDRAM. */
  142. /*@}*/
  143. /*@} xgNutArchArmAt91Sdramc */
  144. #endif /* _ARCH_ARM_AT91_SDRAMC_H_ */