blob: 871d6a81d5a45e90ad86e72424076611a6af699e [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +09002/*
3 * (C) Copyright 2007
4 * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +09005 */
6
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +09007#include <asm/macro.h>
8
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +09009 .global lowlevel_init
10
11 .text
12 .align 2
13
14lowlevel_init:
15
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090016 write16 WTCSR_A, WTCSR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090017
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090018 write16 WTCNT_A, WTCNT_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090019
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090020 write16 FRQCR_A, FRQCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090021
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090022 write16 UCLKCR_A, UCLKCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090023
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090024 write32 CMNCR_A, CMNCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090025
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090026 write32 CMNCR_A, CMNCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090027
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090028 write32 CS0BCR_A, CS0BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090029
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090030 write32 CS2BCR_A, CS2BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090031
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090032 write32 CS3BCR_A, CS3BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090033
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090034 write32 CS4BCR_A, CS4BCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090035
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090036 write32 CS5ABCR_A, CS5ABCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090037
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090038 write32 CS5BBCR_A, CS5BBCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090039
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090040 write32 CS6ABCR_A, CS6ABCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090041
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090042 write32 CS6BBCR_A, CS6BBCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090043
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090044 write32 CS0WCR_A, CS0WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090045
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090046 write32 CS2WCR_A, CS2WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090047
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090048 write32 CS3WCR_A, CS3WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090049
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090050 write32 CS4WCR_A, CS4WCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090051
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090052 write32 CS5AWCR_A, CS5AWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090053
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090054 write32 CS5BWCR_A, CS5BWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090055
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090056 write32 CS6AWCR_A, CS6AWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090057
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090058 write32 CS6BWCR_A, CS6BWCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090059
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090060 write32 SDCR_A, SDCR_D1
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090061
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090062 write32 RTCSR_A, RTCSR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090063
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090064 write32 RTCNT_A RTCNT_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090065
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090066 write32 RTCOR_A, RTCOR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090067
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090068 write32 SDCR_A, SDCR_D2
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090069
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090070 write16 SDMR3_A, SDMR3_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090071
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090072 write16 PCCR_A, PCCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090073
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090074 write16 PDCR_A, PDCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090075
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090076 write16 PECR_A, PECR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090077
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090078 write16 PGCR_A, PGCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090079
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090080 write16 PHCR_A, PHCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090081
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090082 write16 PPCR_A, PPCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090083
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090084 write16 PTCR_A, PTCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090085
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090086 write16 PVCR_A, PVCR_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090087
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090088 write16 PSELA_A, PSELA_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090089
Nobuhiro Iwamatsu3e3eec32009-02-03 13:35:05 +090090 write32 CCR_A, CCR_D
91
92 write8 LED_A, LED_D
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +090093
94 rts
95 nop
96
97 .align 4
98
99FRQCR_A: .long 0xA415FF80 /* FRQCR Address */
100WTCNT_A: .long 0xA415FF84
101WTCSR_A: .long 0xA415FF86
102UCLKCR_A: .long 0xA40A0008
Nobuhiro Iwamatsufc0db132010-07-22 16:14:54 +0900103FRQCR_D: .word 0x1103 /* I:B:P=8:4:2 */
104WTCNT_D: .word 0x5A00
105WTCSR_D: .word 0xA506
106UCLKCR_D: .word 0xA5C0
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900107
108#define BSC_BASE 0xA4FD0000
109CMNCR_A: .long BSC_BASE
110CS0BCR_A: .long BSC_BASE + 0x04
111CS2BCR_A: .long BSC_BASE + 0x08
112CS3BCR_A: .long BSC_BASE + 0x0C
113CS4BCR_A: .long BSC_BASE + 0x10
114CS5ABCR_A: .long BSC_BASE + 0x14
115CS5BBCR_A: .long BSC_BASE + 0x18
116CS6ABCR_A: .long BSC_BASE + 0x1C
117CS6BBCR_A: .long BSC_BASE + 0x20
118CS0WCR_A: .long BSC_BASE + 0x24
119CS2WCR_A: .long BSC_BASE + 0x28
120CS3WCR_A: .long BSC_BASE + 0x2C
121CS4WCR_A: .long BSC_BASE + 0x30
122CS5AWCR_A: .long BSC_BASE + 0x34
123CS5BWCR_A: .long BSC_BASE + 0x38
124CS6AWCR_A: .long BSC_BASE + 0x3C
125CS6BWCR_A: .long BSC_BASE + 0x40
126SDCR_A: .long BSC_BASE + 0x44
127RTCSR_A: .long BSC_BASE + 0x48
128RTCNT_A: .long BSC_BASE + 0x4C
129RTCOR_A: .long BSC_BASE + 0x50
130SDMR3_A: .long BSC_BASE + 0x58C0
131
132CMNCR_D: .long 0x00000010
133CS0BCR_D: .long 0x36DB0400
134CS2BCR_D: .long 0x36DB0400
135CS3BCR_D: .long 0x36DB4600
136CS4BCR_D: .long 0x36DB0400
137CS5ABCR_D: .long 0x36DB0400
138CS5BBCR_D: .long 0x36DB0200
139CS6ABCR_D: .long 0x36DB0400
140CS6BBCR_D: .long 0x36DB0400
141CS0WCR_D: .long 0x00000B01
142CS2WCR_D: .long 0x00000500
143CS3WCR_D: .long 0x00006D1B
144CS4WCR_D: .long 0x00000500
145CS5AWCR_D: .long 0x00000500
146CS5BWCR_D: .long 0x00000500
147CS6AWCR_D: .long 0x00000500
148CS6BWCR_D: .long 0x00000500
149SDCR_D1: .long 0x00000011
150RTCSR_D: .long 0xA55A0010
151RTCNT_D: .long 0xA55A001F
152RTCOR_D: .long 0xA55A001F
Nobuhiro Iwamatsufc0db132010-07-22 16:14:54 +0900153SDMR3_D: .word 0x0000
154.align 2
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900155SDCR_D2: .long 0x00000811
156
157#define PFC_BASE 0xA4050100
158PCCR_A: .long PFC_BASE + 0x04
159PDCR_A: .long PFC_BASE + 0x06
160PECR_A: .long PFC_BASE + 0x08
161PGCR_A: .long PFC_BASE + 0x0C
162PHCR_A: .long PFC_BASE + 0x0E
163PPCR_A: .long PFC_BASE + 0x18
164PTCR_A: .long PFC_BASE + 0x1E
165PVCR_A: .long PFC_BASE + 0x22
166PSELA_A: .long PFC_BASE + 0x24
167
Nobuhiro Iwamatsufc0db132010-07-22 16:14:54 +0900168PCCR_D: .word 0x0000
169PDCR_D: .word 0x0000
170PECR_D: .word 0x0000
171PGCR_D: .word 0x0000
172PHCR_D: .word 0x0000
173PPCR_D: .word 0x00AA
174PTCR_D: .word 0x0280
175PVCR_D: .word 0x0000
176PSELA_D: .word 0x0000
177.align 2
Yoshihiro Shimodab2b5e2b2007-12-03 22:58:50 +0900178
179CCR_A: .long 0xFFFFFFEC
180!CCR_D: .long 0x0000000D
181CCR_D: .long 0x0000000B
182
183LED_A: .long 0xB6800000
184LED_D: .long 0xFF