start.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright (C) 1998 Dan Malek <dmalek@jlc.net>
  3. * Copyright (C) 1999 Magnus Damm <kieraypc01.p.y.kie.era.ericsson.se>
  4. * Copyright (C) 2000-2003 Wolfgang Denk <wd@denx.de>
  5. * Coldfire contribution by Bernhard Kuhn <bkuhn@metrowerks.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <config.h>
  26. #include "version.h"
  27. #ifndef CONFIG_IDENT_STRING
  28. #define CONFIG_IDENT_STRING ""
  29. #endif
  30. #define MCF_MBAR 0x10000000
  31. #define MEM_BUILTIN_ADDR 0x20000000
  32. #define MEM_BUILTIN_SIZE 0x1000
  33. #define DRAM_ADDR 0x0
  34. #define DRAM_SIZE 0x400000
  35. .text
  36. .globl _start
  37. _start:
  38. nop
  39. nop
  40. move.w #0x2700,%sr
  41. move.l #0, %d0
  42. movec %d0, %VBR
  43. #ifdef CONFIG_M5272
  44. move.l #(MCF_MBAR+1), %d0
  45. move.c %d0, %MBAR
  46. move.l #(MEM_BUILTIN_ADDR+1), %d0
  47. movec %d0, %RAMBAR0
  48. move.l #0x01000000, %d0 /* Invalidate cache cmd */
  49. movec %d0, %CACR /* Invalidate cache */
  50. move.l #0x0000c000, %d0 /* Setup cache mask */
  51. movec %d0, %ACR0 /* Enable cache */
  52. move.l #0xff00c000, %d0 /* Setup cache mask */
  53. movec %d0, %ACR1 /* Enable cache */
  54. move.l #0x80000100, %d0 /* Setup cache mask */
  55. movec %d0, %CACR /* Enable cache */
  56. #endif
  57. move.l #_sbss,%a0
  58. move.l #_ebss,%d0
  59. 1:
  60. clr.l (%a0)+
  61. cmp.l %a0,%d0
  62. bne.s 1b
  63. /* move.l #MEM_BUILTIN_ADDR+MEM_BUILTIN_SIZE, %sp */
  64. move.l #DRAM_ADDR+DRAM_SIZE, %sp
  65. clr.l %sp@-
  66. jsr board_init_f
  67. .globl exception_handler
  68. exception_handler:
  69. move.w #0x2700,%sr
  70. lea %sp@(-60),%sp
  71. movem.l %d0-%d7/%a0-%a6,%sp@
  72. jsr do_exception
  73. movem.l %sp@,%d0-%d7/%a0-%a6
  74. lea %sp@(60),%sp
  75. rte
  76. .globl buserror_handler
  77. buserror_handler:
  78. move.w #0x2700,%sr
  79. lea %sp@(-60),%sp
  80. movem.l %d0-%d7/%a0-%a6,%sp@
  81. jsr do_buserror
  82. movem.l %sp@,%d0-%d7/%a0-%a6
  83. lea %sp@(60),%sp
  84. rte
  85. .globl addresserror_handler
  86. addresserror_handler:
  87. move.w #0x2700,%sr
  88. lea %sp@(-60),%sp
  89. movem.l %d0-%d7/%a0-%a6,%sp@
  90. jsr do_buserror
  91. movem.l %sp@,%d0-%d7/%a0-%a6
  92. lea %sp@(60),%sp
  93. rte
  94. .globl get_endaddr
  95. get_endaddr:
  96. movel #_end,%d0
  97. rts
  98. #ifdef CONFIG_M5272
  99. .globl icache_enable
  100. icache_enable:
  101. move.l #0x01000000, %d0 /* Invalidate cache cmd */
  102. movec %d0, %CACR /* Invalidate cache */
  103. move.l #0x0000c000, %d0 /* Setup cache mask */
  104. movec %d0, %ACR0 /* Enable cache */
  105. move.l #0xff00c000, %d0 /* Setup cache mask */
  106. movec %d0, %ACR1 /* Enable cache */
  107. move.l #0x80000100, %d0 /* Setup cache mask */
  108. movec %d0, %CACR /* Enable cache */
  109. moveq #1, %d0
  110. move.l %d0, icache_state
  111. rts
  112. .globl icache_disable
  113. icache_disable:
  114. move.l #0x00000100, %d0 /* Setup cache mask */
  115. movec %d0, %CACR /* Enable cache */
  116. clr.l %d0 /* Setup cache mask */
  117. movec %d0, %ACR0 /* Enable cache */
  118. movec %d0, %ACR1 /* Enable cache */
  119. moveq #0, %d0
  120. move.l %d0, icache_state
  121. rts
  122. #endif
  123. #ifdef CONFIG_M5282
  124. .globl icache_enable
  125. icache_enable:
  126. rts
  127. .globl icache_disable
  128. icache_disable:
  129. rts
  130. #endif
  131. .globl icache_status
  132. icache_status:
  133. move.l icache_state, %d0
  134. rts
  135. .data
  136. icache_state:
  137. .long 1
  138. .globl version_string
  139. version_string:
  140. .ascii U_BOOT_VERSION
  141. .ascii " (", __DATE__, " - ", __TIME__, ")"
  142. .ascii CONFIG_IDENT_STRING, "\0"