blob: 2f6a9b74ad0efc9d9e0c0d11b262a535ac35b93c [file] [log] [blame]
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +09001/*
2 * modified from SH-IPL+g (init-r0p751rlc0011rl.S)
3 * Initial Register Data for R0P751RLC0011RL (SH7751R 240MHz/120MHz/60MHz)
4 * Coyright (c) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5*/
6
7#include <config.h>
8#include <version.h>
9
10#include <asm/processor.h>
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010011#include <asm/macro.h>
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090012
13 .global lowlevel_init
14 .text
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010015 .align 2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090016
17lowlevel_init:
18
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010019 write32 CCR_A, CCR_D_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090020
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010021 write32 MMUCR_A, MMUCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090022
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010023 write32 BCR1_A, BCR1_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090024
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010025 write16 BCR2_A, BCR2_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090026
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010027 write16 BCR3_A, BCR3_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090028
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010029 write32 BCR4_A, BCR4_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090030
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010031 write32 WCR1_A, WCR1_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090032
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010033 write32 WCR2_A, WCR2_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090034
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010035 write32 WCR3_A, WCR3_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090036
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010037 write16 PCR_A, PCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090038
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010039 write16 LED_A, #0xff
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090040
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010041 write32 MCR_A, MCR_D1
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090042
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010043 write16 RTCNT_A, RTCNT_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090044
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010045 write16 RTCOR_A, RTCOR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090046
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010047 write16 RFCR_A, RFCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090048
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010049 write16 RTCSR_A, RTCSR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090050
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010051 write8 SDMR3_A, #0x55
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090052
53 /* Wait DRAM refresh 30 times */
Jean-Christophe PLAGNIOL-VILLARDbd963702008-12-20 19:29:48 +010054 mov.l RFCR_A, r1
55 mov #30, r3
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900561:
Jean-Christophe PLAGNIOL-VILLARDbd963702008-12-20 19:29:48 +010057 mov.w @r1, r0
58 extu.w r0, r2
59 cmp/hi r3, r2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090060 bf 1b
61
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010062 write32 MCR_A, MCR_D2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090063
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010064 write8 SDMR3_A, #0
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090065
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010066 write32 IRLMASK_A, IRLMASK_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090067
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010068 write32 CCR_A, CCR_D_E
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090069
70 rts
71 nop
72
73 .align 2
74CCR_A: .long CCR /* Cache Control Register */
75CCR_D_D: .long 0x0808 /* Flush the cache, disable */
76CCR_D_E: .long 0x8000090B
77
78FRQCR_A: .long FRQCR /* FRQCR Address */
79FRQCR_D: .long 0x00000e0a /* 03/07/15 modify */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010080BCR1_A: .long BCR1 /* BCR1 Address */
81BCR1_D: .long 0x00180008
82BCR2_A: .long BCR2 /* BCR2 Address */
83BCR2_D: .long 0xabe8
84BCR3_A: .long BCR3 /* BCR3 Address */
85BCR3_D: .long 0x0000
86BCR4_A: .long BCR4 /* BCR4 Address */
87BCR4_D: .long 0x00000010
88WCR1_A: .long WCR1 /* WCR1 Address */
89WCR1_D: .long 0x33343333
90WCR2_A: .long WCR2 /* WCR2 Address */
91WCR2_D: .long 0xcff86fbf
92WCR3_A: .long WCR3 /* WCR3 Address */
93WCR3_D: .long 0x07777707
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090094LED_A: .long 0x04000036 /* LED Address */
95RTCNT_A: .long RTCNT /* RTCNT Address */
96RTCNT_D: .long 0xA500 /* RTCNT Write Code A5h Data 00h */
97RTCOR_A: .long RTCOR /* RTCOR Address */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010098RTCOR_D: .long 0xA534 /* RTCOR Write Code */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090099RTCSR_A: .long RTCSR /* RTCSR Address */
100RTCSR_D: .long 0xA510 /* RTCSR Write Code */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100101SDMR3_A: .long 0xFF9400CC /* SDMR3 Address */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900102SDMR3_D: .long 0x55
103MCR_A: .long MCR /* MCR Address */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100104MCR_D1: .long 0x081901F4 /* MRSET:'0' */
105MCR_D2: .long 0x481901F4 /* MRSET:'1' */
106RFCR_A: .long RFCR /* RFCR Address */
107RFCR_D: .long 0xA400 /* RFCR Write Code A4h Data 00h */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900108PCR_A: .long PCR /* PCR Address */
109PCR_D: .long 0x0000
110MMUCR_A: .long MMUCR /* MMUCCR Address */
111MMUCR_D: .long 0x00000000 /* MMUCCR Data */
112IRLMASK_A: .long 0xA4000000 /* IRLMASK Address */
113IRLMASK_D: .long 0x00000000 /* IRLMASK Data */