at91_smc.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #ifndef _ARCH_ARM_AT91_SMC_H_
  2. #define _ARCH_ARM_AT91_SMC_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_smc.h
  36. * \brief AT91 static memory controller.
  37. *
  38. * \verbatim
  39. *
  40. * $Log: at91_smc.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 xgNutArchArmAt91Smc
  49. */
  50. /*@{*/
  51. /*! \name SMC Setup Register */
  52. /*@{*/
  53. #define SMC_SETUP(cs) (SMC_BASE + 0x10 * cs + 0x00) /*!< \brief SMC setup register address. */
  54. #define SMC_NWE_SETUP 0x0000003F /*!< \brief NWE setup length mask. */
  55. #define SMC_NWE_SETUP_LSB 0 /*!< \brief NWE setup length LSB. */
  56. #define SMC_NCS_WR_SETUP 0x00003F00 /*!< \brief NCS setup length in write access mask. */
  57. #define SMC_NCS_WR_SETUP_LSB 8 /*!< \brief NCS setup length in write access LSB. */
  58. #define SMC_NRD_SETUP 0x003F0000 /*!< \brief NRD setup length mask. */
  59. #define SMC_NRD_SETUP_LSB 16 /*!< \brief NRD setup length LSB. */
  60. #define SMC_NCS_RD_SETUP 0x3F000000 /*!< \brief NCS setup length in read access mask. */
  61. #define SMC_NCS_RD_SETUP_LSB 24 /*!< \brief NCS setup length in read access LSB. */
  62. /*@}*/
  63. /*! \name SMC Pulse Register */
  64. /*@{*/
  65. #define SMC_PULSE(cs) (SMC_BASE + 0x10 * cs + 0x04) /*!< \brief SMC pulse register address. */
  66. #define SMC_NWE_PULSE 0x0000003F /*!< \brief NWE pulse length mask. */
  67. #define SMC_NWE_PULSE_LSB 0 /*!< \brief NWE pulse length LSB. */
  68. #define SMC_NCS_WR_PULSE 0x00003F00 /*!< \brief NCS pulse length in write access mask. */
  69. #define SMC_NCS_WR_PULSE_LSB 8 /*!< \brief NCS pulse length in write access LSB. */
  70. #define SMC_NRD_PULSE 0x003F0000 /*!< \brief NRD pulse length mask. */
  71. #define SMC_NRD_PULSE_LSB 16 /*!< \brief NRD pulse length LSB. */
  72. #define SMC_NCS_RD_PULSE 0x3F000000 /*!< \brief NCS pulse length in read access mask. */
  73. #define SMC_NCS_RD_PULSE_LSB 24 /*!< \brief NCS pulse length in read access LSB. */
  74. /*@}*/
  75. /*! \name SMC Cycle Register */
  76. /*@{*/
  77. #define SMC_CYCLE(cs) (SMC_BASE + 0x10 * cs + 0x08) /*!< \brief SMC cycle register address. */
  78. #define SMC_NWE_CYCLE 0x000001FF /*!< \brief Total write cycle length mask. */
  79. #define SMC_NWE_CYCLE_LSB 0 /*!< \brief Total write cycle length LSB. */
  80. #define SMC_NRD_CYCLE 0x01FF0000 /*!< \brief Total read cycle length mask. */
  81. #define SMC_NRD_CYCLE_LSB 16 /*!< \brief Total read cycle length LSB. */
  82. /*@}*/
  83. /*! \name SMC Mode Register */
  84. /*@{*/
  85. #define SMC_MODE(cs) (SMC_BASE + 0x10 * cs + 0x0C) /*!< \brief SMC mode register address. */
  86. #define SMC_READ_MODE 0x00000001 /*!< \brief Read operation mode. */
  87. #define SMC_WRITE_MODE 0x00000002 /*!< \brief Write operation mode. */
  88. #define SMC_EXNW_MODE 0x00000030 /*!< \brief NWAIT mode mask. */
  89. #define SMC_EXNW_MODE_DISABLED 0x00000000 /*!< \brief NWAIT mode mask. */
  90. #define SMC_EXNW_MODE_FROZEN 0x00000020 /*!< \brief NWAIT mode mask. */
  91. #define SMC_EXNW_MODE_READY 0x00000030 /*!< \brief NWAIT mode mask. */
  92. #define SMC_BAT 0x00000100 /*!< \brief Byte access mode. */
  93. #define SMC_DBW 0x00003000 /*!< \brief Data bus width. */
  94. #define SMC_DBW_8 0x00000000 /*!< \brief 8-bit data bus. */
  95. #define SMC_DBW_16 0x00001000 /*!< \brief 16-bit data bus. */
  96. #define SMC_DBW_32 0x00002000 /*!< \brief 32-bit data bus. */
  97. #define SMC_TDF_CYCLES 0x000F0000 /*!< \brief Data float time mask. */
  98. #define SMC_TDF_CYCLES_LSB 0x000F0000 /*!< \brief Data float time LSB. */
  99. #define SMC_TDF_MODE 0x00100000 /*!< \brief TDF optimization. */
  100. #define SMC_PMEN 0x01000000 /*!< \brief Page mode enable. */
  101. #define SMC_PS 0x30000000 /*!< \brief Page size mask. */
  102. #define SMC_PS_4 0x30000000 /*!< \brief 4-byte page. */
  103. #define SMC_PS_8 0x30000000 /*!< \brief 8-byte page. */
  104. #define SMC_PS_16 0x30000000 /*!< \brief 16-byte page. */
  105. #define SMC_PS_32 0x30000000 /*!< \brief 32-byte page. */
  106. /*@}*/
  107. /*@} xgNutArchArmAt91Smc */
  108. #endif /* _ARCH_ARM_AT91_SMC_H_ */