lowlevel_init.S 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /*
  2. * Copyright (C) 2008 Renesas Solutions Corp.
  3. * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
  4. *
  5. * board/ap325rxa/lowlevel_init.S
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #include <config.h>
  23. #include <version.h>
  24. #include <asm/processor.h>
  25. /*
  26. * Board specific low level init code, called _very_ early in the
  27. * startup sequence. Relocation to SDRAM has not happened yet, no
  28. * stack is available, bss section has not been initialised, etc.
  29. *
  30. * (Note: As no stack is available, no subroutines can be called...).
  31. */
  32. .global lowlevel_init
  33. .text
  34. .align 2
  35. lowlevel_init:
  36. mov.l DRVCRA_A, r1
  37. mov.l DRVCRA_D, r0
  38. mov.w r0, @r1
  39. mov.l DRVCRB_A, r1
  40. mov.l DRVCRB_D, r0
  41. mov.w r0, @r1
  42. mov.l RWTCSR_A, r1
  43. mov.l RWTCSR_D1, r0
  44. mov.w r0, @r1
  45. mov.l RWTCNT_A, r1
  46. mov.l RWTCNT_D, r0
  47. mov.w r0, @r1
  48. mov.l RWTCSR_A, r1
  49. mov.l RWTCSR_D2, r0
  50. mov.w r0, @r1
  51. mov.l FRQCR_A, r1
  52. mov.l FRQCR_D, r0
  53. mov.l r0, @r1
  54. mov.l CMNCR_A, r1
  55. mov.l CMNCR_D, r0
  56. mov.l r0, @r1
  57. mov.l CS0BCR_A ,r1
  58. mov.l CS0BCR_D ,r0
  59. mov.l r0, @r1
  60. mov.l CS4BCR_A ,r1
  61. mov.l CS4BCR_D ,r0
  62. mov.l r0, @r1
  63. mov.l CS5ABCR_A ,r1
  64. mov.l CS5ABCR_D ,r0
  65. mov.l r0, @r1
  66. mov.l CS5BBCR_A ,r1
  67. mov.l CS5BBCR_D ,r0
  68. mov.l r0, @r1
  69. mov.l CS6ABCR_A ,r1
  70. mov.l CS6ABCR_D ,r0
  71. mov.l r0, @r1
  72. mov.l CS6BBCR_A ,r1
  73. mov.l CS6BBCR_D ,r0
  74. mov.l r0, @r1
  75. mov.l CS0WCR_A ,r1
  76. mov.l CS0WCR_D ,r0
  77. mov.l r0, @r1
  78. mov.l CS4WCR_A ,r1
  79. mov.l CS4WCR_D ,r0
  80. mov.l r0, @r1
  81. mov.l CS5AWCR_A ,r1
  82. mov.l CS5AWCR_D ,r0
  83. mov.l r0, @r1
  84. mov.l CS5BWCR_A ,r1
  85. mov.l CS5BWCR_D ,r0
  86. mov.l r0, @r1
  87. mov.l CS6AWCR_A ,r1
  88. mov.l CS6AWCR_D ,r0
  89. mov.l r0, @r1
  90. mov.l CS6BWCR_A ,r1
  91. mov.l CS6BWCR_D ,r0
  92. mov.l r0, @r1
  93. mov.l SBSC_SDCR_A, r1
  94. mov.l SBSC_SDCR_D1, r0
  95. mov.l r0, @r1
  96. mov.l SBSC_SDWCR_A, r1
  97. mov.l SBSC_SDWCR_D, r0
  98. mov.l r0, @r1
  99. mov.l SBSC_SDPCR_A, r1
  100. mov.l SBSC_SDPCR_D, r0
  101. mov.l r0, @r1
  102. mov.l SBSC_RTCSR_A, r1
  103. mov.l SBSC_RTCSR_D, r0
  104. mov.l r0, @r1
  105. mov.l SBSC_RTCNT_A, r1
  106. mov.l SBSC_RTCNT_D, r0
  107. mov.l r0, @r1
  108. mov.l SBSC_RTCOR_A, r1
  109. mov.l SBSC_RTCOR_D, r0
  110. mov.l r0, @r1
  111. mov.l SBSC_SDMR3_A1, r1
  112. mov.l SBSC_SDMR3_D, r0
  113. mov.b r0, @r1
  114. mov.l SBSC_SDMR3_A2, r1
  115. mov.l SBSC_SDMR3_D, r0
  116. mov.b r0, @r1
  117. mov.l SLEEP_CNT, r1
  118. 2: tst r1, r1
  119. nop
  120. bf/s 2b
  121. dt r1
  122. mov.l SBSC_SDMR3_A3, r1
  123. mov.l SBSC_SDMR3_D, r0
  124. mov.b r0, @r1
  125. mov.l SBSC_SDCR_A, r1
  126. mov.l SBSC_SDCR_D2, r0
  127. mov.l r0, @r1
  128. mov.l CCR_A, r1
  129. mov.l CCR_D, r0
  130. mov.l r0, @r1
  131. ! BL bit off (init = ON) (?!?)
  132. stc sr, r0 ! BL bit off(init=ON)
  133. mov.l SR_MASK_D, r1
  134. and r1, r0
  135. ldc r0, sr
  136. rts
  137. mov #0, r0
  138. .align 2
  139. DRVCRA_A: .long DRVCRA
  140. DRVCRB_A: .long DRVCRB
  141. DRVCRA_D: .long 0x4555
  142. DRVCRB_D: .long 0x0005
  143. RWTCSR_A: .long RWTCSR
  144. RWTCNT_A: .long RWTCNT
  145. FRQCR_A: .long FRQCR
  146. RWTCSR_D1: .long 0xa507
  147. RWTCSR_D2: .long 0xa504
  148. RWTCNT_D: .long 0x5a00
  149. FRQCR_D: .long 0x0b04474a
  150. SBSC_SDCR_A: .long SBSC_SDCR
  151. SBSC_SDWCR_A: .long SBSC_SDWCR
  152. SBSC_SDPCR_A: .long SBSC_SDPCR
  153. SBSC_RTCSR_A: .long SBSC_RTCSR
  154. SBSC_RTCNT_A: .long SBSC_RTCNT
  155. SBSC_RTCOR_A: .long SBSC_RTCOR
  156. SBSC_SDMR3_A1: .long 0xfe510000
  157. SBSC_SDMR3_A2: .long 0xfe500242
  158. SBSC_SDMR3_A3: .long 0xfe5c0042
  159. SBSC_SDCR_D1: .long 0x92810112
  160. SBSC_SDCR_D2: .long 0x92810912
  161. SBSC_SDWCR_D: .long 0x05162482
  162. SBSC_SDPCR_D: .long 0x00300087
  163. SBSC_RTCSR_D: .long 0xa55a0212
  164. SBSC_RTCNT_D: .long 0xa55a0000
  165. SBSC_RTCOR_D: .long 0xa55a0040
  166. SBSC_SDMR3_D: .long 0x00
  167. CMNCR_A: .long CMNCR
  168. CS0BCR_A: .long CS0BCR
  169. CS4BCR_A: .long CS4BCR
  170. CS5ABCR_A: .long CS5ABCR
  171. CS5BBCR_A: .long CS5BBCR
  172. CS6ABCR_A: .long CS6ABCR
  173. CS6BBCR_A: .long CS6BBCR
  174. CS0WCR_A: .long CS0WCR
  175. CS4WCR_A: .long CS4WCR
  176. CS5AWCR_A: .long CS5AWCR
  177. CS5BWCR_A: .long CS5BWCR
  178. CS6AWCR_A: .long CS6AWCR
  179. CS6BWCR_A: .long CS6BWCR
  180. CMNCR_D: .long 0x00000013
  181. CS0BCR_D: .long 0x24920400
  182. CS4BCR_D: .long 0x24920400
  183. CS5ABCR_D: .long 0x24920400
  184. CS5BBCR_D: .long 0x7fff0600
  185. CS6ABCR_D: .long 0x24920400
  186. CS6BBCR_D: .long 0x24920600
  187. CS0WCR_D: .long 0x00000480
  188. CS4WCR_D: .long 0x00000480
  189. CS5AWCR_D: .long 0x00000380
  190. CS5BWCR_D: .long 0x00000600
  191. CS6AWCR_D: .long 0x00000300
  192. CS6BWCR_D: .long 0x00000540
  193. CCR_A: .long 0xff00001c
  194. CCR_D: .long 0x0000090d
  195. SLEEP_CNT: .long 0x00000800
  196. SR_MASK_D: .long 0xEFFFFF0F