lowlevel_init.S 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. #include <asm/macro.h>
  26. /*
  27. * Board specific low level init code, called _very_ early in the
  28. * startup sequence. Relocation to SDRAM has not happened yet, no
  29. * stack is available, bss section has not been initialised, etc.
  30. *
  31. * (Note: As no stack is available, no subroutines can be called...).
  32. */
  33. .global lowlevel_init
  34. .text
  35. .align 2
  36. lowlevel_init:
  37. write16 DRVCRA_A, DRVCRA_D
  38. write16 DRVCRB_A, DRVCRB_D
  39. write16 RWTCSR_A, RWTCSR_D1
  40. write16 RWTCNT_A, RWTCNT_D
  41. write16 RWTCSR_A, RWTCSR_D2
  42. write32 FRQCR_A, FRQCR_D
  43. write32 CMNCR_A, CMNCR_D
  44. write32 CS0BCR_A, CS0BCR_D
  45. write32 CS4BCR_A, CS4BCR_D
  46. write32 CS5ABCR_A, CS5ABCR_D
  47. write32 CS5BBCR_A, CS5BBCR_D
  48. write32 CS6ABCR_A, CS6ABCR_D
  49. write32 CS6BBCR_A, CS6BBCR_D
  50. write32 CS0WCR_A, CS0WCR_D
  51. write32 CS4WCR_A, CS4WCR_D
  52. write32 CS5AWCR_A, CS5AWCR_D
  53. write32 CS5BWCR_A, CS5BWCR_D
  54. write32 CS6AWCR_A, CS6AWCR_D
  55. write32 CS6BWCR_A, CS6BWCR_D
  56. write32 SBSC_SDCR_A, SBSC_SDCR_D1
  57. write32 SBSC_SDWCR_A, SBSC_SDWCR_D
  58. write32 SBSC_SDPCR_A, SBSC_SDPCR_D
  59. write32 SBSC_RTCSR_A, SBSC_RTCSR_D
  60. write32 SBSC_RTCNT_A, SBSC_RTCNT_D
  61. write32 SBSC_RTCOR_A, SBSC_RTCOR_D
  62. write8 SBSC_SDMR3_A1, SBSC_SDMR3_D
  63. write8 SBSC_SDMR3_A2, SBSC_SDMR3_D
  64. mov.l SLEEP_CNT, r1
  65. 2: tst r1, r1
  66. nop
  67. bf/s 2b
  68. dt r1
  69. write8 SBSC_SDMR3_A3, SBSC_SDMR3_D
  70. write32 SBSC_SDCR_A, SBSC_SDCR_D2
  71. write32 CCR_A, CCR_D
  72. ! BL bit off (init = ON) (?!?)
  73. stc sr, r0 ! BL bit off(init=ON)
  74. mov.l SR_MASK_D, r1
  75. and r1, r0
  76. ldc r0, sr
  77. rts
  78. mov #0, r0
  79. .align 2
  80. DRVCRA_A: .long DRVCRA
  81. DRVCRB_A: .long DRVCRB
  82. DRVCRA_D: .long 0x4555
  83. DRVCRB_D: .long 0x0005
  84. RWTCSR_A: .long RWTCSR
  85. RWTCNT_A: .long RWTCNT
  86. FRQCR_A: .long FRQCR
  87. RWTCSR_D1: .long 0xa507
  88. RWTCSR_D2: .long 0xa504
  89. RWTCNT_D: .long 0x5a00
  90. FRQCR_D: .long 0x0b04474a
  91. SBSC_SDCR_A: .long SBSC_SDCR
  92. SBSC_SDWCR_A: .long SBSC_SDWCR
  93. SBSC_SDPCR_A: .long SBSC_SDPCR
  94. SBSC_RTCSR_A: .long SBSC_RTCSR
  95. SBSC_RTCNT_A: .long SBSC_RTCNT
  96. SBSC_RTCOR_A: .long SBSC_RTCOR
  97. SBSC_SDMR3_A1: .long 0xfe510000
  98. SBSC_SDMR3_A2: .long 0xfe500242
  99. SBSC_SDMR3_A3: .long 0xfe5c0042
  100. SBSC_SDCR_D1: .long 0x92810112
  101. SBSC_SDCR_D2: .long 0x92810912
  102. SBSC_SDWCR_D: .long 0x05162482
  103. SBSC_SDPCR_D: .long 0x00300087
  104. SBSC_RTCSR_D: .long 0xa55a0212
  105. SBSC_RTCNT_D: .long 0xa55a0000
  106. SBSC_RTCOR_D: .long 0xa55a0040
  107. SBSC_SDMR3_D: .long 0x00
  108. CMNCR_A: .long CMNCR
  109. CS0BCR_A: .long CS0BCR
  110. CS4BCR_A: .long CS4BCR
  111. CS5ABCR_A: .long CS5ABCR
  112. CS5BBCR_A: .long CS5BBCR
  113. CS6ABCR_A: .long CS6ABCR
  114. CS6BBCR_A: .long CS6BBCR
  115. CS0WCR_A: .long CS0WCR
  116. CS4WCR_A: .long CS4WCR
  117. CS5AWCR_A: .long CS5AWCR
  118. CS5BWCR_A: .long CS5BWCR
  119. CS6AWCR_A: .long CS6AWCR
  120. CS6BWCR_A: .long CS6BWCR
  121. CMNCR_D: .long 0x00000013
  122. CS0BCR_D: .long 0x24920400
  123. CS4BCR_D: .long 0x24920400
  124. CS5ABCR_D: .long 0x24920400
  125. CS5BBCR_D: .long 0x7fff0600
  126. CS6ABCR_D: .long 0x24920400
  127. CS6BBCR_D: .long 0x24920600
  128. CS0WCR_D: .long 0x00000480
  129. CS4WCR_D: .long 0x00000480
  130. CS5AWCR_D: .long 0x00000380
  131. CS5BWCR_D: .long 0x00000080
  132. CS6AWCR_D: .long 0x00000300
  133. CS6BWCR_D: .long 0x00000540
  134. CCR_A: .long 0xff00001c
  135. CCR_D: .long 0x0000090d
  136. SLEEP_CNT: .long 0x00000800
  137. SR_MASK_D: .long 0xEFFFFF0F