Yoshihiro Shimoda | b2b5e2b | 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 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 21 | #include <asm/macro.h> |
| 22 | |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 23 | .global lowlevel_init |
| 24 | |
| 25 | .text |
| 26 | .align 2 |
| 27 | |
| 28 | lowlevel_init: |
| 29 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 30 | write16 WTCSR_A, WTCSR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 31 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 32 | write16 WTCNT_A, WTCNT_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 33 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 34 | write16 FRQCR_A, FRQCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 35 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 36 | write16 UCLKCR_A, UCLKCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 37 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 38 | write32 CMNCR_A, CMNCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 39 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 40 | write32 CMNCR_A, CMNCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 41 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 42 | write32 CS0BCR_A, CS0BCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 43 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 44 | write32 CS2BCR_A, CS2BCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 45 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 46 | write32 CS3BCR_A, CS3BCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 47 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 48 | write32 CS4BCR_A, CS4BCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 49 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 50 | write32 CS5ABCR_A, CS5ABCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 51 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 52 | write32 CS5BBCR_A, CS5BBCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 53 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 54 | write32 CS6ABCR_A, CS6ABCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 55 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 56 | write32 CS6BBCR_A, CS6BBCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 57 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 58 | write32 CS0WCR_A, CS0WCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 59 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 60 | write32 CS2WCR_A, CS2WCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 61 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 62 | write32 CS3WCR_A, CS3WCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 63 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 64 | write32 CS4WCR_A, CS4WCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 65 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 66 | write32 CS5AWCR_A, CS5AWCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 67 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 68 | write32 CS5BWCR_A, CS5BWCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 69 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 70 | write32 CS6AWCR_A, CS6AWCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 71 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 72 | write32 CS6BWCR_A, CS6BWCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 73 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 74 | write32 SDCR_A, SDCR_D1 |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 75 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 76 | write32 RTCSR_A, RTCSR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 77 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 78 | write32 RTCNT_A RTCNT_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 79 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 80 | write32 RTCOR_A, RTCOR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 81 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 82 | write32 SDCR_A, SDCR_D2 |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 83 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 84 | write16 SDMR3_A, SDMR3_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 85 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 86 | write16 PCCR_A, PCCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 87 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 88 | write16 PDCR_A, PDCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 89 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 90 | write16 PECR_A, PECR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 91 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 92 | write16 PGCR_A, PGCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 93 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 94 | write16 PHCR_A, PHCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 95 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 96 | write16 PPCR_A, PPCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 97 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 98 | write16 PTCR_A, PTCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 99 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 100 | write16 PVCR_A, PVCR_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 101 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 102 | write16 PSELA_A, PSELA_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 103 | |
Nobuhiro Iwamatsu | 3e3eec3 | 2009-02-03 13:35:05 +0900 | [diff] [blame] | 104 | write32 CCR_A, CCR_D |
| 105 | |
| 106 | write8 LED_A, LED_D |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 107 | |
| 108 | rts |
| 109 | nop |
| 110 | |
| 111 | .align 4 |
| 112 | |
| 113 | FRQCR_A: .long 0xA415FF80 /* FRQCR Address */ |
| 114 | WTCNT_A: .long 0xA415FF84 |
| 115 | WTCSR_A: .long 0xA415FF86 |
| 116 | UCLKCR_A: .long 0xA40A0008 |
Nobuhiro Iwamatsu | fc0db13 | 2010-07-22 16:14:54 +0900 | [diff] [blame] | 117 | FRQCR_D: .word 0x1103 /* I:B:P=8:4:2 */ |
| 118 | WTCNT_D: .word 0x5A00 |
| 119 | WTCSR_D: .word 0xA506 |
| 120 | UCLKCR_D: .word 0xA5C0 |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 121 | |
| 122 | #define BSC_BASE 0xA4FD0000 |
| 123 | CMNCR_A: .long BSC_BASE |
| 124 | CS0BCR_A: .long BSC_BASE + 0x04 |
| 125 | CS2BCR_A: .long BSC_BASE + 0x08 |
| 126 | CS3BCR_A: .long BSC_BASE + 0x0C |
| 127 | CS4BCR_A: .long BSC_BASE + 0x10 |
| 128 | CS5ABCR_A: .long BSC_BASE + 0x14 |
| 129 | CS5BBCR_A: .long BSC_BASE + 0x18 |
| 130 | CS6ABCR_A: .long BSC_BASE + 0x1C |
| 131 | CS6BBCR_A: .long BSC_BASE + 0x20 |
| 132 | CS0WCR_A: .long BSC_BASE + 0x24 |
| 133 | CS2WCR_A: .long BSC_BASE + 0x28 |
| 134 | CS3WCR_A: .long BSC_BASE + 0x2C |
| 135 | CS4WCR_A: .long BSC_BASE + 0x30 |
| 136 | CS5AWCR_A: .long BSC_BASE + 0x34 |
| 137 | CS5BWCR_A: .long BSC_BASE + 0x38 |
| 138 | CS6AWCR_A: .long BSC_BASE + 0x3C |
| 139 | CS6BWCR_A: .long BSC_BASE + 0x40 |
| 140 | SDCR_A: .long BSC_BASE + 0x44 |
| 141 | RTCSR_A: .long BSC_BASE + 0x48 |
| 142 | RTCNT_A: .long BSC_BASE + 0x4C |
| 143 | RTCOR_A: .long BSC_BASE + 0x50 |
| 144 | SDMR3_A: .long BSC_BASE + 0x58C0 |
| 145 | |
| 146 | CMNCR_D: .long 0x00000010 |
| 147 | CS0BCR_D: .long 0x36DB0400 |
| 148 | CS2BCR_D: .long 0x36DB0400 |
| 149 | CS3BCR_D: .long 0x36DB4600 |
| 150 | CS4BCR_D: .long 0x36DB0400 |
| 151 | CS5ABCR_D: .long 0x36DB0400 |
| 152 | CS5BBCR_D: .long 0x36DB0200 |
| 153 | CS6ABCR_D: .long 0x36DB0400 |
| 154 | CS6BBCR_D: .long 0x36DB0400 |
| 155 | CS0WCR_D: .long 0x00000B01 |
| 156 | CS2WCR_D: .long 0x00000500 |
| 157 | CS3WCR_D: .long 0x00006D1B |
| 158 | CS4WCR_D: .long 0x00000500 |
| 159 | CS5AWCR_D: .long 0x00000500 |
| 160 | CS5BWCR_D: .long 0x00000500 |
| 161 | CS6AWCR_D: .long 0x00000500 |
| 162 | CS6BWCR_D: .long 0x00000500 |
| 163 | SDCR_D1: .long 0x00000011 |
| 164 | RTCSR_D: .long 0xA55A0010 |
| 165 | RTCNT_D: .long 0xA55A001F |
| 166 | RTCOR_D: .long 0xA55A001F |
Nobuhiro Iwamatsu | fc0db13 | 2010-07-22 16:14:54 +0900 | [diff] [blame] | 167 | SDMR3_D: .word 0x0000 |
| 168 | .align 2 |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 169 | SDCR_D2: .long 0x00000811 |
| 170 | |
| 171 | #define PFC_BASE 0xA4050100 |
| 172 | PCCR_A: .long PFC_BASE + 0x04 |
| 173 | PDCR_A: .long PFC_BASE + 0x06 |
| 174 | PECR_A: .long PFC_BASE + 0x08 |
| 175 | PGCR_A: .long PFC_BASE + 0x0C |
| 176 | PHCR_A: .long PFC_BASE + 0x0E |
| 177 | PPCR_A: .long PFC_BASE + 0x18 |
| 178 | PTCR_A: .long PFC_BASE + 0x1E |
| 179 | PVCR_A: .long PFC_BASE + 0x22 |
| 180 | PSELA_A: .long PFC_BASE + 0x24 |
| 181 | |
Nobuhiro Iwamatsu | fc0db13 | 2010-07-22 16:14:54 +0900 | [diff] [blame] | 182 | PCCR_D: .word 0x0000 |
| 183 | PDCR_D: .word 0x0000 |
| 184 | PECR_D: .word 0x0000 |
| 185 | PGCR_D: .word 0x0000 |
| 186 | PHCR_D: .word 0x0000 |
| 187 | PPCR_D: .word 0x00AA |
| 188 | PTCR_D: .word 0x0280 |
| 189 | PVCR_D: .word 0x0000 |
| 190 | PSELA_D: .word 0x0000 |
| 191 | .align 2 |
Yoshihiro Shimoda | b2b5e2b | 2007-12-03 22:58:50 +0900 | [diff] [blame] | 192 | |
| 193 | CCR_A: .long 0xFFFFFFEC |
| 194 | !CCR_D: .long 0x0000000D |
| 195 | CCR_D: .long 0x0000000B |
| 196 | |
| 197 | LED_A: .long 0xB6800000 |
| 198 | LED_D: .long 0xFF |