1 #ifndef CYGONCE_HAL_TRITON270_H
2 #define CYGONCE_HAL_TRITON270_H
4 /*=============================================================================
8 // HAL Description of PXA27x control registers
9 // and ARM memory control in general.
11 //#####ECOSGPLCOPYRIGHTBEGIN####
12 //## -------------------------------------------
13 //## This file is part of eCos, the Embedded Configurable Operating System.
14 //## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
16 //## eCos is free software; you can redistribute it and/or modify it under
17 //## the terms of the GNU General Public License as published by the Free
18 //## Software Foundation; either version 2 or (at your option) any later version.
20 //## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21 //## WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 //## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 //## for more details.
25 //## You should have received a copy of the GNU General Public License along
26 //## with eCos; if not, write to the Free Software Foundation, Inc.,
27 //## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29 //## As a special exception, if other files instantiate templates or use macros
30 //## or inline functions from this file, or you compile this file and link it
31 //## with other works to produce a work based on this file, this file does not
32 //## by itself cause the resulting work to be covered by the GNU General Public
33 //## License. However the source code for this file must still be made available
34 //## in accordance with section (3) of the GNU General Public License.
36 //## This exception does not invalidate any other reasons why a work based on
37 //## this file might be covered by the GNU General Public License.
39 //## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40 //## at http://sources.redhat.com/ecos/ecos-license/
41 //## -------------------------------------------
42 //#####ECOSGPLCOPYRIGHTEND####
43 //=============================================================================
44 //#####DESCRIPTIONBEGIN####
46 // Author(s): usteinkohl
47 // Contributors: usteinkohl
48 // Date: 14th January 2003
49 // Purpose: Intel PXA27x register and Ka-Ro TRITON270 hardware descriptions
51 // Usage: #include <cyg/hal/hal_triton270.h>
53 //####DESCRIPTIONEND####
55 //===========================================================================*/
58 /* TRITON270 Devices */
61 #include <pkgconf/system.h> // System-wide configuration info
63 #define BOOT_ROM 0x00000000 /* Boot ROM (Flash) */
64 #define SDRAM_B0 0xA0000000 /* 64 MByte of SDRAM Bank 0 */
66 #define SMC91C111_ETH_IOBASE 0x14000300 /* I/O base connected to CS5# */
67 #define IRQ_GPIO_ETH CYGNUM_HAL_INTERRUPT_GPIO52
70 #define __REG(x) ((volatile unsigned long *)(x))
72 typedef struct pin_i2c_t_tag {
77 // i2c function prototypes
80 cyg_int32 write_i2c_pcf8574(cyg_uint8 device_adr, cyg_uint8 dat_value);
81 cyg_int32 read_i2c_pcf8574(cyg_uint8 device_adr);
83 void init_i2c_pp(void); /* init i2c par. port */
85 void triton270_program_new_stack(void *func);
87 void pin_i2c_setup(pin_i2c_t *pin_data);
88 void bus_out(pin_i2c_t *pin_data, unsigned char pdata);
89 int bus_in(pin_i2c_t *pin_data);
90 void i2c_start(pin_i2c_t *pin_data);
91 void i2c_stop(pin_i2c_t *pin_data);
92 int i2c_read_ack(pin_i2c_t *pin_data);
93 void i2c_write_ack(pin_i2c_t *pin_data);
94 void i2c_write_nack(pin_i2c_t *pin_data);
95 void i2c_slave_addr(pin_i2c_t *pin_data, unsigned char dev, unsigned char mode);
96 void i2c_read(pin_i2c_t *pin_data, unsigned char *res);
97 void i2c_write(pin_i2c_t *pin_data, unsigned char val);
99 int se_read(pin_i2c_t *pin_data, unsigned char addr, unsigned char dev_address, unsigned int numb, char *dat);
100 int se_write(pin_i2c_t *pin_data, unsigned char addr,unsigned char dev_address, unsigned char val);
102 int ltc1663_write(pin_i2c_t *pin_data, unsigned char dev_address, unsigned char command, unsigned short val);
104 int set_alternate_function(unsigned char gpio_nr, unsigned char function_code);
105 int set_pin_dir(unsigned char pin_no, unsigned char io_code); /* 0=input 1=output */
106 int set_pin(unsigned char pin_no);
107 int get_pin_status(unsigned char pin_no);
108 int clear_pin(unsigned char pin_no);
109 int set_rising_edge(unsigned char pin_no, unsigned char io_code); /* 0= disable 1= enable */
110 int set_falling_edge(unsigned char pin_no, unsigned char io_code); /* 0= disable 1= enable */
111 int clear_edge(unsigned char pin_no);
112 int detect_edge(unsigned char pin_no);
114 void reset_cp_dac(void);
116 cyg_int32 write_i2c_pwr(cyg_uint8 device_adr, cyg_uint8 dat_value);
117 void change_core_voltage(unsigned char ind);
118 void change_clock(unsigned char ind);
119 int get_clock_table_index(int clock);
121 typedef struct clock_param_s {
122 unsigned short t_clock;
123 unsigned short sys_clock;
124 unsigned short mem_clock;
125 unsigned short SDRAM_clock;
126 unsigned short LCD_clock;
127 unsigned char CCCR_A;
128 unsigned char CCCR_L;
129 unsigned char CCCR_2N;
130 unsigned char CLKCFG_T;
131 unsigned char CLKCFG_HT;
132 unsigned char CLKCFG_B;
133 unsigned short VOLTAGE_VAL;
134 unsigned char DAC_VAL;
135 unsigned char MDREFR_K0DB4;
136 unsigned char MDREFR_K0DB2;
140 extern clock_param_t pclktab[];
145 #define NUM_GPIOS 128
147 // Memory Controller 0x48000000
148 #define MDCNFG __REG(0x48000000) // SDRAM configuration register 0
149 #define MDREFR __REG(0x48000004) // SDRAM refresh control register
150 #define MSC0 __REG(0x48000008) // Static memory control register 0
151 #define MSC1 __REG(0x4800000C) // Static memory control register 1
152 #define MSC2 __REG(0x48000010) // Static memory control register 2
153 #define MECR __REG(0x48000014) // Expansion memory (PCMCIA / Compact Flash) bus configuration register
154 #define SXLCR __REG(0x48000018) // LCR value to be written to SDRAM-Timing Synchronous Flash
155 #define SXCNFG __REG(0x4800001C) // Synchronous static memory control register
156 #define FLYCNFG __REG(0x48000020) // Fly by DMA DVAL assert and deassert times
157 #define SXMRS __REG(0x48000024) // MRS value to be written to Synchronous Flash or SMROM
158 #define MCMEM0 __REG(0x48000028) // Card interface Common Memory Space Socket 0 Timing Configuration
159 #define MCMEM1 __REG(0x4800002C) // Card interface Common Memory Space Socket 1 Timing Configuration
160 #define MCATT0 __REG(0x48000030) // Card interface Attribute Space Socket 0 Timing Configuration
161 #define MCATT1 __REG(0x48000034) // Card interface Attribute Space Socket 1 Timing Configuration
162 #define MCIO0 __REG(0x48000038) // Card interface I/O Space Socket 0 Timing Configuration
163 #define MCIO1 __REG(0x4800003C) // Card interface I/O Space Socket 1 Timing Configuration
164 #define MDMRS __REG(0x48000040) // MRS value to be written to SDRAM
165 #define BOOTDEF __REG(0x48000044) // Read-Only Boot-time register. Contains BOOT_SEL and PKG_SEL values.
166 // LCD Controller 0x44000000
167 #define LCCR0 __REG(0x44000000) // LCD controller control register 0
168 #define LCCR1 __REG(0x44000004) // LCD controller control register 1
169 #define LCCR2 __REG(0x44000008) // LCD controller control register 2
170 #define LCCR3 __REG(0x4400000C) // LCD controller control register 3
171 #define FDADR0 __REG(0x44000200) // DMA channel 0 frame descriptor address register
172 #define FSADR0 __REG(0x44000204) // DMA channel 0 frame source address register
173 #define FIDR0 __REG(0x44000208) // DMA channel 0 frame ID register
174 #define LDCMD0 __REG(0x4400020C) // DMA channel 0 command register
175 #define FDADR1 __REG(0x44000210) // DMA channel 1 frame descriptor address register
176 #define FSADR1 __REG(0x44000214) // DMA channel 1 frame source address register
177 #define FIDR1 __REG(0x44000218) // DMA channel 1 frame ID register
178 #define LDCMD1 __REG(0x4400021C) // DMA channel 1 command register
179 #define FBR0 __REG(0x44000020) // DMA channel 0 frame branch register
180 #define FBR1 __REG(0x44000024) // DMA channel 1 frame branch register
181 #define LCSR __REG(0x44000038) // LCD controller status register
182 #define LIIDR __REG(0x4400003C) // LCD controller interrupt ID register
183 #define TRGBR __REG(0x44000040) // TMED RGB Seed Register
184 #define TCR __REG(0x44000044) // TMED Control Register
185 // DMA Controller 0x40000000
186 #define DCSR0 __REG(0x40000000) // DMA Control / Status Register for Channel 0
187 #define DCSR1 __REG(0x40000004) // DMA Control / Status Register for Channel 1
188 #define DCSR2 __REG(0x40000008) // DMA Control / Status Register for Channel 2
189 #define DCSR3 __REG(0x4000000c) // DMA Control / Status Register for Channel 3
190 #define DCSR4 __REG(0x40000010) // DMA Control / Status Register for Channel 4
191 #define DCSR5 __REG(0x40000014) // DMA Control / Status Register for Channel 5
192 #define DCSR6 __REG(0x40000018) // DMA Control / Status Register for Channel 6
193 #define DCSR7 __REG(0x4000001c) // DMA Control / Status Register for Channel 7
194 #define DCSR8 __REG(0x40000020) // DMA Control / Status Register for Channel 8
195 #define DCSR9 __REG(0x40000024) // DMA Control / Status Register for Channel 9
196 #define DCSR10 __REG(0x40000028) // DMA Control / Status Register for Channel 10
197 #define DCSR11 __REG(0x4000002c) // DMA Control / Status Register for Channel 11
198 #define DCSR12 __REG(0x40000030) // DMA Control / Status Register for Channel 12
199 #define DCSR13 __REG(0x40000034) // DMA Control / Status Register for Channel 13
200 #define DCSR14 __REG(0x40000038) // DMA Control / Status Register for Channel 14
201 #define DCSR15 __REG(0x4000003c) // DMA Control / Status Register for Channel 15
202 #define DCSR16 __REG(0x40000040) // DMA Control / Status Register for Channel 16
203 #define DCSR17 __REG(0x40000044) // DMA Control / Status Register for Channel 17
204 #define DCSR18 __REG(0x40000048) // DMA Control / Status Register for Channel 18
205 #define DCSR19 __REG(0x4000004c) // DMA Control / Status Register for Channel 19
206 #define DCSR20 __REG(0x40000050) // DMA Control / Status Register for Channel 20
207 #define DCSR21 __REG(0x40000054) // DMA Control / Status Register for Channel 21
208 #define DCSR22 __REG(0x40000058) // DMA Control / Status Register for Channel 22
209 #define DCSR23 __REG(0x4000005c) // DMA Control / Status Register for Channel 23
210 #define DCSR24 __REG(0x40000060) // DMA Control / Status Register for Channel 24
211 #define DCSR25 __REG(0x40000064) // DMA Control / Status Register for Channel 25
212 #define DCSR26 __REG(0x40000068) // DMA Control / Status Register for Channel 26
213 #define DCSR27 __REG(0x4000006c) // DMA Control / Status Register for Channel 27
214 #define DCSR28 __REG(0x40000070) // DMA Control / Status Register for Channel 28
215 #define DCSR29 __REG(0x40000074) // DMA Control / Status Register for Channel 29
216 #define DCSR30 __REG(0x40000078) // DMA Control / Status Register for Channel 30
217 #define DCSR31 __REG(0x4000007c) // DMA Control / Status Register for Channel 31
219 #define DALGN __REG(0x400000A0) // Alignment Register
221 #define DINT __REG(0x400000f0) // DMA Interrupt Register
222 #define DRCMR0 __REG(0x40000100) // Request to Channel Map Register for DREQ 0 (companion chip request 0)
223 #define DRCMR1 __REG(0x40000104) // Request to Channel Map Register for DREQ 1 (companion chip request 1)
224 #define DRCMR2 __REG(0x40000108) // Request to Channel Map Register for I2S receive Request
225 #define DRCMR3 __REG(0x4000010c) // Request to Channel Map Register for I2S transmit Request
226 #define DRCMR4 __REG(0x40000110) // Request to Channel Map Register for BTUART receive Request
227 #define DRCMR5 __REG(0x40000114) // Request to Channel Map Register for BTUART transmit Request.
228 #define DRCMR6 __REG(0x40000118) // Request to Channel Map Register for FFUART receive Request
229 #define DRCMR7 __REG(0x4000011c) // Request to Channel Map Register for FFUART transmit Request
230 #define DRCMR8 __REG(0x40000120) // Request to Channel Map Register for AC97 microphone Request
231 #define DRCMR9 __REG(0x40000124) // Request to Channel Map Register for AC97 modem receive Request
232 #define DRCMR10 __REG(0x40000128) // Request to Channel Map Register for AC97 modem transmit Request
233 #define DRCMR11 __REG(0x4000012c) // Request to Channel Map Register for AC97 audio receive Request
234 #define DRCMR12 __REG(0x40000130) // Request to Channel Map Register for AC97 audio transmit Request
235 #define DRCMR13 __REG(0x40000134) // Request to Channel Map Register for SSP receive Request
236 #define DRCMR14 __REG(0x40000138) // Request to Channel Map Register for SSP transmit Request
237 #define DRCMR15 __REG(0x4000013c) // Reserved
238 #define DRCMR16 __REG(0x40000140) // Reserved
239 #define DRCMR17 __REG(0x40000144) // Request to Channel Map Register for ICP receive Request
240 #define DRCMR18 __REG(0x40000148) // Request to Channel Map Register for ICP transmit Request
241 #define DRCMR19 __REG(0x4000014c) // Request to Channel Map Register for STUART receive Request
242 #define DRCMR20 __REG(0x40000150) // Request to Channel Map Register for STUART transmit Request
243 #define DRCMR21 __REG(0x40000154) // Request to Channel Map Register for MMC receive Request
244 #define DRCMR22 __REG(0x40000158) // Request to Channel Map Register for MMC transmit Request
245 #define DRCMR23 __REG(0x4000015c) // RESERVED
246 #define DRCMR24 __REG(0x40000160) // RESERVED
247 #define DRCMR25 __REG(0x40000164) // Request to Channel Map Register for USB endpoint 1 Request
248 #define DRCMR26 __REG(0x40000168) // Request to Channel Map Register for USB endpoint 2 Request
249 #define DRCMR27 __REG(0x4000016C) // Request to Channel Map Register for USB endpoint 3 Request
250 #define DRCMR28 __REG(0x40000170) // Request to Channel Map Register for USB endpoint 4 Request
251 #define DRCMR29 __REG(0x40000174) // RESERVED
252 #define DRCMR30 __REG(0x40000178) // Request to Channel Map Register for USB endpoint 6 Request
253 #define DRCMR31 __REG(0x4000017C) // Request to Channel Map Register for USB endpoint 7 Request
254 #define DRCMR32 __REG(0x40000180) // Request to Channel Map Register for USB endpoint 8 Request
255 #define DRCMR33 __REG(0x40000184) // Request to Channel Map Register for USB endpoint 9 Request
256 #define DRCMR34 __REG(0x40000188) // RESERVED
257 #define DRCMR35 __REG(0x4000018C) // Request to Channel Map Register for USB endpoint 11 Request
258 #define DRCMR36 __REG(0x40000190) // Request to Channel Map Register for USB endpoint 12 Request
259 #define DRCMR37 __REG(0x40000194) // Request to Channel Map Register for USB endpoint 13 Request
260 #define DRCMR38 __REG(0x40000198) // Request to Channel Map Register for USB endpoint 14 Request
261 #define DRCMR39 __REG(0x4000019C) // RESERVED
262 #define DDADR0 __REG(0x40000200) // DMA Descriptor Address Register channel 0
263 #define DSADR0 __REG(0x40000204) // DMA Source Address Register channel 0
264 #define DTADR0 __REG(0x40000208) // DMA Target Address Register channel 0
265 #define DCMD0 __REG(0x4000020C) // DMA Command Address Register channel 0
266 #define DDADR1 __REG(0x40000210) // DMA Descriptor Address Register channel 1
267 #define DSADR1 __REG(0x40000214) // DMA Source Address Register channel 1
268 #define DTADR1 __REG(0x40000218) // DMA Target Address Register channel 1
269 #define DCMD1 __REG(0x4000021C) // DMA Command Address Register channel 1
270 #define DDADR2 __REG(0x40000220) // DMA Descriptor Address Register channel 2
271 #define DSADR2 __REG(0x40000224) // DMA Source Address Register channel 2
272 #define DTADR2 __REG(0x40000228) // DMA Target Address Register channel 2
273 #define DCMD2 __REG(0x4000022C) // DMA Command Address Register channel 2
274 #define DDADR3 __REG(0x40000230) // DMA Descriptor Address Register channel 3
275 #define DSADR3 __REG(0x40000234) // DMA Source Address Register channel 3
276 #define DTADR3 __REG(0x40000238) // DMA Target Address Register channel 3
277 #define DCMD3 __REG(0x4000023C) // DMA Command Address Register channel 3
278 #define DDADR4 __REG(0x40000240) // DMA Descriptor Address Register channel 4
279 #define DSADR4 __REG(0x40000244) // DMA Source Address Register channel 4
280 #define DTADR4 __REG(0x40000248) // DMA Target Address Register channel 4
281 #define DCMD4 __REG(0x4000024C) // DMA Command Address Register channel 4
282 #define DDADR5 __REG(0x40000250) // DMA Descriptor Address Register channel 5
283 #define DSADR5 __REG(0x40000254) // DMA Source Address Register channel 5
284 #define DTADR5 __REG(0x40000258) // DMA Target Address Register channel 5
285 #define DCMD5 __REG(0x4000025C) // DMA Command Address Register channel 5
286 #define DDADR6 __REG(0x40000260) // DMA Descriptor Address Register channel 6
287 #define DSADR6 __REG(0x40000264) // DMA Source Address Register channel 6
288 #define DTADR6 __REG(0x40000268) // DMA Target Address Register channel 6
289 #define DCMD6 __REG(0x4000026C) // DMA Command Address Register channel 6
290 #define DDADR7 __REG(0x40000270) // DMA Descriptor Address Register channel 7
291 #define DSADR7 __REG(0x40000274) // DMA Source Address Register channel 7
292 #define DTADR7 __REG(0x40000278) // DMA Target Address Register channel 7
293 #define DCMD7 __REG(0x4000027C) // DMA Command Address Register channel 7
294 #define DDADR8 __REG(0x40000280) // DMA Descriptor Address Register channel 8
295 #define DSADR8 __REG(0x40000284) // DMA Source Address Register channel 8
296 #define DTADR8 __REG(0x40000288) // DMA Target Address Register channel 8
297 #define DCMD8 __REG(0x4000028C) // DMA Command Address Register channel 8
298 #define DDADR9 __REG(0x40000290) // DMA Descriptor Address Register channel 9
299 #define DSADR9 __REG(0x40000294) // DMA Source Address Register channel 9
300 #define DTADR9 __REG(0x40000298) // DMA Target Address Register channel 9
301 #define DCMD9 __REG(0x4000029C) // DMA Command Address Register channel 9
302 #define DDADR10 __REG(0x400002a0) // DMA Descriptor Address Register channel 10
303 #define DSADR10 __REG(0x400002a4) // DMA Source Address Register channel 10
304 #define DTADR10 __REG(0x400002a8) // DMA Target Address Register channel 10
305 #define DCMD10 __REG(0x400002aC) // DMA Command Address Register channel 10
306 #define DDADR11 __REG(0x400002b0) // DMA Descriptor Address Register channel 11
307 #define DSADR11 __REG(0x400002b4) // DMA Source Address Register channel 11
308 #define DTADR11 __REG(0x400002b8) // DMA Target Address Register channel 11
309 #define DCMD11 __REG(0x400002bC) // DMA Command Address Register channel 11
310 #define DDADR12 __REG(0x400002c0) // DMA Descriptor Address Register channel 12
311 #define DSADR12 __REG(0x400002c4) // DMA Source Address Register channel 12
312 #define DTADR12 __REG(0x400002c8) // DMA Target Address Register channel 12
313 #define DCMD12 __REG(0x400002cC) // DMA Command Address Register channel 12
314 #define DDADR13 __REG(0x400002d0) // DMA Descriptor Address Register channel 13
315 #define DSADR13 __REG(0x400002d4) // DMA Source Address Register channel 13
316 #define DTADR13 __REG(0x400002d8) // DMA Target Address Register channel 13
317 #define DCMD13 __REG(0x400002dC) // DMA Command Address Register channel 13
318 #define DDADR14 __REG(0x400002e0) // DMA Descriptor Address Register channel 14
319 #define DSADR14 __REG(0x400002e4) // DMA Source Address Register channel 14
320 #define DTADR14 __REG(0x400002e8) // DMA Target Address Register channel 14
321 #define DCMD14 __REG(0x400002eC) // DMA Command Address Register channel 14
322 #define DDADR15 __REG(0x400002f0) // DMA Descriptor Address Register channel 15
323 #define DSADR15 __REG(0x400002f4) // DMA Source Address Register channel 15
324 #define DTADR15 __REG(0x400002f8) // DMA Target Address Register channel 15
325 #define DCMD15 __REG(0x400002fC) // DMA Command Address Register channel 15
326 // Full Function UART
327 #define FFRBR __REG(0x40100000) // Receive Buffer Register (read only)
328 #define FFTHR __REG(0x40100000) // Transmit Holding Register (write only)
329 #define FFIER __REG(0x40100004) // Interrupt Enable Register (read/write)
330 #define FFIIR __REG(0x40100008) // Interrupt ID Register (read only)
331 #define FFFCR __REG(0x40100008) // FIFO Control Register (write only)
332 #define FFLCR __REG(0x4010000C) // Line Control Register (read/write)
333 #define FFMCR __REG(0x40100010) // Modem Control Register (read/write)
334 #define FFLSR __REG(0x40100014) // Line Status Register (read only)
335 #define FFMSR __REG(0x40100018) // Modem Status Register (read only)
336 #define FFSPR __REG(0x4010001C) // Scratch Pad Register (read/write)
337 #define FFDLL __REG(0x40100000) // baud divisor lower byte (read/write)
338 #define FFDLH __REG(0x40100004) // baud divisor higher byte (read/write)
339 #define FFISR __REG(0x40100020) // slow Infrared Select Register (read/write)
341 #define BTRBR __REG(0x40200000) // Receive Buffer Register (read only)
342 #define BTTHR __REG(0x40200000) // Transmit Holding Register (write only)
343 #define BTIER __REG(0x40200004) // Interrupt Enable Register (read/write)
344 #define BTIIR __REG(0x40200008) // Interrupt ID Register (read only)
345 #define BTFCR __REG(0x40200008) // FIFO Control Register (write only)
346 #define BTLCR __REG(0x4020000C) // Line Control Register (read/write)
347 #define BTMCR __REG(0x40200010) // Modem Control Register (read/write)
348 #define BTLSR __REG(0x40200014) // Line Status Register (read only)
349 #define BTMSR __REG(0x40200018) // Modem Status Register (read only)
350 #define BTSPR __REG(0x4020001C) // Scratch Pad Register (read/write)
351 #define BTDLL __REG(0x40200000) // baud divisor lower byte (read/write)
352 #define BTDLH __REG(0x40200004) // baud divisor higher byte (read/write)
353 #define BTISR __REG(0x40200020) // slow Infrared Select Register (read/write)
355 #define STRBR __REG(0x40700000) // Receive Buffer Register (read only)
356 #define STTHR __REG(0x40700000) // Transmit Holding Register (write only)
357 #define STIER __REG(0x40700004) // Interrupt Enable Register (read/write)
358 #define STIIR __REG(0x40700008) // Interrupt ID Register (read only)
359 #define STFCR __REG(0x40700008) // FIFO Control Register (write only)
360 #define STLCR __REG(0x4070000C) // Line Control Register (read/write)
361 #define STMCR __REG(0x40700010) // Modem Control Register (read/write)
362 #define STLSR __REG(0x40700014) // Line Status Register (read only)
363 #define STMSR __REG(0x40700018) // Reserved
364 #define STSPR __REG(0x4070001C) // Scratch Pad Register (read/write)
365 #define STDLL __REG(0x40700000) // baud divisor lower byte (read/write)
366 #define STDLH __REG(0x40700004) // baud divisor higher byte (read/write)
367 #define STISR __REG(0x40700020) // slow Infrared Select Register (read/write)
369 #define IBMR __REG(0x40301680) // I2C Bus Monitor Register - IBMR
370 #define IDBR __REG(0x40301688) // I2C Data Buffer Register - IDBR
371 #define ICR __REG(0x40301690) // I2C Control Register - ICR
372 #define ISR __REG(0x40301698) // I2C Status Register - ISR
373 #define ISAR __REG(0x403016A0) // I2C Slave Address Register - ISAR
374 //#define ICCR __REG(0x403016A8) // I2C Clock Count Register - ICCR
376 #define SACR0 __REG(0x40400000) // Global Control Register
377 #define SACR1 __REG(0x40400004) // Serial Audio I2S/MSB-Justified Control Register
378 // - 0x4040-0008 ) // Reserved
379 #define SASR0 __REG(0x4040000C) // Serial Audio I2S/MSB-Justified Interface and FIFO Status Register
380 // - 0x4040-0010 ) // Reserved
381 #define SAIMR __REG(0x40400014) // Serial Audio Interrupt Mask Register
382 #define SAICR __REG(0x40400018) // Serial Audio Interrupt Clear Register
385 // Reserved __REG(0x4040)-0058 -
386 #define SAITR __REG(0x4040005C) // Serial Audio Interrupt Test Register
387 #define SADIV __REG(0x40400060) // Audio clock divider register. See section Section 12.3, "Serial Audio Clocks and Sampling Frequencies" on page 12-7.
388 // - 0x4040-0064 Reserved
390 // Reserved __REG(0x4040)-007C -
391 #define SADR __REG(0x40400080) // Serial Audio Data Register (TX and RX FIFO access register).
392 // - 0x4040-0084 to 0x404F-FFFF Reserved
394 #define POCR __REG(0x40500000) // PCM Out Control Register
395 #define PICR __REG(0x40500004) // PCM In Control Register
396 #define MCCR __REG(0x40500008) // Mic In Control Register
397 #define GCR __REG(0x4050000C) // Global Control Register
398 #define POSR __REG(0x40500010) // PCM Out Status Register
399 #define PISR __REG(0x40500014) // PCM In Status Register
400 #define MCSR __REG(0x40500018) // Mic In Status Register
401 #define GSR __REG(0x4050001C) // Global Status Register
402 #define CAR __REG(0x40500020) // CODEC Access Register
403 // - 0x4050-0024 through 0x4050-003C Reserved
404 #define PCDR __REG(0x40500040) // PCM FIFO Data Register
405 // - 0x4050-0044 through 0x4050-005C Reserved
406 #define MCDR __REG(0x40500060) // Mic-in FIFO Data Register
407 // - 0x4050-0064 through 0x4050-00FC Reserved
408 #define MOCR __REG(0x40500100) // MODEM Out Control Register
409 // - 0x4050-0104 Reserved
410 #define MICR __REG(0x40500108) // MODEM In Control Register
411 // - 0x4050-010C Reserved
412 #define MOSR __REG(0x40500110) // MODEM Out Status Register
413 // - 0x4050-0114 Reserved
414 #define MISR __REG(0x40500118) // MODEM In Status Register
415 // - 0x4050-011C through 0x4050-013C Reserved
416 #define MODR __REG(0x40500140) // MODEM FIFO Data Register
417 // - 0x4050-0144 through 0x4050-01FC Reserved
418 // (0x4050-0200 through 0x4050-02FC)
419 // with all in increments of 0x00004 Primary Audio CODEC registers
420 // (0x4050-0300 through 0x4050-03FC)
421 // with all in increments of 0x00004 Secondary Audio CODEC registers
423 // with all in increments of 0x0000-0004 Primary MODEM CODEC registers
425 // with all in increments of 0x00004 Secondary MODEM CODEC registers
427 #define UDCCR __REG(0x40600000) // UDC control register
428 #define UDCCS0 __REG(0x40600010) // UDC Endpoint 0 Control/Status Register
429 #define UDCCS1 __REG(0x40600014) // UDC Endpoint 1 (IN) Control/Status Register
430 #define UDCCS2 __REG(0x40600018) // UDC Endpoint 2 (OUT) Control/Status Register
431 #define UDCCS3 __REG(0x4060001C) // UDC Endpoint 3 (IN) Control/Status Register
432 #define UDCCS4 __REG(0x40600020) // UDC Endpoint 4 (OUT) Control/Status Register
433 #define UDCCS5 __REG(0x40600024) // UDC Endpoint 5 (Interrupt) Control/Status Register
434 #define UDCCS6 __REG(0x40600028) // UDC Endpoint 6 (IN) Control/Status Register
435 #define UDCCS7 __REG(0x4060002C) // UDC Endpoint 7 (OUT) Control/Status Register
436 #define UDCCS8 __REG(0x40600030) // UDC Endpoint 8 (IN) Control/Status Register
437 #define UDCCS9 __REG(0x40600034) // UDC Endpoint 9 (OUT) Control/Status Register
438 #define UDCCS10 __REG(0x40600038) // UDC Endpoint 10 (Interrupt) Control/Status Register
439 #define UDCCS11 __REG(0x4060003C) // UDC Endpoint 11 (IN) Control/Status Register
440 #define UDCCS12 __REG(0x40600040) // UDC Endpoint 12 (OUT) Control/Status Register
441 #define UDCCS13 __REG(0x40600044) // UDC Endpoint 13 (IN) Control/Status Register
442 #define UDCCS14 __REG(0x40600048) // UDC Endpoint 14 (OUT) Control/Status Register
443 #define UDCCS15 __REG(0x4060004C) // UDC Endpoint 15 (Interrupt) Control/Status Register
444 #define UFNRH __REG(0x40600060) // UDC Frame Number Register High
445 #define UFNRL __REG(0x40600064) // UDC Frame Number Register Low
446 #define UDDR0 __REG(0x40600080) // UDC Endpoint 0 Data Register
447 #define UDDR1 __REG(0x40600100) // UDC Endpoint 1 Data Register
448 #define UDDR2 __REG(0x406001C0) // UDC Endpoint 2 Data Register
449 #define UDDR3 __REG(0x40600200) // UDC Endpoint 3 Data Register
450 #define UDDR4 __REG(0x40600400) // UDC Endpoint 4 Data Register
451 #define UDDR5 __REG(0x406000A0) // UDC Endpoint 5 Data Register
452 #define UDDR6 __REG(0x40600600) // UDC Endpoint 6 Data Register
453 #define UDDR7 __REG(0x40600680) // UDC Endpoint 7 Data Register
454 #define UDDR8 __REG(0x40600700) // UDC Endpoint 8 Data Register
455 #define UDDR9 __REG(0x40600A00) // UDC Endpoint 9 Data Register
456 #define UDDR10 __REG(0x406000C0) // UDC Endpoint 10 Data Register
457 #define UDDR11 __REG(0x40600B00) // UDC Endpoint 11 Data Register
458 #define UDDR12 __REG(0x40600B80) // UDC Endpoint 12 Data Register
459 #define UDDR13 __REG(0x40600C00) // UDC Endpoint 13 Data Register
460 #define UDDR14 __REG(0x40600E00) // UDC Endpoint 14 Data Register
461 #define UDDR15 __REG(0x406000E0) // UDC Endpoint 15 Data Register
462 #define UICR0 __REG(0x40600050) // UDC Interrupt Control Register 0
463 #define UICR1 __REG(0x40600054) // UDC Interrupt Control Register 1
464 #define USIR0 __REG(0x40600058) // UDC Status Interrupt Register 0
465 #define USIR1 __REG(0x4060005C) // UDC Status Interrupt Register 1
467 #define ICCR0 __REG(0x40800000) // ICP control register 0
468 #define ICCR1 __REG(0x40800004) // ICP control register 1
469 #define ICCR2 __REG(0x40800008) // ICP control register 2
470 #define ICDR __REG(0x4080000C) // ICP data register
471 // - 0x40800010 Reserved
472 #define ICSR0 __REG(0x40800014) // ICP status register 0
473 #define ICSR1 __REG(0x40800018) // ICP status register 1
474 // - 0x4080001C - 0x4080FFFF Reserved
476 #define RCNR __REG(0x40900000) //RTC count register
477 #define RTAR __REG(0x40900004) //RTC alarm register
478 #define RTSR __REG(0x40900008) //RTC status register
479 #define RTTR __REG(0x4090000C) //RTC timer trim register
482 #define OSMR0 __REG(0x40A00000) // OS timer match registers<3:0>
483 #define OSMR1 __REG(0x40A00004) //
484 #define OSMR2 __REG(0x40A00008) //
485 #define OSMR3 __REG(0x40A0000C) //
486 #define OSCR __REG(0x40A00010) // OS timer counter register
487 #define OSSR __REG(0x40A00014) // OS timer status register
488 #define OWER __REG(0x40A00018) // OS timer watchdog enable register
489 #define OIER __REG(0x40A0001C) // OS timer interrupt enable register
491 #define PWMCTRL0 __REG(0x40B00000) // PWM 0 Control Register
492 #define PWDUTY0 __REG(0x40B00004) // PWM 0 Duty Cycle Register
493 #define PERVAL0 __REG(0x40B00008) // PWM 0 Period Control Register
495 #define PWMCTRL1 __REG(0x40C00000) // PWM 1Control Register
496 #define PWDUTY1 __REG(0x40C00004) // PWM 1 Duty Cycle Register
497 #define PERVAL1 __REG(0x40C00008) // PWM 1 Period Control Register
499 #define ICIP __REG(0x40D00000) // Interrupt controller IRQ pending register
500 #define ICIP2 __REG(0x40D0009c) // Interrupt controller IRQ pending register
502 #define ICMR __REG(0x40D00004) // Interrupt controller mask register
503 #define ICMR2 __REG(0x40D000a0) // Interrupt controller mask register
505 #define ICLR __REG(0x40D00008) // Interrupt controller level register
506 #define ICLR2 __REG(0x40D000a4) // Interrupt controller level register
508 #define ICFP __REG(0x40D0000C) // Interrupt controller FIQ pending register
509 #define ICFP2 __REG(0x40D000a8) // Interrupt controller FIQ pending register
511 #define ICPR __REG(0x40D00010) // Interrupt controller pending register
512 #define ICPR2 __REG(0x40D000ac) // Interrupt controller pending register
514 #define ICCR __REG(0x40D00014) // Interrupt controller control register
517 #define GPLRa __REG(0x40E00000) // GPIO pin-level register GPIO<31:0>
518 #define GPLRb __REG(0x40E00004) // GPIO pin-level register GPIO<63:32>
519 #define GPLRc __REG(0x40E00008) // GPIO pin-level register GPIO<95:64>
520 #define GPLRd __REG(0x40E00100) // GPIO pin-level register GPIO<120:95>
522 #define GPDRa __REG(0x40E0000C) // GPIO pin direction register GPIO<31:0>
523 #define GPDRb __REG(0x40E00010) // GPIO pin direction register GPIO<63:32>
524 #define GPDRc __REG(0x40E00014) // GPIO pin direction register GPIO<95:64>
525 #define GPDRd __REG(0x40E0010c) // GPIO pin direction register GPIO<120:96>
527 #define GPSRa __REG(0x40E00018) // GPIO pin output set register GPIO<31:0>
528 #define GPSRb __REG(0x40E0001C) // GPIO pin output set register GPIO<63:32>
529 #define GPSRc __REG(0x40E00020) // GPIO pin output set register GPIO<80:95>
530 #define GPSRd __REG(0x40E00118) // GPIO pin output set register GPIO<120:96>
532 #define GPCRa __REG(0x40E00024) // GPIO pin output clear register GPIO<31:0>
533 #define GPCRb __REG(0x40E00028) // GPIO pin output clear register GPIO <63:32>
534 #define GPCRc __REG(0x40E0002C) // GPIO pin output clear register GPIO <80:95>
535 #define GPCRd __REG(0x40E00124) // GPIO pin output clear register GPIO <120:96>
537 #define GRERa __REG(0x40E00030) // GPIO rising-edge detect register GPIO<31:0>
538 #define GRERb __REG(0x40E00034) // GPIO rising-edge detect register GPIO<63:32>
539 #define GRERc __REG(0x40E00038) // GPIO rising-edge detect register GPIO<95:64>
540 #define GRERd __REG(0x40E00130) // GPIO rising-edge detect register GPIO<120:96>
542 #define GFERa __REG(0x40E0003C) // GPIO falling-edge detect register GPIO<31:0>
543 #define GFERb __REG(0x40E00040) // GPIO falling-edge detect register GPIO<63:32>
544 #define GFERc __REG(0x40E00044) // GPIO falling-edge detect register GPIO<95:64>
545 #define GFERd __REG(0x40E0013c) // GPIO falling-edge detect register GPIO<120:96>
547 #define GEDRa __REG(0x40E00048) // GPIO edge detect status register GPIO<31:0>
548 #define GEDRb __REG(0x40E0004C) // GPIO edge detect status register GPIO<63:32>
549 #define GEDRc __REG(0x40E00050) // GPIO edge detect status register GPIO<95:64>
550 #define GEDRd __REG(0x40E00148) // GPIO edge detect status register GPIO<120:96>
552 #define GAFR0a __REG(0x40E00054) // GPIO alternate function select register GPIO<15:0>
553 #define GAFR1a __REG(0x40E00058) // GPIO alternate function select register GPIO<31:16>
554 #define GAFR0b __REG(0x40E0005C) // GPIO alternate function select register GPIO<47:32>
555 #define GAFR1b __REG(0x40E00060) // GPIO alternate function select register GPIO<63:48>
556 #define GAFR0c __REG(0x40E00064) // GPIO alternate function select register GPIO<79:64>
557 #define GAFR1c __REG(0x40E00068) // GPIO alternate function select register GPIO<95:80>
558 #define GAFR0d __REG(0x40E0006c) // GPIO alternate function select register GPIO<111:96>
559 #define GAFR1d __REG(0x40E00070) // GPIO alternate function select register GPIO<120:112>
561 // Power Manager and Reset Control
562 #define PMCR __REG(0x40F00000) // Power Manager Control register
563 #define PSSR __REG(0x40F00004) // Power Manager Sleep Status register
564 #define PSPR __REG(0x40F00008) // Power Manager Scratch Pad register
565 #define PWER __REG(0x40F0000C) // Power Manager Wake-up Enable register
566 #define PRER __REG(0x40F00010) // Power Manager GPIO Rising-edge Detect Enable register
567 #define PFER __REG(0x40F00014) // Power Manager GPIO Falling-edge Detect Enable register
568 #define PEDR __REG(0x40F00018) // Power Manager GPIO Edge Detect Status register
569 #define PCFR __REG(0x40F0001C) // Power Manager General Configuration register
570 #define PGSRx __REG(0x40F00020) // Power Manager GPIO Sleep State register for GP[31-0]
571 #define PGSRy __REG(0x40F00024) // Power Manager GPIO Sleep State register for GP[63-32]
572 #define PGSRz __REG(0x40F00028) // Power Manager GPIO Sleep State register for GP[84-64]
573 // - 0x40F0002C Reserved
574 // - 0x40F0002C Reserved
575 #define RCSR __REG(0x40F00030) // Reset controller status register
576 // - 0x40F00034 - 0x40F0017F Reserved
577 #define PWRIBMR __REG(0x40f00180) // Power I2C Bus Monitor Register
578 #define PWRIDBR __REG(0x40f00188) // Power I2C Data Buffer Register
579 #define PWRICR __REG(0x40f00190) // Power I2C Control Register
580 #define PWRISR __REG(0x40f00198) // Power I2C Status Register
581 #define PWRISAR __REG(0x40f001A0) // Power I2C Slave Address Register
582 // - 0x40F001A4 - 0x40FFFFFF Reserved
585 #define CCCR __REG(0x41300000) // Core Clock Configuration Register
586 #define CKEN __REG(0x41300004) // Clock Enable Register
587 #define OSCC __REG(0x41300008) // Oscillator Configuration Register
588 // - 0x4130000C - 0x413FFFFF Reserved
590 #define SSCR0 __REG(0x41000000) // SSP Control Register 0
591 #define SSCR1 __REG(0x41000004) // SSP Control Register 1
592 #define SSSR __REG(0x41000008) // SSP Status Register
593 #define SSITR __REG(0x4100000C) // SSP Interrupt Test Register
594 #define SSDR __REG(0x41000010) // SSP Data Write Register/SSP Data Read Register
595 // - 0x41000014 - 0x410FFFFF Reserved
597 #define MMCSTRPCL __REG(0x41100000) // Control to start and stop MMC clock
598 #define MMCSTAT __REG(0x41100004) // MMC status register (read only)
599 #define MMCCLKRT __REG(0x41100008) // MMC clock rate
600 #define MMCSPI __REG(0x4110000c) // SPI mode control bits
601 #define MMCCMDAT __REG(0x41100010) // Command/response/data sequence control
602 #define MMCRESTO __REG(0x41100014) // Expected response time out
603 #define MMCRDTO __REG(0x41100018) // Expected data read time out
604 #define MMCBLKLEN __REG(0x4110001c) // Block length of data transaction
605 #define MMCNOB __REG(0x41100020) // "Number of blocks, for block mode"
606 #define MMCPRTBUF __REG(0x41100024) // Partial MMC_TXFIFO FIFO written
607 #define MMCIMASK __REG(0x41100028) // Interrupt Mask
608 #define MMCIREG __REG(0x4110002c) // Interrupt Register (read only)
609 #define MMCCMD __REG(0x41100030) // Index of current command
610 #define MMCARGH __REG(0x41100034) // MSW part of the current command argument
611 #define MMCARGL __REG(0x41100038) // LSW part of the current command argument
612 #define MMCRES __REG(0x4110003c) // Response FIFO (read only)
613 #define MMCRXFIFO __REG(0x41100040) // Receive FIFO (read only)
614 #define MMCTXFIFO __REG(0x41100044) // Transmit FIFO (write only)
616 #define ADCD __REG(0x41200000) // ADC Data Register
617 #define ADCS __REG(0x41200004) // ADC Control Register
618 #define ADCE __REG(0x41200008) // ADC Enable Register
619 #define ADCTSC __REG(0x4120000C) // ADC Touch Screen Control Register
620 #define ADCTSS1 __REG(0x41200010) // ADC Touch Screen Setup Register 1
621 #define ADCTSS2 __REG(0x41200014) // ADC Touch Screen Setup Register 2
622 // -- 0x41200018 - 0x412FFFF Reserved
624 /* I2C register definitions */
625 /* some bit masks of register ICR */
626 #define ICR_START 0x00000001
627 #define ICR_STOP 0x00000002
628 #define ICR_ACKNAK 0x00000004
629 #define ICR_TB 0x00000008
630 #define ICR_MA 0x00000010
631 #define ICR_SCLE 0x00000020
632 #define ICR_IUE 0x00000040
633 #define ICR_GCD 0x00000080
634 #define ICR_ITEIE 0x00000100
635 #define ICR_IRFIE 0x00000200
636 #define ICR_BEIE 0x00000400
637 #define ICR_SSDIE 0x00000800
638 #define ICR_ALDIE 0x00001000
639 #define ICR_SADIE 0x00002000
640 #define ICR_UR 0x00004000
641 #define ICR_FM 0x00008000
643 /* some bit masks of register ISR */
644 #define ISR_RWM 0x00000001
645 #define ISR_ACKNACK 0x00000002
646 #define ISR_UB 0x00000004
647 #define ISR_IBB 0x00000008
648 #define ISR_SSD 0x00000010
649 #define ISR_ALD 0x00000020
650 #define ISR_ITE 0x00000040
651 #define ISR_IRF 0x00000080
652 #define ISR_GCAD 0x00000100
653 #define ISR_SAD 0x00000200
654 #define ISR_BED 0x00000400
656 #define OSSR_TIMER0 (0x1 << 0)
657 #define OSSR_TIMER1 (0x1 << 1)
658 #define OSSR_TIMER2 (0x1 << 2)
659 #define OSSR_TIMER3 (0x1 << 3)
661 #define OIER_TIMER0 (0x1 << 0)
662 #define OIER_TIMER1 (0x1 << 1)
663 #define OIER_TIMER2 (0x1 << 2)
664 #define OIER_TIMER3 (0x1 << 3)
666 #define OWER_WME (0x1 << 0)