source: anotherchoice/tags/jsp-1.4.4-full-UTF8/config/armv4/az9360mb/ns9360.h@ 26

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

initial

File size: 65.6 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-2003 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 *
9 * Copyright (C) 2005-2007 by Y.D.K.Co.,LTD Technologies company
10 *
11 * 上記著作権者
12は,以下の (1)〜(4) の条件か,Free Software Foundation
13 * によってå…
14¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
15 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
16 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
17å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
18 * 利用と呼ぶ)することを無償で許諾する.
19 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
20 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
21 * スコード中に含まれていること.
22 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
23 * 用できる形で再é…
24å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
25å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
26 * 者
27マニュアルなど)に,上記の著作権表示,この利用条件および下記
28 * の無保証規定を掲載すること.
29 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
30 * 用できない形で再é…
31å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
32 * と.
33 * (a) 再é…
34å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
35マニュアルなど)に,上記の著
36 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
37 * (b) 再é…
38å¸ƒã®å½¢æ…
39‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
40 * 報告すること.
41 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
42 * 害からも,上記著作権者
43およびTOPPERSプロジェクトをå…
44è²¬ã™ã‚‹ã“と.
45 *
46 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
47お
48 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
49 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
50 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
51 *
52 * @(#) $Id: ns9360.h,v 1.1 2007/05/21 01:33:50 honda Exp $
53 */
54
55#ifndef _NS9360_H_
56#define _NS9360_H_
57
58
59#ifndef _MACRO_ONLY
60#include <itron.h>
61#include <sil.h>
62#endif /* _MACRO_ONLY */
63
64
65#include <armv4.h>
66
67/************************************************/
68/* CPU(Compiler) value type */
69/************************************************/
70
71#define ARM9_INPUT_FREQUENCY 29491200
72#define MPMC_REFRESH_RATE 7812 /* nano-seconds */
73
74#define STACKTOP stack_end /* 非タスクコンテキスト用のスタックの初期値 */
75
76
77
78/*
79 * タイマーの割り込みレベル
80 */
81#define INTLV_TIM0 4
82
83
84/*
85 * タイマ値の内
86部表現とミリ秒単位との変換
87 */
88#define TIMER_CLOCK 177000 /* Base clock = 177MHz */
89
90
91/*
92 * キャッシュ関連の設定
93 */
94
95/*
96 * キャッシュの設定 CP5 No.1 に書き込む値
97 * ICache のみON
98 */
99#define CP5_NO1_VAL 0x1078
100
101/*
102 * プロセッサのエンディアン
103 */
104#define SIL_ENDIAN SIL_ENDIAN_BIG /* Big */
105
106/*
107 *System Configuration Registers
108 */
109#define SYS_CONT_MODULE_BASE 0xa0900000 /* 1 M */
110#define AHB_ABT_CFG_REG (SYS_CONT_MODULE_BASE+0x0000) /* AHB Arbiter Gen Configuration */
111#define BRC0_REG (SYS_CONT_MODULE_BASE+0x0004) /* BRC0 */
112#define BRC1_REG (SYS_CONT_MODULE_BASE+0x0008) /* BRC1 */
113#define BRC2_REG (SYS_CONT_MODULE_BASE+0x000C) /* BRC2 */
114#define BRC3_REG (SYS_CONT_MODULE_BASE+0x0010) /* BRC3 */
115#define BAT_BMT_REG (SYS_CONT_MODULE_BASE+0x0014) /* AHB Bus Arbiter Timeout Period AHB Bus Monitor Timeout Period */
116#define AHB_ERR1_REG (SYS_CONT_MODULE_BASE+0x0018) /* AHB Error Detect Status 1 */
117#define AHB_ERR2_REG (SYS_CONT_MODULE_BASE+0x001C) /* AHB Error Detect Status 2 */
118#define AHB_ERRMON_REG (SYS_CONT_MODULE_BASE+0x0020) /* AHB Error Monitoring Configuration */
119#define SWDT_CFG_REG (SYS_CONT_MODULE_BASE+0x0174) /* Software Watchdog Configuration */
120#define SWDT_REG (SYS_CONT_MODULE_BASE+0x0178) /* Software Watchdog Timer */
121#define CLK_CFG_REG (SYS_CONT_MODULE_BASE+0x017C) /* Clock Configuration register */
122#define RS_CNT_REG (SYS_CONT_MODULE_BASE+0x0180) /* Reset and Sleep Control register */
123#define MS_CFG_REG (SYS_CONT_MODULE_BASE+0x0184) /* Miscellaneous System Configuration register */
124#define PLL_CFG_REG (SYS_CONT_MODULE_BASE+0x0188) /* PLL Configuration register */
125#define GEMID_REG (SYS_CONT_MODULE_BASE+0x0210) /* GenID General purpose, user-defined ID register */
126#define EXINT0_CR (SYS_CONT_MODULE_BASE+0x0214) /* External Interrupt 0 Control register */
127#define EXINT1_CR (SYS_CONT_MODULE_BASE+0x0218) /* External Interrupt 1 Control register */
128#define EXINT2_CR (SYS_CONT_MODULE_BASE+0x021C) /* External Interrupt 2 Control register */
129#define EXINT3_CR (SYS_CONT_MODULE_BASE+0x0220) /* External Interrupt 3 Control register */
130
131#define IVARV_REG INT_VECT0_REG /* Interrupt Vector Address Register base */
132#define INT_CONFIG_REG INT_CFG0_3_REG /* Interrupt Configuration Register base */
133#define AHB_ABT_CFG_REG_debug 0x00000002 /* debuger flag */
134#define AHB_ABT_CFG_REG_restart 0x00000004 /* Software Restart flag */
135#define SCM_PLL_REG_FSStatus 0x01800000 /* PLL FS Status */
136#define SCM_PLL_REG_NDStatus 0x001f0000 /* PLL ND Status */
137
138/*
139 * Interrupt Controller Registers
140 */
141#define INT_VECT0_REG (SYS_CONT_MODULE_BASE+0x00C4) /* Interrupt Vector Address Register Level 0 */
142#define INT_VECT1_REG (SYS_CONT_MODULE_BASE+0x00C8) /* Interrupt Vector Address Register Level 1 */
143#define INT_VECT2_REG (SYS_CONT_MODULE_BASE+0x00CC) /* Interrupt Vector Address Register Level 2 */
144#define INT_VECT3_REG (SYS_CONT_MODULE_BASE+0x00D0) /* Interrupt Vector Address Register Level 3 */
145#define INT_VECT4_REG (SYS_CONT_MODULE_BASE+0x00D4) /* Interrupt Vector Address Register Level 4 */
146#define INT_VECT5_REG (SYS_CONT_MODULE_BASE+0x00D8) /* Interrupt Vector Address Register Level 5 */
147#define INT_VECT6_REG (SYS_CONT_MODULE_BASE+0x00DC) /* Interrupt Vector Address Register Level 6 */
148#define INT_VECT7_REG (SYS_CONT_MODULE_BASE+0x00E0) /* Interrupt Vector Address Register Level 7 */
149#define INT_VECT8_REG (SYS_CONT_MODULE_BASE+0x00E4) /* Interrupt Vector Address Register Level 8 */
150#define INT_VECT9_REG (SYS_CONT_MODULE_BASE+0x00E8) /* Interrupt Vector Address Register Level 9 */
151#define INT_VECT10_REG (SYS_CONT_MODULE_BASE+0x00EC) /* Interrupt Vector Address Register Level 10 */
152#define INT_VECT11_REG (SYS_CONT_MODULE_BASE+0x00F0) /* Interrupt Vector Address Register Level 11 */
153#define INT_VECT12_REG (SYS_CONT_MODULE_BASE+0x00F4) /* Interrupt Vector Address Register Level 12 */
154#define INT_VECT13_REG (SYS_CONT_MODULE_BASE+0x00F8) /* Interrupt Vector Address Register Level 13 */
155#define INT_VECT14_REG (SYS_CONT_MODULE_BASE+0x00FC) /* Interrupt Vector Address Register Level 14 */
156#define INT_VECT15_REG (SYS_CONT_MODULE_BASE+0x0100) /* Interrupt Vector Address Register Level 15 */
157#define INT_VECT16_REG (SYS_CONT_MODULE_BASE+0x0104) /* Interrupt Vector Address Register Level 16 */
158#define INT_VECT17_REG (SYS_CONT_MODULE_BASE+0x0108) /* Interrupt Vector Address Register Level 17 */
159#define INT_VECT18_REG (SYS_CONT_MODULE_BASE+0x010C) /* Interrupt Vector Address Register Level 18 */
160#define INT_VECT19_REG (SYS_CONT_MODULE_BASE+0x0110) /* Interrupt Vector Address Register Level 19 */
161#define INT_VECT20_REG (SYS_CONT_MODULE_BASE+0x0114) /* Interrupt Vector Address Register Level 20 */
162#define INT_VECT21_REG (SYS_CONT_MODULE_BASE+0x0118) /* Interrupt Vector Address Register Level 21 */
163#define INT_VECT22_REG (SYS_CONT_MODULE_BASE+0x011C) /* Interrupt Vector Address Register Level 22 */
164#define INT_VECT23_REG (SYS_CONT_MODULE_BASE+0x0120) /* Interrupt Vector Address Register Level 23 */
165#define INT_VECT24_REG (SYS_CONT_MODULE_BASE+0x0124) /* Interrupt Vector Address Register Level 24 */
166#define INT_VECT25_REG (SYS_CONT_MODULE_BASE+0x0128) /* Interrupt Vector Address Register Level 25 */
167#define INT_VECT26_REG (SYS_CONT_MODULE_BASE+0x012C) /* Interrupt Vector Address Register Level 26 */
168#define INT_VECT27_REG (SYS_CONT_MODULE_BASE+0x0130) /* Interrupt Vector Address Register Level 27 */
169#define INT_VECT28_REG (SYS_CONT_MODULE_BASE+0x0134) /* Interrupt Vector Address Register Level 28 */
170#define INT_VECT29_REG (SYS_CONT_MODULE_BASE+0x0138) /* Interrupt Vector Address Register Level 29 */
171#define INT_VECT30_REG (SYS_CONT_MODULE_BASE+0x013C) /* Interrupt Vector Address Register Level 30 */
172#define INT_VECT31_REG (SYS_CONT_MODULE_BASE+0x0140) /* Interrupt Vector Address Register Level 31 */
173#define INT_CFG0_3_REG (SYS_CONT_MODULE_BASE+0x0144) /* Int Config 0 Int Config 1 Int Config 2 Int Config 3 */
174#define INT_CFG4_7_REG (SYS_CONT_MODULE_BASE+0x0148) /* Int Config 4 Int Config 5 Int Config 6 Int Config 7 */
175#define INT_CFG8_11_REG (SYS_CONT_MODULE_BASE+0x014C) /* Int Config 8 Int Config 9 Int Config 10 Int Config 11 */
176#define INT_CFG12_15_REG (SYS_CONT_MODULE_BASE+0x0150) /* Int Config 12 Int Config 13 Int Config 14 Int Config 15 */
177#define INT_CFG16_19_REG (SYS_CONT_MODULE_BASE+0x0154) /* Int Config 16 Int Config 17 Int Config 18 Int Config 19 */
178#define INT_CFG20_23_REG (SYS_CONT_MODULE_BASE+0x0158) /* Int Config 20 Int Config 21 Int Config 22 Int Config 23 */
179#define INT_CFG24_27_REG (SYS_CONT_MODULE_BASE+0x015C) /* Int Config 24 Int Config 25 Int Config 26 Int Config 27 */
180#define INT_CFG28_31_REG (SYS_CONT_MODULE_BASE+0x0160) /* Int Config 28 Int Config 29 Int Config 30 Int Config 31 */
181#define ISRADDR_REG (SYS_CONT_MODULE_BASE+0x0164) /* ISRADDR */
182#define ISA_REG (SYS_CONT_MODULE_BASE+0x0168) /* Interrupt Status Active */
183#define ISRAW_REG (SYS_CONT_MODULE_BASE+0x016C) /* Interrupt Status Raw */
184#define INT_ID_REG (SYS_CONT_MODULE_BASE+0x018C) /* Active Interrupt Level register */
185
186#define INT_CFG_BIT_IE 0x80 /* IntConfigReg IE bit */
187#define INT_CFG_BIT_INV 0x40 /* IntConfigReg INV bit */
188/* #define INT_CFG_BIT_IT 0x20 */ /* IntConfigReg IT bit */
189#define INT_CFG_BIT_IT 0x0 /* IntConfigReg IT bit */
190
191#define BBBIE_REG 0xa0401004 /* BBus Bridge Interrupt Enable register */
192#define BBBIS_REG 0xa0401000 /* BBus Bridge Interrupt Status register */
193/* BBus Bridge Interrupt Enable/Status register bit define */
194#define BBBI_GLBL 0x80000000
195#define BBBI_DMA2 0x02000000
196#define BBBI_DMA1 0x01000000
197#define BBBI_1284 0x00000800
198#define BBBI_I2C 0x00000400
199#define BBBI_S4TX 0x00000200
200#define BBBI_S4RX 0x00000100
201#define BBBI_S3TX 0x00000080
202#define BBBI_S3RX 0x00000040
203#define BBBI_S1TX 0x00000020
204#define BBBI_S1RX 0x00000010
205#define BBBI_S2TX 0x00000008
206#define BBBI_S2RX 0x00000004
207#define BBBI_USB 0x00000002
208#define BBBI_DMA 0x00000001
209
210#define BBBIS_MASK 0x03000fff; /* BBus Interrupt Status register Mask patern */
211
212
213/*
214 * Chip Select Registers
215 */
216#define CS4B_REG (SYS_CONT_MODULE_BASE+0x01D0) /* System Memory Chip Select 4 Dynamic Memory Base */
217#define CS4M_REG (SYS_CONT_MODULE_BASE+0x01D4) /* System Memory Chip Select 4 Dynamic Memory Mask */
218#define CS5B_REG (SYS_CONT_MODULE_BASE+0x01D8) /* System Memory Chip Select 5 Dynamic Memory Base */
219#define CS5M_REG (SYS_CONT_MODULE_BASE+0x01DC) /* System Memory Chip Select 5 Dynamic Memory Mask */
220#define CS6B_REG (SYS_CONT_MODULE_BASE+0x01E0) /* System Memory Chip Select 6 Dynamic Memory Base */
221#define CS6M_REG (SYS_CONT_MODULE_BASE+0x01E4) /* System Memory Chip Select 6 Dynamic Memory Mask */
222#define CD7B_REG (SYS_CONT_MODULE_BASE+0x01E8) /* System Memory Chip Select 7 Dynamic Memory Base */
223#define CS7M_REG (SYS_CONT_MODULE_BASE+0x01EC) /* System Memory Chip Select 7 Dynamic Memory Mask */
224#define CS0B_REG (SYS_CONT_MODULE_BASE+0x01F0) /* System Memory Chip Select 0 Static Memory Base */
225#define CS0M_REG (SYS_CONT_MODULE_BASE+0x01F4) /* System Memory Chip Select 0 Static Memory Mask */
226#define CS1B_REG (SYS_CONT_MODULE_BASE+0x01F8) /* System Memory Chip Select 1 Static Memory Base */
227#define CS1M_REG (SYS_CONT_MODULE_BASE+0x01FC) /* System Memory Chip Select 1 Static Memory Mask */
228#define CS2B_REG (SYS_CONT_MODULE_BASE+0x0200) /* System Memory Chip Select 2 Static Memory Base */
229#define CS2M_REG (SYS_CONT_MODULE_BASE+0x0204) /* System Memory Chip Select 2 Static Memory Mask */
230#define CS3B_REG (SYS_CONT_MODULE_BASE+0x0208) /* System Memory Chip Select 3 Static Memory Base */
231#define CS3M_REG (SYS_CONT_MODULE_BASE+0x020C) /* System Memory Chip Select 3 Static Memory Mask */
232
233/*
234 *Timer Registers
235 */
236#define TIMER0_RLC_REG (SYS_CONT_MODULE_BASE+0x0044) /* Timer 0 Reload Count register */
237#define TIMER1_RLC_REG (SYS_CONT_MODULE_BASE+0x0048) /* Timer 1 Reload Count register */
238#define TIMER2_RLC_REG (SYS_CONT_MODULE_BASE+0x004C) /* Timer 2 Reload Count register */
239#define TIMER3_RLC_REG (SYS_CONT_MODULE_BASE+0x0050) /* Timer 3 Reload Count register */
240#define TIMER4_RLC_REG (SYS_CONT_MODULE_BASE+0x0054) /* Timer 4 Reload Count register */
241#define TIMER5_RLC_REG (SYS_CONT_MODULE_BASE+0x0058) /* Timer 5 Reload Count register */
242#define TIMER6_RLC_REG (SYS_CONT_MODULE_BASE+0x005C) /* Timer 6 Reload Count register */
243#define TIMER7_RLC_REG (SYS_CONT_MODULE_BASE+0x0060) /* Timer 7 Reload Count register */
244#define TIMER8_RLC_REG (SYS_CONT_MODULE_BASE+0x0064) /* Timer 8 Reload Count register */
245#define TIMER9_RLC_REG (SYS_CONT_MODULE_BASE+0x0068) /* Timer 9 Reload Count register */
246#define TIMER10_RLC_REG (SYS_CONT_MODULE_BASE+0x006C) /* Timer 10 Reload Count register */
247#define TIMER11_RLC_REG (SYS_CONT_MODULE_BASE+0x0070) /* Timer 11 Reload Count register */
248#define TIMER12_RLC_REG (SYS_CONT_MODULE_BASE+0x0074) /* Timer 12 Reload Count register */
249#define TIMER13_RLC_REG (SYS_CONT_MODULE_BASE+0x0078) /* Timer 13 Reload Count register */
250#define TIMER14_RLC_REG (SYS_CONT_MODULE_BASE+0x007C) /* Timer 14 Reload Count register */
251#define TIMER15_RLC_REG (SYS_CONT_MODULE_BASE+0x0080) /* Timer 15 Reload Count register */
252#define TIMER0_RR (SYS_CONT_MODULE_BASE+0x0084) /* Timer 0 Read register */
253#define TIMER1_RR (SYS_CONT_MODULE_BASE+0x0088) /* Timer 1 Read register */
254#define TIMER2_RR (SYS_CONT_MODULE_BASE+0x008C) /* Timer 2 Read register */
255#define TIMER3_RR (SYS_CONT_MODULE_BASE+0x0090) /* Timer 3 Read register */
256#define TIMER4_RR (SYS_CONT_MODULE_BASE+0x0094) /* Timer 4 Read register */
257#define TIMER5_RR (SYS_CONT_MODULE_BASE+0x0098) /* Timer 5 Read register */
258#define TIMER6_RR (SYS_CONT_MODULE_BASE+0x009C) /* Timer 6 Read register */
259#define TIMER7_RR (SYS_CONT_MODULE_BASE+0x00A0) /* Timer 7 Read register */
260#define TIMER8_RR (SYS_CONT_MODULE_BASE+0x00A4) /* Timer 8 Read register */
261#define TIMER9_RR (SYS_CONT_MODULE_BASE+0x00A8) /* Timer 9 Read register */
262#define TIMER10_RR (SYS_CONT_MODULE_BASE+0x00AC) /* Timer 10 Read register */
263#define TIMER11_RR (SYS_CONT_MODULE_BASE+0x00B0) /* Timer 11 Read register */
264#define TIMER12_RR (SYS_CONT_MODULE_BASE+0x00B4) /* Timer 12 Read register */
265#define TIMER13_RR (SYS_CONT_MODULE_BASE+0x00B8) /* Timer 13 Read register */
266#define TIMER14_RR (SYS_CONT_MODULE_BASE+0x00BC) /* Timer 14 Read register */
267#define TIMER15_RR (SYS_CONT_MODULE_BASE+0x00C0) /* Timer 15 Read register */
268#define TIS_REG (SYS_CONT_MODULE_BASE+0x0170) /* Timer Interrupt Status register */
269#define TIMER0_CR (SYS_CONT_MODULE_BASE+0x0190) /* Timer 0 Control register */
270#define TIMER1_CR (SYS_CONT_MODULE_BASE+0x0194) /* Timer 1 Control register */
271#define TIMER2_CR (SYS_CONT_MODULE_BASE+0x0198) /* Timer 2 Control register */
272#define TIMER3_CR (SYS_CONT_MODULE_BASE+0x019C) /* Timer 3 Control register */
273#define TIMER4_CR (SYS_CONT_MODULE_BASE+0x01A0) /* Timer 4 Control register */
274#define TIMER5_CR (SYS_CONT_MODULE_BASE+0x01A4) /* Timer 5 Control register */
275#define TIMER6_CR (SYS_CONT_MODULE_BASE+0x01A8) /* Timer 6 Control register */
276#define TIMER7_CR (SYS_CONT_MODULE_BASE+0x01AC) /* Timer 7 Control register */
277#define TIMER8_CR (SYS_CONT_MODULE_BASE+0x01B0) /* Timer 8 Control register */
278#define TIMER9_CR (SYS_CONT_MODULE_BASE+0x01B4) /* Timer 9 Control register */
279#define TIMER10_CR (SYS_CONT_MODULE_BASE+0x01B8) /* Timer 10 Control register */
280#define TIMER11_CR (SYS_CONT_MODULE_BASE+0x01BC) /* Timer 11 Control register */
281#define TIMER12_CR (SYS_CONT_MODULE_BASE+0x01C0) /* Timer 12 Control register */
282#define TIMER13_CR (SYS_CONT_MODULE_BASE+0x01C4) /* Timer 13 Control register */
283#define TIMER14_CR (SYS_CONT_MODULE_BASE+0x01C8) /* Timer 14 Control register */
284#define TIMER15_CR (SYS_CONT_MODULE_BASE+0x01CC) /* Timer 15 Control register */
285
286/* Defines for the SCM modules dynamic (RAM) chip selects */
287#define SCM_CS4_BASE_REG (SYS_CONT_MODULE_BASE+0x01D0)
288#define SCM_CS4_MASK_REG (SYS_CONT_MODULE_BASE+0x01D4)
289#define SCM_CS5_BASE_REG (SYS_CONT_MODULE_BASE+0x01D8)
290#define SCM_CS5_MASK_REG (SYS_CONT_MODULE_BASE+0x01DC)
291#define SCM_CS6_BASE_REG (SYS_CONT_MODULE_BASE+0x01E0)
292#define SCM_CS6_MASK_REG (SYS_CONT_MODULE_BASE+0x01E4)
293#define SCM_CS7_BASE_REG (SYS_CONT_MODULE_BASE+0x01E8)
294#define SCM_CS7_MASK_REG (SYS_CONT_MODULE_BASE+0x01EC)
295
296/* Defines for the SCM modules static chip selects */
297#define SCM_CS0_BASE_REG (SYS_CONT_MODULE_BASE+0x01F0)
298#define SCM_CS0_MASK_REG (SYS_CONT_MODULE_BASE+0x01F4)
299#define SCM_CS1_BASE_REG (SYS_CONT_MODULE_BASE+0x01F8)
300#define SCM_CS1_MASK_REG (SYS_CONT_MODULE_BASE+0x01FC)
301#define SCM_CS2_BASE_REG (SYS_CONT_MODULE_BASE+0x0200)
302#define SCM_CS2_MASK_REG (SYS_CONT_MODULE_BASE+0x0204)
303#define SCM_CS3_BASE_REG (SYS_CONT_MODULE_BASE+0x0208)
304#define SCM_CS3_MASK_REG (SYS_CONT_MODULE_BASE+0x020C)
305
306/*
307 *Interrupt ID
308 */
309#define INT_ID_WDT 0 /* WDT Interrupt ID */
310#define INT_ID_AHB_ER 1 /* AHB Bus Error Interrupt ID */
311#define INT_ID_BBUS_INT 2 /* BBus Aggregate Interrupt ID */
312#define INT_ID_ETH_RX 4 /* Ethernet Module Receive Interrupt ID */
313#define INT_ID_ETH_TX 5 /* Ethernet Module Transmit Interrupt ID */
314#define INT_ID_ETH_PHY 6 /* Ethernet Phy Interrupt ID */
315#define INT_ID_LCD 7 /* LCD Module interrupt ID */
316#define INT_ID_PCI_BRG 8 /* PCI Bridge Module Interrupt ID */
317#define INT_ID_PCI_ABT 9 /* PCI Arbiter Module Interrupt ID */
318#define INT_ID_PCI_EX0 10 /* PCI External Interrupt 0 ID */
319#define INT_ID_PCI_EX1 11 /* PCI External Interrupt 1 ID */
320#define INT_ID_PCI_EX2 12 /* PCI External Interrupt 2 ID */
321#define INT_ID_PCI_EX3 13 /* PCI External Interrupt 3 ID */
322#define INT_ID_I2C 14 /* I2C Interrupt ID */
323#define INT_ID_BBUS_DMA 15 /* BBus DMA Interrupt ID */
324#define INT_ID_TIMER0 16 /* Timer Interrupt 0 ID */
325#define INT_ID_TIMER1 17 /* Timer Interrupt 1 ID */
326#define INT_ID_TIMER2 18 /* Timer Interrupt 2 ID */
327#define INT_ID_TIMER3 19 /* Timer Interrupt 3 ID */
328#define INT_ID_TIMER4 20 /* Timer Interrupt 4 ID */
329#define INT_ID_TIMER5 21 /* Timer Interrupt 5 ID */
330#define INT_ID_TIMER6 22 /* Timer Interrupt 6 ID */
331#define INT_ID_TIMER7 23 /* Timer Interrupt 7 ID */
332#define INT_ID_TIMER89 24 /* Timer Interrupt 8 and 9 ID */
333#define INT_ID_USB_HOST 25 /* USB HOST Interrupt ID */
334#define INT_ID_USB_DEV 26 /* USB DEVIDE Interrupt ID */
335#define INT_ID_TIMER1415 27 /* Timer Interrupt 14 and 15 ID */
336#define INT_ID_EXT_INT0 28 /* External Interrupt 0 ID */
337#define INT_ID_EXT_INT1 29 /* External Interrupt 1 ID */
338#define INT_ID_EXT_INT2 30 /* External Interrupt 2 ID */
339#define INT_ID_EXT_INT3 31 /* External Interrupt 3 ID */
340/* これ以降はBBusの割込みID */
341#define INT_ID_BBUS_F 32 /* BBus Interrupt First ID */
342#define INT_ID_BBUS_RFU30 33 /* BBus Interrupt RFU (bit30) */
343#define INT_ID_BBUS_RFU29 34 /* BBus Interrupt RFU (bit29) */
344#define INT_ID_BBUS_RFU28 35 /* BBus Interrupt RFU (bit28) */
345#define INT_ID_BBUS_RFU27 36 /* BBus Interrupt RFU (bit27) */
346#define INT_ID_BBUS_RFU26 37 /* BBus Interrupt RFU (bit26) */
347#define INT_ID_AHB_DMA2 38 /* AHB_DMA2 Interrupt (BBus bit25) */
348#define INT_ID_AHB_DMA1 39 /* AHB_DMA1 Interrupt (BBus bit24) */
349#define INT_ID_BBUS_RFU23 40 /* BBus Interrupt RFU (bit23) */
350#define INT_ID_BBUS_RFU22 41 /* BBus Interrupt RFU (bit22) */
351#define INT_ID_BBUS_RFU21 42 /* BBus Interrupt RFU (bit21) */
352#define INT_ID_BBUS_RFU20 43 /* BBus Interrupt RFU (bit20) */
353#define INT_ID_BBUS_RFU19 44 /* BBus Interrupt RFU (bit19) */
354#define INT_ID_BBUS_RFU18 45 /* BBus Interrupt RFU (bit18) */
355#define INT_ID_BBUS_RFU17 46 /* BBus Interrupt RFU (bit17) */
356#define INT_ID_BBUS_RFU16 47 /* BBus Interrupt RFU (bit16) */
357#define INT_ID_BBUS_RFU15 48 /* BBus Interrupt RFU (bit15) */
358#define INT_ID_BBUS_RFU14 49 /* BBus Interrupt RFU (bit14) */
359#define INT_ID_BBUS_RFU13 50 /* BBus Interrupt RFU (bit13) */
360#define INT_ID_BBUS_RFU12 51 /* BBus Interrupt RFU (bit12) */
361#define INT_ID_1284 52 /* IEEE 1284 Module Interrupt (BBus bit11) */
362#define INT_ID_BI2C 53 /* I2C Interrupt (BBus bit10) */
363#define INT_ID_SERD_TX 54 /* SER D Tx Interrupt (BBus bit9) */
364#define INT_ID_SERD_RX 55 /* SER D Rx Interrupt (BBus bit8) */
365#define INT_ID_SERC_TX 56 /* SER C Tx Interrupt (BBus bit7) */
366#define INT_ID_SERC_RX 57 /* SER C Rx Interrupt (BBus bit6) */
367#define INT_ID_SERA_TX 58 /* SER A Tx Interrupt (BBus bit5) */
368#define INT_ID_SERA_RX 59 /* SER A Rx Interrupt (BBus bit4) */
369#define INT_ID_SERB_TX 60 /* SER B Tx Interrupt (BBus bit3) */
370#define INT_ID_SERB_RX 61 /* SER B Rx Interrupt (BBus bit2) */
371#define INT_ID_USB 62 /* USB module Interrupt (BBus bit1) */
372#define INT_ID_DMAE 63 /* BBus DMA aggregate Interrupt (BBus bit0) */
373
374#define INT_ID_NONE 0xff /* unuse ID */
375#define BBUS_IRQ_NUM 32 /* BBus IRQ start number */
376
377
378/*
379 * Serial Controller Registers
380 */
381#define SC2CRA_REG 0x90200000 /* Channel B Control Register A */
382#define SC2CRB_REG 0x90200004 /* Channel B Control Register B */
383#define SC2SRA_REG 0x90200008 /* Channel B Status Register A */
384#define SC2BRG_REG 0x9020000C /* Channel B Bit-Rate register */
385#define SC2FIFO_REG 0x90200010 /* Channel B FIFO Data register */
386#define SC2RBT_REG 0x90200014 /* Channel B Receive Buffer Gap Timer */
387#define SC2RCT_REG 0x90200018 /* Channel B Receive Character Gap Timer */
388#define SC2RMR_REG 0x9020001C /* Channel B Receive Match register */
389#define SC2RMM_REG 0x90200020 /* Channel B Receive Match Mask register */
390#define SC2FCR_REG 0x90200034 /* Channel B Flow Control register */
391#define SC2FCF_REG 0x90200038 /* Channel B Flow Control Force register */
392
393#define SC1CRA_REG 0x90200040 /* Channel A Control Register A */
394#define SC1CRB_REG 0x90200044 /* Channel A Control Register B */
395#define SC1SRA_REG 0x90200048 /* Channel A Status Register A */
396#define SC1BRG_REG 0x9020004C /* Channel A Bit-Rate register */
397#define SC1FIFO_REG 0x90200050 /* Channel A FIFO Data register */
398#define SC1RBT_REG 0x90200054 /* Channel A Receive Buffer Gap Timer */
399#define SC1RCT_REG 0x90200058 /* Channel A Receive Character Gap Timer */
400#define SC1RMR_REG 0x9020005C /* Channel A Receive Match register */
401#define SC1RMM_REG 0x90200060 /* Channel A Receive Match Mask register */
402#define SC1FCR_REG 0x90200074 /* Channel A Flow Control register */
403#define SC1FCF_REG 0x90200078 /* Channel A Flow Control Force register */
404
405#define SC3CRA_REG 0x90300000 /* Channel C Control Register A */
406#define SC3CRB_REG 0x90300004 /* Channel C Control Register B */
407#define SC3SRA_REG 0x90300008 /* Channel C Status Register A */
408#define SC3BRG_REG 0x9030000C /* Channel C Bit-Rate register */
409#define SC3FIFO_REG 0x90300010 /* Channel C FIFO Data register */
410#define SC3RBT_REG 0x90300014 /* Channel C Receive Buffer Gap Timer */
411#define SC3RCT_REG 0x90300018 /* Channel C Receive Character Gap Timer */
412#define SC3RMR_REG 0x9030001C /* Channel C Receive Match register */
413#define SC3RMM_REG 0x90300020 /* Channel C Receive Match Mask register */
414#define SC3FCR_REG 0x90300034 /* Channel C Flow Control register */
415#define SC3FCF_REG 0x90300038 /* Channel C Flow Control Force register */
416
417#define SC4CRA_REG 0x90300040 /* Channel D Control Register A */
418#define SC4CRB_REG 0x90300044 /* Channel D Control Register B */
419#define SC4SRA_REG 0x90300048 /* Channel D Status Register A */
420#define SC4BRG_REG 0x9030004C /* Channel D Bit-Rate register */
421#define SC4FIFO_REG 0x90300050 /* Channel D FIFO Data register */
422#define SC4RBT_REG 0x90300054 /* Channel D Receive Buffer Gap Timer */
423#define SC4RCT_REG 0x90300058 /* Channel D Receive Character Gap Timer */
424#define SC4RMR_REG 0x9030005C /* Channel D Receive Match register */
425#define SC4RMM_REG 0x90300060 /* Channel D Receive Match Mask register */
426#define SC4FCR_REG 0x90300074 /* Channel D Flow Control register */
427#define SC4FCF_REG 0x90300078 /* Channel D Flow Control Force register */
428
429/* Serial Channel Control Register bit define */
430#define SCCRA_CE 0x80000000 /* 1... .... .... .... .... .... .... .... */
431#define SCCRA_BRK 0x40000000 /* .1.. .... .... .... .... .... .... .... */
432#define SCCRA_STICK 0x20000000 /* ..1. .... .... .... .... .... .... .... */
433#define SCCRA_EPS 0x10000000 /* ...1 .... .... .... .... .... .... .... */
434#define SCCRA_PE 0x08000000 /* .... 1... .... .... .... .... .... .... */
435#define SCCRA_STOP 0x04000000 /* .... .1.. .... .... .... .... .... .... */
436#define SCCRA_WLS 0x03000000 /* .... ..11 .... .... .... .... .... .... */
437#define SCCRA_CTSTX 0x00800000 /* .... .... 1... .... .... .... .... .... */
438#define SCCRA_RTSRX 0x00400000 /* .... .... .1.. .... .... .... .... .... */
439#define SCCRA_RL 0x00200000 /* .... .... ..1. .... .... .... .... .... */
440#define SCCRA_LL 0x00100000 /* .... .... ...1 .... .... .... .... .... */
441#define SCCRA_DTR 0x00020000 /* .... .... .... ..1. .... .... .... .... */
442#define SCCRA_RTS 0x00010000 /* .... .... .... ...1 .... .... .... .... */
443#define SCCRA_RIE 0x00000e00 /* .... .... .... .... .... 111. .... .... */
444#define SCCRA_ERXDMA 0x00000100 /* .... .... .... .... .... ...1 .... .... */
445#define SCCRA_RIC 0x000000e0 /* .... .... .... .... .... .... 111. .... */
446#define SCCRA_TIC 0x0000001e /* .... .... .... .... .... .... ...1 111. */
447#define SCCRA_ETXDMA 0x00000001 /* .... .... .... .... .... .... .... ...1 */
448#define SCCRB_RDM 0xf0000000 /* 1111 .... .... .... .... .... .... .... */
449#define SCCRB_RBGT 0x08000000 /* .... 1... .... .... .... .... .... .... */
450#define SCCRB_RCGT 0x04000000 /* .... .1.. .... .... .... .... .... .... */
451#define SCCRB_MODE 0x00300000 /* .... .... ..11 .... .... .... .... .... */
452#define SCCRB_BITORDR 0x00080000 /* .... .... .... 1... .... .... .... .... */
453#define SCCRB_RTSTX 0x00008000 /* .... .... .... .... 1... .... .... .... */
454
455/* Serial Channel Status Register bit define */
456#define SCSRA_MATCH 0xf0000000 /* 1111 .... .... .... .... .... .... .... */
457#define SCSRA_BGAP 0x08000000 /* .... 1... .... .... .... .... .... .... */
458#define SCSRA_CGAP 0x04000000 /* .... .1.. .... .... .... .... .... .... */
459#define SCSRA_RXFDB 0x00300000 /* .... .... ..11 .... .... .... .... .... */
460#define SCSRA_DCD 0x00080000 /* .... .... .... 1... .... .... .... .... */
461#define SCSRA_RI 0x00040000 /* .... .... .... .1.. .... .... .... .... */
462#define SCSRA_DSR 0x00020000 /* .... .... .... ..1. .... .... .... .... */
463#define SCSRA_CTS 0x00010000 /* .... .... .... ...1 .... .... .... .... */
464#define SCSRA_RBRK 0x00008000 /* .... .... .... .... 1... .... .... .... */
465#define SCSRA_RFE 0x00004000 /* .... .... .... .... .1.. .... .... .... */
466#define SCSRA_RPE 0x00002000 /* .... .... .... .... ..1. .... .... .... */
467#define SCSRA_ROVER 0x00001000 /* .... .... .... .... ...1 .... .... .... */
468#define SCSRA_RRDY 0x00000800 /* .... .... .... .... .... 1... .... .... */
469#define SCSRA_RHALF 0x00000400 /* .... .... .... .... .... .1.. .... .... */
470#define SCSRA_RBC 0x00000200 /* .... .... .... .... .... ..1. .... .... */
471#define SCSRA_RFS 0x00000100 /* .... .... .... .... .... ...1 .... .... */
472#define SCSRA_DCDI 0x00000080 /* .... .... .... .... .... .... 1... .... */
473#define SCSRA_RII 0x00000040 /* .... .... .... .... .... .... .1.. .... */
474#define SCSRA_DSRI 0x00000020 /* .... .... .... .... .... .... ..1. .... */
475#define SCSRA_CTSI 0x00000010 /* .... .... .... .... .... .... ...1 .... */
476#define SCSRA_TRDY 0x00000008 /* .... .... .... .... .... .... .... 1... */
477#define SCSRA_THALF 0x00000004 /* .... .... .... .... .... .... .... .1.. */
478#define SCSRA_TEMPTY 0x00000001 /* .... .... .... .... .... .... .... ...1 */
479
480
481/*
482 *Memory Controller Registers
483 */
484#define MEM_CONTROLLER_BASE 0xA0700000 /* ARM MPMC Memory Controller Registers Base Address */
485#define HIGHEST_HW 0xFFFEFFF0 /* Highest *hardware only* address, use for termination */
486#define CS_BASE_SHIFT_BITS 12
487#define CS_MASK_SHIFT_BITS 12
488
489
490#define MPMCControl_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x0))
491#define MPMCStatus_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x4))
492#define MPMCConfig_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x8))
493#define MPMCDynamicControl_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x20))
494#define MPMCDynamicRefresh_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x24))
495#define MPMCDynamicReadConfig_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x28))
496#define MPMCDynamictRP_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x30))
497#define MPMCDynamictRAS_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x34))
498#define MPMCDynamictSREX_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x38))
499#define MPMCDynamictAPR_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x3C))
500#define MPMCDynamictDAL_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x40))
501#define MPMCDynamictWR_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x44))
502#define MPMCDynamictRC_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x48))
503#define MPMCDynamictRFC_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x4C))
504#define MPMCDynamictXSR_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x50))
505#define MPMCDynamictRRD_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x54))
506#define MPMCDynamictMRD_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x58))
507#define MPMCStaticExtendedWait_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x80))
508#define MPMCDynamicConfig0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x100))
509#define MPMCDynamicRasCas0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x104))
510#define MPMCDynamicConfig1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x120))
511#define MPMCDynamicRasCas1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x124))
512#define MPMCDynamicConfig2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x140))
513#define MPMCDynamicRasCas2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x144))
514#define MPMCDynamicConfig3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x160))
515#define MPMCDynamicRasCas3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x164))
516#define MPMCStaticConfig0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x200))
517#define MPMCStaticWaitWen0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x204))
518#define MPMCStaticWaitOen0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x208))
519#define MPMCStaticWaitRd0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x20C))
520#define MPMCStaticWaitPage0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x210))
521#define MPMCStaticWaitWr0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x214))
522#define MPMCStaticWaitTurn0_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x218))
523#define MPMCStaticConfig1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x220))
524#define MPMCStaticWaitWen1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x224))
525#define MPMCStaticWaitOen1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x228))
526#define MPMCStaticWaitRd1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x22C))
527#define MPMCStaticWaitPage1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x230))
528#define MPMCStaticWaitWr1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x234))
529#define MPMCStaticWaitTurn1_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x238))
530#define MPMCStaticConfig2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x240))
531#define MPMCStaticWaitWen2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x244))
532#define MPMCStaticWaitOen2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x248))
533#define MPMCStaticWaitRd2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x24C))
534#define MPMCStaticWaitPage2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x250))
535#define MPMCStaticWaitWr2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x254))
536#define MPMCStaticWaitTurn2_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x258))
537#define MPMCStaticConfig3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x260))
538#define MPMCStaticWaitWen3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x264))
539#define MPMCStaticWaitOen3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x268))
540#define MPMCStaticWaitRd3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x26C))
541#define MPMCStaticWaitPage3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x270))
542#define MPMCStaticWaitWr3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x274))
543#define MPMCStaticWaitTurn3_REG ((UW volatile *) (MEM_CONTROLLER_BASE + 0x278))
544
545
546/* PrimeCell MultiPort Memory Controller defines */
547 #define MPMC_DYNAMIC_REFRESH_refresh 10, 0
548 #define MPMC_DYNAMIC_CONFIG0_config 31, 0
549 #define MPMC_DYNAMIC_RASCAS0_rascas 31, 0
550 #define MPMC_DYNAMIC_CONFIG1_config 31, 0
551 #define MPMC_DYNAMIC_RASCAS1_rascas 31, 0
552 #define MPMC_DYNAMIC_CONFIG2_config 31, 0
553 #define MPMC_DYNAMIC_RASCAS2_rascas 31, 0
554 #define MPMC_DYNAMIC_CONFIG3_config 31, 0
555 #define MPMC_DYNAMIC_RASCAS3_rascas 31, 0
556
557 /* Defines for static memory */
558 #define MPMC_STATIC_CONFIG0_config 0x82
559 #define MPMC_STATIC_WAIT_WEN0_wen 0x02
560 #define MPMC_STATIC_WAIT_OEN0_oen 0x02
561 #define MPMC_STATIC_WAIT_RD0_rd 0x09
562 #define MPMC_STATIC_WAIT_PAGE0_page 0x02
563 #define MPMC_STATIC_WAIT_WR0_wr 0x09
564 #define MPMC_STATIC_WAIT_TURN0_turn 0x02
565
566 #define MPMC_STATIC_CONFIG1_config 0x81
567 #define MPMC_STATIC_WAIT_WEN1_wen 0x00
568 #define MPMC_STATIC_WAIT_OEN1_oen 0x00
569 #define MPMC_STATIC_WAIT_RD1_rd 0x08
570 #define MPMC_STATIC_WAIT_PAGE1_page 0x00
571 #define MPMC_STATIC_WAIT_WR1_wr 0x04
572 #define MPMC_STATIC_WAIT_TURN1_turn 0x00
573
574 #define MPMC_STATIC_CONFIG2_config 0x82
575 #define MPMC_STATIC_WAIT_WEN2_wen 0x02
576 #define MPMC_STATIC_WAIT_OEN2_oen 0x02
577 #define MPMC_STATIC_WAIT_RD2_rd 0x09
578 #define MPMC_STATIC_WAIT_PAGE2_page 0x02
579 #define MPMC_STATIC_WAIT_WR2_wr 0x09
580 #define MPMC_STATIC_WAIT_TURN2_turn 0x02
581
582 #define MPMC_STATIC_CONFIG3_config 0x82
583 #define MPMC_STATIC_WAIT_WEN3_wen 0x02
584 #define MPMC_STATIC_WAIT_OEN3_oen 0x02
585 #define MPMC_STATIC_WAIT_RD3_rd 0x09
586 #define MPMC_STATIC_WAIT_PAGE3_page 0x02
587 #define MPMC_STATIC_WAIT_WR3_wr 0x09
588 #define MPMC_STATIC_WAIT_TURN3_turn 0x02
589
590
591/*
592 * BBus Utility Control ans Status Registers
593 */
594
595/* address */
596#define BBUS_UTILITY_BASE 0x90600000 /* BBus Utility Control ans Status Registers Base Address */
597
598#define BBUS_MAST_RESET_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x0))
599#define BBUS_INTERRUPT_STATUS_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x4))
600#define BBUS_GPIO_CONFIG1_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x10))
601#define BBUS_GPIO_CONFIG2_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x14))
602#define BBUS_GPIO_CONFIG3_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x18))
603#define BBUS_GPIO_CONFIG4_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x1c))
604#define BBUS_GPIO_CONFIG5_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x20))
605#define BBUS_GPIO_CONFIG6_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x24))
606#define BBUS_GPIO_CONFIG7_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x28))
607#define BBUS_GPIO_CONT1_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x30))
608#define BBUS_GPIO_CONT2_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x34))
609#define BBUS_GPIO_STATUS1_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x40))
610#define BBUS_GPIO_STATUS2_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x44))
611#define BBUS_TIMEOUT_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x50))
612#define BBUS_DMA_INT_STATUS_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x60))
613#define BBUS_DMA_INT_ENABLE_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x64))
614#define BBUS_USB_CONFIG_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x70))
615#define BBUS_ENDIAN_CONFIG_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x80))
616#define BBUS_ARM_WAKEUP_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x90))
617#define BBUS_GPIO_CONFIG8_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x100))
618#define BBUS_GPIO_CONFIG9_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x104))
619#define BBUS_GPIO_CONFIG10_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x108))
620#define BBUS_GPIO_CONT3_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x120))
621#define BBUS_GPIO_STATUS3_REG ((UW volatile *) (BBUS_UTILITY_BASE + 0x130))
622
623/* registers value */
624#define BBUS_MAST_RESET_USBDEV 0x00001000 /* UDBDEV bit ON */
625#define BBUS_MAST_RESET_USBHST 0x00000800 /* UDBHST bit ON */
626#define BBUS_MAST_RESET_RTC2 0x00000400 /* RTC2 bit ON */
627#define BBUS_MAST_RESET_RTC1 0x00000200 /* RTC1 bit ON */
628#define BBUS_MAST_RESET_I2C 0x00000080 /* I2C bit ON */
629#define BBUS_MAST_RESET_1284 0x00000040 /* IEEE 1284 bit ON */
630#define BBUS_MAST_RESET_SerD 0x00000020 /* SerD bit ON */
631#define BBUS_MAST_RESET_SerC 0x00000010 /* SerC bit ON */
632#define BBUS_MAST_RESET_SerA 0x00000008 /* SerA bit ON */
633#define BBUS_MAST_RESET_SerB 0x00000004 /* SerB bit ON */
634#define BBUS_MAST_RESET_DMA 0x00000001 /* DMA bit ON */
635
636#define BBUS_INTERRUPT_RESET 0x00000001 /* Interrupt Reset */
637
638#define BBUS_GPIO_CONFIG1_GPIO0 0x00000000 /* GPIO[0] Configration D03:00 : Func0 */
639#define BBUS_GPIO_CONFIG1_GPIO1 0x00000000 /* GPIO[1] Configration D07:04 : Func0 */
640#define BBUS_GPIO_CONFIG1_GPIO2 0x00000b00 /* GPIO[2] Configration D11:08 : Func3 */
641#define BBUS_GPIO_CONFIG1_GPIO3 0x0000b000 /* GPIO[3] Configration D15:12 : Func3 */
642#define BBUS_GPIO_CONFIG1_GPIO4 0x000b0000 /* GPIO[4] Configration D19:16 : Func3 */
643#define BBUS_GPIO_CONFIG1_GPIO5 0x00b00000 /* GPIO[5] Configration D23:20 : Func3 */
644#define BBUS_GPIO_CONFIG1_GPIO6 0x00000000 /* GPIO[6] Configration D27:24 : Func0 */
645#define BBUS_GPIO_CONFIG1_GPIO7 0xb0000000 /* GPIO[7] Configration D31:28 : Func3 */
646
647#define BBUS_GPIO_CONFIG2_GPIO8 0x00000000 /* GPIO[8] Configration D03:00 : Func0 */
648#define BBUS_GPIO_CONFIG2_GPIO9 0x00000000 /* GPIO[9] Configration D07:04 : Func0 */
649#define BBUS_GPIO_CONFIG2_GPIO10 0x00000400 /* GPIO[10] Configration D11:08 : Func0 */
650#define BBUS_GPIO_CONFIG2_GPIO11 0x00004000 /* GPIO[11] Configration D15:12 : Func0 */
651#define BBUS_GPIO_CONFIG2_GPIO12 0x00040000 /* GPIO[12] Configration D19:16 : Func0 */
652#define BBUS_GPIO_CONFIG2_GPIO13 0x00400000 /* GPIO[13] Configration D23:20 : Func0 */
653#define BBUS_GPIO_CONFIG2_GPIO14 0x04000000 /* GPIO[14] Configration D27:24 : Func0 */
654#define BBUS_GPIO_CONFIG2_GPIO15 0x40000000 /* GPIO[15] Configration D31:28 : Func0 */
655
656#define BBUS_GPIO_CONFIG3_GPIO16 0x0000000b /* GPIO[16] Configration D03:00 : Func3 */
657#define BBUS_GPIO_CONFIG3_GPIO17 0x000000b0 /* GPIO[17] Configration D07:04 : Func3 */
658#define BBUS_GPIO_CONFIG3_GPIO18 0x00000b00 /* GPIO[18] Configration D11:08 : Func3 */
659#define BBUS_GPIO_CONFIG3_GPIO19 0x0000b000 /* GPIO[19] Configration D15:12 : Func3 */
660#define BBUS_GPIO_CONFIG3_GPIO20 0x000b0000 /* GPIO[20] Configration D19:16 : Func3 */
661#define BBUS_GPIO_CONFIG3_GPIO21 0x00b00000 /* GPIO[21] Configration D23:20 : Func3 */
662#define BBUS_GPIO_CONFIG3_GPIO22 0x0b000000 /* GPIO[22] Configration D27:24 : Func3 */
663#define BBUS_GPIO_CONFIG3_GPIO23 0xb0000000 /* GPIO[23] Configration D31:28 : Func3 */
664
665#define BBUS_GPIO_CONFIG4_GPIO24 0x0000000b /* GPIO[24] Configration D03:00 : Func3 */
666#define BBUS_GPIO_CONFIG4_GPIO25 0x000000b0 /* GPIO[25] Configration D07:04 : Func3 */
667#define BBUS_GPIO_CONFIG4_GPIO26 0x00000b00 /* GPIO[26] Configration D11:08 : Func3 */
668#define BBUS_GPIO_CONFIG4_GPIO27 0x0000b000 /* GPIO[27] Configration D15:12 : Func3 */
669#define BBUS_GPIO_CONFIG4_GPIO28 0x000b0000 /* GPIO[28] Configration D19:16 : Func3 */
670#define BBUS_GPIO_CONFIG4_GPIO29 0x00b00000 /* GPIO[29] Configration D23:20 : Func3 */
671#define BBUS_GPIO_CONFIG4_GPIO30 0x0b000000 /* GPIO[30] Configration D27:24 : Func3 */
672#define BBUS_GPIO_CONFIG4_GPIO31 0xb0000000 /* GPIO[31] Configration D31:28 : Func3 */
673
674#define BBUS_GPIO_CONFIG5_GPIO32 0x00000003 /* GPIO[32] Configration D03:00 : Func3 */
675#define BBUS_GPIO_CONFIG5_GPIO33 0x00000030 /* GPIO[33] Configration D07:04 : Func3 */
676#define BBUS_GPIO_CONFIG5_GPIO34 0x00000300 /* GPIO[34] Configration D11:08 : Func3 */
677#define BBUS_GPIO_CONFIG5_GPIO35 0x00003000 /* GPIO[35] Configration D15:12 : Func3 */
678#define BBUS_GPIO_CONFIG5_GPIO36 0x000b0000 /* GPIO[36] Configration D19:16 : Func3 */
679#define BBUS_GPIO_CONFIG5_GPIO37 0x00b00000 /* GPIO[37] Configration D23:20 : Func3 */
680#define BBUS_GPIO_CONFIG5_GPIO38 0x0b000000 /* GPIO[38] Configration D27:24 : Func3 */
681#define BBUS_GPIO_CONFIG5_GPIO39 0xb0000000 /* GPIO[39] Configration D31:28 : Func3 */
682
683#define BBUS_GPIO_CONFIG6_GPIO40 0x00000000 /* GPIO[40] Configration D03:00 : Func0 */
684#define BBUS_GPIO_CONFIG6_GPIO41 0x00000000 /* GPIO[41] Configration D07:04 : Func0 */
685#define BBUS_GPIO_CONFIG6_GPIO42 0x00000200 /* GPIO[42] Configration D11:08 : Func2 */
686#define BBUS_GPIO_CONFIG6_GPIO43 0x00002000 /* GPIO[43] Configration D15:12 : Func2 */
687#define BBUS_GPIO_CONFIG6_GPIO44 0x00060000 /* GPIO[44] Configration D19:16 : Func2 */
688#define BBUS_GPIO_CONFIG6_GPIO45 0x00200000 /* GPIO[45] Configration D23:20 : Func2 */
689#define BBUS_GPIO_CONFIG6_GPIO46 0x0b000000 /* GPIO[46] Configration D27:24 : Func3 */
690#define BBUS_GPIO_CONFIG6_GPIO47 0x30000000 /* GPIO[47] Configration D31:28 : Func3 */
691
692#define BBUS_GPIO_CONFIG7_GPIO48 0x00000000 /* GPIO[48] Configration D03:00 : Func0 */
693#define BBUS_GPIO_CONFIG7_GPIO49 0x00000000 /* GPIO[49] Configration D07:04 : Func0 */
694#define BBUS_GPIO_CONFIG7_GPIO50 0x00000000 /* GPIO[50] Configration D11:08 : Func0 */
695#define BBUS_GPIO_CONFIG7_GPIO51 0x00000000 /* GPIO[51] Configration D15:12 : Func0 */
696#define BBUS_GPIO_CONFIG7_GPIO52 0x00000000 /* GPIO[52] Configration D19:16 : Func0 */
697#define BBUS_GPIO_CONFIG7_GPIO53 0x00000000 /* GPIO[53] Configration D23:20 : Func0 */
698#define BBUS_GPIO_CONFIG7_GPIO54 0x00000000 /* GPIO[54] Configration D27:24 : Func0 */
699#define BBUS_GPIO_CONFIG7_GPIO55 0x00000000 /* GPIO[55] Configration D31:28 : Func0 */
700
701#define BBUS_GPIO_CONFIG8_GPIO56 0x00000000 /* GPIO[56] Configration D03:00 : Func0 */
702#define BBUS_GPIO_CONFIG8_GPIO57 0x00000000 /* GPIO[57] Configration D07:04 : Func0 */
703#define BBUS_GPIO_CONFIG8_GPIO58 0x00000000 /* GPIO[58] Configration D11:08 : Func0 */
704#define BBUS_GPIO_CONFIG8_GPIO59 0x00000000 /* GPIO[59] Configration D15:12 : Func0 */
705#define BBUS_GPIO_CONFIG8_GPIO60 0x00000000 /* GPIO[60] Configration D19:16 : Func0 */
706#define BBUS_GPIO_CONFIG8_GPIO61 0x00000000 /* GPIO[61] Configration D23:20 : Func0 */
707#define BBUS_GPIO_CONFIG8_GPIO62 0x00000000 /* GPIO[62] Configration D27:24 : Func0 */
708#define BBUS_GPIO_CONFIG8_GPIO63 0x00000000 /* GPIO[63] Configration D31:28 : Func0 */
709
710#define BBUS_GPIO_CONFIG9_GPIO64 0x00000000 /* GPIO[64] Configration D03:00 : Func0 */
711#define BBUS_GPIO_CONFIG9_GPIO65 0x00000000 /* GPIO[65] Configration D07:04 : Func3 */
712#define BBUS_GPIO_CONFIG9_GPIO66 0x00000000 /* GPIO[66] Configration D11:08 : Func3 */
713#define BBUS_GPIO_CONFIG9_GPIO67 0x0000b000 /* GPIO[67] Configration D15:12 : Func3 */
714#define BBUS_GPIO_CONFIG9_GPIO68 0x00020000 /* GPIO[68] Configration D19:16 : Func1 */
715#define BBUS_GPIO_CONFIG9_GPIO69 0x00200000 /* GPIO[69] Configration D23:20 : Func3 */
716#define BBUS_GPIO_CONFIG9_GPIO70 0x03000000 /* GPIO[70] Configration D27:24 : Func3 */
717#define BBUS_GPIO_CONFIG9_GPIO71 0x30000000 /* GPIO[71] Configration D31:28 : Func3 */
718
719#define BBUS_GPIO_CONFIG10_GPIO72 0x00000003 /* GPIO[72] Configration D03:00 : Func3 */
720
721
722#define BBUS_GPIO_CONT_STS1_GPIO0 0x00000001 /* GPIO[0] control/status bit */
723#define BBUS_GPIO_CONT_STS1_GPIO1 0x00000002 /* GPIO[1] control/status bit */
724#define BBUS_GPIO_CONT_STS1_GPIO2 0x00000004 /* GPIO[2] control/status bit */
725#define BBUS_GPIO_CONT_STS1_GPIO3 0x00000008 /* GPIO[3] control/status bit */
726#define BBUS_GPIO_CONT_STS1_GPIO4 0x00000010 /* GPIO[4] control/status bit */
727#define BBUS_GPIO_CONT_STS1_GPIO5 0x00000020 /* GPIO[5] control/status bit */
728#define BBUS_GPIO_CONT_STS1_GPIO6 0x00000040 /* GPIO[6] control/status bit */
729#define BBUS_GPIO_CONT_STS1_GPIO7 0x00000080 /* GPIO[7] control/status bit */
730#define BBUS_GPIO_CONT_STS1_GPIO8 0x00000100 /* GPIO[8] control/status bit */
731#define BBUS_GPIO_CONT_STS1_GPIO9 0x00000200 /* GPIO[9] control/status bit */
732#define BBUS_GPIO_CONT_STS1_GPIO10 0x00000400 /* GPIO[10] control/status bit */
733#define BBUS_GPIO_CONT_STS1_GPIO11 0x00000800 /* GPIO[11] control/status bit */
734#define BBUS_GPIO_CONT_STS1_GPIO12 0x00001000 /* GPIO[12] control/status bit */
735#define BBUS_GPIO_CONT_STS1_GPIO13 0x00002000 /* GPIO[13] control/status bit */
736#define BBUS_GPIO_CONT_STS1_GPIO14 0x00004000 /* GPIO[14] control/status bit */
737#define BBUS_GPIO_CONT_STS1_GPIO15 0x00008000 /* GPIO[15] control/status bit */
738#define BBUS_GPIO_CONT_STS1_GPIO16 0x00010000 /* GPIO[16] control/status bit */
739#define BBUS_GPIO_CONT_STS1_GPIO17 0x00020000 /* GPIO[17] control/status bit */
740#define BBUS_GPIO_CONT_STS1_GPIO18 0x00040000 /* GPIO[18] control/status bit */
741#define BBUS_GPIO_CONT_STS1_GPIO19 0x00080000 /* GPIO[19] control/status bit */
742#define BBUS_GPIO_CONT_STS1_GPIO20 0x00100000 /* GPIO[20] control/status bit */
743#define BBUS_GPIO_CONT_STS1_GPIO21 0x00200000 /* GPIO[21] control/status bit */
744#define BBUS_GPIO_CONT_STS1_GPIO22 0x00400000 /* GPIO[22] control/status bit */
745#define BBUS_GPIO_CONT_STS1_GPIO23 0x00800000 /* GPIO[23] control/status bit */
746#define BBUS_GPIO_CONT_STS1_GPIO24 0x01000000 /* GPIO[24] control/status bit */
747#define BBUS_GPIO_CONT_STS1_GPIO25 0x02000000 /* GPIO[25] control/status bit */
748#define BBUS_GPIO_CONT_STS1_GPIO26 0x04000000 /* GPIO[26] control/status bit */
749#define BBUS_GPIO_CONT_STS1_GPIO27 0x08000000 /* GPIO[27] control/status bit */
750#define BBUS_GPIO_CONT_STS1_GPIO28 0x10000000 /* GPIO[28] control/status bit */
751#define BBUS_GPIO_CONT_STS1_GPIO29 0x20000000 /* GPIO[29] control/status bit */
752#define BBUS_GPIO_CONT_STS1_GPIO30 0x40000000 /* GPIO[30] control/status bit */
753#define BBUS_GPIO_CONT_STS1_GPIO31 0x80000000 /* GPIO[31] control/status bit */
754#define BBUS_GPIO_CONT_STS2_GPIO32 0x00000001 /* GPIO[32] control/status bit */
755#define BBUS_GPIO_CONT_STS2_GPIO33 0x00000002 /* GPIO[33] control/status bit */
756#define BBUS_GPIO_CONT_STS2_GPIO34 0x00000004 /* GPIO[34] control/status bit */
757#define BBUS_GPIO_CONT_STS2_GPIO35 0x00000008 /* GPIO[35] control/status bit */
758#define BBUS_GPIO_CONT_STS2_GPIO36 0x00000010 /* GPIO[36] control/status bit */
759#define BBUS_GPIO_CONT_STS2_GPIO37 0x00000020 /* GPIO[37] control/status bit */
760#define BBUS_GPIO_CONT_STS2_GPIO38 0x00000040 /* GPIO[38] control/status bit */
761#define BBUS_GPIO_CONT_STS2_GPIO39 0x00000080 /* GPIO[39] control/status bit */
762#define BBUS_GPIO_CONT_STS2_GPIO40 0x00000100 /* GPIO[40] control/status bit */
763#define BBUS_GPIO_CONT_STS2_GPIO41 0x00000200 /* GPIO[41] control/status bit */
764#define BBUS_GPIO_CONT_STS2_GPIO42 0x00000400 /* GPIO[42] control/status bit */
765#define BBUS_GPIO_CONT_STS2_GPIO43 0x00000800 /* GPIO[43] control/status bit */
766#define BBUS_GPIO_CONT_STS2_GPIO44 0x00001000 /* GPIO[44] control/status bit */
767#define BBUS_GPIO_CONT_STS2_GPIO45 0x00002000 /* GPIO[45] control/status bit */
768#define BBUS_GPIO_CONT_STS2_GPIO46 0x00004000 /* GPIO[46] control/status bit */
769#define BBUS_GPIO_CONT_STS2_GPIO47 0x00008000 /* GPIO[47] control/status bit */
770#define BBUS_GPIO_CONT_STS2_GPIO48 0x00010000 /* GPIO[48] control/status bit */
771#define BBUS_GPIO_CONT_STS2_GPIO49 0x00020000 /* GPIO[49] control/status bit */
772#define BBUS_GPIO_CONT_STS2_GPIO50 0x00040000 /* GPIO[50] control/status bit */
773#define BBUS_GPIO_CONT_STS2_GPIO51 0x00080000 /* GPIO[51] control/status bit */
774#define BBUS_GPIO_CONT_STS2_GPIO52 0x00100000 /* GPIO[52] control/status bit */
775#define BBUS_GPIO_CONT_STS2_GPIO53 0x00200000 /* GPIO[53] control/status bit */
776#define BBUS_GPIO_CONT_STS2_GPIO54 0x00400000 /* GPIO[54] control/status bit */
777#define BBUS_GPIO_CONT_STS2_GPIO55 0x00800000 /* GPIO[55] control/status bit */
778#define BBUS_GPIO_CONT_STS2_GPIO56 0x01000000 /* GPIO[56] control/status bit */
779#define BBUS_GPIO_CONT_STS2_GPIO57 0x02000000 /* GPIO[57] control/status bit */
780#define BBUS_GPIO_CONT_STS2_GPIO58 0x04000000 /* GPIO[58] control/status bit */
781#define BBUS_GPIO_CONT_STS2_GPIO59 0x08000000 /* GPIO[59] control/status bit */
782#define BBUS_GPIO_CONT_STS2_GPIO60 0x10000000 /* GPIO[60] control/status bit */
783#define BBUS_GPIO_CONT_STS2_GPIO61 0x20000000 /* GPIO[61] control/status bit */
784#define BBUS_GPIO_CONT_STS2_GPIO62 0x40000000 /* GPIO[62] control/status bit */
785#define BBUS_GPIO_CONT_STS2_GPIO63 0x80000000 /* GPIO[63] control/status bit */
786#define BBUS_GPIO_CONT_STS3_GPIO64 0x00000001 /* GPIO[64] control/status bit */
787#define BBUS_GPIO_CONT_STS3_GPIO65 0x00000002 /* GPIO[65] control/status bit */
788#define BBUS_GPIO_CONT_STS3_GPIO66 0x00000004 /* GPIO[66] control/status bit */
789#define BBUS_GPIO_CONT_STS3_GPIO67 0x00000008 /* GPIO[67] control/status bit */
790#define BBUS_GPIO_CONT_STS3_GPIO68 0x00000010 /* GPIO[68] control/status bit */
791#define BBUS_GPIO_CONT_STS3_GPIO69 0x00000020 /* GPIO[69] control/status bit */
792#define BBUS_GPIO_CONT_STS3_GPIO70 0x00000040 /* GPIO[70] control/status bit */
793#define BBUS_GPIO_CONT_STS3_GPIO71 0x00000080 /* GPIO[71] control/status bit */
794#define BBUS_GPIO_CONT_STS3_GPIO72 0x00000100 /* GPIO[72] control/status bit */
795
796#define BBUS_DMA_INT_STS_CH0 0x00000001 /* BBus DMA channel #1 interrupt status bit */
797#define BBUS_DMA_INT_STS_CH1 0x00000002 /* BBus DMA channel #2 interrupt status bit */
798#define BBUS_DMA_INT_STS_CH2 0x00000004 /* BBus DMA channel #3 interrupt status bit */
799#define BBUS_DMA_INT_STS_CH3 0x00000008 /* BBus DMA channel #4 interrupt status bit */
800#define BBUS_DMA_INT_STS_CH4 0x00000010 /* BBus DMA channel #5 interrupt status bit */
801#define BBUS_DMA_INT_STS_CH5 0x00000020 /* BBus DMA channel #6 interrupt status bit */
802#define BBUS_DMA_INT_STS_CH6 0x00000040 /* BBus DMA channel #7 interrupt status bit */
803#define BBUS_DMA_INT_STS_CH7 0x00000080 /* BBus DMA channel #8 interrupt status bit */
804#define BBUS_DMA_INT_STS_CH8 0x00000100 /* BBus DMA channel #9 interrupt status bit */
805#define BBUS_DMA_INT_STS_CH9 0x00000200 /* BBus DMA channel #10 interrupt status bit */
806#define BBUS_DMA_INT_STS_CH10 0x00000400 /* BBus DMA channel #11 interrupt status bit */
807#define BBUS_DMA_INT_STS_CH11 0x00000800 /* BBus DMA channel #12 interrupt status bit */
808#define BBUS_DMA_INT_STS_CH12 0x00001000 /* BBus DMA channel #13 interrupt status bit */
809#define BBUS_DMA_INT_STS_CH13 0x00002000 /* BBus DMA channel #14 interrupt status bit */
810#define BBUS_DMA_INT_STS_CH14 0x00004000 /* BBus DMA channel #14 interrupt status bit */
811#define BBUS_DMA_INT_STS_CH15 0x00008000 /* BBus DMA channel #15 interrupt status bit */
812#define BBUS_DMA_INT_STS_CH16 0x00010000 /* BBus DMA channel #16 interrupt status bit */
813
814#define BBUS_DMA_INT_ENABLE_CH0 0x00000001 /* BBus DMA channel #1 interrupt enable bit */
815#define BBUS_DMA_INT_ENABLE_CH1 0x00000002 /* BBus DMA channel #2 interrupt enable bit */
816#define BBUS_DMA_INT_ENABLE_CH2 0x00000004 /* BBus DMA channel #3 interrupt enable bit */
817#define BBUS_DMA_INT_ENABLE_CH3 0x00000008 /* BBus DMA channel #4 interrupt enable bit */
818#define BBUS_DMA_INT_ENABLE_CH4 0x00000010 /* BBus DMA channel #5 interrupt enable bit */
819#define BBUS_DMA_INT_ENABLE_CH5 0x00000020 /* BBus DMA channel #6 interrupt enable bit */
820#define BBUS_DMA_INT_ENABLE_CH6 0x00000040 /* BBus DMA channel #7 interrupt enable bit */
821#define BBUS_DMA_INT_ENABLE_CH7 0x00000080 /* BBus DMA channel #8 interrupt enable bit */
822#define BBUS_DMA_INT_ENABLE_CH8 0x00000100 /* BBus DMA channel #9 interrupt enable bit */
823#define BBUS_DMA_INT_ENABLE_CH9 0x00000200 /* BBus DMA channel #10 interrupt enable bit */
824#define BBUS_DMA_INT_ENABLE_CH10 0x00000400 /* BBus DMA channel #11 interrupt enable bit */
825#define BBUS_DMA_INT_ENABLE_CH11 0x00000800 /* BBus DMA channel #12 interrupt enable bit */
826#define BBUS_DMA_INT_ENABLE_CH12 0x00001000 /* BBus DMA channel #13 interrupt enable bit */
827#define BBUS_DMA_INT_ENABLE_CH13 0x00002000 /* BBus DMA channel #14 interrupt enable bit */
828#define BBUS_DMA_INT_ENABLE_CH14 0x00004000 /* BBus DMA channel #14 interrupt enable bit */
829#define BBUS_DMA_INT_ENABLE_CH15 0x00008000 /* BBus DMA channel #15 interrupt enable bit */
830#define BBUS_DMA_INT_ENABLE_CH16 0x00010000 /* BBus DMA channel #16 interrupt enable bit */
831
832
833/*
834 * Ethernet Control ans Status Registers
835 */
836
837/* address */
838#define ETH_CONTROL_BASE 0xa0600000 /* Ethernet Control ans Status Registers Base Address */
839
840#define ETH_CONTROL_EGCR1 ((UW volatile *) (ETH_CONTROL_BASE + 0x000))
841#define ETH_CONTROL_EGCR2 ((UW volatile *) (ETH_CONTROL_BASE + 0x004))
842#define ETH_CONTROL_EGSR ((UW volatile *) (ETH_CONTROL_BASE + 0x008))
843#define ETH_CONTROL_ETSR ((UW volatile *) (ETH_CONTROL_BASE + 0x018))
844#define ETH_CONTROL_ERSR ((UW volatile *) (ETH_CONTROL_BASE + 0x01c))
845#define ETH_CONTROL_MAC1 ((UW volatile *) (ETH_CONTROL_BASE + 0x400))
846#define ETH_CONTROL_MAC2 ((UW volatile *) (ETH_CONTROL_BASE + 0x404))
847#define ETH_CONTROL_IPGT ((UW volatile *) (ETH_CONTROL_BASE + 0x408))
848#define ETH_CONTROL_IPGR ((UW volatile *) (ETH_CONTROL_BASE + 0x40c))
849#define ETH_CONTROL_CLRT ((UW volatile *) (ETH_CONTROL_BASE + 0x410))
850#define ETH_CONTROL_MAXF ((UW volatile *) (ETH_CONTROL_BASE + 0x414))
851#define ETH_CONTROL_SUPP ((UW volatile *) (ETH_CONTROL_BASE + 0x418))
852#define ETH_CONTROL_MCFG ((UW volatile *) (ETH_CONTROL_BASE + 0x420))
853#define ETH_CONTROL_MCMD ((UW volatile *) (ETH_CONTROL_BASE + 0x424))
854#define ETH_CONTROL_MADR ((UW volatile *) (ETH_CONTROL_BASE + 0x428))
855#define ETH_CONTROL_MWTD ((UW volatile *) (ETH_CONTROL_BASE + 0x42c))
856#define ETH_CONTROL_MRDD ((UW volatile *) (ETH_CONTROL_BASE + 0x430))
857#define ETH_CONTROL_MIND ((UW volatile *) (ETH_CONTROL_BASE + 0x434))
858#define ETH_CONTROL_SA1 ((UW volatile *) (ETH_CONTROL_BASE + 0x440))
859#define ETH_CONTROL_SA2 ((UW volatile *) (ETH_CONTROL_BASE + 0x444))
860#define ETH_CONTROL_SA3 ((UW volatile *) (ETH_CONTROL_BASE + 0x448))
861#define ETH_CONTROL_SAFR ((UW volatile *) (ETH_CONTROL_BASE + 0x500))
862#define ETH_CONTROL_HT1 ((UW volatile *) (ETH_CONTROL_BASE + 0x504))
863#define ETH_CONTROL_HT2 ((UW volatile *) (ETH_CONTROL_BASE + 0x508))
864#define ETH_CONTROL_STAT ((UW volatile *) (ETH_CONTROL_BASE + 0x680))
865#define ETH_CONTROL_RXAPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa00))
866#define ETH_CONTROL_RXBPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa04))
867#define ETH_CONTROL_RXCPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa08))
868#define ETH_CONTROL_RXDPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa0c))
869#define ETH_CONTROL_EINTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa10))
870#define ETH_CONTROL_EINTREN ((UW volatile *) (ETH_CONTROL_BASE + 0xa14))
871#define ETH_CONTROL_TXPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa18))
872#define ETH_CONTROL_TXRPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa1c))
873#define ETH_CONTROL_TXERBD ((UW volatile *) (ETH_CONTROL_BASE + 0xa20))
874#define ETH_CONTROL_TXSPTR ((UW volatile *) (ETH_CONTROL_BASE + 0xa24))
875#define ETH_CONTROL_RXAOFF ((UW volatile *) (ETH_CONTROL_BASE + 0xa28))
876#define ETH_CONTROL_RXBOFF ((UW volatile *) (ETH_CONTROL_BASE + 0xa2c))
877#define ETH_CONTROL_RXCOFF ((UW volatile *) (ETH_CONTROL_BASE + 0xa30))
878#define ETH_CONTROL_RXDOFF ((UW volatile *) (ETH_CONTROL_BASE + 0xa34))
879#define ETH_CONTROL_TXOFF ((UW volatile *) (ETH_CONTROL_BASE + 0xa38))
880#define ETH_CONTROL_RXFREE ((UW volatile *) (ETH_CONTROL_BASE + 0xa3c))
881#define ETH_CONTROL_TXBD ((UW volatile *) (ETH_CONTROL_BASE + 0x1000))
882
883
884/*
885 * 割込みハンドラのベクタ番号(割込み優å…
886ˆåº¦)
887 */
888/*#define INHNO_SIO INTLV_UART */
889#define INHNO_SIO2_RX 57
890#define INHNO_SIO2_TX 56
891#define INHNO_SIO_RX 59
892#define INHNO_SIO_TX 58
893#define INHNO_BBB 8
894#define INHNO_ETH_RX 5
895#define INHNO_ETH_TX 6
896#define INHNO_ETH_LINK 7
897#define INHNO_USB_HOST_D 25
898#define INHNO_USBDEV 26
899
900#ifndef _MACRO_ONLY
901
902/*
903 * カーネル起動時用の初期化(sys_putcを使用するため)
904 */
905extern void uart_init(ID siopid);
906
907/*
908 * シリアルI/Oポート初期化ブロック
909 */
910typedef struct sio_port_initialization_block {
911
912 VP pSraReg; /* SRA Reg Address */
913 VP pFifoReg; /* FIFO Reg Address */
914 VP pCraReg; /* CRA Reg Address */
915 VP pCrbReg; /* CRB Reg Address */
916 VP pRctReg; /* RCT Reg Address */
917 VP pRbtReg; /* RBT Reg Address */
918 VP pBrgReg; /* BRG Reg Address */
919 UW CraData; /* CRA Reg Set Data */
920 UW CrbData; /* CRB Reg Set Data */
921 UW RctData; /* RCT Reg Set Data */
922 UW RbtData; /* RBT Reg Set Data */
923 UW BrgData; /* BRG Reg Set Data */
924 UW BbbiTx; /* BBUS Bridge TX INT Control */
925 UW BbbiRx; /* BBUS Bridge RX INT Control */
926
927} SIOPINIB;
928
929/*
930 * シリアルI/Oポート管理ブロックの定義
931 */
932typedef struct sio_port_control_block {
933 const SIOPINIB *siopinib; /* シリアルI/Oポート初期化ブロック */
934 VP_INT exinf; /* 拡張情
935å ± */
936 BOOL openflag; /* オープン済みフラグ */
937 BOOL sendflag; /* 送信割込みイネーブルフラグ */
938 BOOL getready; /* 文字を受信した状æ…
939‹ */
940 BOOL putready; /* 文字を送信できる状æ…
941‹ */
942 UW rxfdb; /* rxbuf内
943の受信バイト数 */
944 UW rxbuf; /* 受信バッファ */
945 ID siopid;
946}SIOPCB;
947
948/*
949 * コールバックルーチンの識別番号
950 */
951#define SIO_ERDY_SND 1u /* 送信可能コールバック */
952#define SIO_ERDY_RCV 2u /* 受信通知コールバック */
953
954
955/*
956 * オンチップのUARTからのポーリング出力
957 */
958extern void uart_putc(char c);
959
960/*
961 * SIOドライバの初期化ルーチン
962 */
963extern void uart_initialize(void);
964
965
966/*
967 * オープンしているポートがあるか?
968 */
969extern BOOL uart_openflag(ID siopid);
970
971
972/*
973 * シリアルI/Oポートのオープン
974 */
975extern SIOPCB *uart_opn_por(ID siopid, VP_INT exinf);
976
977
978/*
979 * シリアルI/Oポートのクローズ
980 */
981extern void uart_cls_por(SIOPCB *siopcb);
982
983
984/*
985 * シリアルI/Oポートへの文字送信
986 */
987extern BOOL uart_snd_chr(SIOPCB *siopcb, char c);
988
989
990/*
991 * シリアルI/Oポートからの文字受信
992 */
993extern INT uart_rcv_chr(SIOPCB *siopcb);
994
995
996/*
997 * シリアルI/Oポートからのコールバックの許可
998 */
999extern void uart_ena_cbr(SIOPCB *siopcb, UINT cbrtn);
1000
1001
1002/*
1003 * シリアルI/Oポートからのコールバックの禁止
1004 */
1005extern void uart_dis_cbr(SIOPCB *siopcb, UINT cbrtn);
1006
1007
1008/*
1009 * SIOの割込みサービスルーチン
1010 */
1011extern void uart_isr(void);
1012
1013
1014/*
1015 * シリアルI/Oポートからの送信可能コールバック
1016 */
1017extern void uart_ierdy_snd(VP_INT exinf);
1018
1019/*
1020 * シリアルI/Oポートからの受信通知コールバック
1021 */
1022extern void uart_ierdy_rcv(VP_INT exinf);
1023
1024/*
1025 * SIOの割込み許可ルーチン
1026 */
1027extern void uart_TxRx_Enable(ID siopid);
1028
1029/*
1030 * SIOの割込み禁止ルーチン
1031 */
1032extern void uart_TxRx_Disable(ID siopid);
1033
1034/*
1035 * 現在のシリアルポートの取得
1036 */
1037extern ID uart_get_id(SIOPCB *siopcb);
1038
1039#endif /* _MACRO_ONLY */
1040
1041
1042
1043/*
1044 * キャッシュ関連
1045 */
1046#ifndef _MACRO_ONLY
1047
1048#define CACHE_TAG_RAM 0x11000000 /* W */
1049
1050Inline void
1051cache_on(void)
1052{
1053
1054}
1055
1056
1057Inline void
1058cache_off(void)
1059{
1060
1061}
1062
1063
1064Inline void
1065cache_purge(void)
1066{
1067
1068}
1069
1070
1071#endif /* _MACRO_ONLY */
1072#endif /* _NS9360_H_ */
Note: See TracBrowser for help on using the repository browser.