2008-03-25 08:11:24 +00:00
|
|
|
/*
|
|
|
|
* modified from SH-IPL+g (init-r0p751rlc0011rl.S)
|
|
|
|
* Initial Register Data for R0P751RLC0011RL (SH7751R 240MHz/120MHz/60MHz)
|
|
|
|
* Coyright (c) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <version.h>
|
|
|
|
|
|
|
|
#include <asm/processor.h>
|
2008-12-20 18:29:49 +00:00
|
|
|
#include <asm/macro.h>
|
2008-03-25 08:11:24 +00:00
|
|
|
|
|
|
|
.global lowlevel_init
|
|
|
|
.text
|
2008-12-02 06:40:03 +00:00
|
|
|
.align 2
|
2008-03-25 08:11:24 +00:00
|
|
|
|
|
|
|
lowlevel_init:
|
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 CCR_A, CCR_D_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 MMUCR_A, MMUCR_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 BCR1_A, BCR1_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 BCR2_A, BCR2_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 BCR3_A, BCR3_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 BCR4_A, BCR4_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 WCR1_A, WCR1_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 WCR2_A, WCR2_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 WCR3_A, WCR3_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 PCR_A, PCR_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 LED_A, #0xff
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 MCR_A, MCR_D1
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 RTCNT_A, RTCNT_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 RTCOR_A, RTCOR_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 RFCR_A, RFCR_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write16 RTCSR_A, RTCSR_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write8 SDMR3_A, #0x55
|
2008-03-25 08:11:24 +00:00
|
|
|
|
|
|
|
/* Wait DRAM refresh 30 times */
|
2008-12-20 18:29:48 +00:00
|
|
|
mov.l RFCR_A, r1
|
|
|
|
mov #30, r3
|
2008-03-25 08:11:24 +00:00
|
|
|
1:
|
2008-12-20 18:29:48 +00:00
|
|
|
mov.w @r1, r0
|
|
|
|
extu.w r0, r2
|
|
|
|
cmp/hi r3, r2
|
2008-03-25 08:11:24 +00:00
|
|
|
bf 1b
|
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 MCR_A, MCR_D2
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write8 SDMR3_A, #0
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 IRLMASK_A, IRLMASK_D
|
2008-03-25 08:11:24 +00:00
|
|
|
|
2008-12-20 18:29:49 +00:00
|
|
|
write32 CCR_A, CCR_D_E
|
2008-03-25 08:11:24 +00:00
|
|
|
|
|
|
|
rts
|
|
|
|
nop
|
|
|
|
|
|
|
|
.align 2
|
|
|
|
CCR_A: .long CCR /* Cache Control Register */
|
|
|
|
CCR_D_D: .long 0x0808 /* Flush the cache, disable */
|
|
|
|
CCR_D_E: .long 0x8000090B
|
|
|
|
|
|
|
|
FRQCR_A: .long FRQCR /* FRQCR Address */
|
|
|
|
FRQCR_D: .long 0x00000e0a /* 03/07/15 modify */
|
2008-12-02 06:40:03 +00:00
|
|
|
BCR1_A: .long BCR1 /* BCR1 Address */
|
|
|
|
BCR1_D: .long 0x00180008
|
|
|
|
BCR2_A: .long BCR2 /* BCR2 Address */
|
|
|
|
BCR2_D: .long 0xabe8
|
|
|
|
BCR3_A: .long BCR3 /* BCR3 Address */
|
|
|
|
BCR3_D: .long 0x0000
|
|
|
|
BCR4_A: .long BCR4 /* BCR4 Address */
|
|
|
|
BCR4_D: .long 0x00000010
|
|
|
|
WCR1_A: .long WCR1 /* WCR1 Address */
|
|
|
|
WCR1_D: .long 0x33343333
|
|
|
|
WCR2_A: .long WCR2 /* WCR2 Address */
|
|
|
|
WCR2_D: .long 0xcff86fbf
|
|
|
|
WCR3_A: .long WCR3 /* WCR3 Address */
|
|
|
|
WCR3_D: .long 0x07777707
|
2008-03-25 08:11:24 +00:00
|
|
|
LED_A: .long 0x04000036 /* LED Address */
|
|
|
|
RTCNT_A: .long RTCNT /* RTCNT Address */
|
|
|
|
RTCNT_D: .long 0xA500 /* RTCNT Write Code A5h Data 00h */
|
|
|
|
RTCOR_A: .long RTCOR /* RTCOR Address */
|
2008-12-02 06:40:03 +00:00
|
|
|
RTCOR_D: .long 0xA534 /* RTCOR Write Code */
|
2008-03-25 08:11:24 +00:00
|
|
|
RTCSR_A: .long RTCSR /* RTCSR Address */
|
|
|
|
RTCSR_D: .long 0xA510 /* RTCSR Write Code */
|
2008-12-02 06:40:03 +00:00
|
|
|
SDMR3_A: .long 0xFF9400CC /* SDMR3 Address */
|
2008-03-25 08:11:24 +00:00
|
|
|
SDMR3_D: .long 0x55
|
|
|
|
MCR_A: .long MCR /* MCR Address */
|
2008-12-02 06:40:03 +00:00
|
|
|
MCR_D1: .long 0x081901F4 /* MRSET:'0' */
|
|
|
|
MCR_D2: .long 0x481901F4 /* MRSET:'1' */
|
|
|
|
RFCR_A: .long RFCR /* RFCR Address */
|
|
|
|
RFCR_D: .long 0xA400 /* RFCR Write Code A4h Data 00h */
|
2008-03-25 08:11:24 +00:00
|
|
|
PCR_A: .long PCR /* PCR Address */
|
|
|
|
PCR_D: .long 0x0000
|
|
|
|
MMUCR_A: .long MMUCR /* MMUCCR Address */
|
|
|
|
MMUCR_D: .long 0x00000000 /* MMUCCR Data */
|
|
|
|
IRLMASK_A: .long 0xA4000000 /* IRLMASK Address */
|
|
|
|
IRLMASK_D: .long 0x00000000 /* IRLMASK Data */
|