blob: 75938116bc5c7b9e43c49281918ca2b0b3cb74e6 [file] [log] [blame]
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +09001/*
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 Iwamatsu3e3eec32009-02-03 13:35:05 +090021#include <asm/macro.h>
22
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090023 .global lowlevel_init
24
25 .text
26 .align 2
27
28lowlevel_init:
29
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090030 write16 WTCSR_A, WTCSR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090031
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090032 write16 WTCNT_A, WTCNT_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090033
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090034 write16 FRQCR_A, FRQCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090035
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090036 write16 UCLKCR_A, UCLKCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090037
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090038 write32 CMNCR_A, CMNCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090039
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090040 write32 CMNCR_A, CMNCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090041
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090042 write32 CS0BCR_A, CS0BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090043
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090044 write32 CS2BCR_A, CS2BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090045
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090046 write32 CS3BCR_A, CS3BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090047
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090048 write32 CS4BCR_A, CS4BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090049
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090050 write32 CS5ABCR_A, CS5ABCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090051
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090052 write32 CS5BBCR_A, CS5BBCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090053
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090054 write32 CS6ABCR_A, CS6ABCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090055
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090056 write32 CS6BBCR_A, CS6BBCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090057
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090058 write32 CS0WCR_A, CS0WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090059
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090060 write32 CS2WCR_A, CS2WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090061
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090062 write32 CS3WCR_A, CS3WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090063
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090064 write32 CS4WCR_A, CS4WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090065
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090066 write32 CS5AWCR_A, CS5AWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090067
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090068 write32 CS5BWCR_A, CS5BWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090069
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090070 write32 CS6AWCR_A, CS6AWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090071
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090072 write32 CS6BWCR_A, CS6BWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090073
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090074 write32 SDCR_A, SDCR_D1
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090075
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090076 write32 RTCSR_A, RTCSR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090077
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090078 write32 RTCNT_A RTCNT_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090079
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090080 write32 RTCOR_A, RTCOR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090081
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090082 write32 SDCR_A, SDCR_D2
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090083
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090084 write16 SDMR3_A, SDMR3_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090085
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090086 write16 PCCR_A, PCCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090087
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090088 write16 PDCR_A, PDCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090089
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090090 write16 PECR_A, PECR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090091
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090092 write16 PGCR_A, PGCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090093
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090094 write16 PHCR_A, PHCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090095
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090096 write16 PPCR_A, PPCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090097
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090098 write16 PTCR_A, PTCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090099
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +0900100 write16 PVCR_A, PVCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900101
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +0900102 write16 PSELA_A, PSELA_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900103
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +0900104 write32 CCR_A, CCR_D
105
106 write8 LED_A, LED_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900107
108 rts
109 nop
110
111 .align 4
112
113FRQCR_A: .long 0xA415FF80 /* FRQCR Address */
114WTCNT_A: .long 0xA415FF84
115WTCSR_A: .long 0xA415FF86
116UCLKCR_A: .long 0xA40A0008
117FRQCR_D: .long 0x1103 /* I:B:P=8:4:2 */
118WTCNT_D: .long 0x5A00
119WTCSR_D: .long 0xA506
120UCLKCR_D: .long 0xA5C0
121
122#define BSC_BASE 0xA4FD0000
123CMNCR_A: .long BSC_BASE
124CS0BCR_A: .long BSC_BASE + 0x04
125CS2BCR_A: .long BSC_BASE + 0x08
126CS3BCR_A: .long BSC_BASE + 0x0C
127CS4BCR_A: .long BSC_BASE + 0x10
128CS5ABCR_A: .long BSC_BASE + 0x14
129CS5BBCR_A: .long BSC_BASE + 0x18
130CS6ABCR_A: .long BSC_BASE + 0x1C
131CS6BBCR_A: .long BSC_BASE + 0x20
132CS0WCR_A: .long BSC_BASE + 0x24
133CS2WCR_A: .long BSC_BASE + 0x28
134CS3WCR_A: .long BSC_BASE + 0x2C
135CS4WCR_A: .long BSC_BASE + 0x30
136CS5AWCR_A: .long BSC_BASE + 0x34
137CS5BWCR_A: .long BSC_BASE + 0x38
138CS6AWCR_A: .long BSC_BASE + 0x3C
139CS6BWCR_A: .long BSC_BASE + 0x40
140SDCR_A: .long BSC_BASE + 0x44
141RTCSR_A: .long BSC_BASE + 0x48
142RTCNT_A: .long BSC_BASE + 0x4C
143RTCOR_A: .long BSC_BASE + 0x50
144SDMR3_A: .long BSC_BASE + 0x58C0
145
146CMNCR_D: .long 0x00000010
147CS0BCR_D: .long 0x36DB0400
148CS2BCR_D: .long 0x36DB0400
149CS3BCR_D: .long 0x36DB4600
150CS4BCR_D: .long 0x36DB0400
151CS5ABCR_D: .long 0x36DB0400
152CS5BBCR_D: .long 0x36DB0200
153CS6ABCR_D: .long 0x36DB0400
154CS6BBCR_D: .long 0x36DB0400
155CS0WCR_D: .long 0x00000B01
156CS2WCR_D: .long 0x00000500
157CS3WCR_D: .long 0x00006D1B
158CS4WCR_D: .long 0x00000500
159CS5AWCR_D: .long 0x00000500
160CS5BWCR_D: .long 0x00000500
161CS6AWCR_D: .long 0x00000500
162CS6BWCR_D: .long 0x00000500
163SDCR_D1: .long 0x00000011
164RTCSR_D: .long 0xA55A0010
165RTCNT_D: .long 0xA55A001F
166RTCOR_D: .long 0xA55A001F
167SDMR3_D: .long 0x0000
168SDCR_D2: .long 0x00000811
169
170#define PFC_BASE 0xA4050100
171PCCR_A: .long PFC_BASE + 0x04
172PDCR_A: .long PFC_BASE + 0x06
173PECR_A: .long PFC_BASE + 0x08
174PGCR_A: .long PFC_BASE + 0x0C
175PHCR_A: .long PFC_BASE + 0x0E
176PPCR_A: .long PFC_BASE + 0x18
177PTCR_A: .long PFC_BASE + 0x1E
178PVCR_A: .long PFC_BASE + 0x22
179PSELA_A: .long PFC_BASE + 0x24
180
181PCCR_D: .long 0x0000
182PDCR_D: .long 0x0000
183PECR_D: .long 0x0000
184PGCR_D: .long 0x0000
185PHCR_D: .long 0x0000
186PPCR_D: .long 0x00AA
187PTCR_D: .long 0x0280
188PVCR_D: .long 0x0000
189PSELA_D: .long 0x0000
190
191CCR_A: .long 0xFFFFFFEC
192!CCR_D: .long 0x0000000D
193CCR_D: .long 0x0000000B
194
195LED_A: .long 0xB6800000
196LED_D: .long 0xFF