source: UsbWattMeter/trunk/asp_dcre/target/grsakura_ccrx/target_support.src@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

File size: 5.1 KB
Line 
1;*
2;* TOPPERS/ASP Kernel
3;* Toyohashi Open Platform for Embedded Real-Time Systems/
4;* Advanced Standard Profile Kernel
5;*
6;* Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
7;* Toyohashi Univ. of Technology, JAPAN
8;* Copyright (C) 2001 by OAKS16KIT support
9;* Copyright (C) 2003-2004 by Naoki Saito
10;* Nagoya Municipal Industrial Research Institute, JAPAN
11;* Copyright (C) 2003-2004 by Ryosuke Takeuchi
12;* Platform Development Center RICOH COMPANY,LTD. JAPAN
13;* Copyright (C) 2008-2010 by Witz Corporation, JAPAN
14;* Copyright (C) 2013 by Mitsuhiro Matsuura
15;*
16;* ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
17;* ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
18;* •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
19;* (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
20;* Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
21;* ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
22;* (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
23;* —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
24ƒƒ“ƒgi—˜—p
25;* ŽÒƒ}ƒjƒ…
26ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
27;* ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
28;* (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
29;* —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
30;* ‚ƁD
31;* (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
32ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
33ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
34;* ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
35;* (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
36;* •ñ‚·‚邱‚ƁD
37;* (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
38;* ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
39;* ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
40;* —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
41;* –Ɛӂ·‚邱‚ƁD
42;*
43;* –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
44;* ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
45;* ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
46;* ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
47;* ‚̐ӔC‚𕉂í‚È‚¢D
48;*
49;* @(#) $Id: target_support.src 536 2014-10-09 23:11:40Z coas-nagasima $
50;*
51
52 .section P, CODE
53
54
55 .glb _hardware_init_hook
56 .glb _software_init_hook
57
58
59_hardware_init_hook:
60 ;
61 ; “®ìƒ‚[ƒhÝ’è
62 ;
63 ; “®ìƒ‚[ƒh‚̓{[ƒhã‚Ì’[Žq‚É‚æ‚Á‚ÄŒˆ’肳‚ê‚邽‚ß,
64 ; ‚±‚±‚Å‚Í“Á•ÊÝ’肵‚È‚¢.
65 ; ‚½‚¾‚µ, ƒŠƒgƒ‹ƒGƒ“ƒfƒBƒAƒ“/ƒVƒ“ƒOƒ‹ƒ`ƒbƒvƒ‚[ƒh
66 ; ‚Å‚ ‚邱‚Æ‚ð‘O’ñ‚Æ‚·‚é.
67 ;
68 ; ‚Ü‚½ƒŠƒZƒbƒgŒã, “à‘ ROMF—LŒø, “à‘ RAMF—LŒø, ŠO•”ƒoƒXF–³Œø
69 ; ‚Å‚ ‚é.
70 ;
71
72 ;
73 ; ƒNƒƒbƒNÝ’è
74 ;
75 ; “ü—́F12MHz
76 ; PLL‰ñ˜HF12 x 8 = 96MHz
77 ; ƒVƒXƒeƒ€ƒNƒƒbƒNF96MHz
78 ; Žü•Óƒ‚ƒWƒ…
79[ƒ‹ƒNƒƒbƒNF48MHz
80 ; ŠO•”ƒoƒXƒNƒƒbƒNF96MHz
81 ; ‚Æ‚·‚é.
82 ;
83
84 ;PORT3.PDR.BIT.B6 = 0;
85 MOV.L #08C003H,R11
86 MOV.B [R11],R10
87 BCLR #6,R10
88 MOV.B R10,[R11]
89 ;PORT3.PDR.BIT.B7 = 0;
90 MOV.L #08C003H,R11
91 MOV.B [R11],R10
92 BCLR #7,R10
93 MOV.B R10,[R11]
94 ;PORT3.PMR.BIT.B6 = 0;
95 MOV.L #08C003H,R11
96 MOV.B 60H[R11],R10
97 BCLR #6,R10
98 MOV.B R10,60H[R11]
99 ;PORT3.PMR.BIT.B7 = 0;
100 MOV.L #08C003H,R11
101 MOV.B 60H[R11],R10
102 BCLR #7,R10
103 MOV.B R10,60H[R11]
104 ;
105 ;SYSTEM.PRCR.WORD = 0xa503;
106 MOV.L #080000H,R10
107 MOV.W #-5AFDH,03FEH[R10]
108 ;
109 ;while(SYSTEM.MOFCR.BIT.MOFXIN == 0)
110 BRA.B _hardware_init_hook_01
111 ;SYSTEM.MOFCR.BIT.MOFXIN = 1; // ƒƒCƒ“ƒNƒƒbƒN”­UŠí‹­§”­U
112_hardware_init_hook_00:
113 MOV.L #080000H,R11
114 MOV.B 0C293H[R11],R10
115 BSET #0,R10
116 MOV.B R10,0C293H[R11]
117_hardware_init_hook_01:
118 MOV.L #080000H,R10
119 MOV.B 0C293H[R10],R10
120 AND #1H,R10
121 MOVU.B R10,R10
122 CMP #0H,R10
123 BEQ.B _hardware_init_hook_00
124 ;
125 ;while(SYSTEM.MOSCCR.BIT.MOSTP == 1)
126 BRA.B _hardware_init_hook_11
127 ;SYSTEM.MOSCCR.BIT.MOSTP = 0; // ƒƒCƒ“ƒNƒƒbƒN”­UŠí“®ì
128_hardware_init_hook_10:
129 MOV.L #080000H,R11
130 MOV.B 32H[R11],R10
131 BCLR #0,R10
132 MOV.B R10,32H[R11]
133_hardware_init_hook_11:
134 MOV.L #080000H,R10
135 MOV.B 32H[R10],R10
136 AND #1H,R10
137 MOVU.B R10,R10
138 CMP #0H,R10
139 BNE.B _hardware_init_hook_10
140 ;
141 ;SYSTEM.PLLCR.BIT.STC = 0x0f;
142 MOV.L #080000H,R10
143 MOV.W 28H[R10],R11
144 AND #-3F01H,R11
145 OR #0F00H,R11
146 MOV.W R11,28H[R10]
147 ;SYSTEM.PLLCR2.BIT.PLLEN = 0;
148 MOV.L #080000H,R11
149 MOV.B 2AH[R11],R10
150 BCLR #0,R10
151 MOV.B R10,2AH[R11]
152 ;
153 ;SYSTEM.SCKCR.LONG = 0x21021211;
154 MOV.L #080000H,R10
155 MOV.L #21021211H,20H[R10]
156 ;
157 ;SYSTEM.SCKCR3.BIT.CKSEL = 4; // PLL‰ñ˜H‘I‘ð
158 MOV.L #080000H,R10
159 MOV.W 26H[R10],R11
160 AND #-0701H,R11
161 OR #0400H,R11
162 MOV.W R11,26H[R10]
163
164 ;
165 ; ƒ‚ƒWƒ…
166[ƒ‹ƒXƒgƒbƒv
167 ;
168 ; ƒŠƒZƒbƒgŒã, “®ì‚µ‚Ä‚¢‚é“à‘ Žü•Óƒ‚ƒWƒ…
169[ƒ‹‚ÍDMAC, DTC,
170 ; “à‘ RAM‚Ì‚Ý‚Å‚ ‚é.
171 ; ‚»‚êˆÈŠO‚Ì“à‘ Žü•Óƒ‚ƒWƒ…
172[ƒ‹‚ÉŠÖ‚µ‚Ä‚ÍŽg—p‚·‚鑤‚Å
173 ; Ý’è‚·‚邱‚Æ.
174 ;
175
176 ;SYSTEM.PRCR.WORD = 0xa500;
177 MOV.L #080000H,R10
178 MOV.W #-5B00H,03FEH[R10]
179 rts
180
181
182_software_init_hook:
183 ;
184 ; –{ƒRƒ“ƒpƒCƒ‰‚Å‚Íweak definition‚Ì‹@”\‚ª–³‚¢‚½‚ß,
185 ; “Á‚É•K—v‚ȏˆ—‚Í‚È‚¢‚ª, •K‚¸ŒÄ‚яo‚·‚±‚Æ‚Æ‚·‚é.
186 ;
187 rts
188
189
190 .end
191
Note: See TracBrowser for help on using the repository browser.