blob: 76d3cfc40865d9a4d41d9bbc8dda33e0cec6c4c6 [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
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090039 write16 LED_A, LED_D
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
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090051 write8 SDMR3_A, SDMR3_D0
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
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090064 write8 SDMR3_A, SDMR3_D1
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 */
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +090095LED_D: .long 0xFF /* LED Data */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +090096RTCNT_A: .long RTCNT /* RTCNT Address */
97RTCNT_D: .long 0xA500 /* RTCNT Write Code A5h Data 00h */
98RTCOR_A: .long RTCOR /* RTCOR Address */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +010099RTCOR_D: .long 0xA534 /* RTCOR Write Code */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900100RTCSR_A: .long RTCSR /* RTCSR Address */
101RTCSR_D: .long 0xA510 /* RTCSR Write Code */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100102SDMR3_A: .long 0xFF9400CC /* SDMR3 Address */
Nobuhiro Iwamatsufcbff802009-01-11 17:48:56 +0900103SDMR3_D0: .long 0x55
104SDMR3_D1: .long 0x00
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900105MCR_A: .long MCR /* MCR Address */
Jean-Christophe PLAGNIOL-VILLARD3c233cf2008-12-02 07:40:03 +0100106MCR_D1: .long 0x081901F4 /* MRSET:'0' */
107MCR_D2: .long 0x481901F4 /* MRSET:'1' */
108RFCR_A: .long RFCR /* RFCR Address */
109RFCR_D: .long 0xA400 /* RFCR Write Code A4h Data 00h */
Nobuhiro Iwamatsu868b52b2008-03-25 17:11:24 +0900110PCR_A: .long PCR /* PCR Address */
111PCR_D: .long 0x0000
112MMUCR_A: .long MMUCR /* MMUCCR Address */
113MMUCR_D: .long 0x00000000 /* MMUCCR Data */
114IRLMASK_A: .long 0xA4000000 /* IRLMASK Address */
115IRLMASK_D: .long 0x00000000 /* IRLMASK Data */