blob: 93e336951cd36f2c920687a4e1979399c0e72e61 [file] [log] [blame]
wdenk7ac16102004-08-01 22:48:16 +00001#ifndef _IMX_REGS_H
2#define _IMX_REGS_H
Benoît Thébaudeau1da8a7b2012-08-13 07:27:58 +00003
4#define ARCH_MXC
5
wdenk7ac16102004-08-01 22:48:16 +00006/* ------------------------------------------------------------------------
7 * Motorola IMX system registers
8 * ------------------------------------------------------------------------
9 *
10 */
11
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +010012#define IO_ADDRESS(x) ((x) | IMX_IO_BASE)
13
wdenk7ac16102004-08-01 22:48:16 +000014# ifndef __ASSEMBLY__
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +010015# define __REG(x) (*((volatile u32 *)IO_ADDRESS(x)))
16# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
wdenk7ac16102004-08-01 22:48:16 +000017# else
18# define __REG(x) (x)
19# define __REG2(x,y) ((x)+(y))
20#endif
21
22#define IMX_IO_BASE 0x00200000
23
24/*
25 * Register BASEs, based on OFFSETs
26 *
27 */
28#define IMX_AIPI1_BASE (0x00000 + IMX_IO_BASE)
29#define IMX_WDT_BASE (0x01000 + IMX_IO_BASE)
30#define IMX_TIM1_BASE (0x02000 + IMX_IO_BASE)
31#define IMX_TIM2_BASE (0x03000 + IMX_IO_BASE)
32#define IMX_RTC_BASE (0x04000 + IMX_IO_BASE)
33#define IMX_LCDC_BASE (0x05000 + IMX_IO_BASE)
34#define IMX_UART1_BASE (0x06000 + IMX_IO_BASE)
35#define IMX_UART2_BASE (0x07000 + IMX_IO_BASE)
36#define IMX_PWM_BASE (0x08000 + IMX_IO_BASE)
37#define IMX_DMAC_BASE (0x09000 + IMX_IO_BASE)
38#define IMX_AIPI2_BASE (0x10000 + IMX_IO_BASE)
39#define IMX_SIM_BASE (0x11000 + IMX_IO_BASE)
40#define IMX_USBD_BASE (0x12000 + IMX_IO_BASE)
41#define IMX_SPI1_BASE (0x13000 + IMX_IO_BASE)
42#define IMX_MMC_BASE (0x14000 + IMX_IO_BASE)
43#define IMX_ASP_BASE (0x15000 + IMX_IO_BASE)
44#define IMX_BTA_BASE (0x16000 + IMX_IO_BASE)
Heiko Schocher24ebcf22015-05-18 10:58:12 +020045#define I2C1_BASE_ADDR (0x17000 + IMX_IO_BASE)
wdenk7ac16102004-08-01 22:48:16 +000046#define IMX_SSI_BASE (0x18000 + IMX_IO_BASE)
47#define IMX_SPI2_BASE (0x19000 + IMX_IO_BASE)
48#define IMX_MSHC_BASE (0x1A000 + IMX_IO_BASE)
49#define IMX_PLL_BASE (0x1B000 + IMX_IO_BASE)
50#define IMX_SYSCTRL_BASE (0x1B800 + IMX_IO_BASE)
51#define IMX_GPIO_BASE (0x1C000 + IMX_IO_BASE)
52#define IMX_EIM_BASE (0x20000 + IMX_IO_BASE)
53#define IMX_SDRAMC_BASE (0x21000 + IMX_IO_BASE)
54#define IMX_MMA_BASE (0x22000 + IMX_IO_BASE)
55#define IMX_AITC_BASE (0x23000 + IMX_IO_BASE)
56#define IMX_CSI_BASE (0x24000 + IMX_IO_BASE)
57
wdenk915b3762005-04-05 22:30:50 +000058/* Watchdog Registers*/
59
60#define WCR __REG(IMX_WDT_BASE + 0x00) /* Watchdog Control Register */
61#define WSR __REG(IMX_WDT_BASE + 0x04) /* Watchdog Service Register */
62#define WSTR __REG(IMX_WDT_BASE + 0x08) /* Watchdog Status Register */
63
wdenk7ac16102004-08-01 22:48:16 +000064/* SYSCTRL Registers */
65#define SIDR __REG(IMX_SYSCTRL_BASE + 0x4) /* Silicon ID Register */
66#define FMCR __REG(IMX_SYSCTRL_BASE + 0x8) /* Function Multiplex Control Register */
67#define GPCR __REG(IMX_SYSCTRL_BASE + 0xC) /* Function Multiplex Control Register */
68
69/* Chip Select Registers */
70#define CS0U __REG(IMX_EIM_BASE) /* Chip Select 0 Upper Register */
71#define CS0L __REG(IMX_EIM_BASE + 0x4) /* Chip Select 0 Lower Register */
72#define CS1U __REG(IMX_EIM_BASE + 0x8) /* Chip Select 1 Upper Register */
73#define CS1L __REG(IMX_EIM_BASE + 0xc) /* Chip Select 1 Lower Register */
74#define CS2U __REG(IMX_EIM_BASE + 0x10) /* Chip Select 2 Upper Register */
75#define CS2L __REG(IMX_EIM_BASE + 0x14) /* Chip Select 2 Lower Register */
76#define CS3U __REG(IMX_EIM_BASE + 0x18) /* Chip Select 3 Upper Register */
77#define CS3L __REG(IMX_EIM_BASE + 0x1c) /* Chip Select 3 Lower Register */
78#define CS4U __REG(IMX_EIM_BASE + 0x20) /* Chip Select 4 Upper Register */
79#define CS4L __REG(IMX_EIM_BASE + 0x24) /* Chip Select 4 Lower Register */
80#define CS5U __REG(IMX_EIM_BASE + 0x28) /* Chip Select 5 Upper Register */
81#define CS5L __REG(IMX_EIM_BASE + 0x2c) /* Chip Select 5 Lower Register */
82#define EIM __REG(IMX_EIM_BASE + 0x30) /* EIM Configuration Register */
83
84/* SDRAM controller registers */
85
86#define SDCTL0 __REG(IMX_SDRAMC_BASE) /* SDRAM 0 Control Register */
87#define SDCTL1 __REG(IMX_SDRAMC_BASE + 0x4) /* SDRAM 1 Control Register */
88#define SDMISC __REG(IMX_SDRAMC_BASE + 0x14) /* Miscellaneous Register */
89#define SDRST __REG(IMX_SDRAMC_BASE + 0x18) /* SDRAM Reset Register */
90
91/* PLL registers */
92#define CSCR __REG(IMX_PLL_BASE) /* Clock Source Control Register */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +010093#define CSCR_SPLL_RESTART (1<<22)
94#define CSCR_MPLL_RESTART (1<<21)
95#define CSCR_SYSTEM_SEL (1<<16)
96#define CSCR_BCLK_DIV (0xf<<10)
97#define CSCR_MPU_PRESC (1<<15)
98#define CSCR_SPEN (1<<1)
99#define CSCR_MPEN (1<<0)
100
wdenk7ac16102004-08-01 22:48:16 +0000101#define MPCTL0 __REG(IMX_PLL_BASE + 0x4) /* MCU PLL Control Register 0 */
102#define MPCTL1 __REG(IMX_PLL_BASE + 0x8) /* MCU PLL and System Clock Register 1 */
103#define SPCTL0 __REG(IMX_PLL_BASE + 0xc) /* System PLL Control Register 0 */
104#define SPCTL1 __REG(IMX_PLL_BASE + 0x10) /* System PLL Control Register 1 */
105#define PCDR __REG(IMX_PLL_BASE + 0x20) /* Peripheral Clock Divider Register */
106
wdenk7ac16102004-08-01 22:48:16 +0000107/*
108 * GPIO Module and I/O Multiplexer
109 * x = 0..3 for reg_A, reg_B, reg_C, reg_D
110 */
111#define DDIR(x) __REG2(IMX_GPIO_BASE + 0x00, ((x) & 3) << 8)
112#define OCR1(x) __REG2(IMX_GPIO_BASE + 0x04, ((x) & 3) << 8)
113#define OCR2(x) __REG2(IMX_GPIO_BASE + 0x08, ((x) & 3) << 8)
114#define ICONFA1(x) __REG2(IMX_GPIO_BASE + 0x0c, ((x) & 3) << 8)
115#define ICONFA2(x) __REG2(IMX_GPIO_BASE + 0x10, ((x) & 3) << 8)
116#define ICONFB1(x) __REG2(IMX_GPIO_BASE + 0x14, ((x) & 3) << 8)
117#define ICONFB2(x) __REG2(IMX_GPIO_BASE + 0x18, ((x) & 3) << 8)
118#define DR(x) __REG2(IMX_GPIO_BASE + 0x1c, ((x) & 3) << 8)
119#define GIUS(x) __REG2(IMX_GPIO_BASE + 0x20, ((x) & 3) << 8)
120#define SSR(x) __REG2(IMX_GPIO_BASE + 0x24, ((x) & 3) << 8)
121#define ICR1(x) __REG2(IMX_GPIO_BASE + 0x28, ((x) & 3) << 8)
122#define ICR2(x) __REG2(IMX_GPIO_BASE + 0x2c, ((x) & 3) << 8)
123#define IMR(x) __REG2(IMX_GPIO_BASE + 0x30, ((x) & 3) << 8)
124#define ISR(x) __REG2(IMX_GPIO_BASE + 0x34, ((x) & 3) << 8)
125#define GPR(x) __REG2(IMX_GPIO_BASE + 0x38, ((x) & 3) << 8)
126#define SWR(x) __REG2(IMX_GPIO_BASE + 0x3c, ((x) & 3) << 8)
127#define PUEN(x) __REG2(IMX_GPIO_BASE + 0x40, ((x) & 3) << 8)
128
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100129#define GPIO_PORT_MAX 3
130
wdenk7ac16102004-08-01 22:48:16 +0000131#define GPIO_PIN_MASK 0x1f
132#define GPIO_PORT_MASK (0x3 << 5)
133
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100134#define GPIO_PORT_SHIFT 5
wdenk7ac16102004-08-01 22:48:16 +0000135#define GPIO_PORTA (0<<5)
136#define GPIO_PORTB (1<<5)
137#define GPIO_PORTC (2<<5)
138#define GPIO_PORTD (3<<5)
139
140#define GPIO_OUT (1<<7)
141#define GPIO_IN (0<<7)
142#define GPIO_PUEN (1<<8)
143
144#define GPIO_PF (0<<9)
145#define GPIO_AF (1<<9)
146
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100147#define GPIO_OCR_SHIFT 10
wdenk7ac16102004-08-01 22:48:16 +0000148#define GPIO_OCR_MASK (3<<10)
149#define GPIO_AIN (0<<10)
150#define GPIO_BIN (1<<10)
151#define GPIO_CIN (2<<10)
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100152#define GPIO_DR (3<<10)
153
154#define GPIO_AOUT_SHIFT 12
155#define GPIO_AOUT_MASK (3<<12)
156#define GPIO_AOUT (0<<12)
157#define GPIO_AOUT_ISR (1<<12)
158#define GPIO_AOUT_0 (2<<12)
159#define GPIO_AOUT_1 (3<<12)
wdenk7ac16102004-08-01 22:48:16 +0000160
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100161#define GPIO_BOUT_SHIFT 14
162#define GPIO_BOUT_MASK (3<<14)
163#define GPIO_BOUT (0<<14)
164#define GPIO_BOUT_ISR (1<<14)
165#define GPIO_BOUT_0 (2<<14)
166#define GPIO_BOUT_1 (3<<14)
167
168#define GPIO_GIUS (1<<16)
wdenk7ac16102004-08-01 22:48:16 +0000169
170/* assignements for GPIO alternate/primary functions */
171
172/* FIXME: This list is not completed. The correct directions are
173 * missing on some (many) pins
174 */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100175#define PA0_AIN_SPI2_CLK ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 0 )
wdenk7ac16102004-08-01 22:48:16 +0000176#define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100177#define PA1_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTA | GPIO_IN | 1 )
wdenk7ac16102004-08-01 22:48:16 +0000178#define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 )
179#define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 )
180#define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 )
181#define PA4_PF_CSI_D0 ( GPIO_PORTA | GPIO_PF | 4 )
182#define PA5_PF_CSI_D1 ( GPIO_PORTA | GPIO_PF | 5 )
183#define PA6_PF_CSI_D2 ( GPIO_PORTA | GPIO_PF | 6 )
184#define PA7_PF_CSI_D3 ( GPIO_PORTA | GPIO_PF | 7 )
185#define PA8_PF_CSI_D4 ( GPIO_PORTA | GPIO_PF | 8 )
186#define PA9_PF_CSI_D5 ( GPIO_PORTA | GPIO_PF | 9 )
187#define PA10_PF_CSI_D6 ( GPIO_PORTA | GPIO_PF | 10 )
188#define PA11_PF_CSI_D7 ( GPIO_PORTA | GPIO_PF | 11 )
189#define PA12_PF_CSI_VSYNC ( GPIO_PORTA | GPIO_PF | 12 )
190#define PA13_PF_CSI_HSYNC ( GPIO_PORTA | GPIO_PF | 13 )
191#define PA14_PF_CSI_PIXCLK ( GPIO_PORTA | GPIO_PF | 14 )
192#define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 )
193#define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 )
194#define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100195#define PA17_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 17 )
wdenk7ac16102004-08-01 22:48:16 +0000196#define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 )
197#define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 )
198#define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 )
199#define PA21_PF_A0 ( GPIO_PORTA | GPIO_PF | 21 )
200#define PA22_PF_CS4 ( GPIO_PORTA | GPIO_PF | 22 )
201#define PA23_PF_CS5 ( GPIO_PORTA | GPIO_PF | 23 )
202#define PA24_PF_A16 ( GPIO_PORTA | GPIO_PF | 24 )
203#define PA24_AF_ETMTRACEPKT0 ( GPIO_PORTA | GPIO_AF | 24 )
204#define PA25_PF_A17 ( GPIO_PORTA | GPIO_PF | 25 )
205#define PA25_AF_ETMTRACEPKT1 ( GPIO_PORTA | GPIO_AF | 25 )
206#define PA26_PF_A18 ( GPIO_PORTA | GPIO_PF | 26 )
207#define PA26_AF_ETMTRACEPKT2 ( GPIO_PORTA | GPIO_AF | 26 )
208#define PA27_PF_A19 ( GPIO_PORTA | GPIO_PF | 27 )
209#define PA27_AF_ETMTRACEPKT3 ( GPIO_PORTA | GPIO_AF | 27 )
210#define PA28_PF_A20 ( GPIO_PORTA | GPIO_PF | 28 )
211#define PA28_AF_ETMPIPESTAT0 ( GPIO_PORTA | GPIO_AF | 28 )
212#define PA29_PF_A21 ( GPIO_PORTA | GPIO_PF | 29 )
213#define PA29_AF_ETMPIPESTAT1 ( GPIO_PORTA | GPIO_AF | 29 )
214#define PA30_PF_A22 ( GPIO_PORTA | GPIO_PF | 30 )
215#define PA30_AF_ETMPIPESTAT2 ( GPIO_PORTA | GPIO_AF | 30 )
216#define PA31_PF_A23 ( GPIO_PORTA | GPIO_PF | 31 )
217#define PA31_AF_ETMTRACECLK ( GPIO_PORTA | GPIO_AF | 31 )
218#define PB8_PF_SD_DAT0 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8 )
219#define PB8_AF_MS_PIO ( GPIO_PORTB | GPIO_AF | 8 )
220#define PB9_PF_SD_DAT1 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9 )
221#define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
222#define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
223#define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100224#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
wdenk7ac16102004-08-01 22:48:16 +0000225#define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100226#define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
wdenk7ac16102004-08-01 22:48:16 +0000227#define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100228#define PB13_PF_SD_CMD ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13 )
wdenk7ac16102004-08-01 22:48:16 +0000229#define PB13_AF_MS_BS ( GPIO_PORTB | GPIO_AF | 13 )
230#define PB14_AF_SSI_RXFS ( GPIO_PORTB | GPIO_AF | 14 )
231#define PB15_AF_SSI_RXCLK ( GPIO_PORTB | GPIO_AF | 15 )
232#define PB16_AF_SSI_RXDAT ( GPIO_PORTB | GPIO_IN | GPIO_AF | 16 )
233#define PB17_AF_SSI_TXDAT ( GPIO_PORTB | GPIO_OUT | GPIO_AF | 17 )
234#define PB18_AF_SSI_TXFS ( GPIO_PORTB | GPIO_AF | 18 )
235#define PB19_AF_SSI_TXCLK ( GPIO_PORTB | GPIO_AF | 19 )
236#define PB20_PF_USBD_AFE ( GPIO_PORTB | GPIO_PF | 20 )
237#define PB21_PF_USBD_OE ( GPIO_PORTB | GPIO_PF | 21 )
238#define PB22_PFUSBD_RCV ( GPIO_PORTB | GPIO_PF | 22 )
239#define PB23_PF_USBD_SUSPND ( GPIO_PORTB | GPIO_PF | 23 )
240#define PB24_PF_USBD_VP ( GPIO_PORTB | GPIO_PF | 24 )
241#define PB25_PF_USBD_VM ( GPIO_PORTB | GPIO_PF | 25 )
242#define PB26_PF_USBD_VPO ( GPIO_PORTB | GPIO_PF | 26 )
243#define PB27_PF_USBD_VMO ( GPIO_PORTB | GPIO_PF | 27 )
244#define PB28_PF_UART2_CTS ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 28 )
245#define PB29_PF_UART2_RTS ( GPIO_PORTB | GPIO_IN | GPIO_PF | 29 )
246#define PB30_PF_UART2_TXD ( GPIO_PORTB | GPIO_OUT | GPIO_PF | 30 )
247#define PB31_PF_UART2_RXD ( GPIO_PORTB | GPIO_IN | GPIO_PF | 31 )
248#define PC3_PF_SSI_RXFS ( GPIO_PORTC | GPIO_PF | 3 )
249#define PC4_PF_SSI_RXCLK ( GPIO_PORTC | GPIO_PF | 4 )
250#define PC5_PF_SSI_RXDAT ( GPIO_PORTC | GPIO_IN | GPIO_PF | 5 )
251#define PC6_PF_SSI_TXDAT ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 6 )
252#define PC7_PF_SSI_TXFS ( GPIO_PORTC | GPIO_PF | 7 )
253#define PC8_PF_SSI_TXCLK ( GPIO_PORTC | GPIO_PF | 8 )
254#define PC9_PF_UART1_CTS ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 9 )
255#define PC10_PF_UART1_RTS ( GPIO_PORTC | GPIO_IN | GPIO_PF | 10 )
256#define PC11_PF_UART1_TXD ( GPIO_PORTC | GPIO_OUT | GPIO_PF | 11 )
257#define PC12_PF_UART1_RXD ( GPIO_PORTC | GPIO_IN | GPIO_PF | 12 )
258#define PC13_PF_SPI1_SPI_RDY ( GPIO_PORTC | GPIO_PF | 13 )
259#define PC14_PF_SPI1_SCLK ( GPIO_PORTC | GPIO_PF | 14 )
260#define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 )
261#define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 )
262#define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100263#define PC24_BIN_UART3_RI ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24 )
264#define PC25_BIN_UART3_DSR ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25 )
265#define PC26_AOUT_UART3_DTR ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 26 )
266#define PC27_BIN_UART3_DCD ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27 )
267#define PC28_BIN_UART3_CTS ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28 )
268#define PC29_AOUT_UART3_RTS ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 29 )
269#define PC30_BIN_UART3_TX ( GPIO_GIUS | GPIO_PORTC | GPIO_BIN | 30 )
270#define PC31_AOUT_UART3_RX ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 31)
wdenk7ac16102004-08-01 22:48:16 +0000271#define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 )
272#define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100273#define PD7_AF_UART2_DTR ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | GPIO_AF | 7 )
274#define PD7_AIN_SPI2_SCLK ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 7 )
wdenk7ac16102004-08-01 22:48:16 +0000275#define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 )
276#define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100277#define PD8_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 8 )
wdenk7ac16102004-08-01 22:48:16 +0000278#define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 )
279#define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100280#define PD9_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | 9 )
wdenk7ac16102004-08-01 22:48:16 +0000281#define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 )
282#define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100283#define PD10_AIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_OUT | 10 )
wdenk7ac16102004-08-01 22:48:16 +0000284#define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 )
285#define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 )
286#define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 )
287#define PD14_PF_FLM_VSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 14 )
288#define PD15_PF_LD0 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 15 )
289#define PD16_PF_LD1 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 16 )
290#define PD17_PF_LD2 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 17 )
291#define PD18_PF_LD3 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 18 )
292#define PD19_PF_LD4 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 19 )
293#define PD20_PF_LD5 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 20 )
294#define PD21_PF_LD6 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 21 )
295#define PD22_PF_LD7 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 22 )
296#define PD23_PF_LD8 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 23 )
297#define PD24_PF_LD9 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 24 )
298#define PD25_PF_LD10 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 25 )
299#define PD26_PF_LD11 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 26 )
300#define PD27_PF_LD12 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 27 )
301#define PD28_PF_LD13 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 28 )
302#define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 )
303#define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 )
304#define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 )
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100305#define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 )
wdenk7ac16102004-08-01 22:48:16 +0000306
307/*
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100308 * PWM controller
309 */
310#define PWMC __REG(IMX_PWM_BASE + 0x00) /* PWM Control Register */
311#define PWMS __REG(IMX_PWM_BASE + 0x04) /* PWM Sample Register */
312#define PWMP __REG(IMX_PWM_BASE + 0x08) /* PWM Period Register */
313#define PWMCNT __REG(IMX_PWM_BASE + 0x0C) /* PWM Counter Register */
314
315#define PWMC_HCTR (0x01<<18) /* Halfword FIFO Data Swapping */
316#define PWMC_BCTR (0x01<<17) /* Byte FIFO Data Swapping */
317#define PWMC_SWR (0x01<<16) /* Software Reset */
318#define PWMC_CLKSRC (0x01<<15) /* Clock Source */
319#define PWMC_PRESCALER(x) (((x-1) & 0x7F) << 8) /* PRESCALER */
320#define PWMC_IRQ (0x01<< 7) /* Interrupt Request */
321#define PWMC_IRQEN (0x01<< 6) /* Interrupt Request Enable */
322#define PWMC_FIFOAV (0x01<< 5) /* FIFO Available */
323#define PWMC_EN (0x01<< 4) /* Enables/Disables the PWM */
324#define PWMC_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
325#define PWMC_CLKSEL(x) (((x) & 0x03) << 0) /* Clock Selection */
326
327#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
328#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
329#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
330
331/*
wdenk7ac16102004-08-01 22:48:16 +0000332 * DMA Controller
333 */
334#define DCR __REG(IMX_DMAC_BASE +0x00) /* DMA Control Register */
335#define DISR __REG(IMX_DMAC_BASE +0x04) /* DMA Interrupt status Register */
336#define DIMR __REG(IMX_DMAC_BASE +0x08) /* DMA Interrupt mask Register */
337#define DBTOSR __REG(IMX_DMAC_BASE +0x0c) /* DMA Burst timeout status Register */
338#define DRTOSR __REG(IMX_DMAC_BASE +0x10) /* DMA Request timeout Register */
339#define DSESR __REG(IMX_DMAC_BASE +0x14) /* DMA Transfer Error Status Register */
340#define DBOSR __REG(IMX_DMAC_BASE +0x18) /* DMA Buffer overflow status Register */
341#define DBTOCR __REG(IMX_DMAC_BASE +0x1c) /* DMA Burst timeout control Register */
342#define WSRA __REG(IMX_DMAC_BASE +0x40) /* W-Size Register A */
343#define XSRA __REG(IMX_DMAC_BASE +0x44) /* X-Size Register A */
344#define YSRA __REG(IMX_DMAC_BASE +0x48) /* Y-Size Register A */
345#define WSRB __REG(IMX_DMAC_BASE +0x4c) /* W-Size Register B */
346#define XSRB __REG(IMX_DMAC_BASE +0x50) /* X-Size Register B */
347#define YSRB __REG(IMX_DMAC_BASE +0x54) /* Y-Size Register B */
348#define SAR(x) __REG2( IMX_DMAC_BASE + 0x80, (x) << 6) /* Source Address Registers */
349#define DAR(x) __REG2( IMX_DMAC_BASE + 0x84, (x) << 6) /* Destination Address Registers */
350#define CNTR(x) __REG2( IMX_DMAC_BASE + 0x88, (x) << 6) /* Count Registers */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100351#define CCR(x) __REG2( IMX_DMAC_BASE + 0x8c, (x) << 6) /* Control Registers */
wdenk7ac16102004-08-01 22:48:16 +0000352#define RSSR(x) __REG2( IMX_DMAC_BASE + 0x90, (x) << 6) /* Request source select Registers */
353#define BLR(x) __REG2( IMX_DMAC_BASE + 0x94, (x) << 6) /* Burst length Registers */
354#define RTOR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Request timeout Registers */
355#define BUCR(x) __REG2( IMX_DMAC_BASE + 0x98, (x) << 6) /* Bus Utilization Registers */
356
357/* TODO: define DMA_REQ lines */
358
359#define DCR_DRST (1<<1)
360#define DCR_DEN (1<<0)
361#define DBTOCR_EN (1<<15)
362#define DBTOCR_CNT(x) ((x) & 0x7fff )
363#define CNTR_CNT(x) ((x) & 0xffffff )
364#define CCR_DMOD_LINEAR ( 0x0 << 12 )
365#define CCR_DMOD_2D ( 0x1 << 12 )
366#define CCR_DMOD_FIFO ( 0x2 << 12 )
367#define CCR_DMOD_EOBFIFO ( 0x3 << 12 )
368#define CCR_SMOD_LINEAR ( 0x0 << 10 )
369#define CCR_SMOD_2D ( 0x1 << 10 )
370#define CCR_SMOD_FIFO ( 0x2 << 10 )
371#define CCR_SMOD_EOBFIFO ( 0x3 << 10 )
372#define CCR_MDIR_DEC (1<<9)
373#define CCR_MSEL_B (1<<8)
374#define CCR_DSIZ_32 ( 0x0 << 6 )
375#define CCR_DSIZ_8 ( 0x1 << 6 )
376#define CCR_DSIZ_16 ( 0x2 << 6 )
377#define CCR_SSIZ_32 ( 0x0 << 4 )
378#define CCR_SSIZ_8 ( 0x1 << 4 )
379#define CCR_SSIZ_16 ( 0x2 << 4 )
380#define CCR_REN (1<<3)
381#define CCR_RPT (1<<2)
382#define CCR_FRC (1<<1)
383#define CCR_CEN (1<<0)
384#define RTOR_EN (1<<15)
385#define RTOR_CLK (1<<14)
386#define RTOR_PSC (1<<13)
387
388/*
389 * LCD Controller
390 */
391
392#define LCDC_SSA __REG(IMX_LCDC_BASE+0x00)
393
394#define LCDC_SIZE __REG(IMX_LCDC_BASE+0x04)
395#define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20)
396#define SIZE_YMAX(y) ( (y) & 0x1ff )
397
398#define LCDC_VPW __REG(IMX_LCDC_BASE+0x08)
399#define VPW_VPW(x) ( (x) & 0x3ff )
400
401#define LCDC_CPOS __REG(IMX_LCDC_BASE+0x0C)
402#define CPOS_CC1 (1<<31)
403#define CPOS_CC0 (1<<30)
404#define CPOS_OP (1<<28)
405#define CPOS_CXP(x) (((x) & 3ff) << 16)
406#define CPOS_CYP(y) ((y) & 0x1ff)
407
408#define LCDC_LCWHB __REG(IMX_LCDC_BASE+0x10)
409#define LCWHB_BK_EN (1<<31)
410#define LCWHB_CW(w) (((w) & 0x1f) << 24)
411#define LCWHB_CH(h) (((h) & 0x1f) << 16)
412#define LCWHB_BD(x) ((x) & 0xff)
413
414#define LCDC_LCHCC __REG(IMX_LCDC_BASE+0x14)
415#define LCHCC_CUR_COL_R(r) (((r) & 0x1f) << 11)
416#define LCHCC_CUR_COL_G(g) (((g) & 0x3f) << 5)
417#define LCHCC_CUR_COL_B(b) ((b) & 0x1f)
418
419#define LCDC_PCR __REG(IMX_LCDC_BASE+0x18)
420#define PCR_TFT (1<<31)
421#define PCR_COLOR (1<<30)
422#define PCR_PBSIZ_1 (0<<28)
423#define PCR_PBSIZ_2 (1<<28)
424#define PCR_PBSIZ_4 (2<<28)
425#define PCR_PBSIZ_8 (3<<28)
426#define PCR_BPIX_1 (0<<25)
427#define PCR_BPIX_2 (1<<25)
428#define PCR_BPIX_4 (2<<25)
429#define PCR_BPIX_8 (3<<25)
430#define PCR_BPIX_12 (4<<25)
431#define PCR_BPIX_16 (4<<25)
432#define PCR_PIXPOL (1<<24)
433#define PCR_FLMPOL (1<<23)
434#define PCR_LPPOL (1<<22)
435#define PCR_CLKPOL (1<<21)
436#define PCR_OEPOL (1<<20)
437#define PCR_SCLKIDLE (1<<19)
438#define PCR_END_SEL (1<<18)
439#define PCR_END_BYTE_SWAP (1<<17)
440#define PCR_REV_VS (1<<16)
441#define PCR_ACD_SEL (1<<15)
442#define PCR_ACD(x) (((x) & 0x7f) << 8)
443#define PCR_SCLK_SEL (1<<7)
444#define PCR_SHARP (1<<6)
445#define PCR_PCD(x) ((x) & 0x3f)
446
447#define LCDC_HCR __REG(IMX_LCDC_BASE+0x1C)
448#define HCR_H_WIDTH(x) (((x) & 0x3f) << 26)
449#define HCR_H_WAIT_1(x) (((x) & 0xff) << 8)
450#define HCR_H_WAIT_2(x) ((x) & 0xff)
451
452#define LCDC_VCR __REG(IMX_LCDC_BASE+0x20)
453#define VCR_V_WIDTH(x) (((x) & 0x3f) << 26)
454#define VCR_V_WAIT_1(x) (((x) & 0xff) << 8)
455#define VCR_V_WAIT_2(x) ((x) & 0xff)
456
457#define LCDC_POS __REG(IMX_LCDC_BASE+0x24)
458#define POS_POS(x) ((x) & 1f)
459
460#define LCDC_LSCR1 __REG(IMX_LCDC_BASE+0x28)
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100461#define LSCR1_PS_RISE_DELAY(x) (((x) & 0x7f) << 26)
462#define LSCR1_CLS_RISE_DELAY(x) (((x) & 0x3f) << 16)
463#define LSCR1_REV_TOGGLE_DELAY(x) (((x) & 0xf) << 8)
464#define LSCR1_GRAY2(x) (((x) & 0xf) << 4)
465#define LSCR1_GRAY1(x) (((x) & 0xf))
wdenk7ac16102004-08-01 22:48:16 +0000466
467#define LCDC_PWMR __REG(IMX_LCDC_BASE+0x2C)
468#define PWMR_CLS(x) (((x) & 0x1ff) << 16)
469#define PWMR_LDMSK (1<<15)
470#define PWMR_SCR1 (1<<10)
471#define PWMR_SCR0 (1<<9)
472#define PWMR_CC_EN (1<<8)
473#define PWMR_PW(x) ((x) & 0xff)
474
475#define LCDC_DMACR __REG(IMX_LCDC_BASE+0x30)
476#define DMACR_BURST (1<<31)
477#define DMACR_HM(x) (((x) & 0xf) << 16)
478#define DMACR_TM(x) ((x) &0xf)
479
480#define LCDC_RMCR __REG(IMX_LCDC_BASE+0x34)
481#define RMCR_LCDC_EN (1<<1)
482#define RMCR_SELF_REF (1<<0)
483
484#define LCDC_LCDICR __REG(IMX_LCDC_BASE+0x38)
485#define LCDICR_INT_SYN (1<<2)
486#define LCDICR_INT_CON (1)
487
488#define LCDC_LCDISR __REG(IMX_LCDC_BASE+0x40)
489#define LCDISR_UDR_ERR (1<<3)
490#define LCDISR_ERR_RES (1<<2)
491#define LCDISR_EOF (1<<1)
492#define LCDISR_BOF (1<<0)
493/*
494 * UART Module
495 */
496#define URXD0(x) __REG2( IMX_UART1_BASE + 0x0, ((x) & 1) << 12) /* Receiver Register */
497#define URTX0(x) __REG2( IMX_UART1_BASE + 0x40, ((x) & 1) << 12) /* Transmitter Register */
498#define UCR1(x) __REG2( IMX_UART1_BASE + 0x80, ((x) & 1) << 12) /* Control Register 1 */
499#define UCR2(x) __REG2( IMX_UART1_BASE + 0x84, ((x) & 1) << 12) /* Control Register 2 */
500#define UCR3(x) __REG2( IMX_UART1_BASE + 0x88, ((x) & 1) << 12) /* Control Register 3 */
501#define UCR4(x) __REG2( IMX_UART1_BASE + 0x8c, ((x) & 1) << 12) /* Control Register 4 */
502#define UFCR(x) __REG2( IMX_UART1_BASE + 0x90, ((x) & 1) << 12) /* FIFO Control Register */
503#define USR1(x) __REG2( IMX_UART1_BASE + 0x94, ((x) & 1) << 12) /* Status Register 1 */
504#define USR2(x) __REG2( IMX_UART1_BASE + 0x98, ((x) & 1) << 12) /* Status Register 2 */
505#define UESC(x) __REG2( IMX_UART1_BASE + 0x9c, ((x) & 1) << 12) /* Escape Character Register */
506#define UTIM(x) __REG2( IMX_UART1_BASE + 0xa0, ((x) & 1) << 12) /* Escape Timer Register */
507#define UBIR(x) __REG2( IMX_UART1_BASE + 0xa4, ((x) & 1) << 12) /* BRM Incremental Register */
508#define UBMR(x) __REG2( IMX_UART1_BASE + 0xa8, ((x) & 1) << 12) /* BRM Modulator Register */
509#define UBRC(x) __REG2( IMX_UART1_BASE + 0xac, ((x) & 1) << 12) /* Baud Rate Count Register */
510#define BIPR1(x) __REG2( IMX_UART1_BASE + 0xb0, ((x) & 1) << 12) /* Incremental Preset Register 1 */
511#define BIPR2(x) __REG2( IMX_UART1_BASE + 0xb4, ((x) & 1) << 12) /* Incremental Preset Register 2 */
512#define BIPR3(x) __REG2( IMX_UART1_BASE + 0xb8, ((x) & 1) << 12) /* Incremental Preset Register 3 */
513#define BIPR4(x) __REG2( IMX_UART1_BASE + 0xbc, ((x) & 1) << 12) /* Incremental Preset Register 4 */
514#define BMPR1(x) __REG2( IMX_UART1_BASE + 0xc0, ((x) & 1) << 12) /* BRM Modulator Register 1 */
515#define BMPR2(x) __REG2( IMX_UART1_BASE + 0xc4, ((x) & 1) << 12) /* BRM Modulator Register 2 */
516#define BMPR3(x) __REG2( IMX_UART1_BASE + 0xc8, ((x) & 1) << 12) /* BRM Modulator Register 3 */
517#define BMPR4(x) __REG2( IMX_UART1_BASE + 0xcc, ((x) & 1) << 12) /* BRM Modulator Register 4 */
518#define UTS(x) __REG2( IMX_UART1_BASE + 0xd0, ((x) & 1) << 12) /* UART Test Register */
519
520/* UART Control Register Bit Fields.*/
521#define URXD_CHARRDY (1<<15)
522#define URXD_ERR (1<<14)
523#define URXD_OVRRUN (1<<13)
524#define URXD_FRMERR (1<<12)
525#define URXD_BRK (1<<11)
526#define URXD_PRERR (1<<10)
527#define UCR1_ADEN (1<<15) /* Auto dectect interrupt */
528#define UCR1_ADBR (1<<14) /* Auto detect baud rate */
529#define UCR1_TRDYEN (1<<13) /* Transmitter ready interrupt enable */
530#define UCR1_IDEN (1<<12) /* Idle condition interrupt */
531#define UCR1_RRDYEN (1<<9) /* Recv ready interrupt enable */
532#define UCR1_RDMAEN (1<<8) /* Recv ready DMA enable */
533#define UCR1_IREN (1<<7) /* Infrared interface enable */
534#define UCR1_TXMPTYEN (1<<6) /* Transimitter empty interrupt enable */
535#define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */
536#define UCR1_SNDBRK (1<<4) /* Send break */
537#define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */
538#define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */
539#define UCR1_DOZE (1<<1) /* Doze */
540#define UCR1_UARTEN (1<<0) /* UART enabled */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100541#define UCR2_ESCI (1<<15) /* Escape seq interrupt enable */
542#define UCR2_IRTS (1<<14) /* Ignore RTS pin */
543#define UCR2_CTSC (1<<13) /* CTS pin control */
wdenk7ac16102004-08-01 22:48:16 +0000544#define UCR2_CTS (1<<12) /* Clear to send */
545#define UCR2_ESCEN (1<<11) /* Escape enable */
546#define UCR2_PREN (1<<8) /* Parity enable */
547#define UCR2_PROE (1<<7) /* Parity odd/even */
548#define UCR2_STPB (1<<6) /* Stop */
549#define UCR2_WS (1<<5) /* Word size */
550#define UCR2_RTSEN (1<<4) /* Request to send interrupt enable */
551#define UCR2_TXEN (1<<2) /* Transmitter enabled */
552#define UCR2_RXEN (1<<1) /* Receiver enabled */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100553#define UCR2_SRST (1<<0) /* SW reset */
554#define UCR3_DTREN (1<<13) /* DTR interrupt enable */
wdenk7ac16102004-08-01 22:48:16 +0000555#define UCR3_PARERREN (1<<12) /* Parity enable */
556#define UCR3_FRAERREN (1<<11) /* Frame error interrupt enable */
557#define UCR3_DSR (1<<10) /* Data set ready */
558#define UCR3_DCD (1<<9) /* Data carrier detect */
559#define UCR3_RI (1<<8) /* Ring indicator */
560#define UCR3_TIMEOUTEN (1<<7) /* Timeout interrupt enable */
561#define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */
562#define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */
563#define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100564#define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */
565#define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */
566#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
567#define UCR3_BPEN (1<<0) /* Preset registers enable */
wdenk7ac16102004-08-01 22:48:16 +0000568#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100569#define UCR4_INVR (1<<9) /* Inverted infrared reception */
570#define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */
571#define UCR4_WKEN (1<<7) /* Wake interrupt enable */
572#define UCR4_REF16 (1<<6) /* Ref freq 16 MHz */
573#define UCR4_IRSC (1<<5) /* IR special case */
574#define UCR4_TCEN (1<<3) /* Transmit complete interrupt enable */
575#define UCR4_BKEN (1<<2) /* Break condition interrupt enable */
576#define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */
577#define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */
wdenk7ac16102004-08-01 22:48:16 +0000578#define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */
579#define UFCR_RFDIV (7<<7) /* Reference freq divider mask */
580#define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */
581#define USR1_PARITYERR (1<<15) /* Parity error interrupt flag */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100582#define USR1_RTSS (1<<14) /* RTS pin status */
583#define USR1_TRDY (1<<13) /* Transmitter ready interrupt/dma flag */
584#define USR1_RTSD (1<<12) /* RTS delta */
585#define USR1_ESCF (1<<11) /* Escape seq interrupt flag */
wdenk7ac16102004-08-01 22:48:16 +0000586#define USR1_FRAMERR (1<<10) /* Frame error interrupt flag */
587#define USR1_RRDY (1<<9) /* Receiver ready interrupt/dma flag */
588#define USR1_TIMEOUT (1<<7) /* Receive timeout interrupt status */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100589#define USR1_RXDS (1<<6) /* Receiver idle interrupt flag */
wdenk7ac16102004-08-01 22:48:16 +0000590#define USR1_AIRINT (1<<5) /* Async IR wake interrupt flag */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100591#define USR1_AWAKE (1<<4) /* Aysnc wake interrupt flag */
592#define USR2_ADET (1<<15) /* Auto baud rate detect complete */
593#define USR2_TXFE (1<<14) /* Transmit buffer FIFO empty */
594#define USR2_DTRF (1<<13) /* DTR edge interrupt flag */
595#define USR2_IDLE (1<<12) /* Idle condition */
596#define USR2_IRINT (1<<8) /* Serial infrared interrupt flag */
597#define USR2_WAKE (1<<7) /* Wake */
598#define USR2_RTSF (1<<4) /* RTS edge interrupt flag */
599#define USR2_TXDC (1<<3) /* Transmitter complete */
600#define USR2_BRCD (1<<2) /* Break condition */
wdenk7ac16102004-08-01 22:48:16 +0000601#define USR2_ORE (1<<1) /* Overrun error */
602#define USR2_RDR (1<<0) /* Recv data ready */
603#define UTS_FRCPERR (1<<13) /* Force parity error */
604#define UTS_LOOP (1<<12) /* Loop tx and rx */
605#define UTS_TXEMPTY (1<<6) /* TxFIFO empty */
606#define UTS_RXEMPTY (1<<5) /* RxFIFO empty */
Jean-Christophe PLAGNIOL-VILLARD8554ea82008-02-25 00:03:11 +0100607#define UTS_TXFULL (1<<4) /* TxFIFO full */
608#define UTS_RXFULL (1<<3) /* RxFIFO full */
wdenk7ac16102004-08-01 22:48:16 +0000609#define UTS_SOFTRST (1<<0) /* Software reset */
610
611/* General purpose timers registers */
612#define TCTL1 __REG(IMX_TIM1_BASE)
613#define TPRER1 __REG(IMX_TIM1_BASE + 0x4)
614#define TCMP1 __REG(IMX_TIM1_BASE + 0x8)
615#define TCR1 __REG(IMX_TIM1_BASE + 0xc)
616#define TCN1 __REG(IMX_TIM1_BASE + 0x10)
617#define TSTAT1 __REG(IMX_TIM1_BASE + 0x14)
618#define TCTL2 __REG(IMX_TIM2_BASE)
619#define TPRER2 __REG(IMX_TIM2_BASE + 0x4)
620#define TCMP2 __REG(IMX_TIM2_BASE + 0x8)
621#define TCR2 __REG(IMX_TIM2_BASE + 0xc)
622#define TCN2 __REG(IMX_TIM2_BASE + 0x10)
623#define TSTAT2 __REG(IMX_TIM2_BASE + 0x14)
624
625/* General purpose timers bitfields */
626#define TCTL_SWR (1<<15) /* Software reset */
627#define TCTL_FRR (1<<8) /* Freerun / restart */
628#define TCTL_CAP (3<<6) /* Capture Edge */
629#define TCTL_OM (1<<5) /* output mode */
630#define TCTL_IRQEN (1<<4) /* interrupt enable */
631#define TCTL_CLKSOURCE (7<<1) /* Clock source */
632#define TCTL_TEN (1) /* Timer enable */
633#define TPRER_PRES (0xff) /* Prescale */
634#define TSTAT_CAPT (1<<1) /* Capture event */
635#define TSTAT_COMP (1) /* Compare event */
636
637#endif /* _IMX_REGS_H */