Yoshihiro Shimoda | dad925c | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
| 3 | * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License as |
| 7 | * published by the Free Software Foundation; either version 2 of |
| 8 | * the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 18 | * MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | .global lowlevel_init |
| 22 | |
| 23 | .text |
| 24 | .align 2 |
| 25 | |
| 26 | lowlevel_init: |
| 27 | |
| 28 | mov.l WTCSR_A,r1 |
| 29 | mov.l WTCSR_D,r0 |
| 30 | mov.w r0,@r1 |
| 31 | |
| 32 | mov.l WTCNT_A,r1 |
| 33 | mov.l WTCNT_D,r0 |
| 34 | mov.w r0,@r1 |
| 35 | |
| 36 | mov.l FRQCR_A,r1 |
| 37 | mov.l FRQCR_D,r0 |
| 38 | mov.w r0,@r1 |
| 39 | |
| 40 | mov.l UCLKCR_A,r1 |
| 41 | mov.l UCLKCR_D,r0 |
| 42 | mov.w r0,@r1 |
| 43 | |
| 44 | mov.l CMNCR_A, r1 |
| 45 | mov.l CMNCR_D, r0 |
| 46 | mov.l r0, @r1 |
| 47 | |
| 48 | mov.l CS0BCR_A, r1 |
| 49 | mov.l CS0BCR_D, r0 |
| 50 | mov.l r0, @r1 |
| 51 | |
| 52 | mov.l CS2BCR_A, r1 |
| 53 | mov.l CS2BCR_D, r0 |
| 54 | mov.l r0, @r1 |
| 55 | |
| 56 | mov.l CS3BCR_A, r1 |
| 57 | mov.l CS3BCR_D, r0 |
| 58 | mov.l r0, @r1 |
| 59 | |
| 60 | mov.l CS4BCR_A, r1 |
| 61 | mov.l CS4BCR_D, r0 |
| 62 | mov.l r0, @r1 |
| 63 | |
| 64 | mov.l CS5ABCR_A, r1 |
| 65 | mov.l CS5ABCR_D, r0 |
| 66 | mov.l r0, @r1 |
| 67 | |
| 68 | mov.l CS5BBCR_A, r1 |
| 69 | mov.l CS5BBCR_D, r0 |
| 70 | mov.l r0, @r1 |
| 71 | |
| 72 | mov.l CS6ABCR_A, r1 |
| 73 | mov.l CS6ABCR_D, r0 |
| 74 | mov.l r0, @r1 |
| 75 | |
| 76 | mov.l CS6BBCR_A, r1 |
| 77 | mov.l CS6BBCR_D, r0 |
| 78 | mov.l r0, @r1 |
| 79 | |
| 80 | mov.l CS0WCR_A, r1 |
| 81 | mov.l CS0WCR_D, r0 |
| 82 | mov.l r0, @r1 |
| 83 | |
| 84 | mov.l CS2WCR_A, r1 |
| 85 | mov.l CS2WCR_D, r0 |
| 86 | mov.l r0, @r1 |
| 87 | |
| 88 | mov.l CS3WCR_A, r1 |
| 89 | mov.l CS3WCR_D, r0 |
| 90 | mov.l r0, @r1 |
| 91 | |
| 92 | mov.l CS4WCR_A, r1 |
| 93 | mov.l CS4WCR_D, r0 |
| 94 | mov.l r0, @r1 |
| 95 | |
| 96 | mov.l CS5AWCR_A, r1 |
| 97 | mov.l CS5AWCR_D, r0 |
| 98 | mov.l r0, @r1 |
| 99 | |
| 100 | mov.l CS5BWCR_A, r1 |
| 101 | mov.l CS5BWCR_D, r0 |
| 102 | mov.l r0, @r1 |
| 103 | |
| 104 | mov.l CS6AWCR_A, r1 |
| 105 | mov.l CS6AWCR_D, r0 |
| 106 | mov.l r0, @r1 |
| 107 | |
| 108 | mov.l CS6BWCR_A, r1 |
| 109 | mov.l CS6BWCR_D, r0 |
| 110 | mov.l r0, @r1 |
| 111 | |
| 112 | mov.l SDCR_A, r1 |
| 113 | mov.l SDCR_D1, r0 |
| 114 | mov.l r0, @r1 |
| 115 | |
| 116 | mov.l RTCSR_A, r1 |
| 117 | mov.l RTCSR_D, r0 |
| 118 | mov.l r0, @r1 |
| 119 | |
| 120 | mov.l RTCNT_A, r1 |
| 121 | mov.l RTCNT_D, r0 |
| 122 | mov.l r0, @r1 |
| 123 | |
| 124 | mov.l RTCOR_A, r1 |
| 125 | mov.l RTCOR_D, r0 |
| 126 | mov.l r0, @r1 |
| 127 | |
| 128 | mov.l SDCR_A, r1 |
| 129 | mov.l SDCR_D2, r0 |
| 130 | mov.l r0, @r1 |
| 131 | |
| 132 | mov.l SDMR3_A, r1 |
| 133 | mov.l SDMR3_D, r0 |
| 134 | mov.w r0, @r1 |
| 135 | |
| 136 | mov.l PCCR_A, r1 |
| 137 | mov.l PCCR_D, r0 |
| 138 | mov.w r0, @r1 |
| 139 | |
| 140 | mov.l PDCR_A, r1 |
| 141 | mov.l PDCR_D, r0 |
| 142 | mov.w r0, @r1 |
| 143 | |
| 144 | mov.l PECR_A, r1 |
| 145 | mov.l PECR_D, r0 |
| 146 | mov.w r0, @r1 |
| 147 | |
| 148 | mov.l PGCR_A, r1 |
| 149 | mov.l PGCR_D, r0 |
| 150 | mov.w r0, @r1 |
| 151 | |
| 152 | mov.l PHCR_A, r1 |
| 153 | mov.l PHCR_D, r0 |
| 154 | mov.w r0, @r1 |
| 155 | |
| 156 | mov.l PPCR_A, r1 |
| 157 | mov.l PPCR_D, r0 |
| 158 | mov.w r0, @r1 |
| 159 | |
| 160 | mov.l PTCR_A, r1 |
| 161 | mov.l PTCR_D, r0 |
| 162 | mov.w r0, @r1 |
| 163 | |
| 164 | mov.l PVCR_A, r1 |
| 165 | mov.l PVCR_D, r0 |
| 166 | mov.w r0, @r1 |
| 167 | |
| 168 | mov.l PSELA_A, r1 |
| 169 | mov.l PSELA_D, r0 |
| 170 | mov.w r0, @r1 |
| 171 | |
| 172 | mov.l CCR_A, r1 |
| 173 | mov.l CCR_D, r0 |
| 174 | mov.l r0, @r1 |
| 175 | |
| 176 | mov.l LED_A, r1 |
| 177 | mov.l LED_D, r0 |
| 178 | mov.b r0, @r1 |
| 179 | |
| 180 | rts |
| 181 | nop |
| 182 | |
| 183 | .align 4 |
| 184 | |
| 185 | FRQCR_A: .long 0xA415FF80 /* FRQCR Address */ |
| 186 | WTCNT_A: .long 0xA415FF84 |
| 187 | WTCSR_A: .long 0xA415FF86 |
| 188 | UCLKCR_A: .long 0xA40A0008 |
| 189 | FRQCR_D: .long 0x1103 /* I:B:P=8:4:2 */ |
| 190 | WTCNT_D: .long 0x5A00 |
| 191 | WTCSR_D: .long 0xA506 |
| 192 | UCLKCR_D: .long 0xA5C0 |
| 193 | |
| 194 | #define BSC_BASE 0xA4FD0000 |
| 195 | CMNCR_A: .long BSC_BASE |
| 196 | CS0BCR_A: .long BSC_BASE + 0x04 |
| 197 | CS2BCR_A: .long BSC_BASE + 0x08 |
| 198 | CS3BCR_A: .long BSC_BASE + 0x0C |
| 199 | CS4BCR_A: .long BSC_BASE + 0x10 |
| 200 | CS5ABCR_A: .long BSC_BASE + 0x14 |
| 201 | CS5BBCR_A: .long BSC_BASE + 0x18 |
| 202 | CS6ABCR_A: .long BSC_BASE + 0x1C |
| 203 | CS6BBCR_A: .long BSC_BASE + 0x20 |
| 204 | CS0WCR_A: .long BSC_BASE + 0x24 |
| 205 | CS2WCR_A: .long BSC_BASE + 0x28 |
| 206 | CS3WCR_A: .long BSC_BASE + 0x2C |
| 207 | CS4WCR_A: .long BSC_BASE + 0x30 |
| 208 | CS5AWCR_A: .long BSC_BASE + 0x34 |
| 209 | CS5BWCR_A: .long BSC_BASE + 0x38 |
| 210 | CS6AWCR_A: .long BSC_BASE + 0x3C |
| 211 | CS6BWCR_A: .long BSC_BASE + 0x40 |
| 212 | SDCR_A: .long BSC_BASE + 0x44 |
| 213 | RTCSR_A: .long BSC_BASE + 0x48 |
| 214 | RTCNT_A: .long BSC_BASE + 0x4C |
| 215 | RTCOR_A: .long BSC_BASE + 0x50 |
| 216 | SDMR3_A: .long BSC_BASE + 0x58C0 |
| 217 | |
| 218 | CMNCR_D: .long 0x00000010 |
| 219 | CS0BCR_D: .long 0x36DB0400 |
| 220 | CS2BCR_D: .long 0x36DB0400 |
| 221 | CS3BCR_D: .long 0x36DB4600 |
| 222 | CS4BCR_D: .long 0x36DB0400 |
| 223 | CS5ABCR_D: .long 0x36DB0400 |
| 224 | CS5BBCR_D: .long 0x36DB0200 |
| 225 | CS6ABCR_D: .long 0x36DB0400 |
| 226 | CS6BBCR_D: .long 0x36DB0400 |
| 227 | CS0WCR_D: .long 0x00000B01 |
| 228 | CS2WCR_D: .long 0x00000500 |
| 229 | CS3WCR_D: .long 0x00006D1B |
| 230 | CS4WCR_D: .long 0x00000500 |
| 231 | CS5AWCR_D: .long 0x00000500 |
| 232 | CS5BWCR_D: .long 0x00000500 |
| 233 | CS6AWCR_D: .long 0x00000500 |
| 234 | CS6BWCR_D: .long 0x00000500 |
| 235 | SDCR_D1: .long 0x00000011 |
| 236 | RTCSR_D: .long 0xA55A0010 |
| 237 | RTCNT_D: .long 0xA55A001F |
| 238 | RTCOR_D: .long 0xA55A001F |
| 239 | SDMR3_D: .long 0x0000 |
| 240 | SDCR_D2: .long 0x00000811 |
| 241 | |
| 242 | #define PFC_BASE 0xA4050100 |
| 243 | PCCR_A: .long PFC_BASE + 0x04 |
| 244 | PDCR_A: .long PFC_BASE + 0x06 |
| 245 | PECR_A: .long PFC_BASE + 0x08 |
| 246 | PGCR_A: .long PFC_BASE + 0x0C |
| 247 | PHCR_A: .long PFC_BASE + 0x0E |
| 248 | PPCR_A: .long PFC_BASE + 0x18 |
| 249 | PTCR_A: .long PFC_BASE + 0x1E |
| 250 | PVCR_A: .long PFC_BASE + 0x22 |
| 251 | PSELA_A: .long PFC_BASE + 0x24 |
| 252 | |
| 253 | PCCR_D: .long 0x0000 |
| 254 | PDCR_D: .long 0x0000 |
| 255 | PECR_D: .long 0x0000 |
| 256 | PGCR_D: .long 0x0000 |
| 257 | PHCR_D: .long 0x0000 |
| 258 | PPCR_D: .long 0x00AA |
| 259 | PTCR_D: .long 0x0280 |
| 260 | PVCR_D: .long 0x0000 |
| 261 | PSELA_D: .long 0x0000 |
| 262 | |
| 263 | CCR_A: .long 0xFFFFFFEC |
| 264 | !CCR_D: .long 0x0000000D |
| 265 | CCR_D: .long 0x0000000B |
| 266 | |
| 267 | LED_A: .long 0xB6800000 |
| 268 | LED_D: .long 0xFF |