blob: f3392f097dc78e004e147b50e5c5f479c06de667 [file] [log] [blame]
Nobuhiro Iwamatsuf5e24662008-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-VILLARDf7e78f32008-12-20 19:29:49 +010011#include <asm/macro.h>
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090012
13 .global lowlevel_init
14 .text
Jean-Christophe PLAGNIOL-VILLARD4d4a9602008-12-02 07:40:03 +010015 .align 2
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090016
17lowlevel_init:
18
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010019 write32 CCR_A, CCR_D_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090020
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010021 write32 MMUCR_A, MMUCR_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090022
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010023 write32 BCR1_A, BCR1_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090024
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010025 write16 BCR2_A, BCR2_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090026
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010027 write16 BCR3_A, BCR3_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090028
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010029 write32 BCR4_A, BCR4_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090030
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010031 write32 WCR1_A, WCR1_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090032
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010033 write32 WCR2_A, WCR2_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090034
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010035 write32 WCR3_A, WCR3_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090036
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010037 write16 PCR_A, PCR_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090038
Nobuhiro Iwamatsuc9935c92009-01-11 17:48:56 +090039 write16 LED_A, LED_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090040
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010041 write32 MCR_A, MCR_D1
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090042
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010043 write16 RTCNT_A, RTCNT_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090044
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010045 write16 RTCOR_A, RTCOR_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090046
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010047 write16 RFCR_A, RFCR_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090048
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010049 write16 RTCSR_A, RTCSR_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090050
Nobuhiro Iwamatsuc9935c92009-01-11 17:48:56 +090051 write8 SDMR3_A, SDMR3_D0
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090052
53 /* Wait DRAM refresh 30 times */
Jean-Christophe PLAGNIOL-VILLARDe4430772008-12-20 19:29:48 +010054 mov.l RFCR_A, r1
55 mov #30, r3
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +0900561:
Jean-Christophe PLAGNIOL-VILLARDe4430772008-12-20 19:29:48 +010057 mov.w @r1, r0
58 extu.w r0, r2
59 cmp/hi r3, r2
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090060 bf 1b
61
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010062 write32 MCR_A, MCR_D2
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090063
Nobuhiro Iwamatsuc9935c92009-01-11 17:48:56 +090064 write8 SDMR3_A, SDMR3_D1
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090065
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010066 write32 IRLMASK_A, IRLMASK_D
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090067
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010068 write32 CCR_A, CCR_D_E
Nobuhiro Iwamatsuf5e24662008-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-VILLARD4d4a9602008-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 Iwamatsuf5e24662008-03-25 17:11:24 +090094LED_A: .long 0x04000036 /* LED Address */
Nobuhiro Iwamatsuc9935c92009-01-11 17:48:56 +090095LED_D: .long 0xFF /* LED Data */
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090096RTCNT_A: .long RTCNT /* RTCNT Address */
Nobuhiro Iwamatsuedb32052010-07-22 15:41:49 +090097RTCNT_D: .word 0xA500 /* RTCNT Write Code A5h Data 00h */
98.align 2
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +090099RTCOR_A: .long RTCOR /* RTCOR Address */
Nobuhiro Iwamatsuedb32052010-07-22 15:41:49 +0900100RTCOR_D: .word 0xA534 /* RTCOR Write Code */
101.align 2
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +0900102RTCSR_A: .long RTCSR /* RTCSR Address */
Nobuhiro Iwamatsuedb32052010-07-22 15:41:49 +0900103RTCSR_D: .word 0xA510 /* RTCSR Write Code */
104.align 2
Jean-Christophe PLAGNIOL-VILLARD4d4a9602008-12-02 07:40:03 +0100105SDMR3_A: .long 0xFF9400CC /* SDMR3 Address */
Nobuhiro Iwamatsuc9935c92009-01-11 17:48:56 +0900106SDMR3_D0: .long 0x55
107SDMR3_D1: .long 0x00
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +0900108MCR_A: .long MCR /* MCR Address */
Jean-Christophe PLAGNIOL-VILLARD4d4a9602008-12-02 07:40:03 +0100109MCR_D1: .long 0x081901F4 /* MRSET:'0' */
110MCR_D2: .long 0x481901F4 /* MRSET:'1' */
111RFCR_A: .long RFCR /* RFCR Address */
112RFCR_D: .long 0xA400 /* RFCR Write Code A4h Data 00h */
Nobuhiro Iwamatsuf5e24662008-03-25 17:11:24 +0900113PCR_A: .long PCR /* PCR Address */
114PCR_D: .long 0x0000
115MMUCR_A: .long MMUCR /* MMUCCR Address */
116MMUCR_D: .long 0x00000000 /* MMUCCR Data */
117IRLMASK_A: .long 0xA4000000 /* IRLMASK Address */
118IRLMASK_D: .long 0x00000000 /* IRLMASK Data */