crt_mcf5225x.S 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. * Copyright 2012 by Embedded Technologies s.r.o
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. //------------------------------------------------------------------------------
  33. // Peripheral vectors
  34. //------------------------------------------------------------------------------
  35. .section .vectors,"ax",%progbits
  36. vector40: .long IH_DEFAULT
  37. vector41: .long IH_DEFAULT
  38. vector42: .long IH_DEFAULT
  39. vector43: .long IH_DEFAULT
  40. vector44: .long IH_DEFAULT
  41. vector45: .long IH_DEFAULT
  42. vector46: .long IH_DEFAULT
  43. vector47: .long IH_DEFAULT
  44. vector48: .long IH_DEFAULT
  45. vector49: .long IH_DEFAULT
  46. vector4A: .long IH_DEFAULT
  47. vector4B: .long IH_DEFAULT
  48. vector4C: .long IH_DEFAULT
  49. vector4D: .long IH_UART0
  50. vector4E: .long IH_UART1
  51. vector4F: .long IH_UART2
  52. vector50: .long IH_DEFAULT
  53. vector51: .long IH_I2C0
  54. vector52: .long IH_DEFAULT
  55. vector53: .long IH_DEFAULT
  56. vector54: .long IH_DEFAULT
  57. vector55: .long IH_DEFAULT
  58. vector56: .long IH_DEFAULT
  59. vector57: .long IH_DEFAULT
  60. vector58: .long IH_DEFAULT
  61. vector59: .long IH_DEFAULT
  62. vector5A: .long IH_DEFAULT
  63. vector5B: .long IH_DEFAULT
  64. vector5C: .long IH_DEFAULT
  65. vector5D: .long IH_DEFAULT
  66. vector5E: .long IH_DEFAULT
  67. vector5F: .long IH_DEFAULT
  68. vector60: .long IH_DEFAULT
  69. vector61: .long IH_DEFAULT
  70. vector62: .long IH_DEFAULT
  71. vector63: .long IH_DEFAULT
  72. vector64: .long IH_DEFAULT
  73. vector65: .long IH_DEFAULT
  74. vector66: .long IH_DEFAULT
  75. vector67: .long IH_DEFAULT
  76. vector68: .long IH_DEFAULT
  77. vector69: .long IH_DEFAULT
  78. vector6A: .long IH_DEFAULT
  79. vector6B: .long IH_DEFAULT
  80. vector6C: .long IH_DEFAULT
  81. vector6D: .long IH_DEFAULT
  82. vector6E: .long IH_DEFAULT
  83. vector6F: .long IH_DEFAULT
  84. vector70: .long IH_DEFAULT
  85. vector71: .long IH_DEFAULT
  86. vector72: .long IH_DEFAULT
  87. vector73: .long IH_DEFAULT
  88. vector74: .long IH_DEFAULT
  89. vector75: .long IH_DEFAULT
  90. vector76: .long IH_DEFAULT
  91. vector77: .long IH_PIT0
  92. vector78: .long IH_PIT1
  93. vector79: .long IH_DEFAULT
  94. vector7A: .long IH_DEFAULT
  95. vector7B: .long IH_DEFAULT
  96. vector7C: .long IH_DEFAULT
  97. vector7D: .long IH_DEFAULT
  98. vector7E: .long IH_I2C1
  99. vector7F: .long IH_DEFAULT
  100. vector80: .long IH_DEFAULT
  101. vector81: .long IH_DEFAULT
  102. vector82: .long IH_DEFAULT
  103. vector83: .long IH_DEFAULT
  104. vector84: .long IH_DEFAULT
  105. vector85: .long IH_DEFAULT
  106. vector86: .long IH_DEFAULT
  107. vector87: .long IH_DEFAULT
  108. vector88: .long IH_DEFAULT
  109. vector89: .long IH_DEFAULT
  110. vector8A: .long IH_DEFAULT
  111. vector8B: .long IH_DEFAULT
  112. vector8C: .long IH_DEFAULT
  113. vector8D: .long IH_DEFAULT
  114. vector8E: .long IH_DEFAULT
  115. vector8F: .long IH_DEFAULT
  116. vector90: .long IH_DEFAULT
  117. vector91: .long IH_DEFAULT
  118. vector92: .long IH_DEFAULT
  119. vector93: .long IH_DEFAULT
  120. vector94: .long IH_DEFAULT
  121. vector95: .long IH_DEFAULT
  122. vector96: .long IH_DEFAULT
  123. vector97: .long IH_DEFAULT
  124. vector98: .long IH_DEFAULT
  125. vector99: .long IH_DEFAULT
  126. vector9A: .long IH_DEFAULT
  127. vector9B: .long IH_DEFAULT
  128. vector9C: .long IH_DEFAULT
  129. vector9D: .long IH_DEFAULT
  130. vector9E: .long IH_DEFAULT
  131. vector9F: .long IH_DEFAULT
  132. vectorA0: .long IH_DEFAULT
  133. vectorA1: .long IH_DEFAULT
  134. vectorA2: .long IH_DEFAULT
  135. vectorA3: .long IH_DEFAULT
  136. vectorA4: .long IH_DEFAULT
  137. vectorA5: .long IH_DEFAULT
  138. vectorA6: .long IH_DEFAULT
  139. vectorA7: .long IH_DEFAULT
  140. vectorA8: .long IH_DEFAULT
  141. vectorA9: .long IH_DEFAULT
  142. vectorAA: .long IH_DEFAULT
  143. vectorAB: .long IH_DEFAULT
  144. vectorAC: .long IH_DEFAULT
  145. vectorAD: .long IH_DEFAULT
  146. vectorAE: .long IH_DEFAULT
  147. vectorAF: .long IH_DEFAULT
  148. vectorB0: .long IH_DEFAULT
  149. vectorB1: .long IH_DEFAULT
  150. vectorB2: .long IH_DEFAULT
  151. vectorB3: .long IH_DEFAULT
  152. vectorB4: .long IH_DEFAULT
  153. vectorB5: .long IH_DEFAULT
  154. vectorB6: .long IH_DEFAULT
  155. vectorB7: .long IH_DEFAULT
  156. vectorB8: .long IH_DEFAULT
  157. vectorB9: .long IH_DEFAULT
  158. vectorBA: .long IH_DEFAULT
  159. vectorBB: .long IH_DEFAULT
  160. vectorBC: .long IH_DEFAULT
  161. vectorBD: .long IH_DEFAULT
  162. vectorBE: .long IH_DEFAULT
  163. vectorBF: .long IH_DEFAULT
  164. //------------------------------------------------------------------------------
  165. // Section 0 - Basic CPU initialization (family dependant code)
  166. // - The code starts here after reset
  167. // - After this section, C stack memory must be initialized
  168. //------------------------------------------------------------------------------
  169. .section .init0,"ax",%progbits
  170. /* Initialize SCM (System Control Module) */
  171. move.l #__rambar+0x221,%d0 /* data + code + enable peripheral access */
  172. movec.l %d0,%RAMBAR
  173. move.l #__flashbar+0x21,%d0 /* data + code */
  174. movec.l %d0,%FLASHBAR
  175. move.l #__ipsbar+0x1,%d0
  176. move.l %d0,0x40000000
  177. /* Enable PST[3:0] signals .. required for program trace support */
  178. move.l #0xf,%d0
  179. move.b %d0,__ipsbar+0x100074
  180. //------------------------------------------------------------------------------
  181. // Section 12 - CPU and Peripherals Initialization (family dependant code)
  182. //------------------------------------------------------------------------------
  183. .section .init12,"ax",%progbits
  184. jsr InitIntramAccess
  185. jsr InitClock