summaryrefslogtreecommitdiff
path: root/include/ns9750_sys.h
blob: c563cada09e4db240bd1d78b10f0802177864f4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/***********************************************************************
 *
 * Copyright (C) 2004 by FS Forth-Systeme GmbH.
 * All rights reserved.
 *
 * $Id: ns9750_sys.h,v 1.1 2004/02/16 10:37:20 mpietrek Exp $
 * @Author: Markus Pietrek
 * @Descr: Definitions for SYS Control Module
 * @References: [1] NS9750 Hardware Reference Manual/December 2003 Chap. 4
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 *
 ***********************************************************************/

#ifndef FS_NS9750_SYS_H
#define FS_NS9750_SYS_H

#define NS9750_SYS_MODULE_BASE		(0xA0900000)

#define get_sys_reg_addr(c) \
	((volatile unsigned int *)(NS9750_SYS_MODULE_BASE+(unsigned int) (c)))

/* the register addresses */

#define NS9750_SYS_AHB_GEN		(0x0000)
#define NS9750_SYS_BRC_BASE		(0x0004)
#define NS9750_SYS_AHB_TIMEOUT		(0x0014)
#define NS9750_SYS_AHB_ERROR1   	(0x0018)
#define NS9750_SYS_AHB_ERROR2   	(0x001C)
#define NS9750_SYS_AHB_MON    		(0x0020)
#define NS9750_SYS_TIMER_COUNT_BASE	(0x0044)
#define NS9750_SYS_TIMER_READ_BASE	(0x0084)
#define NS9750_SYS_INT_VEC_ADR_BASE	(0x00C4)
#define NS9750_SYS_INT_CFG_BASE		(0x0144)
#define NS9750_SYS_ISRADDR		(0x0164)
#define NS9750_SYS_INT_STAT_ACTIVE	(0x0168)
#define NS9750_SYS_INT_STAT_RAW		(0x016C)
#define NS9750_SYS_TIMER_INT_STAT	(0x0170)
#define NS9750_SYS_SW_WDOG_CFG		(0x0174)
#define NS9750_SYS_SW_WDOG_TIMER	(0x0178)
#define NS9750_SYS_CLOCK		(0x017C)
#define NS9750_SYS_RESET		(0x0180)
#define NS9750_SYS_MISC			(0x0184)
#define NS9750_SYS_PLL			(0x0188)
#define NS9750_SYS_ACT_INT_STAT		(0x018C)
#define NS9750_SYS_TIMER_CTRL_BASE	(0x0190)
#define NS9750_SYS_CS_DYN_BASE_BASE	(0x01D0)
#define NS9750_SYS_CS_DYN_MASK_BASE	(0x01D4)
#define NS9750_SYS_CS_STATIC_BASE_BASE	(0x01F0)
#define NS9750_SYS_CS_STATIC_MASK_BASE	(0x01F4)
#define NS9750_SYS_GEN_ID		(0x0210)
#define NS9750_SYS_EXT_INT_CTRL_BASE	(0x0214)

/* the vectored register addresses */

#define NS9750_SYS_TIMER_COUNT(c)	(NS9750_SYS_TIMER_COUNT_BASE + (c))
#define NS9750_SYS_TIMER_READ(c)	(NS9750_SYS_TIMER_READ_BASE + (c))
#define NS9750_SYS_INT_VEC_ADR(c)	(NS9750_SYS_INT_VEC_ADR_BASE + (c))
#define NS9750_SYS_TIMER_CTRL(c)	(NS9750_SYS_TIMER_CTRL_BASE + (c))
/* CS_DYN start with 4 */
#define NS9750_SYS_CS_DYN_BASE(c)	(NS9750_SYS_CS_DYN_BASE_BASE + ((c)-4)*2)
#define NS9750_SYS_CS_DYN_MASK(c)	(NS9750_SYS_CS_DYN_MASK_BASE + ((c)-4)*2)
/* CS_STATIC start with 0 */
#define NS9750_SYS_CS_STATIC_BASE(c)	(NS9750_SYS_CS_STATIC_BASE_BASE + (c)*2)
#define NS9750_SYS_CS_STATIC_MASK(c)	(NS9750_SYS_CS_STATIC_MASK_BASE + (c)*2)
#define NS9750_SYS_EXT_INT_CTRL(c)	(NS9750_SYS_EXT_INT_CTRL + (c))

/* register bit fields */

#define NS9750_SYS_AHB_GEN_EXMAM	(0x00000001)

/* need to be n*8bit to BRC channel */
#define NS9750_SYS_BRC_CEB		(0x00000080)
#define NS9750_SYS_BRC_BRF_MA		(0x00000030)
#define NS9750_SYS_BRC_BRF_100		(0x00000000)
#define NS9750_SYS_BRC_BRF_75		(0x00000010)
#define NS9750_SYS_BRC_BRF_50		(0x00000020)
#define NS9750_SYS_BRC_BRF_25		(0x00000030)

#define NS9750_SYS_AHB_TIMEOUT_BAT_MA	(0xFFFF0000)
#define NS9750_SYS_AHB_TIMEOUT_BMT_MA	(0x0000FFFF)

#define NS9750_SYS_AHB_ERROR2_ABL	(0x00040000)
#define NS9750_SYS_AHB_ERROR2_AER	(0x00020000)
#define NS9750_SYS_AHB_ERROR2_ABM	(0x00010000)
#define NS9750_SYS_AHB_ERROR2_ABA	(0x00008000)
#define NS9750_SYS_AHB_ERROR2_HWRT	(0x00004000)
#define NS9750_SYS_AHB_ERROR2_HMID_MA	(0x00003C00)
#define NS9750_SYS_AHB_ERROR2_HTPC_MA	(0x000003C0)
#define NS9750_SYS_AHB_ERROR2_HSZ_MA	(0x00000038)
#define NS9750_SYS_AHB_ERROR2_RR_MA	(0x00000007)

#define NS9750_SYS_AHB_MON_EIC		(0x00800000)
#define NS9750_SYS_AHB_MON_MBII		(0x00400000)
#define NS9750_SYS_AHB_MON_MBL_MA	(0x003FFFC0)
#define NS9750_SYS_AHB_MON_MBLDC	(0x00000020)
#define NS9750_SYS_AHB_MON_SERDC	(0x00000010)
#define NS9750_SYS_AHB_MON_BMTC_MA	(0x0000000C)
#define NS9750_SYS_AHB_MON_BMTC_RECORD	(0x00000000)
#define NS9750_SYS_AHB_MON_BMTC_GEN_IRQ	(0x00000004)
#define NS9750_SYS_AHB_MON_BMTC_GEN_RES	(0x00000008)
#define NS9750_SYS_AHB_MON_BATC_MA	(0x00000003)
#define NS9750_SYS_AHB_MON_BATC_RECORD	(0x00000000)
#define NS9750_SYS_AHB_MON_BATC_GEN_IRQ	(0x00000001)
#define NS9750_SYS_AHB_MON_BATC_GEN_RES	(0x00000002)

/* need to be n*8bit to Int Level */

#define NS9750_SYS_INT_CFG_IE		(0x00000080)
#define NS9750_SYS_INT_CFG_IT    	(0x00000020)
#define NS9750_SYS_INT_CFG_IAD_MA	(0x0000001F)

#define NS9750_SYS_TIMER_INT_STAT_MA 	(0x0000FFFF)

#define NS9750_SYS_SW_WDOG_CFG_SWWE	(0x00000080)
#define NS9750_SYS_SW_WDOG_CFG_SWWI	(0x00000020)
#define NS9750_SYS_SW_WDOG_CFG_SWWIC	(0x00000010)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_MA	(0x00000007)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_2 	(0x00000000)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_4 	(0x00000001)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_8 	(0x00000002)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_16	(0x00000003)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_32	(0x00000004)
#define NS9750_SYS_SW_WDOG_CFG_SWTCS_64	(0x00000005)

#define NS9750_SYS_CLOCK_LPCS_MA	(0x00000380)
#define NS9750_SYS_CLOCK_LPCS_1 	(0x00000000)
#define NS9750_SYS_CLOCK_LPCS_2 	(0x00000080)
#define NS9750_SYS_CLOCK_LPCS_4 	(0x00000100)
#define NS9750_SYS_CLOCK_LPCS_8 	(0x00000180)
#define NS9750_SYS_CLOCK_LPCS_EXT	(0x00000200)
#define NS9750_SYS_CLOCK_BBC		(0x00000040)
#define NS9750_SYS_CLOCK_LCC		(0x00000020)
#define NS9750_SYS_CLOCK_MCC		(0x00000010)
#define NS9750_SYS_CLOCK_PARBC		(0x00000008)
#define NS9750_SYS_CLOCK_PC		(0x00000004)
#define NS9750_SYS_CLOCK_MACC		(0x00000001)

#define NS9750_SYS_RESET_SR		(0x80000000)
#define NS9750_SYS_RESET_I2CW		(0x00100000)
#define NS9750_SYS_RESET_CSE		(0x00080000)
#define NS9750_SYS_RESET_SMWE		(0x00040000)
#define NS9750_SYS_RESET_EWE		(0x00020000)
#define NS9750_SYS_RESET_PI3WE		(0x00010000)
#define NS9750_SYS_RESET_BBT		(0x00000040)
#define NS9750_SYS_RESET_LCDC		(0x00000020)
#define NS9750_SYS_RESET_MEMC		(0x00000010)
#define NS9750_SYS_RESET_PCIAR		(0x00000008)
#define NS9750_SYS_RESET_PCIM		(0x00000004)
#define NS9750_SYS_RESET_MACM		(0x00000001)

#define NS9750_SYS_MISC_REV_MA		(0xFF000000)
#define NS9750_SYS_MISC_PCIA		(0x00002000)
#define NS9750_SYS_MISC_VDIS		(0x00001000)
#define NS9750_SYS_MISC_BMM		(0x00000800)
#define NS9750_SYS_MISC_CS1DB		(0x00000400)
#define NS9750_SYS_MISC_CS1DW_MA	(0x00000300)
#define NS9750_SYS_MISC_MCCM		(0x00000080)
#define NS9750_SYS_MISC_PMSS		(0x00000040)
#define NS9750_SYS_MISC_CS1P		(0x00000020)
#define NS9750_SYS_MISC_ENDM		(0x00000008)
#define NS9750_SYS_MISC_MBAR		(0x00000004)
#define NS9750_SYS_MISC_IRAM0		(0x00000001)

#define NS9750_SYS_PLL_PLLBS		(0x02000000)
#define NS9750_SYS_PLL_PLLFS_MA		(0x01800000)
#define NS9750_SYS_PLL_PLLIS_MA		(0x00600000)
#define NS9750_SYS_PLL_PLLND_MA		(0x001F0000)
#define NS9750_SYS_PLL_PLLSW		(0x00008000)
#define NS9750_SYS_PLL_PLLBSSW		(0x00000200)
#define NS9750_SYS_PLL_FSEL_MA		(0x00000180)
#define NS9750_SYS_PLL_CPCC_MA		(0x00000060)
#define NS9750_SYS_PLL_NDSW_MA		(0x0000001F)

#define NS9750_SYS_ACT_INT_STAT_MA 	(0x0000FFFF)

#define NS9750_SYS_TIMER_CTRL_TEN	(0x00008000)
#define NS9750_SYS_TIMER_CTRL_INTC	(0x00000200)
#define NS9750_SYS_TIMER_CTRL_TLCS_MA	(0x000001C0)
#define NS9750_SYS_TIMER_CTRL_TLCS_1 	(0x00000000)
#define NS9750_SYS_TIMER_CTRL_TLCS_2 	(0x00000040)
#define NS9750_SYS_TIMER_CTRL_TLCS_4 	(0x00000080)
#define NS9750_SYS_TIMER_CTRL_TLCS_8 	(0x000000C0)
#define NS9750_SYS_TIMER_CTRL_TLCS_16	(0x00000100)
#define NS9750_SYS_TIMER_CTRL_TLCS_32	(0x00000140)
#define NS9750_SYS_TIMER_CTRL_TLCS_64	(0x00000180)
#define NS9750_SYS_TIMER_CTRL_TLCS_EXT	(0x000001C0)
#define NS9750_SYS_TIMER_CTRL_TM_MA	(0x00000030)
#define NS9750_SYS_TIMER_CTRL_TM_INT  	(0x00000000)
#define NS9750_SYS_TIMER_CTRL_TM_LOW 	(0x00000010)
#define NS9750_SYS_TIMER_CTRL_TM_HIGH	(0x00000020)
#define NS9750_SYS_TIMER_CTRL_INTS	(0x00000008)
#define NS9750_SYS_TIMER_CTRL_UDS	(0x00000004)
#define NS9750_SYS_TIMER_CTRL_TSZ	(0x00000002)
#define NS9750_SYS_TIMER_CTRL_REN	(0x00000001)

#define NS9750_SYS_EXT_INT_CTRL_STS	(0x00000008)
#define NS9750_SYS_EXT_INT_CTRL_CLR	(0x00000004)
#define NS9750_SYS_EXT_INT_CTRL_PLTY	(0x00000002)
#define NS9750_SYS_EXT_INT_CTRL_LVEDG	(0x00000001)

#endif /* FS_NS9750_SYS_H */