pxa2x0reg.h revision 1.1 1 1.1 bsh /* $NetBSD: pxa2x0reg.h,v 1.1 2002/10/19 19:31:40 bsh Exp $ */
2 1.1 bsh
3 1.1 bsh /*
4 1.1 bsh * Copyright (c) 2002 Genetec Corporation. All rights reserved.
5 1.1 bsh * Written by Hiroyuki Bessho for Genetec Corporation.
6 1.1 bsh *
7 1.1 bsh * Redistribution and use in source and binary forms, with or without
8 1.1 bsh * modification, are permitted provided that the following conditions
9 1.1 bsh * are met:
10 1.1 bsh * 1. Redistributions of source code must retain the above copyright
11 1.1 bsh * notice, this list of conditions and the following disclaimer.
12 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 bsh * notice, this list of conditions and the following disclaimer in the
14 1.1 bsh * documentation and/or other materials provided with the distribution.
15 1.1 bsh * 3. All advertising materials mentioning features or use of this software
16 1.1 bsh * must display the following acknowledgement:
17 1.1 bsh * This product includes software developed for the NetBSD Project by
18 1.1 bsh * Genetec Corporation.
19 1.1 bsh * 4. The name of Genetec Corporation may not be used to endorse or
20 1.1 bsh * promote products derived from this software without specific prior
21 1.1 bsh * written permission.
22 1.1 bsh *
23 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
24 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
27 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
34 1.1 bsh */
35 1.1 bsh
36 1.1 bsh
37 1.1 bsh /*
38 1.1 bsh * Intel PXA2[15]0 processor is XScale based integrated CPU
39 1.1 bsh *
40 1.1 bsh * Reference:
41 1.1 bsh * Intel(r) PXA250 and PXA210 Application Processors
42 1.1 bsh * Developer's Manual
43 1.1 bsh * (278522-001.pdf)
44 1.1 bsh */
45 1.1 bsh #ifndef _ARM_XSCALE_PXA2X0REG_H_
46 1.1 bsh #define _ARM_XSCALE_PXA2X0REG_H_
47 1.1 bsh
48 1.1 bsh /* Borrow some register definitions from sa11x0 */
49 1.1 bsh #include <arm/sa11x0/sa11x0_reg.h>
50 1.1 bsh
51 1.1 bsh #ifndef _LOCORE
52 1.1 bsh #include <sys/types.h> /* for uint32_t */
53 1.1 bsh #endif
54 1.1 bsh
55 1.1 bsh /*
56 1.1 bsh * Chip select domains
57 1.1 bsh */
58 1.1 bsh #define PXA2X0_CS0_START 0x00000000
59 1.1 bsh #define PXA2X0_CS1_START 0x04000000
60 1.1 bsh #define PXA2X0_CS2_START 0x08000000
61 1.1 bsh #define PXA2X0_CS3_START 0x0c000000
62 1.1 bsh #define PXA2X0_CS4_START 0x10000000
63 1.1 bsh #define PXA2X0_CS5_START 0x14000000
64 1.1 bsh
65 1.1 bsh #define PXA2X0_PCMCIA_SLOT0 0x20000000
66 1.1 bsh #define PXA2X0_PCMCIA_SLOT1 0x30000000
67 1.1 bsh
68 1.1 bsh #define PXA2X0_PERIPH_START 0x40000000
69 1.1 bsh /* #define PXA2X0_MEMCTL_START 0x48000000 */
70 1.1 bsh #define PXA2X0_PERIPH_END 0x480fffff
71 1.1 bsh
72 1.1 bsh #define PXA2X0_SDRAM0_START 0xa0000000
73 1.1 bsh #define PXA2X0_SDRAM1_START 0xa4000000
74 1.1 bsh #define PXA2X0_SDRAM2_START 0xa8000000
75 1.1 bsh #define PXA2X0_SDRAM3_START 0xac000000
76 1.1 bsh
77 1.1 bsh /*
78 1.1 bsh * Physical address of integrated peripherals
79 1.1 bsh */
80 1.1 bsh
81 1.1 bsh #define PXA2X0_DMAC_BASE 0x40000000
82 1.1 bsh #define PXA2X0_DMAC_SIZE 0x300
83 1.1 bsh #define PXA2X0_FFUART_BASE 0x40100000 /* Full Function UART */
84 1.1 bsh #define PXA2X0_BTUART_BASE 0x40200000 /* Bluetooth UART */
85 1.1 bsh #define PXA2X0_I2C_BASE 0x40300000
86 1.1 bsh #define PXA2X0_I2C_SIZE 0x000016a4
87 1.1 bsh #define PXA2X0_I2S_BASE 0x40400000
88 1.1 bsh #define PXA2X0_AC97_BASE 0x40500000
89 1.1 bsh #define PXA2X0_UDC_BASE 0x40600000 /* USB Client */
90 1.1 bsh #define PXA2X0_STUART_BASE 0x40700000 /* Standard UART */
91 1.1 bsh #define PXA2X0_ICP_BASE 0x40800000
92 1.1 bsh #define PXA2X0_RTC_BASE 0x40900000
93 1.1 bsh #define PXA2X0_RTC_SIZE 0x10
94 1.1 bsh #define PXA2X0_OST_BASE 0x40a00000 /* OS Timer */
95 1.1 bsh #define PXA2X0_PWM0_BASE 0x40b00000
96 1.1 bsh #define PXA2X0_PWM1_BASE 0x40c00000
97 1.1 bsh #define PXA2X0_INTCTL_BASE 0x40d00000 /* Interrupt controller */
98 1.1 bsh #define PXA2X0_INTCTL_SIZE 0x20
99 1.1 bsh #define PXA2X0_GPIO_BASE 0x40e00000
100 1.1 bsh #define PXA2X0_GPIO_SIZE 0x70
101 1.1 bsh #define PXA2X0_POWMAN_BASE 0x40f00000 /* Power management */
102 1.1 bsh #define PXA2X0_SSP_BASE 0x41000000
103 1.1 bsh #define PXA2X0_MMC_BASE 0x41100000 /* MultiMediaCard */
104 1.1 bsh #define PXA2X0_CLKMAN_BASE 0x41300000 /* Clock Manager */
105 1.1 bsh #define PXA2X0_CLKMAN_SIZE 12
106 1.1 bsh #define PXA2X0_LCDC_BASE 0x44000000 /* LCD Controller */
107 1.1 bsh #define PXA2X0_LCDC_SIZE 0x220
108 1.1 bsh #define PXA2X0_MEMCTL_BASE 0x48000000 /* Memory Controller */
109 1.1 bsh #define PXA2X0_MEMCTL_SIZE 0x48
110 1.1 bsh
111 1.1 bsh /* width of interrupt controller */
112 1.1 bsh #define ICU_LEN 32 /* but [0..7,15,16] is not used */
113 1.1 bsh #define ICU_INT_HWMASK 0xffffff00
114 1.1 bsh #define PXA2X0_IRQ_MIN 8 /* 0..7 are not used by integrated
115 1.1 bsh peripherals */
116 1.1 bsh
117 1.1 bsh /* UART */
118 1.1 bsh #define PXA2X0_COM_FREQ 14745600L
119 1.1 bsh
120 1.1 bsh /* I2C */
121 1.1 bsh #define I2C_IBMR 0x1680 /* Bus monitor register */
122 1.1 bsh #define I2C_IDBR 0x1688 /* Data buffer */
123 1.1 bsh #define I2C_ICR 0x1690 /* Control register */
124 1.1 bsh #define ICR_START (1<<0)
125 1.1 bsh #define ICR_STOP (1<<1)
126 1.1 bsh #define ICR_ACKNAK (1<<2)
127 1.1 bsh #define ICR_TB (1<<3)
128 1.1 bsh #define ICR_MA (1<<4)
129 1.1 bsh #define I2C_ISR 0x1698 /* Status register */
130 1.1 bsh #define I2C_ISAR 0x16a0 /* Slave address */
131 1.1 bsh
132 1.1 bsh /* Clock Manager */
133 1.1 bsh #define CLKMAN_CCCR 0x00 /* Core Clock Configuration */
134 1.1 bsh #define CCCR_TURBO_X1 (2<<7)
135 1.1 bsh #define CCCR_TURBO_X15 (3<<7) /* x 1.5 */
136 1.1 bsh #define CCCR_TURBO_X2 (4<<7)
137 1.1 bsh #define CCCR_TURBO_X25 (5<<7) /* x 2.5 */
138 1.1 bsh #define CCCR_TURBO_X3 (6<<7) /* x 3.0 */
139 1.1 bsh #define CCCR_RUN_X1 (1<<5)
140 1.1 bsh #define CCCR_RUN_X2 (2<<5)
141 1.1 bsh #define CCCR_RUN_X4 (3<<5)
142 1.1 bsh #define CCCR_MEM_X27 (1<<0) /* x27, 99.53MHz */
143 1.1 bsh #define CCCR_MEM_X32 (2<<0) /* x32, 117,96MHz */
144 1.1 bsh #define CCCR_MEM_X36 (3<<0) /* x26, 132.71MHz */
145 1.1 bsh #define CCCR_MEM_X40 (4<<0) /* x27, 99.53MHz */
146 1.1 bsh #define CCCR_MEM_X45 (5<<0) /* x27, 99.53MHz */
147 1.1 bsh #define CCCR_MEM_X9 (0x1f<<0) /* x9, 33.2MHz */
148 1.1 bsh
149 1.1 bsh #define CLKMAN_CKEN 0x04 /* Clock Enable Register */
150 1.1 bsh #define CLKMAN_OSCC 0x08 /* Osillcator Configuration Register */
151 1.1 bsh
152 1.1 bsh #define CCCR_N_SHIFT 7
153 1.1 bsh #define CCCR_N_MASK (0x07<<CCCR_N_SHIFT)
154 1.1 bsh #define CCCR_M_SHIFT 5
155 1.1 bsh #define CCCR_M_MASK (0x03<<CCCR_M_SHIFT)
156 1.1 bsh #define CCCR_L_MASK 0x1f
157 1.1 bsh
158 1.1 bsh #define CKEN_PWM0 (1<<0)
159 1.1 bsh #define CKEN_PWM1 (1<<1)
160 1.1 bsh #define CKEN_AC97 (1<<2)
161 1.1 bsh #define CKEN_SSP (1<<3)
162 1.1 bsh #define CKEN_STUART (1<<5)
163 1.1 bsh #define CKEN_FFUART (1<<6)
164 1.1 bsh #define CKEN_BTUART (1<<7)
165 1.1 bsh #define CKEN_I2S (1<<8)
166 1.1 bsh #define CKEN_USB (1<<11)
167 1.1 bsh #define CKEN_MMC (1<<12)
168 1.1 bsh #define CKEN_FICP (1<<13)
169 1.1 bsh #define CKEN_I2C (1<<14)
170 1.1 bsh #define CKEN_LCD (1<<16)
171 1.1 bsh
172 1.1 bsh #define OSCC_OOK (1<<0) /* 32.768KHz oscillator status */
173 1.1 bsh #define OSCC_OON (1<<1) /* 32.768KHz oscillator */
174 1.1 bsh
175 1.1 bsh /*
176 1.1 bsh * RTC
177 1.1 bsh */
178 1.1 bsh #define RTC_RCNR 0x0000 /* count register */
179 1.1 bsh #define RTC_RTAR 0x0004 /* alarm register */
180 1.1 bsh #define RTC_RTSR 0x0008 /* status register */
181 1.1 bsh #define RTC_RTTR 0x000c /* trim register */
182 1.1 bsh /*
183 1.1 bsh * GPIO
184 1.1 bsh */
185 1.1 bsh #define GPIO_GPLR0 0x00 /* Level reg [31:0] */
186 1.1 bsh #define GPIO_GPLR1 0x04 /* Level reg [63:32] */
187 1.1 bsh #define GPIO_GPLR2 0x08 /* Level reg [80:64] */
188 1.1 bsh
189 1.1 bsh #define GPIO_GPDR0 0x0c /* dir reg [31:0] */
190 1.1 bsh #define GPIO_GPDR1 0x10 /* dir reg [63:32] */
191 1.1 bsh #define GPIO_GPDR2 0x14 /* dir reg [80:64] */
192 1.1 bsh
193 1.1 bsh #define GPIO_GPSR0 0x18 /* set reg [31:0] */
194 1.1 bsh #define GPIO_GPSR1 0x1c /* set reg [63:32] */
195 1.1 bsh #define GPIO_GPSR2 0x20 /* set reg [80:64] */
196 1.1 bsh
197 1.1 bsh #define GPIO_GPCR0 0x24 /* clear reg [31:0] */
198 1.1 bsh #define GPIO_GPCR1 0x28 /* clear reg [63:32] */
199 1.1 bsh #define GPIO_GPCR2 0x2c /* clear reg [80:64] */
200 1.1 bsh
201 1.1 bsh #define GPIO_GPER0 0x30 /* rising edge [31:0] */
202 1.1 bsh #define GPIO_GPER1 0x34 /* rising edge [63:32] */
203 1.1 bsh #define GPIO_GPER2 0x38 /* rising edge [80:64] */
204 1.1 bsh
205 1.1 bsh #define GPIO_GRER0 0x30 /* rising edge [31:0] */
206 1.1 bsh #define GPIO_GRER1 0x34 /* rising edge [63:32] */
207 1.1 bsh #define GPIO_GRER2 0x38 /* rising edge [80:64] */
208 1.1 bsh
209 1.1 bsh #define GPIO_GFER0 0x3c /* falling edge [31:0] */
210 1.1 bsh #define GPIO_GFER1 0x40 /* falling edge [63:32] */
211 1.1 bsh #define GPIO_GFER2 0x44 /* falling edge [80:64] */
212 1.1 bsh
213 1.1 bsh #define GPIO_GEDR0 0x48 /* edge detect [31:0] */
214 1.1 bsh #define GPIO_GEDR1 0x4c /* edge detect [63:32] */
215 1.1 bsh #define GPIO_GEDR2 0x50 /* edge detect [80:64] */
216 1.1 bsh
217 1.1 bsh #define GPIO_GAFR0_L 0x54 /* alternate function [15:0] */
218 1.1 bsh #define GPIO_GAFR0_U 0x58 /* alternate function [31:16] */
219 1.1 bsh #define GPIO_GAFR1_L 0x5c /* alternate function [47:32] */
220 1.1 bsh #define GPIO_GAFR1_U 0x60 /* alternate function [63:48] */
221 1.1 bsh #define GPIO_GAFR2_L 0x64 /* alternate function [79:64] */
222 1.1 bsh #define GPIO_GAFR2_U 0x68 /* alternate function [80] */
223 1.1 bsh
224 1.1 bsh /*
225 1.1 bsh * memory controller
226 1.1 bsh */
227 1.1 bsh
228 1.1 bsh #define MEMCTL_MDCNFG 0x0000
229 1.1 bsh #define MDCNFG_DE0 (1<<0)
230 1.1 bsh #define MDCNFG_DE1 (1<<1)
231 1.1 bsh #define MDCNFG_DE2 (1<<16)
232 1.1 bsh #define MDCNFG_DE3 (1<<17)
233 1.1 bsh
234 1.1 bsh #define MEMCTL_MDREFR 0x04 /* refresh control register */
235 1.1 bsh #define MDREFR_DRI 0xfff
236 1.1 bsh #define MDREFR_E0PIN (1<<12)
237 1.1 bsh #define MDREFR_K0RUN (1<<13) /* SDCLK0 enable */
238 1.1 bsh #define MDREFR_K0DB2 (1<<14) /* SDCLK0 1/2 freq */
239 1.1 bsh #define MDREFR_E1PIN (1<<15)
240 1.1 bsh #define MDREFR_K1RUN (1<<16) /* SDCLK1 enable */
241 1.1 bsh #define MDREFR_K1DB2 (1<<17) /* SDCLK1 1/2 freq */
242 1.1 bsh #define MDREFR_K2RUN (1<<18) /* SDCLK2 enable */
243 1.1 bsh #define MDREFR_K2DB2 (1<<19) /* SDCLK2 1/2 freq */
244 1.1 bsh #define MDREFR_APD (1<<20) /* Auto Power Down */
245 1.1 bsh #define MDREFR_SLFRSH (1<<22) /* Self Refresh */
246 1.1 bsh #define MDREFR_K0FREE (1<<23) /* SDCLK0 free run */
247 1.1 bsh #define MDREFR_K1FREE (1<<24) /* SDCLK1 free run */
248 1.1 bsh #define MDREFR_K2FREE (1<<25) /* SDCLK2 free run */
249 1.1 bsh
250 1.1 bsh #define MEMCTL_MSC0 0x08 /* Asychronous Statis memory Control CS[01] */
251 1.1 bsh #define MEMCTL_MSC1 0x0c /* Asychronous Statis memory Control CS[23] */
252 1.1 bsh #define MEMCTL_MSC2 0x10 /* Asychronous Statis memory Control CS[45] */
253 1.1 bsh #define MSC2_RBUFF_SHIFT 15 /* return data buffer */
254 1.1 bsh #define MSC2_RBUFF (1<<MSC2_RBUFF_SHIFT)
255 1.1 bsh #define MSC2_RRR_SHIFT 12 /* recovery time */
256 1.1 bsh #define MSC2_RRR (7<<MSC2_RRR_SHIFT)
257 1.1 bsh #define MSC2_RDN_SHIFT 8 /* ROM delay next access */
258 1.1 bsh #define MSC2_RDN (0x0f<<MSC2_RDN_SHIFT)
259 1.1 bsh #define MSC2_RDF_SHIFT 4 /* ROM delay first access*/
260 1.1 bsh #define MSC2_RDF (0x0f<<MSC2_RDF_SHIFT)
261 1.1 bsh #define MSC2_RBW_SHIFT 3 /* 32/16 bit bus */
262 1.1 bsh #define MSC2_RBW (1<<MSC2_RBW_SHIFT)
263 1.1 bsh #define MSC2_RT_SHIFT 0 /* type */
264 1.1 bsh #define MSC2_RT (7<<MSC2_RT_SHIFT)
265 1.1 bsh #define MSC2_RT_NONBURST 0
266 1.1 bsh #define MSC2_RT_SRAM 1
267 1.1 bsh #define MSC2_RT_BURST4 2
268 1.1 bsh #define MSC2_RT_BURST8 3
269 1.1 bsh #define MSC2_RT_VLIO 4
270 1.1 bsh
271 1.1 bsh #define MEMCTL_MCMEM0 0x28 /* expansion memory timing configuration */
272 1.1 bsh #define MEMCTL_MCMEM1 0x2c /* expansion memory timing configuration */
273 1.1 bsh #define MEMCTL_MCATT0 0x30
274 1.1 bsh #define MEMCTL_MCATT1 0x34
275 1.1 bsh #define MEMCTL_MCIO0 0x38
276 1.1 bsh #define MEMCTL_MCIO1 0x3c
277 1.1 bsh
278 1.1 bsh #define MEMCTL_MECR 0x14 /* Expansion memory configuration */
279 1.1 bsh #define MECR_NOS (1<<0) /* Number of sockets */
280 1.1 bsh #define MECR_CIT (1<<1) /* Card-is-there */
281 1.1 bsh
282 1.1 bsh #define MEMCTL_MDMRS 0x0040
283 1.1 bsh
284 1.1 bsh /*
285 1.1 bsh * LCD Controller
286 1.1 bsh */
287 1.1 bsh #define LCDC_LCCR0 0x000 /* Controller Control Register 0 */
288 1.1 bsh #define LCCR0_ENB (1U<<0) /* LCD Controller Enable */
289 1.1 bsh #define LCCR0_CMS (1U<<1) /* Color/Mono select */
290 1.1 bsh #define LCCR0_SDS (1U<<2) /* Single/Dual -panel */
291 1.1 bsh #define LCCR0_LDM (1U<<3) /* LCD Disable Done Mask */
292 1.1 bsh #define LCCR0_SFM (1U<<4) /* Start of Frame Mask */
293 1.1 bsh #define LCCR0_IUM (1U<<5) /* Input FIFO Underrun Mask */
294 1.1 bsh #define LCCR0_EFM (1U<<6) /* End of Frame Mask */
295 1.1 bsh #define LCCR0_PAS (1U<<7) /* Passive/Active Display select */
296 1.1 bsh #define LCCR0_DPD (1U<<9) /* Double-Pixel Data pin mode */
297 1.1 bsh #define LCCR0_DIS (1U<<10) /* LCD Disable */
298 1.1 bsh #define LCCR0_QDM (1U<<11) /* LCD Quick Disable Mask */
299 1.1 bsh #define LCCR0_BM (1U<<20) /* Branch Mask */
300 1.1 bsh #define LCCR0_OUM (1U<<21) /* Output FIFO Underrun Mask */
301 1.1 bsh
302 1.1 bsh #define LCCR0_IMASK (LCCR0_LDM|LCCR0_SFM|LCCR0_IUM|LCCR0_EFM|LCCR0_QDM|LCCR0_BM|LCCR0_OUM)
303 1.1 bsh
304 1.1 bsh
305 1.1 bsh #define LCDC_LCCR1 0x004 /* Controller Control Register 1 */
306 1.1 bsh #define LCDC_LCCR2 0x008 /* Controller Control Register 2 */
307 1.1 bsh #define LCDC_LCCR3 0x00c /* Controller Control Register 2 */
308 1.1 bsh #define LCCR3_BPP_SHIFT 24 /* Bits per pixel */
309 1.1 bsh #define LCCR3_BPP (0x07<<LCCR3_BPP_SHIFT)
310 1.1 bsh #define LCDC_FBR0 0x020 /* DMA ch0 frame branch register */
311 1.1 bsh #define LCDC_FBR1 0x024 /* DMA ch1 frame branch register */
312 1.1 bsh #define LCDC_LCSR 0x038 /* controller status register */
313 1.1 bsh #define LCSR_LDD (1U<<0) /* LCD disable done */
314 1.1 bsh #define LCSR_SOF (1U<<1) /* Start of frame */
315 1.1 bsh #define LCDC_LIIDR 0x03c /* controller interrupt ID Register */
316 1.1 bsh #define LCDC_TRGBR 0x040 /* TMED RGB Speed Register */
317 1.1 bsh #define LCDC_TCR 0x044 /* TMED Control Register */
318 1.1 bsh #define LCDC_FDADR0 0x200 /* DMA ch0 frame descriptor address */
319 1.1 bsh #define LCDC_FSADR0 0x204 /* DMA ch0 frame source address */
320 1.1 bsh #define LCDC_FIDR0 0x208 /* DMA ch0 frame ID register */
321 1.1 bsh #define LCDC_LDCMD0 0x20c /* DMA ch0 command register */
322 1.1 bsh #define LCDC_FDADR1 0x210 /* DMA ch1 frame descriptor address */
323 1.1 bsh #define LCDC_FSADR1 0x214 /* DMA ch1 frame source address */
324 1.1 bsh #define LCDC_FIDR1 0x218 /* DMA ch1 frame ID register */
325 1.1 bsh #define LCDC_LDCMD1 0x21c /* DMA ch1 command register */
326 1.1 bsh
327 1.1 bsh #endif /* _ARM_XSCALE_PXA2X0REG_H_ */
328