1 | /*
|
---|
2 | * TOPPERS ATK2
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems
|
---|
4 | * Automotive Kernel Version 2
|
---|
5 | *
|
---|
6 | * Copyright (C) 2012-2014 by Center for Embedded Computing Systems
|
---|
7 | * Graduate School of Information Science, Nagoya Univ., JAPAN
|
---|
8 | *
|
---|
9 | * 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
10 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
11 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
12 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
13 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
14 | * スコード中に含まれていること.
|
---|
15 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
16 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
17 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
18 | * の無保証規定を掲載すること.
|
---|
19 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
20 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
21 | * と.
|
---|
22 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
23 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
24 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
25 | * 報告すること.
|
---|
26 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
27 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
28 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
29 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
30 | * 免責すること.
|
---|
31 | *
|
---|
32 | * 本ソフトウェアは,AUTOSAR(AUTomotive Open System ARchitecture)仕
|
---|
33 | * 様に基づいている.上記の許諾は,AUTOSARの知的財産権を許諾するもので
|
---|
34 | * はない.AUTOSARは,AUTOSAR仕様に基づいたソフトウェアを商用目的で利
|
---|
35 | * 用する者に対して,AUTOSARパートナーになることを求めている.
|
---|
36 | *
|
---|
37 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
38 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
39 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
40 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
41 | * の責任を負わない.
|
---|
42 | *
|
---|
43 | * $Id: rh850_f1l.h 187 2015-06-25 03:39:04Z t_ishikawa $
|
---|
44 | */
|
---|
45 |
|
---|
46 | /*
|
---|
47 | * RH850/F1Lのハードウェア資源の定義
|
---|
48 | */
|
---|
49 |
|
---|
50 | #ifndef TOPPERS_RH850_F1L_H
|
---|
51 | #define TOPPERS_RH850_F1L_H
|
---|
52 |
|
---|
53 | #define _RH850G3K_
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * 保護コマンドレジスタ
|
---|
57 | */
|
---|
58 | #define PROTCMD0 0xFFF80000
|
---|
59 | #define PROTCMD1 0xFFF88000
|
---|
60 | #define CLMA0PCMD 0xFFF8C010
|
---|
61 | #define CLMA1PCMD 0xFFF8D010
|
---|
62 | #define CLMA2PCMD 0xFFF8E010
|
---|
63 | #define PROTCMDCLMA 0xFFF8C200
|
---|
64 | #define JPPCMD0 0xFFC204C0
|
---|
65 | #define PPCMD0 0xFFC14C00
|
---|
66 | #define PPCMD1 0xFFC14C04
|
---|
67 | #define PPCMD2 0xFFC14C08
|
---|
68 | #define PPCMD8 0xFFC14C20
|
---|
69 | #define PPCMD9 0xFFC14C24
|
---|
70 | #define PPCMD10 0xFFC14C28
|
---|
71 | #define PPCMD11 0xFFC14C2C
|
---|
72 | #define PPCMD12 0xFFC14C30
|
---|
73 | #define PPCMD18 0xFFC14C48
|
---|
74 | #define PPCMD20 0xFFC14C50
|
---|
75 | #define PROTCMDCVM 0xFFF50100
|
---|
76 | #define FLMDPCMD 0xFFA00004
|
---|
77 |
|
---|
78 | /*
|
---|
79 | * 保護ステータスレジスタ
|
---|
80 | */
|
---|
81 | #define PROTS0 0xFFF80004
|
---|
82 | #define PROTS1 0xFFF88004
|
---|
83 | #define CLMA0PS 0xFFF8C014
|
---|
84 | #define CLMA1PS 0xFFF8D014
|
---|
85 | #define CLMA2PS 0xFFF8E014
|
---|
86 | #define PROTSCLMA 0xFFF8C204
|
---|
87 | #define JPPROTS0 0xFFC204B0
|
---|
88 | #define PPROTS0 0xFFC14B00
|
---|
89 | #define PPROTS1 0xFFC14B04
|
---|
90 | #define PPROTS2 0xFFC14B08
|
---|
91 | #define PPROTS8 0xFFC14B20
|
---|
92 | #define PPROTS9 0xFFC14B24
|
---|
93 | #define PPROTS10 0xFFC14B28
|
---|
94 | #define PPROTS11 0xFFC14B2C
|
---|
95 | #define PPROTS12 0xFFC14B30
|
---|
96 | #define PPROTS18 0xFFC14B48
|
---|
97 | #define PPROTS20 0xFFC14B50
|
---|
98 | #define PROTSCVM 0xFFF50104
|
---|
99 | #define FLMDPS 0xFFA00008
|
---|
100 |
|
---|
101 | /*
|
---|
102 | * 保護コマンドレジスタの番号
|
---|
103 | */
|
---|
104 | #define PNO_CtrlProt0 0
|
---|
105 | #define PNO_CtrlProt1 1
|
---|
106 | #define PNO_ClkMonitorCtrlProt0 2
|
---|
107 | #define PNO_ClkMonitorCtrlProt1 3
|
---|
108 | #define PNO_ClkMonitorCtrlProt2 4
|
---|
109 | #define PNO_ClkMonitorTestProt 5
|
---|
110 | #define PNO_PortProt1_0 6
|
---|
111 | #define PNO_PortProt1_1 7
|
---|
112 | #define PNO_PortProt1_2 8
|
---|
113 | #define PNO_PortProt1_8 9
|
---|
114 | #define PNO_PortProt1_9 10
|
---|
115 | #define PNO_PortProt1_10 11
|
---|
116 | #define PNO_PortProt1_11 12
|
---|
117 | #define PNO_PortProt1_12 13
|
---|
118 | #define PNO_PortProt1_18 14
|
---|
119 | #define PNO_PortProt1_20 15
|
---|
120 | #define PNO_PortProt2 16
|
---|
121 | #define PNO_CoreVMonitorProt 17
|
---|
122 | #define PNO_SelfProgProt 18
|
---|
123 |
|
---|
124 | /*
|
---|
125 | * PORTレジスタ
|
---|
126 | */
|
---|
127 | #define PORT_BASE UINT_C(0xffc10000)
|
---|
128 |
|
---|
129 | /* 端子機能設定 (USE)*/
|
---|
130 | #define PMC(n) ((PORT_BASE) + 0x0400 + (n * 0x04U)) /* ポート・モード・コントロール・レジスタ */
|
---|
131 | #define PMCSR(n) ((PORT_BASE) + 0x0900 + (n * 0x04U)) /* ポート・モード・コントロール・セット/リセット・レジスタ */
|
---|
132 | #define PIPC(n) ((PORT_BASE) + 0x4200 + (n * 0x04U)) /* ポートIP コントロール・レジスタ */
|
---|
133 | #define PM(n) ((PORT_BASE) + 0x0300 + (n * 0x04U)) /* ポート・モード・レジスタ */
|
---|
134 | #define PMSR(n) ((PORT_BASE) + 0x0800 + (n * 0x04U)) /* ポート・モード・セット/リセット・レジスタ */
|
---|
135 | #define PIBC(n) ((PORT_BASE) + 0x4000 + (n * 0x04U)) /* ポート入力バッファ・コントロール・レジスタ */
|
---|
136 | #define PFC(n) ((PORT_BASE) + 0x0500 + (n * 0x04U)) /* ポート機能コントロール・レジスタ */
|
---|
137 | #define PFCE(n) ((PORT_BASE) + 0x0600 + (n * 0x04U)) /* ポート機能コントロール・レジスタ */
|
---|
138 | #define PFCAE(n) ((PORT_BASE) + 0x0A00 + (n * 0x04U)) /* ポート機能コントロール・拡張レジスタ */
|
---|
139 |
|
---|
140 | /* 端子データ入力/出力 (USE)*/
|
---|
141 | #define PBDC(n) ((PORT_BASE) + 0x4100 + (n * 0x04U)) /* ポート双方向コントロール・レジスタ */
|
---|
142 | #define PPR(n) ((PORT_BASE) + 0x0200 + (n * 0x04U)) /* ポート端子リード・レジスタ */
|
---|
143 | #define P(n) ((PORT_BASE) + 0x0000 + (n * 0x04U)) /* ポート・レジスタ */
|
---|
144 | #define PNOT(n) ((PORT_BASE) + 0x0700 + (n * 0x04U)) /* ポート・ノット・レジスタ */
|
---|
145 | #define PSR(n) ((PORT_BASE) + 0x0100 + (n * 0x04U)) /* ポート・セット/リセット・レジスタ */
|
---|
146 |
|
---|
147 |
|
---|
148 | /*
|
---|
149 | * PLL関連のレジスタと定義
|
---|
150 | */
|
---|
151 | /* Main OSC */
|
---|
152 | #define MOSCE 0xfff81100
|
---|
153 | #define MOSCS 0xfff81104
|
---|
154 | #define MOSCC 0xfff81108
|
---|
155 | #define MOSCST 0xfff8110c
|
---|
156 | #define MOSCSTPM 0xfff81118
|
---|
157 |
|
---|
158 | /* Sub OSC */
|
---|
159 | #define SOSCE 0xfff81200
|
---|
160 | #define SOSCS 0xfff81204
|
---|
161 |
|
---|
162 | /* PLL */
|
---|
163 | #define PLLE 0xfff89000
|
---|
164 | #define PLLS 0xfff89004
|
---|
165 | #define PLLC 0xfff89008
|
---|
166 |
|
---|
167 | #define CKSC_CPUCLKS_CTL 0xfff8a000
|
---|
168 | #define CKSC_CPUCLKS_ACT 0xfff8a008
|
---|
169 | #define CKSC_CPUCLKD_CTL 0xfff8a100
|
---|
170 | #define CKSC_CPUCLKD_ACT 0xfff8a108
|
---|
171 |
|
---|
172 | #define MHz(n) ((n) * 1000 * 1000)
|
---|
173 | #define CLK_MHz(num) (num * 1000 * 1000)
|
---|
174 |
|
---|
175 | /* xxxS Register (USE) */
|
---|
176 | #define CLK_S_STPACK 0x08
|
---|
177 | #define CLK_S_CLKEN 0x04
|
---|
178 | #define CLK_S_CLKACT 0x02
|
---|
179 | #define CLK_S_CLKSTAB 0x01
|
---|
180 |
|
---|
181 | /* Return Parameter */
|
---|
182 | #define UC_SUCCESS 0
|
---|
183 | #define UC_ERROR 1
|
---|
184 | #define UC_INVALIDPARAM 2
|
---|
185 | #define UC_PROTREGERROR 3
|
---|
186 | #define UC_CLKSTATUSERR 4
|
---|
187 | #define UC_CLKNOTENABLE 5
|
---|
188 | #define UC_CLKNOTACTIVE 6
|
---|
189 | #define UC_CLKNOTSTAB 7
|
---|
190 |
|
---|
191 | /*
|
---|
192 | * INTC
|
---|
193 | */
|
---|
194 | #define INTC1_BASE 0xFFFF9000
|
---|
195 | #define INTC2_BASE 0xFFFFA000
|
---|
196 |
|
---|
197 | #define INTC2_EIC 0x040
|
---|
198 | #define INTC2_EIBD 0x880
|
---|
199 | #define INTC2_INTNO_OFFSET 32
|
---|
200 |
|
---|
201 | /* intno は unsigned を想定 */
|
---|
202 | #define EIC_ADDRESS(intno) (intno <= 31) ? (INTC1_BASE + (intno * 2)) : (INTC2_BASE + INTC2_EIC + ((intno - INTC2_INTNO_OFFSET) * 2))
|
---|
203 |
|
---|
204 | #define TMIN_INTNO UINT_C(0)
|
---|
205 | #define TMAX_INTNO UINT_C(287)
|
---|
206 | #define TNUM_INT UINT_C(288)
|
---|
207 |
|
---|
208 |
|
---|
209 | #define RLIN30_BASE 0xffcf0000
|
---|
210 | #define RLIN31_BASE 0xffcf0040
|
---|
211 | #define RLIN32_BASE 0xffcf0080
|
---|
212 | #define RLIN33_BASE 0xffcf00c0
|
---|
213 | #define RLIN34_BASE 0xffcf0100
|
---|
214 | #define RLIN35_BASE 0xffcf0140
|
---|
215 |
|
---|
216 | /*
|
---|
217 | * INTNO
|
---|
218 | */
|
---|
219 | #define RLIN31_TX_INTNO UINT_C(113)
|
---|
220 | #define RLIN31_RX_INTNO UINT_C(114)
|
---|
221 | #define RLIN32_TX_INTNO UINT_C(157)
|
---|
222 | #define RLIN32_RX_INTNO UINT_C(158)
|
---|
223 | #define RLIN32_ER_INTNO UINT_C(159)
|
---|
224 | #define RLIN35_TX_INTNO UINT_C(229)
|
---|
225 | #define RLIN35_RX_INTNO UINT_C(230)
|
---|
226 | #define RLIN35_ER_INTNO UINT_C(231)
|
---|
227 |
|
---|
228 | #define TAUFJ0I0_INTNO UINT_C(72)
|
---|
229 | #define TAUFJ0I1_INTNO UINT_C(73)
|
---|
230 | #define TAUFJ0I2_INTNO UINT_C(74)
|
---|
231 | #define TAUFJ0I3_INTNO UINT_C(75)
|
---|
232 | #define TAUFJ1I0_INTNO UINT_C(160)
|
---|
233 | #define TAUFJ1I1_INTNO UINT_C(161)
|
---|
234 | #define TAUFJ1I2_INTNO UINT_C(162)
|
---|
235 | #define TAUFJ1I3_INTNO UINT_C(163)
|
---|
236 |
|
---|
237 | #ifndef TOPPERS_MACRO_ONLY
|
---|
238 |
|
---|
239 | extern uint32 EnableSubOSC(void);
|
---|
240 |
|
---|
241 | extern uint32 EnableMainOSC(uint32 clk_in);
|
---|
242 |
|
---|
243 | extern uint32 EnablePLL(void);
|
---|
244 |
|
---|
245 | extern uint32 SetClockSelection(uint32 s_control, uint32 s_status, uint8 regno, uint16 sel,
|
---|
246 | uint32 d_control, uint32 d_status, uint8 divider);
|
---|
247 |
|
---|
248 | #endif /* TOPPERS_MACRO_ONLY */
|
---|
249 |
|
---|
250 |
|
---|
251 | #include "v850.h"
|
---|
252 |
|
---|
253 | #endif /* TOPPERS_RH850_F1L_H */
|
---|