1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
7 * Kenati Technologies, Inc.
9 * board/ms7722se/lowlevel_init.S
14 #include <asm/processor.h>
15 #include <asm/macro.h>
18 * Board specific low level init code, called _very_ early in the
19 * startup sequence. Relocation to SDRAM has not happened yet, no
20 * stack is available, bss section has not been initialised, etc.
22 * (Note: As no stack is available, no subroutines can be called...).
33 * Cache Control Register
34 * Instruction Cache Invalidate
39 * Address of MMU Control Register
40 * TI == TLB Invalidate bit
42 write32 MMUCR_A, MMUCR_D
44 /* Address of Power Control Register 0 */
45 write32 MSTPCR0_A, MSTPCR0_D
47 /* Address of Power Control Register 2 */
48 write32 MSTPCR2_A, MSTPCR2_D
50 write16 SBSCR_A, SBSCR_D
52 write16 PSCR_A, PSCR_D
54 /* 0xA4520004 (Watchdog Control / Status Register) */
55 ! write16 RWTCSR_A, RWTCSR_D_1 /* 0xA507 -> timer_STOP/WDT_CLK=max */
57 /* 0xA4520000 (Watchdog Count Register) */
58 write16 RWTCNT_A, RWTCNT_D /*0x5A00 -> Clear */
60 /* 0xA4520004 (Watchdog Control / Status Register) */
61 write16 RWTCSR_A, RWTCSR_D_2 /* 0xA504 -> timer_STOP/CLK=500ms */
63 /* 0xA4150000 Frequency control register */
64 write32 FRQCR_A, FRQCR_D
66 write32 CCR_A, CCR_D_2
70 write16 PSELA_A, PSELA_D
72 write16 DRVCR_A, DRVCR_D
74 write16 PCCR_A, PCCR_D
76 write16 PECR_A, PECR_D
78 write16 PJCR_A, PJCR_D
80 write16 PXCR_A, PXCR_D
82 write32 CMNCR_A, CMNCR_D
84 write32 CS0BCR_A, CS0BCR_D
86 write32 CS2BCR_A, CS2BCR_D
88 write32 CS4BCR_A, CS4BCR_D
90 write32 CS5ABCR_A, CS5ABCR_D
92 write32 CS5BBCR_A, CS5BBCR_D
94 write32 CS6ABCR_A, CS6ABCR_D
96 write32 CS0WCR_A, CS0WCR_D
98 write32 CS2WCR_A, CS2WCR_D
100 write32 CS4WCR_A, CS4WCR_D
102 write32 CS5AWCR_A, CS5AWCR_D
104 write32 CS5BWCR_A, CS5BWCR_D
106 write32 CS6AWCR_A, CS6AWCR_D
108 ! SDRAM initialization
109 write32 SDCR_A, SDCR_D
111 write32 SDWCR_A, SDWCR_D
113 write32 SDPCR_A, SDPCR_D
115 write32 RTCOR_A, RTCOR_D
117 write32 RTCSR_A, RTCSR_D
119 write8 SDMR3_A, SDMR3_D
121 ! BL bit off (init = ON) (?!?)
123 stc sr, r0 ! BL bit off(init=ON)
135 MSTPCR0_A: .long MSTPCR0
136 MSTPCR2_A: .long MSTPCR2
139 RWTCSR_A: .long RWTCSR
140 RWTCNT_A: .long RWTCNT
143 CCR_D: .long 0x00000800
144 CCR_D_2: .long 0x00000103
145 MMUCR_D: .long 0x00000004
146 MSTPCR0_D: .long 0x00001001
147 MSTPCR2_D: .long 0xffffffff
148 FRQCR_D: .long 0x07022538
150 PSELA_A: .long 0xa405014E
151 PSELA_D: .word 0x0A10
154 DRVCR_A: .long 0xa405018A
155 DRVCR_D: .word 0x0554
158 PCCR_A: .long 0xa4050104
162 PECR_A: .long 0xa4050108
166 PJCR_A: .long 0xa4050110
170 PXCR_A: .long 0xa4050148
175 CMNCR_D: .long 0x00000013
176 CS0BCR_A: .long CS0BCR ! Flash bank 1
177 CS0BCR_D: .long 0x24920400
178 CS2BCR_A: .long CS2BCR ! SRAM
179 CS2BCR_D: .long 0x24920400
180 CS4BCR_A: .long CS4BCR ! FPGA, PCMCIA, USB, ext slot
181 CS4BCR_D: .long 0x24920400
182 CS5ABCR_A: .long CS5ABCR ! Ext slot
183 CS5ABCR_D: .long 0x24920400
184 CS5BBCR_A: .long CS5BBCR ! USB controller
185 CS5BBCR_D: .long 0x24920400
186 CS6ABCR_A: .long CS6ABCR ! Ethernet
187 CS6ABCR_D: .long 0x24920400
189 CS0WCR_A: .long CS0WCR
190 CS0WCR_D: .long 0x00000300
191 CS2WCR_A: .long CS2WCR
192 CS2WCR_D: .long 0x00000300
193 CS4WCR_A: .long CS4WCR
194 CS4WCR_D: .long 0x00000300
195 CS5AWCR_A: .long CS5AWCR
196 CS5AWCR_D: .long 0x00000300
197 CS5BWCR_A: .long CS5BWCR
198 CS5BWCR_D: .long 0x00000300
199 CS6AWCR_A: .long CS6AWCR
200 CS6AWCR_D: .long 0x00000300
202 SDCR_A: .long SBSC_SDCR
203 SDCR_D: .long 0x00020809
204 SDWCR_A: .long SBSC_SDWCR
205 SDWCR_D: .long 0x00164d0d
206 SDPCR_A: .long SBSC_SDPCR
207 SDPCR_D: .long 0x00000087
208 RTCOR_A: .long SBSC_RTCOR
209 RTCOR_D: .long 0xA55A0034
210 RTCSR_A: .long SBSC_RTCSR
211 RTCSR_D: .long 0xA55A0010
212 SDMR3_A: .long 0xFE500180
217 SBSCR_D: .word 0x0040
219 RWTCSR_D_1: .word 0xA507
220 RWTCSR_D_2: .word 0xA507
221 RWTCNT_D: .word 0x5A00
224 SR_MASK_D: .long 0xEFFFFF0F