at91_mc.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #ifndef _ARCH_ARM_AT91_MC_H_
  2. #define _ARCH_ARM_AT91_MC_H_
  3. /*
  4. * Copyright (C) 2005-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_mc.h
  36. * \brief AT91 peripherals.
  37. *
  38. * \verbatim
  39. *
  40. * $Log: at91_mc.h,v $
  41. * Revision 1.3 2006/07/26 11:21:35 haraldkipp
  42. * Made it usable for assembler.
  43. *
  44. * Revision 1.2 2006/07/18 14:04:55 haraldkipp
  45. * Base address removed. Should be specified in the upper level header.
  46. *
  47. * Revision 1.1 2006/07/05 07:45:28 haraldkipp
  48. * Split on-chip interface definitions.
  49. *
  50. *
  51. * \endverbatim
  52. */
  53. #define MC_RCR_OFF 0x00000000 /*!< \brief MC remap control register offset. */
  54. #define MC_RCR (MC_BASE + MC_RCR_OFF) /*!< \brief MC remap control register address. */
  55. #define MC_RCB 0x00000001 /*!< \brief Remap command. */
  56. #define MC_ASR_OFF 0x00000004 /*!< \brief MC abort status register offset. */
  57. #define MC_ASR (MC_BASE + MC_ASR_OFF) /*!< \brief MC abort status register address. */
  58. #define MC_UNDADD 0x00000001 /*!< \brief Undefined Addess Abort status. */
  59. #define MC_MISADD 0x00000002 /*!< \brief Misaligned Addess Abort status. */
  60. #define MC_ABTSZ_MASK 0x00000300 /*!< \brief Abort size status mask. */
  61. #define MC_ABTSZ_BYTE 0x00000000 /*!< \brief Byte size abort. */
  62. #define MC_ABTSZ_HWORD 0x00000100 /*!< \brief Half-word size abort. */
  63. #define MC_ABTSZ_WORD 0x00000200 /*!< \brief Word size abort. */
  64. #define MC_ABTTYP_MASK 0x00000C00 /*!< \brief Abort type status mask. */
  65. #define MC_ABTTYP_DATAR 0x00000000 /*!< \brief Data read abort. */
  66. #define MC_ABTTYP_DATAW 0x00000400 /*!< \brief Data write abort. */
  67. #define MC_ABTTYP_FETCH 0x00000800 /*!< \brief Code fetch abort. */
  68. #define MC_MST_EMAC 0x00010000 /*!< \brief EMAC abort source. */
  69. #define MC_MST_PDC 0x00020000 /*!< \brief PDC abort source. */
  70. #define MC_MST_ARM 0x00040000 /*!< \brief ARM abort source. */
  71. #define MC_SVMST_EMAC 0x01000000 /*!< \brief Saved EMAC abort source. */
  72. #define MC_SVMST_PDC 0x02000000 /*!< \brief Saved PDC abort source. */
  73. #define MC_SVMST_ARM 0x04000000 /*!< \brief Saved ARM abort source. */
  74. #define MC_AASR_OFF 0x00000008 /*!< \brief MC abort address status register offset. */
  75. #define MC_AASR (MC_BASE + MC_AASR_OFF) /*!< \brief MC abort address status register address. */
  76. #define MC_FMR_OFF 0x00000060 /*!< \brief MC flash mode register offset. */
  77. #define MC_FMR (MC_BASE + MC_FMR_OFF) /*!< \brief MC flash mode register address. */
  78. #define MC_FRDY 0x00000001 /*!< \brief Flash ready. */
  79. #define MC_LOCKE 0x00000004 /*!< \brief Lock error. */
  80. #define MC_PROGE 0x00000008 /*!< \brief Programming error. */
  81. #define MC_NEBP 0x00000080 /*!< \brief No erase before programming. */
  82. #define MC_FWS_MASK 0x00000300 /*!< \brief Flash wait state mask. */
  83. #define MC_FWS_1R2W 0x00000000 /*!< \brief 1 cycle for read, 2 for write operations. */
  84. #define MC_FWS_2R3W 0x00000100 /*!< \brief 2 cycles for read, 3 for write operations. */
  85. #define MC_FWS_3R4W 0x00000200 /*!< \brief 3 cycles for read, 4 for write operations. */
  86. #define MC_FWS_4R4W 0x00000300 /*!< \brief 4 cycles for read and write operations. */
  87. #define MC_FMCN_MASK 0x00FF0000 /*!< \brief Flash microsecond cycle number mask. */
  88. #define MC_FCR_OFF 0x00000064 /*!< \brief MC flash command register offset. */
  89. #define MC_FCR (MC_BASE + MC_FCR_OFF) /*!< \brief MC flash command register address. */
  90. #define MC_FCMD_MASK 0x0000000F /*!< \brief Flash command mask. */
  91. #define MC_FCMD_NOP 0x00000000 /*!< \brief No command. */
  92. #define MC_FCMD_WP 0x00000001 /*!< \brief Write page. */
  93. #define MC_FCMD_SLB 0x00000002 /*!< \brief Set lock bit. */
  94. #define MC_FCMD_WPL 0x00000003 /*!< \brief Write page and lock. */
  95. #define MC_FCMD_CLB 0x00000004 /*!< \brief Clear lock bit. */
  96. #define MC_FCMD_EA 0x00000008 /*!< \brief Erase all. */
  97. #define MC_FCMD_SGPB 0x0000000B /*!< \brief Set general purpose NVM bit. */
  98. #define MC_FCMD_CGPB 0x0000000D /*!< \brief Clear general purpose NVM bit. */
  99. #define MC_FCMD_SSB 0x0000000F /*!< \brief Set security bit. */
  100. #define MC_PAGEN_MASK 0x0003FF00 /*!< \brief Page number mask. */
  101. #define MC_KEY 0x5A000000 /*!< \brief Writing protect key. */
  102. #define MC_FSR_OFF 0x00000068 /*!< \brief MC flash status register offset. */
  103. #define MC_FSR (MC_BASE + MC_FSR_OFF) /*!< \brief MC flash status register address. */
  104. #define MC_SECURITY 0x00000010 /*!< \brief Security bit status. */
  105. #define MC_GPNVM0 0x00000100 /*!< \brief General purpose NVM bit 0. */
  106. #define MC_GPNVM1 0x00000200 /*!< \brief General purpose NVM bit 1. */
  107. #define MC_GPNVM2 0x00000400 /*!< \brief General purpose NVM bit 2. */
  108. #define MC_LOCKS0 0x00010000 /*!< \brief Lock region 0 lock status. */
  109. #define MC_LOCKS1 0x00020000 /*!< \brief Lock region 1 lock status. */
  110. #define MC_LOCKS2 0x00040000 /*!< \brief Lock region 2 lock status. */
  111. #define MC_LOCKS3 0x00080000 /*!< \brief Lock region 3 lock status. */
  112. #define MC_LOCKS4 0x00100000 /*!< \brief Lock region 4 lock status. */
  113. #define MC_LOCKS5 0x00200000 /*!< \brief Lock region 5 lock status. */
  114. #define MC_LOCKS6 0x00400000 /*!< \brief Lock region 6 lock status. */
  115. #define MC_LOCKS7 0x00800000 /*!< \brief Lock region 7 lock status. */
  116. #define MC_LOCKS8 0x01000000 /*!< \brief Lock region 8 lock status. */
  117. #define MC_LOCKS9 0x02000000 /*!< \brief Lock region 9 lock status. */
  118. #define MC_LOCKS10 0x04000000 /*!< \brief Lock region 10 lock status. */
  119. #define MC_LOCKS11 0x08000000 /*!< \brief Lock region 11 lock status. */
  120. #define MC_LOCKS12 0x10000000 /*!< \brief Lock region 12 lock status. */
  121. #define MC_LOCKS13 0x20000000 /*!< \brief Lock region 13 lock status. */
  122. #define MC_LOCKS14 0x40000000 /*!< \brief Lock region 14 lock status. */
  123. #define MC_LOCKS15 0x80000000 /*!< \brief Lock region 15 lock status. */
  124. #endif /* _ARCH_ARM_AT91_MC_H_ */