start.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /*
  2. * Copyright (C) 2003 Josef Baumgartner <josef.baumgartner@telex.de>
  3. * Based on code from Bernhard Kuhn <bkuhn@metrowerks.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <config.h>
  24. #include "version.h"
  25. #ifndef CONFIG_IDENT_STRING
  26. #define CONFIG_IDENT_STRING ""
  27. #endif
  28. /* last three long word reserved for cache status */
  29. #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR+CONFIG_SYS_INIT_RAM_END- 4)
  30. #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR+CONFIG_SYS_INIT_RAM_END- 8)
  31. #define CACR_STATUS (CONFIG_SYS_INIT_RAM_ADDR+CONFIG_SYS_INIT_RAM_END-12)
  32. #define _START _start
  33. #define _FAULT _fault
  34. #define SAVE_ALL \
  35. move.w #0x2700,%sr; /* disable intrs */ \
  36. subl #60,%sp; /* space for 15 regs */ \
  37. moveml %d0-%d7/%a0-%a6,%sp@;
  38. #define RESTORE_ALL \
  39. moveml %sp@,%d0-%d7/%a0-%a6; \
  40. addl #60,%sp; /* space for 15 regs */ \
  41. rte;
  42. #if defined(CONFIG_CF_SBF)
  43. #define ASM_DRAMINIT (asm_dram_init - TEXT_BASE + CONFIG_SYS_INIT_RAM_ADDR)
  44. #define ASM_SBF_IMG_HDR (asm_sbf_img_hdr - TEXT_BASE + CONFIG_SYS_INIT_RAM_ADDR)
  45. #endif
  46. .text
  47. /*
  48. * Vector table. This is used for initial platform startup.
  49. * These vectors are to catch any un-intended traps.
  50. */
  51. _vectors:
  52. #if defined(CONFIG_CF_SBF)
  53. INITSP: .long 0 /* Initial SP */
  54. INITPC: .long ASM_DRAMINIT /* Initial PC */
  55. #else
  56. INITSP: .long 0 /* Initial SP */
  57. INITPC: .long _START /* Initial PC */
  58. #endif
  59. vector02: .long _FAULT /* Access Error */
  60. vector03: .long _FAULT /* Address Error */
  61. vector04: .long _FAULT /* Illegal Instruction */
  62. vector05: .long _FAULT /* Reserved */
  63. vector06: .long _FAULT /* Reserved */
  64. vector07: .long _FAULT /* Reserved */
  65. vector08: .long _FAULT /* Privilege Violation */
  66. vector09: .long _FAULT /* Trace */
  67. vector0A: .long _FAULT /* Unimplemented A-Line */
  68. vector0B: .long _FAULT /* Unimplemented F-Line */
  69. vector0C: .long _FAULT /* Debug Interrupt */
  70. vector0D: .long _FAULT /* Reserved */
  71. vector0E: .long _FAULT /* Format Error */
  72. vector0F: .long _FAULT /* Unitialized Int. */
  73. /* Reserved */
  74. vector10_17:
  75. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  76. vector18: .long _FAULT /* Spurious Interrupt */
  77. vector19: .long _FAULT /* Autovector Level 1 */
  78. vector1A: .long _FAULT /* Autovector Level 2 */
  79. vector1B: .long _FAULT /* Autovector Level 3 */
  80. vector1C: .long _FAULT /* Autovector Level 4 */
  81. vector1D: .long _FAULT /* Autovector Level 5 */
  82. vector1E: .long _FAULT /* Autovector Level 6 */
  83. vector1F: .long _FAULT /* Autovector Level 7 */
  84. #if !defined(CONFIG_CF_SBF)
  85. /* TRAP #0 - #15 */
  86. vector20_2F:
  87. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  88. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  89. /* Reserved */
  90. vector30_3F:
  91. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  92. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  93. vector64_127:
  94. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  95. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  96. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  97. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  98. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  99. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  100. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  101. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  102. vector128_191:
  103. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  104. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  105. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  106. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  107. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  108. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  109. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  110. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  111. vector192_255:
  112. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  113. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  114. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  115. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  116. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  117. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  118. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  119. .long _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT, _FAULT
  120. #endif
  121. #if defined(CONFIG_CF_SBF)
  122. /* Image header: chksum 4 bytes, len 4 bytes, img dest 4 bytes */
  123. asm_sbf_img_hdr:
  124. .long 0x00000000 /* checksum, not yet implemented */
  125. .long 0x00020000 /* image length */
  126. .long TEXT_BASE /* image to be relocated at */
  127. asm_dram_init:
  128. move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_CTRL), %d0
  129. movec %d0, %RAMBAR1 /* init Rambar */
  130. move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET), %sp
  131. clr.l %sp@-
  132. /* Must disable global address */
  133. move.l #0xFC008000, %a1
  134. move.l #(CONFIG_SYS_CS0_BASE), (%a1)
  135. move.l #0xFC008008, %a1
  136. move.l #(CONFIG_SYS_CS0_CTRL), (%a1)
  137. move.l #0xFC008004, %a1
  138. move.l #(CONFIG_SYS_CS0_MASK), (%a1)
  139. /*
  140. * Dram Initialization
  141. * a1, a2, and d0
  142. */
  143. /* mscr sdram */
  144. move.l #0xFC0A4074, %a1
  145. move.b #(CONFIG_SYS_SDRAM_DRV_STRENGTH), (%a1)
  146. nop
  147. /* SDRAM Chip 0 and 1 */
  148. move.l #0xFC0B8110, %a1
  149. move.l #0xFC0B8114, %a2
  150. /* calculate the size */
  151. move.l #0x13, %d1
  152. move.l #(CONFIG_SYS_SDRAM_SIZE), %d2
  153. #ifdef CONFIG_SYS_SDRAM_BASE1
  154. lsr.l #1, %d2
  155. #endif
  156. dramsz_loop:
  157. lsr.l #1, %d2
  158. add.l #1, %d1
  159. cmp.l #1, %d2
  160. bne dramsz_loop
  161. /* SDRAM Chip 0 and 1 */
  162. move.l #(CONFIG_SYS_SDRAM_BASE), (%a1)
  163. or.l %d1, (%a1)
  164. #ifdef CONFIG_SYS_SDRAM_BASE1
  165. move.l #(CONFIG_SYS_SDRAM_BASE1), (%a2)
  166. or.l %d1, (%a2)
  167. #endif
  168. nop
  169. /* dram cfg1 and cfg2 */
  170. move.l #0xFC0B8008, %a1
  171. move.l #(CONFIG_SYS_SDRAM_CFG1), (%a1)
  172. nop
  173. move.l #0xFC0B800C, %a2
  174. move.l #(CONFIG_SYS_SDRAM_CFG2), (%a2)
  175. nop
  176. move.l #0xFC0B8000, %a1 /* Mode */
  177. move.l #0xFC0B8004, %a2 /* Ctrl */
  178. /* Issue PALL */
  179. move.l #(CONFIG_SYS_SDRAM_CTRL + 2), (%a2)
  180. nop
  181. /* Issue LEMR */
  182. move.l #(CONFIG_SYS_SDRAM_MODE), (%a1)
  183. nop
  184. move.l #(CONFIG_SYS_SDRAM_EMOD), (%a1)
  185. nop
  186. move.l #1000, %d0
  187. wait1000:
  188. nop
  189. subq.l #1, %d0
  190. bne wait1000
  191. /* Issue PALL */
  192. move.l #(CONFIG_SYS_SDRAM_CTRL + 2), (%a2)
  193. nop
  194. /* Perform two refresh cycles */
  195. move.l #(CONFIG_SYS_SDRAM_CTRL + 4), %d0
  196. nop
  197. move.l %d0, (%a2)
  198. move.l %d0, (%a2)
  199. nop
  200. move.l #(CONFIG_SYS_SDRAM_CTRL), %d0
  201. and.l #0x7FFFFFFF, %d0
  202. or.l #0x10000c00, %d0
  203. move.l %d0, (%a2)
  204. nop
  205. /*
  206. * DSPI Initialization
  207. * a0 - general, sram - 0x80008000 - 32, see M52277EVB.h
  208. * a1 - dspi status
  209. * a2 - dtfr
  210. * a3 - drfr
  211. * a4 - Dst addr
  212. */
  213. /* Enable pins for DSPI mode - chip-selects are enabled later */
  214. move.l #0xFC0A4036, %a0
  215. move.b #0x3F, %d0
  216. move.b %d0, (%a0)
  217. /* DSPI CS */
  218. #ifdef CONFIG_SYS_DSPI_CS0
  219. move.b (%a0), %d0
  220. or.l #0xC0, %d0
  221. move.b %d0, (%a0)
  222. #endif
  223. #ifdef CONFIG_SYS_DSPI_CS2
  224. move.l #0xFC0A4037, %a0
  225. move.b (%a0), %d0
  226. or.l #0x10, %d0
  227. move.b %d0, (%a0)
  228. #endif
  229. nop
  230. /* Configure DSPI module */
  231. move.l #0xFC05C000, %a0
  232. move.l #0x80FF0C00, (%a0) /* Master, clear TX/RX FIFO */
  233. move.l #0xFC05C00C, %a0
  234. move.l #0x3E000011, (%a0)
  235. move.l #0xFC05C034, %a2 /* dtfr */
  236. move.l #0xFC05C03B, %a3 /* drfr */
  237. move.l #(ASM_SBF_IMG_HDR + 4), %a1
  238. move.l (%a1)+, %d5
  239. move.l (%a1), %a4
  240. move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_SBFHDR_DATA_OFFSET), %a0
  241. move.l #(CONFIG_SYS_SBFHDR_SIZE), %d4
  242. move.l #0xFC05C02C, %a1 /* dspi status */
  243. /* Issue commands and address */
  244. move.l #0x8004000B, %d2 /* Fast Read Cmd */
  245. jsr asm_dspi_wr_status
  246. jsr asm_dspi_rd_status
  247. move.l #0x80040000, %d2 /* Address byte 2 */
  248. jsr asm_dspi_wr_status
  249. jsr asm_dspi_rd_status
  250. move.l #0x80040000, %d2 /* Address byte 1 */
  251. jsr asm_dspi_wr_status
  252. jsr asm_dspi_rd_status
  253. move.l #0x80040000, %d2 /* Address byte 0 */
  254. jsr asm_dspi_wr_status
  255. jsr asm_dspi_rd_status
  256. move.l #0x80040000, %d2 /* Dummy Wr and Rd */
  257. jsr asm_dspi_wr_status
  258. jsr asm_dspi_rd_status
  259. /* Transfer serial boot header to sram */
  260. asm_dspi_rd_loop1:
  261. move.l #0x80040000, %d2
  262. jsr asm_dspi_wr_status
  263. jsr asm_dspi_rd_status
  264. move.b %d1, (%a0) /* read, copy to dst */
  265. add.l #1, %a0 /* inc dst by 1 */
  266. sub.l #1, %d4 /* dec cnt by 1 */
  267. bne asm_dspi_rd_loop1
  268. /* Transfer u-boot from serial flash to memory */
  269. asm_dspi_rd_loop2:
  270. move.l #0x80040000, %d2
  271. jsr asm_dspi_wr_status
  272. jsr asm_dspi_rd_status
  273. move.b %d1, (%a4) /* read, copy to dst */
  274. add.l #1, %a4 /* inc dst by 1 */
  275. sub.l #1, %d5 /* dec cnt by 1 */
  276. bne asm_dspi_rd_loop2
  277. move.l #0x00040000, %d2 /* Terminate */
  278. jsr asm_dspi_wr_status
  279. jsr asm_dspi_rd_status
  280. /* jump to memory and execute */
  281. move.l #(TEXT_BASE + 0x400), %a0
  282. move.l %a0, (%a1)
  283. jmp (%a0)
  284. asm_dspi_wr_status:
  285. move.l (%a1), %d0 /* status */
  286. and.l #0x0000F000, %d0
  287. cmp.l #0x00003000, %d0
  288. bgt asm_dspi_wr_status
  289. move.l %d2, (%a2)
  290. rts
  291. asm_dspi_rd_status:
  292. move.l (%a1), %d0 /* status */
  293. and.l #0x000000F0, %d0
  294. lsr.l #4, %d0
  295. cmp.l #0, %d0
  296. beq asm_dspi_rd_status
  297. move.b (%a3), %d1
  298. rts
  299. #endif /* CONFIG_CF_SBF */
  300. .text
  301. . = 0x400
  302. .globl _start
  303. _start:
  304. nop
  305. nop
  306. move.w #0x2700,%sr /* Mask off Interrupt */
  307. /* Set vector base register at the beginning of the Flash */
  308. #if defined(CONFIG_CF_SBF)
  309. move.l #TEXT_BASE, %d0
  310. movec %d0, %VBR
  311. #else
  312. move.l #CONFIG_SYS_FLASH_BASE, %d0
  313. movec %d0, %VBR
  314. move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_CTRL), %d0
  315. movec %d0, %RAMBAR1
  316. #endif
  317. /* initialize general use internal ram */
  318. move.l #0, %d0
  319. move.l #(ICACHE_STATUS), %a1 /* icache */
  320. move.l #(DCACHE_STATUS), %a2 /* icache */
  321. move.l #(CACR_STATUS), %a3 /* CACR */
  322. move.l %d0, (%a1)
  323. move.l %d0, (%a2)
  324. move.l %d0, (%a3)
  325. /* invalidate and disable cache */
  326. move.l #0x01000000, %d0 /* Invalidate cache cmd */
  327. movec %d0, %CACR /* Invalidate cache */
  328. move.l #0, %d0
  329. movec %d0, %ACR0
  330. movec %d0, %ACR1
  331. /* set stackpointer to end of internal ram to get some stackspace for
  332. the first c-code */
  333. move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET), %sp
  334. clr.l %sp@-
  335. move.l #__got_start, %a5 /* put relocation table address to a5 */
  336. bsr cpu_init_f /* run low-level CPU init code (from flash) */
  337. bsr board_init_f /* run low-level board init code (from flash) */
  338. /* board_init_f() does not return */
  339. /*------------------------------------------------------------------------------*/
  340. /*
  341. * void relocate_code (addr_sp, gd, addr_moni)
  342. *
  343. * This "function" does not return, instead it continues in RAM
  344. * after relocating the monitor code.
  345. *
  346. * r3 = dest
  347. * r4 = src
  348. * r5 = length in bytes
  349. * r6 = cachelinesize
  350. */
  351. .globl relocate_code
  352. relocate_code:
  353. link.w %a6,#0
  354. move.l 8(%a6), %sp /* set new stack pointer */
  355. move.l 12(%a6), %d0 /* Save copy of Global Data pointer */
  356. move.l 16(%a6), %a0 /* Save copy of Destination Address */
  357. move.l #CONFIG_SYS_MONITOR_BASE, %a1
  358. move.l #__init_end, %a2
  359. move.l %a0, %a3
  360. /* copy the code to RAM */
  361. 1:
  362. move.l (%a1)+, (%a3)+
  363. cmp.l %a1,%a2
  364. bgt.s 1b
  365. /*
  366. * We are done. Do not return, instead branch to second part of board
  367. * initialization, now running from RAM.
  368. */
  369. move.l %a0, %a1
  370. add.l #(in_ram - CONFIG_SYS_MONITOR_BASE), %a1
  371. jmp (%a1)
  372. in_ram:
  373. clear_bss:
  374. /*
  375. * Now clear BSS segment
  376. */
  377. move.l %a0, %a1
  378. add.l #(_sbss - CONFIG_SYS_MONITOR_BASE),%a1
  379. move.l %a0, %d1
  380. add.l #(_ebss - CONFIG_SYS_MONITOR_BASE),%d1
  381. 6:
  382. clr.l (%a1)+
  383. cmp.l %a1,%d1
  384. bgt.s 6b
  385. /*
  386. * fix got table in RAM
  387. */
  388. move.l %a0, %a1
  389. add.l #(__got_start - CONFIG_SYS_MONITOR_BASE),%a1
  390. move.l %a1,%a5 /* * fix got pointer register a5 */
  391. move.l %a0, %a2
  392. add.l #(__got_end - CONFIG_SYS_MONITOR_BASE),%a2
  393. 7:
  394. move.l (%a1),%d1
  395. sub.l #_start,%d1
  396. add.l %a0,%d1
  397. move.l %d1,(%a1)+
  398. cmp.l %a2, %a1
  399. bne 7b
  400. /* calculate relative jump to board_init_r in ram */
  401. move.l %a0, %a1
  402. add.l #(board_init_r - CONFIG_SYS_MONITOR_BASE), %a1
  403. /* set parameters for board_init_r */
  404. move.l %a0,-(%sp) /* dest_addr */
  405. move.l %d0,-(%sp) /* gd */
  406. jsr (%a1)
  407. /*------------------------------------------------------------------------------*/
  408. /* exception code */
  409. .globl _fault
  410. _fault:
  411. jmp _fault
  412. .globl _exc_handler
  413. _exc_handler:
  414. SAVE_ALL
  415. movel %sp,%sp@-
  416. bsr exc_handler
  417. addql #4,%sp
  418. RESTORE_ALL
  419. .globl _int_handler
  420. _int_handler:
  421. SAVE_ALL
  422. movel %sp,%sp@-
  423. bsr int_handler
  424. addql #4,%sp
  425. RESTORE_ALL
  426. /*------------------------------------------------------------------------------*/
  427. /* cache functions */
  428. .globl icache_enable
  429. icache_enable:
  430. move.l #0x01200000, %d0 /* Invalid cache */
  431. movec %d0, %CACR
  432. move.l #(CONFIG_SYS_SDRAM_BASE + 0x1c000), %d0
  433. movec %d0, %ACR0
  434. move.l #0x81600610, %d0 /* Enable cache */
  435. movec %d0, %CACR
  436. move.l #(ICACHE_STATUS), %a1
  437. moveq #1, %d0
  438. move.l %d0, (%a1)
  439. rts
  440. .globl icache_disable
  441. icache_disable:
  442. move.l #0x01F00000, %d0 /* Setup cache mask */
  443. movec %d0, %CACR /* Invalidate icache */
  444. clr.l %d0
  445. movec %d0, %ACR0
  446. movec %d0, %ACR1
  447. move.l #(ICACHE_STATUS), %a1
  448. moveq #0, %d0
  449. move.l %d0, (%a1)
  450. rts
  451. .globl icache_status
  452. icache_status:
  453. move.l #(ICACHE_STATUS), %a1
  454. move.l (%a1), %d0
  455. rts
  456. .globl icache_invalid
  457. icache_invalid:
  458. move.l #0x80600610, %d0 /* Invalidate icache */
  459. movec %d0, %CACR /* Enable and invalidate cache */
  460. rts
  461. .globl dcache_enable
  462. dcache_enable:
  463. move.l #0x01200000, %d0 /* Invalid cache */
  464. movec %d0, %CACR
  465. move.l #0x81300610, %d0
  466. movec %d0, %CACR
  467. move.l #(DCACHE_STATUS), %a1
  468. moveq #1, %d0
  469. move.l %d0, (%a1)
  470. rts
  471. .globl dcache_disable
  472. dcache_disable:
  473. move.l #0x81600610, %d0 /* Setup cache mask */
  474. movec %d0, %CACR /* Invalidate icache */
  475. move.l #(DCACHE_STATUS), %a1
  476. moveq #0, %d0
  477. move.l %d0, (%a1)
  478. rts
  479. .globl dcache_invalid
  480. dcache_invalid:
  481. move.l #0x81100610, %d0 /* Setup cache mask */
  482. movec %d0, %CACR /* Enable and invalidate cache */
  483. rts
  484. .globl dcache_status
  485. dcache_status:
  486. move.l #(DCACHE_STATUS), %a1
  487. move.l (%a1), %d0
  488. rts
  489. /*------------------------------------------------------------------------------*/
  490. .globl version_string
  491. version_string:
  492. .ascii U_BOOT_VERSION
  493. .ascii " (", __DATE__, " - ", __TIME__, ")"
  494. .ascii CONFIG_IDENT_STRING, "\0"
  495. .align 4