use the -newos toolchain even if -elf is present.
[newos.git] / include / arch / arm / omap.h
blob5eb678494030d131ed8dcbed3ab6913874a646f4
1 #ifndef __OMAP_H
2 #define __OMAP_H
4 #include <newos/types.h>
6 #define REG(r) ((vulong *)(r))
7 #define REG_H(r) ((vushort *)(r))
8 #define REG_B(r) ((vuchar *)(r))
10 #define W_REG(r,v) (*(vuint *)(r) = (uint)(v))
11 #define R_REG(r) (*(vuint *)(r))
13 #define W_REG_H(r,v) (*(vushort *)(r) = (ushort)(v))
14 #define R_REG_H(r) (*(vushort *)(r))
16 #define W_REG_B(r,v) (*(vuchar *)(r) = (uchar)(v))
17 #define R_REG_B(r) (*(vuchar *)(r))
19 #define RMW_REG(r,v,m) W_REG(r, (R_REG(r) & ~(m)) | (v))
20 #define RMW_REG_H(r,v,m) W_REG_H(r, (R_REG_H(r) & ~(m)) | (v))
21 #define RMW_REG_B(r,v,m) W_REG_B(r, (R_REG_B(r) & ~(m)) | (v))
23 /* OMAP 161x Regs */
25 #define ARM_CKCTL 0xFFFECE00
26 #define EN_DSPCK ((uint16)0x2000)
27 #define ARM_TIMXO_CK_GEN1 ((uint16)0x1000)
28 #define DSPMMUDIV_MASK ((uint16)0x0C00)
29 #define TC_CK_DIV_MASK ((uint16)0x0300)
30 #define DSP_DIV_MASK ((uint16)0x00C0)
31 #define ARM_DIV_MASK ((uint16)0x0030)
32 #define LCD_DIV_MASK ((uint16)0x000C)
33 #define PERIPH_DIV_MASK ((uint16)0x0003)
35 #define ARM_IDLECT1 0xFFFECE04
36 #define IDLE_CLKOUT_ARM ((uint16)0x1000)
37 #define WKUP_MODE_ANY ((uint16)0x0400)
38 #define IDLE_STOP_TIMER ((uint16)0x0200)
39 #define IDLE_API_ARM ((uint16)0x0100)
40 #define IDLE_DPLL_ARM ((uint16)0x0080)
41 #define IDLE_IF_ARM ((uint16)0x0040)
42 #define IDLE_PER_ARM ((uint16)0x0004)
43 #define IDLE_OS_CLK_ARM ((uint16)0x0002)
44 #define IDLE_WTD_ARM
46 #define ARM_IDLECT2 0xFFFECE08
47 #define EN_CLKOUT_ARM ((uint16)0x0800)
48 #define DMA_CLK_REQ ((uint16)0x0100)
49 #define EN_TIMER_CLK ((uint16)0x0080)
50 #define EN_API_CLK ((uint16)0x0040)
51 #define EN_LCD_CLK ((uint16)0x0008)
52 #define EN_PERIPH_CLK ((uint16)0x0004)
53 #define EN_OS_CLK ((uint16)0x0002)
54 #define EN_WDT_CLK ((uint16)0x0001)
56 #define ARM_IDLECT3 0xFFFECE24
57 #define IDLTC2_ARM ((uint16)0x0020)
58 #define EN_TC2_CLK ((uint16)0x0010)
59 #define IDLTC1_ARM ((uint16)0x0008)
60 #define EN_TC1_CLK ((uint16)0x0004)
61 #define IDLOCPI_ARM ((uint16)0x0002)
62 #define EN_OCPI_CLK ((uint16)0x0001)
64 #define ARM_EWUPCT 0xFFFECE0C
65 #define EN_EXT_PWR_CTRL ((uint16)0x0020)
66 #define EXT_PWR_DELAY_MASK ((uint16)0x001F)
68 #define ARM_RSTCT1 0xFFFECE10
69 #define SW_RESET ((uint16)0x0008)
70 #define DSP_RESET ((uint16)0x0004)
71 #define DSP_EN ((uint16)0x0002)
72 #define ARM_RESET ((uint16)0x0001)
74 #define ARM_RSTCT2 0xFFFECE14
75 #define PERIPH_EN ((uint16)0x0001)
77 #define ARM_SYSST 0xFFFECE18
78 // CLOCK_SELECT Bits (13:11) of ARM_SYSST
79 #define ARM_CLOCK_SCHEME_MASK ((uint16)0x3800
80 #define ARM_CLOCK_SCHEME_FULLY ((uint16)0x0000 // fully synchronous
81 #define ARM_CLOCK_SCHEME_SCALABLE ((uint16)0x1000 // synchronous scalable
82 #define ARM_CLOCK_SCHEME_BYPASS ((uint16)0x2800 // bypass mode
83 #define ARM_CLOCK_SCHEME_MIX_3 ((uint16)0x3000 // mix mode #3
84 #define ARM_CLOCK_SCHEME_MIX_4 ((uint16)0x3800 // mix mode #4
86 #define ARM_CKOUT1 0xFFFECE1C
87 #define ARM_CKOUT2 0xFFFECE20
88 #define MPUI_CTRL 0xFFFEC900
90 /* clock control */
91 #define ARM_DPLL1_CTL_REG 0xFFFECF00
92 #define ARM_CLK_SYNCHRONOUS_48MHz ((uint16)0x2213)
93 #define ARM_CLK_SYNCHRONOUS_60MHz ((uint16)0x2293)
94 #define ARM_CLK_SYNCHRONOUS_72MHz ((uint16)0x2313)
95 #define ARM_CLK_SYNCHRONOUS_84MHz ((uint16)0x2393)
96 #define ARM_CLK_SYNCHRONOUS_120MHz ((uint16)0x2513)
97 #define ARM_CLK_SYNCHRONOUS_192MHz ((uint16)0x2813)
99 #define CLOCK_CTRL_REG 0xFFFE0830
100 #define ARM_SW_CLOCK_REQUEST 0xFFFE0834
101 #define ARM_STATUS_REQ_REG 0xFFFE0840
102 #define ULPD_PLL_CTRL_STATUS 0xFFFE084C
103 #define ARM_SW_CLOCK_DISABLE 0xFFFE0868
104 #define USB_CLOCK_ENABLE ((uint16)0x0008)
105 #define BT_MCLK_ENABLE ((uint16)0x0004)
106 #define COM_MCLK_ENABLE ((uint16)0x0002)
107 #define PLL_48MHZ_ENABLE ((uint16)0x0001)
108 #define USB_48MHZ_ENABLE ((uint16)0x0100)
109 #define UART1_48MHZ_ENABLE ((uint16)0x0200)
110 #define UART2_48MHZ_ENABLE ((uint16)0x0400)
111 #define UART3_48MHZ_ENABLE ((uint16)0x0800)
112 #define MMC_48MHZ_ENABLE ((uint16)0x1000)
113 #define MMC2_48MHZ_ENABLE ((uint16)0x2000)
114 #define ARM_POWER_CTRL_REG 0xFFFE0850
116 /* EMIFF */
117 #define EMIFF_PRIOR 0xFFFECC08
118 #define EMIFF_CONFIG 0xFFFECC20
119 #define EMIFF_MRS 0xFFFECC24
120 #define EMIFF_CONFIG2 0xFFFECC3C
121 #define EMIFF_DLL_WRD_CTRL 0xFFFECC64
122 #define EMIFF_DLL_WRD_STAT 0xFFFECC68
123 #define EMIFF_MRS_NEW 0xFFFECC70
124 #define EMIFF_EMRS0 0xFFFECC74
125 #define EMIFF_EMRS1 0xFFFECC78
126 #define EMIFF_OP 0xFFFECC80
127 #define EMIFF_CMD 0xFFFECC84
128 #define EMIFF_PTOR1 0xFFFECC8C
129 #define EMIFF_PTOR2 0xFFFECC90
130 #define EMIFF_PTOR3 0xFFFECC94
131 #define EMIFF_AADDR 0xFFFECC98
132 #define EMIFF_ATYPER 0xFFFECC9C
133 #define EMIFF_DLL_LRD_STAT 0xFFFECCBC
134 #define EMIFF_DLL_URD_CTRL 0xFFFECCC0
135 #define EMIFF_DLL_URD_STAT 0xFFFECCC4
136 #define EMIFF_EMRS2 0xFFFECCC8
137 #define EMIFF_DLL_LRD_CTRL 0xFFFECCCC
139 /* mux control */
140 #define FUNC_MUX_CTRL_0 0xFFFE1000
141 #define FUNC_MUX_CTRL_1 0xFFFE1004
142 #define FUNC_MUX_CTRL_2 0xFFFE1008
143 #define COMP_MODE_CTRL_0 0xFFFE100C
144 #define FUNC_MUX_CTRL_3 0xFFFE1010
145 #define FUNC_MUX_CTRL_4 0xFFFE1014
146 #define FUNC_MUX_CTRL_5 0xFFFE1018
147 #define FUNC_MUX_CTRL_6 0xFFFE101C
148 #define FUNC_MUX_CTRL_7 0xFFFE1020
149 #define FUNC_MUX_CTRL_8 0xFFFE1024
150 #define FUNC_MUX_CTRL_9 0xFFFE1028
151 #define FUNC_MUX_CTRL_A 0xFFFE102C
152 #define FUNC_MUX_CTRL_B 0xFFFE1030
153 #define FUNC_MUX_CTRL_C 0xFFFE1034
154 #define FUNC_MUX_CTRL_D 0xFFFE1038
155 #define PULL_DWN_CTRL_0 0xFFFE1040
156 #define PULL_DWN_CTRL_1 0xFFFE1044
157 #define PULL_DWN_CTRL_2 0xFFFE1048
158 #define PULL_DWN_CTRL_3 0xFFFE104C
159 #define GATE_INH_CTRL_0 0xFFFE1050
160 #define CONF_REV 0xFFFE1058
161 #define VOLTAGE_CTRL_0 0xFFFE1060
162 #define USB_TRANSCEIVER_CTRL 0xFFFE1064
163 #define LDO_PWRDN_CTRL 0xFFFE1068
164 #define TEST_DBG_CTRL_0 0xFFFE1070
165 #define MOD_CONF_CTRL_0 0xFFFE1080
166 #define FUNC_MUX_CTRL_E 0xFFFE1090
167 #define FUNC_MUX_CTRL_F 0xFFFE1094
168 #define FUNC_MUX_CTRL_10 0xFFFE1098
169 #define FUNC_MUX_CTRL_11 0xFFFE109C
170 #define FUNC_MUX_CTRL_12 0xFFFE10A0
171 #define PULL_DWN_CTRL_4 0xFFFE10AC
172 #define PU_PD_SEL_0 0xFFFE10B4
173 #define PU_PD_SEL_1 0xFFFE10B8
174 #define PU_PD_SEL_2 0xFFFE10BC
175 #define PU_PD_SEL_3 0xFFFE10C0
176 #define PU_PD_SEL_4 0xFFFE10C4
177 #define MOD_CONF_CTRL_1 0xFFFE1110
178 #define SECCTRL 0xFFFE1120
179 #define CONF_STATUS 0xFFFE1130
180 #define RESET_CONTROL 0xFFFE1140
181 #define CONF_1611_CTRL 0xFFFE1150
183 /* OMAP Device ID Regs */
184 #define OMAP_DIE_ID_0 0xFFFE1800
185 #define OMAP_DIE_ID_1 0xFFFE1804
186 #define OMAP_PRODUCTION_ID_0 0xFFFE2000
187 #define OMAP_PRODUCTION_ID_1 0xFFFE2004
188 #define OMAP32_ID 0xFFFED400
190 /* Interrupt Controller Regs */
191 #define ITR1 0xFFFECB00
192 #define MIR1 0xFFFECB04
193 #define SIR_IRQ_CODE1 0xFFFECB10
194 #define SIR_FIQ_CODE1 0xFFFECB14
195 #define CONTROL_REG1 0xFFFECB18
196 #define ILR1_BASE 0xFFFECB1C
197 #define SISR1 0xFFFECB9C
198 #define GMR1 0xFFFECBA0
200 #define ITR2 0xFFFE0000
201 #define MIR2 0xFFFE0004
202 #define SIR_IRQ_CODE2 0xFFFE0010
203 #define SIR_FIQ_CODE2 0xFFFE0014
204 #define CONTROL_REG2 0xFFFE0018
205 #define ILR2_BASE 0xFFFE001C
206 #define SISR2 0xFFFE009C
207 #define STATUS2 0xFFFE00A0
208 #define OCP_CFG2 0xFFFE00A0
209 #define INTH_REV2 0xFFFE00A0
211 /* DSP */
212 #define DSP_CKCTL 0xE1008000
213 #define DSP_IDLECT1 0xE1008004
214 #define DSP_IDLECT2 0xE1008008
216 /* USB Client */
217 /* all regs 16-bits wide */
218 #define USBC_REV 0xFFFB4000
219 #define USBC_EP_NUM 0xFFFB4004
220 #define USBC_DATA 0xFFFB4008
221 #define USBC_CTRL 0xFFFB400C
222 #define USBC_STAT_FLG 0xFFFB4010
223 #define USBC_RXFSTAT 0xFFFB4014
224 #define USBC_SYSCON1 0xFFFB4018
225 #define USBC_SYSCON2 0xFFFB401C
226 #define USBC_DEVSTAT 0xFFFB4020
227 #define USBC_SOF 0xFFFB4024
228 #define USBC_IRQ_EN 0xFFFB4028
229 #define USBC_DMA_IRQ_EN 0xFFFB402C
230 #define USBC_IRQ_SRC 0xFFFB4030
231 #define USBC_EPN_STAT 0xFFFB4034
232 #define USBC_DMAN_STAT 0xFFFB4038
233 #define USBC_RXDMA_CFG 0xFFFB4040
234 #define USBC_TXDMA_CFG 0xFFFB4044
235 #define USBC_DATA_DMA 0xFFFB4048
236 #define USBC_TXDMA0 0xFFFB4050
237 #define USBC_TXDMA1 0xFFFB4054
238 #define USBC_TXDMA2 0xFFFB4058
239 #define USBC_RXDMA0 0xFFFB4060
240 #define USBC_RXDMA1 0xFFFB4064
241 #define USBC_RXDMA2 0xFFFB4068
242 #define USBC_EP0 0xFFFB4080
243 #define USBC_EPn_RX_BASE 0xFFFB4080
244 #define USBC_EPn_TX_BASE 0xFFFB40C0
246 /* USB OTG */
247 #define OTG_REV 0xFFFB0400
248 #define OTG_SYSCON_1 0xFFFB0404
249 #define OTG_SYSCON_2 0xFFFB0408
250 #define OTG_CTRL 0xFFFB040C
251 #define OTG_IRQ_EN 0xFFFB0410
252 #define OTG_IRQ_SRC 0xFFFB0414
253 #define OTG_OUTCTRL 0xFFFB0418
254 #define OTG_TEST 0xFFFB0420
256 /* I2C */
257 #define I2C_REV 0xFFFB3800
258 #define I2C_IE 0xFFFB3804
259 #define I2C_STAT 0xFFFB3808
260 #define I2C_SYSS 0xFFFB3810
261 #define I2C_BUF 0xFFFB3814
262 #define I2C_CNT 0xFFFB3818
263 #define I2C_DATA 0xFFFB381C
264 #define I2C_SYSC 0xFFFB3820
265 #define I2C_CON 0xFFFB3824
266 #define I2C_OA 0xFFFB3828
267 #define I2C_SA 0xFFFB382C
268 #define I2C_PSC 0xFFFB3830
269 #define I2C_SCLL 0xFFFB3834
270 #define I2C_SCLH 0xFFFB3838
271 #define I2C_SYSTEST 0xFFFB383C
273 #endif