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
26lowlevel_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
185FRQCR_A:	.long	0xA415FF80	/* FRQCR Address */
186WTCNT_A:	.long	0xA415FF84
187WTCSR_A:	.long	0xA415FF86
188UCLKCR_A:	.long	0xA40A0008
189FRQCR_D:	.long	0x1103		/* I:B:P=8:4:2 */
190WTCNT_D:	.long	0x5A00
191WTCSR_D:	.long	0xA506
192UCLKCR_D:	.long	0xA5C0
193
194#define BSC_BASE	0xA4FD0000
195CMNCR_A:	.long	BSC_BASE
196CS0BCR_A:	.long	BSC_BASE + 0x04
197CS2BCR_A:	.long	BSC_BASE + 0x08
198CS3BCR_A:	.long	BSC_BASE + 0x0C
199CS4BCR_A:	.long	BSC_BASE + 0x10
200CS5ABCR_A:	.long	BSC_BASE + 0x14
201CS5BBCR_A:	.long	BSC_BASE + 0x18
202CS6ABCR_A:	.long	BSC_BASE + 0x1C
203CS6BBCR_A:	.long	BSC_BASE + 0x20
204CS0WCR_A:	.long	BSC_BASE + 0x24
205CS2WCR_A:	.long	BSC_BASE + 0x28
206CS3WCR_A:	.long	BSC_BASE + 0x2C
207CS4WCR_A:	.long	BSC_BASE + 0x30
208CS5AWCR_A:	.long	BSC_BASE + 0x34
209CS5BWCR_A:	.long	BSC_BASE + 0x38
210CS6AWCR_A:	.long	BSC_BASE + 0x3C
211CS6BWCR_A:	.long	BSC_BASE + 0x40
212SDCR_A:		.long	BSC_BASE + 0x44
213RTCSR_A:	.long	BSC_BASE + 0x48
214RTCNT_A:	.long	BSC_BASE + 0x4C
215RTCOR_A:	.long	BSC_BASE + 0x50
216SDMR3_A:	.long	BSC_BASE + 0x58C0
217
218CMNCR_D:	.long	0x00000010
219CS0BCR_D:	.long	0x36DB0400
220CS2BCR_D:	.long	0x36DB0400
221CS3BCR_D:	.long	0x36DB4600
222CS4BCR_D:	.long	0x36DB0400
223CS5ABCR_D:	.long	0x36DB0400
224CS5BBCR_D:	.long	0x36DB0200
225CS6ABCR_D:	.long	0x36DB0400
226CS6BBCR_D:	.long	0x36DB0400
227CS0WCR_D:	.long	0x00000B01
228CS2WCR_D:	.long	0x00000500
229CS3WCR_D:	.long	0x00006D1B
230CS4WCR_D:	.long	0x00000500
231CS5AWCR_D:	.long	0x00000500
232CS5BWCR_D:	.long	0x00000500
233CS6AWCR_D:	.long	0x00000500
234CS6BWCR_D:	.long	0x00000500
235SDCR_D1:	.long	0x00000011
236RTCSR_D:	.long	0xA55A0010
237RTCNT_D:	.long	0xA55A001F
238RTCOR_D:	.long	0xA55A001F
239SDMR3_D:	.long	0x0000
240SDCR_D2:	.long	0x00000811
241
242#define PFC_BASE	0xA4050100
243PCCR_A:		.long	PFC_BASE + 0x04
244PDCR_A:		.long	PFC_BASE + 0x06
245PECR_A:		.long	PFC_BASE + 0x08
246PGCR_A:		.long	PFC_BASE + 0x0C
247PHCR_A:		.long	PFC_BASE + 0x0E
248PPCR_A:		.long	PFC_BASE + 0x18
249PTCR_A:		.long	PFC_BASE + 0x1E
250PVCR_A:		.long	PFC_BASE + 0x22
251PSELA_A:	.long	PFC_BASE + 0x24
252
253PCCR_D:		.long	0x0000
254PDCR_D:		.long	0x0000
255PECR_D:		.long	0x0000
256PGCR_D:		.long	0x0000
257PHCR_D:		.long	0x0000
258PPCR_D:		.long	0x00AA
259PTCR_D:		.long	0x0280
260PVCR_D:		.long	0x0000
261PSELA_D:	.long	0x0000
262
263CCR_A:		.long	0xFFFFFFEC
264!CCR_D:		.long	0x0000000D
265CCR_D:		.long	0x0000000B
266
267LED_A:		.long	0xB6800000
268LED_D:		.long	0xFF
269