source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/v850/tk850_sg2/sys_support.S@ 26

Last change on this file since 26 was 26, checked in by ykominami, 12 years ago

initial

File size: 7.9 KB
Line 
1/*
2 * TOPPERS/JSP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Just Standard Profile Kernel
5 *
6 * Copyright (C) 2000-2002 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 * Copyright (C) 2005 by Freelines CO.,Ltd
9 *
10 * 上記著作権者
11は,以下の (1)〜(4) の条件か,Free Software Foundation
12 * によってå…
13¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
14 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
15 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
16å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
17 * 利用と呼ぶ)することを無償で許諾する.
18 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
19 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
20 * スコード中に含まれていること.
21 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
22 * 用できる形で再é…
23å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
24å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
25 * 者
26マニュアルなど)に,上記の著作権表示,この利用条件および下記
27 * の無保証規定を掲載すること.
28 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
29 * 用できない形で再é…
30å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
31 * と.
32 * (a) 再é…
33å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
34マニュアルなど)に,上記の著
35 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
36 * (b) 再é…
37å¸ƒã®å½¢æ…
38‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
39 * 報告すること.
40 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
41 * 害からも,上記著作権者
42およびTOPPERSプロジェクトをå…
43è²¬ã™ã‚‹ã“と.
44 *
45 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
46お
47 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
48 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
49 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
50 *
51 * @(#) $Id: sys_support.S,v 1.2 2007/01/05 02:10:17 honda Exp $
52 */
53
54/*
55 * ターゲットシステム依存モジュール アセンブリ言語部(TK-850ES/SG2用)
56 */
57
58#define _MACRO_ONLY
59#include "jsp_kernel.h"
60#include "v850asm.inc"
61
62#define Set(x,y,z) Lea x, r6; Lea y, r7; st.##z r7, 0[r6]
63
64/*
65 * 低レベルのターゲットシステム依存の初期化
66 *
67 * スタートアップモジュールの中で,メモリの初期化の前に呼び出される.
68 */
69
70 .text
71 .globl hardware_init_hook
72hardware_init_hook:
73
74 /* システムウェイトコントロールレジスタ:5MHz×4=20MHz時 */
75 Set(VSWC, 0x01, b)
76 nop
77 /* 保護された特定レジスタへのアクセス
78 プロセッサクロックコントロールレジスタ:メインクロックのfxx出力(PCC=0) */
79 lea PRCMD, r6
80 lea PCC, r7
81 st.b r0, 0[r6]
82 st.b r0, 0[r7]
83 nop
84 nop
85 nop
86 nop
87 nop
88 Set(PLLCTL,0x03, b) /* PLLコントロールレジスタ:PLL動作 */
89 Set(WDTM2, 0x07, b) /* WDTM2 stop */
90 /* 外部バスの設定 */
91 Set(EXIMC, 0x01, b) /* 外部バスインターフェイスモードレジスタ:セパレートバス */
92 Set(PMC9, 0xFFFF, h) /* P9モードコントロールレジスタ:A0-A15出力 */
93 Set(PMCCM, 0x02, b) /* PCMモードコントロールレジスタ:Clock Out出力 */
94 Set(PMCCT, 0x11, b) /* PCTモードコントロールレジスタ:RD/WR0出力 */
95 Set(PMCDL, 0xFFFF, h) /* PDLモードコントロールレジスタ:AD0-AD15出力 */
96 Set(BSC, 0x5555, h) /* バスサイズレジスタ:All 16bit */
97 Set(DWC0, 0x0000, h) /* データウェイト制御レジスタ:wait=0 */
98 Set(AWC, 0xFF00, h) /* アドレスウェイト制御レジスタ:wait=0 */
99 Set(BCC, 0xAA00, h) /* バスサイクル制御レジスタ:wait=0 */
100 /* NIC設定 */
101 Set(PMC0, 0x10, b) /* P04=INTP1 */
102 Set(PMCT, 0xBF, b) /* ASTB=out(LAN CS) */
103 Set(PCT, 0x00, b) /* ASTB=Low out */
104 Set(PM5, 0xFD, b) /* LAN Reset out */
105 Set(P5 , 0x00, b) /* LAN Reset out */
106
107 jmp r31
108
109
110
111 /* 標準割込み処理とスぺーサー */
112 .macro StandardInterruptEntry name
113 .globl \name
114\name:
115 jr vector_handler
116 nop;nop;nop;nop;nop;nop
117 .endm
118
119 .macro ReservedInterruptEntry
120 nop;nop;nop;nop;nop;nop;nop;nop
121 .endm
122
123/*
124 * 割込みハンドラ部分の定義
125 * とりあえず一箇所に集める。
126 */
127
128 .section ".vectors","ax"
129 .align 4
130 .globl __reset
131__reset:
132 jr start
133 nop;nop;nop;nop;nop;nop
134
135 StandardInterruptEntry NMI
136 StandardInterruptEntry INTWDT2
137 ReservedInterruptEntry
138 StandardInterruptEntry TRAP0
139 StandardInterruptEntry TRAP1
140 StandardInterruptEntry DBG
141/*#-------------------------------------------------------------------
142 # SECURITY_ID
143 #-------------------------------------------------------------------*/
144/* .section "SECURITY_ID" */
145 .word 0xffffffff /* --0-3 byte code,Address is 0x70-0x73 */
146 .word 0xffffffff /* --4-7 byte code,Address is 0x74-0x77 */
147 .hword 0xffff /* --8-9 byte code,Address is 0x78-0x79 */
148/*#-------------------------------------------------------------------
149 # OPTION_BYTES
150 #-------------------------------------------------------------------*/
151/* .section "OPTION_BYTES" */
152 .hword 0x0000 /* --0-1 byte code,Address is 0x7a-0x7b */
153 .hword 0x0000 /* --2-3 byte code,Address is 0x7c-0x7d */
154 .hword 0x0000 /* --4-5 byte code,Address is 0x7e-0x7f */
155
156 StandardInterruptEntry INTLVI
157 StandardInterruptEntry INTP0
158 StandardInterruptEntry INTP1
159 StandardInterruptEntry INTP2
160 StandardInterruptEntry INTP3
161 StandardInterruptEntry INTP4
162 StandardInterruptEntry INTP5
163 StandardInterruptEntry INTP6
164 StandardInterruptEntry INTP7
165 StandardInterruptEntry INTTQ0OV
166 StandardInterruptEntry INTTQ0CC0
167 StandardInterruptEntry INTTQ0CC1
168 StandardInterruptEntry INTTQ0CC2
169 StandardInterruptEntry INTTQ0CC3
170 StandardInterruptEntry INTTP0OV
171 StandardInterruptEntry INTTP0CC0
172 StandardInterruptEntry INTTP0CC1
173 StandardInterruptEntry INTTP1OV
174 StandardInterruptEntry INTTP1CC0
175 StandardInterruptEntry INTTP1CC1
176 StandardInterruptEntry INTTP2OV
177 StandardInterruptEntry INTTP2CC0
178 StandardInterruptEntry INTTP2CC1
179 StandardInterruptEntry INTTP3OV
180 StandardInterruptEntry INTTP3CC0
181 StandardInterruptEntry INTTP3CC1
182 StandardInterruptEntry INTTP4OV
183 StandardInterruptEntry INTTP4CC0
184 StandardInterruptEntry INTTP4CC1
185 StandardInterruptEntry INTTP5OV
186 StandardInterruptEntry INTTP5CC0
187 StandardInterruptEntry INTTP5CC1
188 StandardInterruptEntry INTTM0EQ0
189 StandardInterruptEntry INTCB0R
190 StandardInterruptEntry INTCB0T
191 StandardInterruptEntry INTCB1R
192 StandardInterruptEntry INTCB1T
193 StandardInterruptEntry INTCB2R
194 StandardInterruptEntry INTCB2T
195 StandardInterruptEntry INTCB3R
196 StandardInterruptEntry INTCB3T
197 StandardInterruptEntry INTUA0R
198 StandardInterruptEntry INTUA0T
199 StandardInterruptEntry INTUA1R
200 StandardInterruptEntry INTUA1T
201 StandardInterruptEntry INTUA2R
202 StandardInterruptEntry INTUA2T
203 StandardInterruptEntry INTAD
204 StandardInterruptEntry INTDMA0
205 StandardInterruptEntry INTDMA1
206 StandardInterruptEntry INTDMA2
207 StandardInterruptEntry INTDMA3
208 StandardInterruptEntry INTKR
209 StandardInterruptEntry INTWTI
210 StandardInterruptEntry INTWT
211 StandardInterruptEntry INTC0ERR
212 StandardInterruptEntry INTC0WUP
213 StandardInterruptEntry INTC0REC
214 StandardInterruptEntry INTC0TRX
215
216/*
217 * 評価用高性能?タイマ
218 * (今回は評価用フリーランニングタイマを作らずに直接タイマカウンタをのぞく)
219 */
220Function _vxget_tim
221 Lea TP0CNT, r7
222 ld.h 0[r7], r8
223 st.w r8, 0[r6]
224 mov r0, r10
225 jmp r31
Note: See TracBrowser for help on using the repository browser.