This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / include / asm-arm / arch-omap / hardware.h
1 /*
2  * linux/include/asm-arm/arch-omap/hardware.h
3  *
4  * Hardware definitions for TI OMAP processors and boards
5  *
6  * NOTE: Please put device driver specific defines into a separate header
7  *       file for each driver.
8  *
9  * Copyright (C) 2001 RidgeRun, Inc.
10  * Author: RidgeRun, Inc. Greg Lonnon <glonnon@ridgerun.com>
11  *
12  * Reorganized for Linux-2.6 by Tony Lindgren <tony@atomide.com>
13  *
14  * This program is free software; you can redistribute it and/or modify it
15  * under the terms of the GNU General Public License as published by the
16  * Free Software Foundation; either version 2 of the License, or (at your
17  * option) any later version.
18  *
19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22  * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
25  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * You should have received a copy of the GNU General Public License along
31  * with this program; if not, write to the Free Software Foundation, Inc.,
32  * 675 Mass Ave, Cambridge, MA 02139, USA.
33  */
34
35 #ifndef __ASM_ARCH_OMAP_HARDWARE_H
36 #define __ASM_ARCH_OMAP_HARDWARE_H
37
38 #include <asm/sizes.h>
39 #include <linux/config.h>
40 #ifndef __ASSEMBLER__
41 #include <asm/types.h>
42 #endif
43
44 /*
45  * ----------------------------------------------------------------------------
46  * I/O mapping
47  * ----------------------------------------------------------------------------
48  */
49 #define IO_PHYS                 0xFFFB0000
50 #define IO_OFFSET               0x01000000      /* Virtual IO = 0xfefb0000 */
51 #define IO_VIRT                 (IO_PHYS - IO_OFFSET)
52 #define IO_SIZE                 0x40000
53 #define IO_ADDRESS(x)           ((x) - IO_OFFSET)
54
55 #define PCIO_BASE               0
56
57 #define io_p2v(x)               ((x) - IO_OFFSET)
58 #define io_v2p(x)               ((x) + IO_OFFSET)
59
60 #ifndef __ASSEMBLER__
61
62 /* 16 bit uses LDRH/STRH, base +/- offset_8 */
63 typedef struct { volatile u16 offset[256]; } __regbase16;
64 #define __REGV16(vaddr)         ((__regbase16 *)((vaddr)&~0xff)) \
65                                         ->offset[((vaddr)&0xff)>>1]
66 #define __REG16(paddr)          __REGV16(io_p2v(paddr))
67
68 /* 8/32 bit uses LDR/STR, base +/- offset_12 */
69 typedef struct { volatile u8 offset[4096]; } __regbase8;
70 #define __REGV8(vaddr)          ((__regbase8  *)((paddr)&~4095)) \
71                                         ->offset[((paddr)&4095)>>0]
72 #define __REG8(paddr)           __REGV8(io_p2v(paddr))
73
74 typedef struct { volatile u32 offset[4096]; } __regbase32;
75 #define __REGV32(vaddr)         ((__regbase32 *)((vaddr)&~4095)) \
76                                         ->offset[((vaddr)&4095)>>2]
77 #define __REG32(paddr)          __REGV32(io_p2v(paddr))
78
79 #else
80
81 #define __REG8(paddr)           io_p2v(paddr)
82 #define __REG16(paddr)          io_p2v(paddr)
83 #define __REG32(paddr)          io_p2v(paddr)
84
85 #endif
86
87 /*
88  * ---------------------------------------------------------------------------
89  * Common definitions for all OMAP processors
90  * NOTE: Put all processor or board specific parts to the special header
91  *       files.
92  * ---------------------------------------------------------------------------
93  */
94
95 /*
96  * ----------------------------------------------------------------------------
97  * Clocks
98  * ----------------------------------------------------------------------------
99  */
100 #define CLKGEN_RESET_BASE       (0xfffece00)
101 #define ARM_CKCTL               (CLKGEN_RESET_BASE + 0x0)
102 #define ARM_IDLECT1             (CLKGEN_RESET_BASE + 0x4)
103 #define ARM_IDLECT2             (CLKGEN_RESET_BASE + 0x8)
104 #define ARM_EWUPCT              (CLKGEN_RESET_BASE + 0xC)
105 #define ARM_RSTCT1              (CLKGEN_RESET_BASE + 0x10)
106 #define ARM_RSTCT2              (CLKGEN_RESET_BASE + 0x14)
107 #define ARM_SYSST               (CLKGEN_RESET_BASE + 0x18)
108
109 #define CK_RATEF                1
110 #define CK_IDLEF                2
111 #define CK_ENABLEF              4
112 #define CK_SELECTF              8
113 #define SETARM_IDLE_SHIFT
114
115 /* DPLL control registers */
116 #define DPLL_CTL_REG            (0xfffecf00)
117 #define CK_DPLL1                (0xfffecf00)
118
119 /* ULPD */
120 #define ULPD_REG_BASE           (0xfffe0800)
121 #define ULPD_IT_STATUS_REG      (ULPD_REG_BASE + 0x14)
122 #define ULPD_CLOCK_CTRL_REG     (ULPD_REG_BASE + 0x30)
123 #define ULPD_SOFT_REQ_REG       (ULPD_REG_BASE + 0x34)
124 #define ULPD_DPLL_CTRL_REG      (ULPD_REG_BASE + 0x3c)
125 #define ULPD_STATUS_REQ_REG     (ULPD_REG_BASE + 0x40)
126 #define ULPD_APLL_CTRL_REG      (ULPD_REG_BASE + 0x4c)
127 #define ULPD_POWER_CTRL_REG     (ULPD_REG_BASE + 0x50)
128 #define ULPD_CAM_CLK_CTRL_REG   (ULPD_REG_BASE + 0x7c)
129
130 /*
131  * ---------------------------------------------------------------------------
132  * Timers
133  * ---------------------------------------------------------------------------
134  */
135 #define OMAP_32kHz_TIMER_BASE 0xfffb9000
136
137 /* 32k Timer Registers */
138 #define TIMER32k_CR             0x08
139 #define TIMER32k_TVR            0x00
140 #define TIMER32k_TCR            0x04
141
142 /* 32k Timer Control Register definition */
143 #define TIMER32k_TSS            (1<<0)
144 #define TIMER32k_TRB            (1<<1)
145 #define TIMER32k_INT            (1<<2)
146 #define TIMER32k_ARL            (1<<3)
147
148 /* MPU Timer base addresses */
149 #define OMAP_MPUTIMER_BASE      0xfffec500
150 #define OMAP_MPUTIMER_OFF       0x00000100
151
152 #define OMAP_TIMER1_BASE        0xfffec500
153 #define OMAP_TIMER2_BASE        0xfffec600
154 #define OMAP_TIMER3_BASE        0xfffec700
155 #define OMAP_WATCHDOG_BASE      0xfffec800
156
157 /* MPU Timer Registers */
158 #define CNTL_TIMER              0
159 #define LOAD_TIM                4
160 #define READ_TIM                8
161
162 /* CNTL_TIMER register bits */
163 #define MPUTIM_FREE             (1<<6)
164 #define MPUTIM_CLOCK_ENABLE     (1<<5)
165 #define MPUTIM_PTV_MASK         (0x7<<PTV_BIT)
166 #define MPUTIM_PTV_BIT          2
167 #define MPUTIM_AR               (1<<1)
168 #define MPUTIM_ST               (1<<0)
169
170 /*
171  * ---------------------------------------------------------------------------
172  * Interrupts
173  * ---------------------------------------------------------------------------
174  */
175 #define OMAP_IH1_BASE           0xfffecb00
176 #define OMAP_IH2_BASE           0xfffe0000
177 #define OMAP_ITR                0x0
178 #define OMAP_MASK               0x4
179
180 #define IRQ_ITR                 0x00
181 #define IRQ_MIR                 0x04
182 #define IRQ_SIR_IRQ             0x10
183 #define IRQ_SIR_FIQ             0x14
184 #define IRQ_CONTROL_REG         0x18
185 #define IRQ_ISR                 0x9c
186 #define IRQ_ILR0                0x1c
187
188 /* OMAP-1610 specific interrupt handler registers */
189 #define OMAP_IH2_SECT1          (OMAP_IH2_BASE)
190 #define OMAP_IH2_SECT2          (OMAP_IH2_BASE + 0x100)
191 #define OMAP_IH2_SECT3          (OMAP_IH2_BASE + 0x200)
192 #define OMAP_IH2_SECT4          (OMAP_IH2_BASE + 0x300)
193
194 /*
195  * ---------------------------------------------------------------------------
196  * Traffic controller memory interface
197  * ---------------------------------------------------------------------------
198  */
199 #define TCMIF_BASE              0xfffecc00
200 #define IMIF_PRIO               (TCMIF_BASE + 0x00)
201 #define EMIFS_PRIO_REG          (TCMIF_BASE + 0x04)
202 #define EMIFF_PRIO_REG          (TCMIF_BASE + 0x08)
203 #define EMIFS_CONFIG_REG        (TCMIF_BASE + 0x0c)
204 #define EMIFS_CS0_CONFIG        (TCMIF_BASE + 0x10)
205 #define EMIFS_CS1_CONFIG        (TCMIF_BASE + 0x14)
206 #define EMIFS_CS2_CONFIG        (TCMIF_BASE + 0x18)
207 #define EMIFS_CS3_CONFIG        (TCMIF_BASE + 0x1c)
208 #define EMIFF_SDRAM_CONFIG      (TCMIF_BASE + 0x20)
209 #define EMIFF_MRS               (TCMIF_BASE + 0x24)
210 #define TC_TIMEOUT1             (TCMIF_BASE + 0x28)
211 #define TC_TIMEOUT2             (TCMIF_BASE + 0x2c)
212 #define TC_TIMEOUT3             (TCMIF_BASE + 0x30)
213 #define TC_ENDIANISM            (TCMIF_BASE + 0x34)
214 #define EMIFF_SDRAM_CONFIG_2    (TCMIF_BASE + 0x3c)
215 #define EMIF_CFG_DYNAMIC_WS     (TCMIF_BASE + 0x40)
216
217 /*
218  * ----------------------------------------------------------------------------
219  * System control registers
220  * ----------------------------------------------------------------------------
221  */
222 #define MOD_CONF_CTRL_0         0xfffe1080
223 #define MOD_CONF_CTRL_1         0xfffe1110
224
225 /*
226  * ----------------------------------------------------------------------------
227  * Pin multiplexing registers
228  * ----------------------------------------------------------------------------
229  */
230 #define FUNC_MUX_CTRL_0         0xfffe1000
231 #define FUNC_MUX_CTRL_1         0xfffe1004
232 #define FUNC_MUX_CTRL_2         0xfffe1008
233 #define COMP_MODE_CTRL_0        0xfffe100c
234 #define FUNC_MUX_CTRL_3         0xfffe1010
235 #define FUNC_MUX_CTRL_4         0xfffe1014
236 #define FUNC_MUX_CTRL_5         0xfffe1018
237 #define FUNC_MUX_CTRL_6         0xfffe101C
238 #define FUNC_MUX_CTRL_7         0xfffe1020
239 #define FUNC_MUX_CTRL_8         0xfffe1024
240 #define FUNC_MUX_CTRL_9         0xfffe1028
241 #define FUNC_MUX_CTRL_A         0xfffe102C
242 #define FUNC_MUX_CTRL_B         0xfffe1030
243 #define FUNC_MUX_CTRL_C         0xfffe1034
244 #define FUNC_MUX_CTRL_D         0xfffe1038
245 #define PULL_DWN_CTRL_0         0xfffe1040
246 #define PULL_DWN_CTRL_1         0xfffe1044
247 #define PULL_DWN_CTRL_2         0xfffe1048
248 #define PULL_DWN_CTRL_3         0xfffe104c
249
250 /* OMAP-1610 specific multiplexing registers */
251 #define FUNC_MUX_CTRL_E         0xfffe1090
252 #define FUNC_MUX_CTRL_F         0xfffe1094
253 #define FUNC_MUX_CTRL_10        0xfffe1098
254 #define FUNC_MUX_CTRL_11        0xfffe109c
255 #define FUNC_MUX_CTRL_12        0xfffe10a0
256 #define PU_PD_SEL_0             0xfffe10b4
257 #define PU_PD_SEL_1             0xfffe10b8
258 #define PU_PD_SEL_2             0xfffe10bc
259 #define PU_PD_SEL_3             0xfffe10c0
260 #define PU_PD_SEL_4             0xfffe10c4
261
262 /*
263  * ---------------------------------------------------------------------------
264  * TIPB bus interface
265  * ---------------------------------------------------------------------------
266  */
267 #define TIPB_PUBLIC_CNTL_BASE           0xfffed300
268 #define MPU_PUBLIC_TIPB_CNTL_REG        (TIPB_PUBLIC_CNTL_BASE + 0x8)
269 #define TIPB_PRIVATE_CNTL_BASE          0xfffeca00
270 #define MPU_PRIVATE_TIPB_CNTL_REG       (TIPB_PRIVATE_CNTL_BASE + 0x8)
271
272 /*
273  * ----------------------------------------------------------------------------
274  * DSP control registers
275  * ----------------------------------------------------------------------------
276  */
277 /*  MPUI Interface Registers */
278 #define MPUI_CTRL_REG           (0xfffec900)
279 #define MPUI_DEBUG_ADDR         (0xfffec904)
280 #define MPUI_DEBUG_DATA         (0xfffec908)
281 #define MPUI_DEBUG_FLAG         (0xfffec90c)
282 #define MPUI_STATUS_REG         (0xfffec910)
283 #define MPUI_DSP_STATUS_REG     (0xfffec914)
284 #define MPUI_DSP_BOOT_CONFIG    (0xfffec918)
285 #define MPUI_DSP_API_CONFIG     (0xfffec91c)
286
287
288 #ifndef __ASSEMBLER__
289
290 /*
291  * ---------------------------------------------------------------------------
292  * Processor differentiation
293  * ---------------------------------------------------------------------------
294  */
295 #define OMAP_ID_REG             __REG32(0xfffed404)
296
297 /* See also uncompress.h */
298 #define OMAP_ID_730             0xB55F
299 #define OMAP_ID_1510            0xB470
300 #define OMAP_ID_1610            0xB576
301 #define OMAP_ID_1710            0xB5F7
302 #define OMAP_ID_5912            0xB58C
303
304 #ifdef CONFIG_ARCH_OMAP730
305 #include "omap730.h"
306 #define cpu_is_omap730()        (((OMAP_ID_REG >> 12) & 0xffff) == OMAP_ID_730)
307 #else
308 #define cpu_is_omap730()        0
309 #endif
310
311 #ifdef CONFIG_ARCH_OMAP1510
312 #include "omap1510.h"
313 #define cpu_is_omap1510()       (((OMAP_ID_REG >> 12) & 0xffff) == OMAP_ID_1510)
314 #else
315 #define cpu_is_omap1510()       0
316 #endif
317
318 #ifdef CONFIG_ARCH_OMAP1610
319 #include "omap1610.h"
320 #define cpu_is_omap1710()       (((OMAP_ID_REG >> 12) & 0xffff) == OMAP_ID_1710)
321 /* Detect 1710 as 1610 for now */
322 #define cpu_is_omap1610()       (((OMAP_ID_REG >> 12) & 0xffff) == OMAP_ID_1610 \
323                                 || cpu_is_omap1710())
324 #else
325 #define cpu_is_omap1610()       0
326 #define cpu_is_omap1710()       0
327 #endif
328
329 #ifdef CONFIG_ARCH_OMAP5912
330 #include "omap5912.h"
331 #define cpu_is_omap5912()       (((OMAP_ID_REG >> 12) & 0xffff) == OMAP_ID_5912)
332 #else
333 #define cpu_is_omap5912()       0
334 #endif
335
336 /*
337  * ---------------------------------------------------------------------------
338  * Board differentiation
339  * ---------------------------------------------------------------------------
340  */
341
342 #ifdef CONFIG_MACH_OMAP_INNOVATOR
343 #include "board-innovator.h"
344 #endif
345
346 #ifdef CONFIG_MACH_OMAP_H2
347 #include "board-h2.h"
348 #endif
349
350 #ifdef CONFIG_MACH_OMAP_PERSEUS2
351 #include "board-perseus2.h"
352 #endif
353
354 #ifdef CONFIG_MACH_OMAP_H3
355 #include "board-h3.h"
356 #error "Support for H3 board not yet implemented."
357 #endif
358
359 #ifdef CONFIG_MACH_OMAP_H4
360 #include "board-h4.h"
361 #error "Support for H4 board not yet implemented."
362 #endif
363
364 #ifdef CONFIG_MACH_OMAP_OSK
365 #include "board-osk.h"
366 #endif
367
368 #endif /* !__ASSEMBLER__ */
369
370 #endif  /* __ASM_ARCH_OMAP_HARDWARE_H */