blob: 33f6e078260d8eaccae9a5dd7ce4132086221fa1 [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>
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +09008
9#include <asm/processor.h>
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010010#include <asm/macro.h>
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090011
12 .global lowlevel_init
13 .text
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010014 .align 2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090015
16lowlevel_init:
17
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010018 write32 CCR_A, CCR_D_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090019
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010020 write32 MMUCR_A, MMUCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090021
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010022 write32 BCR1_A, BCR1_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090023
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010024 write16 BCR2_A, BCR2_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090025
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010026 write16 BCR3_A, BCR3_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090027
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010028 write32 BCR4_A, BCR4_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090029
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010030 write32 WCR1_A, WCR1_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090031
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010032 write32 WCR2_A, WCR2_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090033
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010034 write32 WCR3_A, WCR3_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090035
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010036 write16 PCR_A, PCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090037
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090038 write16 LED_A, LED_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090039
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010040 write32 MCR_A, MCR_D1
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090041
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010042 write16 RTCNT_A, RTCNT_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090043
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010044 write16 RTCOR_A, RTCOR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090045
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010046 write16 RFCR_A, RFCR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090047
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010048 write16 RTCSR_A, RTCSR_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090049
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090050 write8 SDMR3_A, SDMR3_D0
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090051
52 /* Wait DRAM refresh 30 times */
Jean-Christophe PLAGNIOL-VILLARDbd963702008-12-20 19:29:48 +010053 mov.l RFCR_A, r1
54 mov #30, r3
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900551:
Jean-Christophe PLAGNIOL-VILLARDbd963702008-12-20 19:29:48 +010056 mov.w @r1, r0
57 extu.w r0, r2
58 cmp/hi r3, r2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090059 bf 1b
60
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010061 write32 MCR_A, MCR_D2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090062
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090063 write8 SDMR3_A, SDMR3_D1
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090064
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010065 write32 IRLMASK_A, IRLMASK_D
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090066
Jean-Christophe PLAGNIOL-VILLARDb9c21722008-12-20 19:29:49 +010067 write32 CCR_A, CCR_D_E
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090068
69 rts
70 nop
71
72 .align 2
73CCR_A: .long CCR /* Cache Control Register */
74CCR_D_D: .long 0x0808 /* Flush the cache, disable */
75CCR_D_E: .long 0x8000090B
76
77FRQCR_A: .long FRQCR /* FRQCR Address */
78FRQCR_D: .long 0x00000e0a /* 03/07/15 modify */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010079BCR1_A: .long BCR1 /* BCR1 Address */
80BCR1_D: .long 0x00180008
81BCR2_A: .long BCR2 /* BCR2 Address */
82BCR2_D: .long 0xabe8
83BCR3_A: .long BCR3 /* BCR3 Address */
84BCR3_D: .long 0x0000
85BCR4_A: .long BCR4 /* BCR4 Address */
86BCR4_D: .long 0x00000010
87WCR1_A: .long WCR1 /* WCR1 Address */
88WCR1_D: .long 0x33343333
89WCR2_A: .long WCR2 /* WCR2 Address */
90WCR2_D: .long 0xcff86fbf
91WCR3_A: .long WCR3 /* WCR3 Address */
92WCR3_D: .long 0x07777707
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090093LED_A: .long 0x04000036 /* LED Address */
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090094LED_D: .long 0xFF /* LED Data */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090095RTCNT_A: .long RTCNT /* RTCNT Address */
Nobuhiro Iwamatsu16863c82010-07-22 15:41:49 +090096RTCNT_D: .word 0xA500 /* RTCNT Write Code A5h Data 00h */
97.align 2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090098RTCOR_A: .long RTCOR /* RTCOR Address */
Nobuhiro Iwamatsu16863c82010-07-22 15:41:49 +090099RTCOR_D: .word 0xA534 /* RTCOR Write Code */
100.align 2
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900101RTCSR_A: .long RTCSR /* RTCSR Address */
Nobuhiro Iwamatsu16863c82010-07-22 15:41:49 +0900102RTCSR_D: .word 0xA510 /* RTCSR Write Code */
103.align 2
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100104SDMR3_A: .long 0xFF9400CC /* SDMR3 Address */
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +0900105SDMR3_D0: .long 0x55
106SDMR3_D1: .long 0x00
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900107MCR_A: .long MCR /* MCR Address */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100108MCR_D1: .long 0x081901F4 /* MRSET:'0' */
109MCR_D2: .long 0x481901F4 /* MRSET:'1' */
110RFCR_A: .long RFCR /* RFCR Address */
111RFCR_D: .long 0xA400 /* RFCR Write Code A4h Data 00h */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900112PCR_A: .long PCR /* PCR Address */
113PCR_D: .long 0x0000
114MMUCR_A: .long MMUCR /* MMUCCR Address */
115MMUCR_D: .long 0x00000000 /* MMUCCR Data */
116IRLMASK_A: .long 0xA4000000 /* IRLMASK Address */
117IRLMASK_D: .long 0x00000000 /* IRLMASK Data */