blob: 7472f9e5523f19da6bc0ae791efd1e3fd65e1a10 [file] [log] [blame]
Bellido Nicolas038c5b62005-06-20 18:51:05 +01001/*
2 * linux/include/asm-arm/arch-aaec2000/aaec2000.h
3 *
4 * AAEC-2000 registers definition
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_AAEC2000_H
14#define __ASM_ARCH_AAEC2000_H
15
16#ifndef __ASM_ARCH_HARDWARE_H
17#error You must include hardware.h not this file
18#endif /* __ASM_ARCH_HARDWARE_H */
19
Bellido Nicolas13b1d672005-10-28 16:51:40 +010020/* Chip selects */
21#define AAEC_CS0 0x00000000
22#define AAEC_CS1 0x10000000
23#define AAEC_CS2 0x20000000
24#define AAEC_CS3 0x30000000
25
26
Bellido Nicolas038c5b62005-06-20 18:51:05 +010027/* Interrupt controller */
28#define IRQ_BASE __REG(0x80000500)
29#define IRQ_INTSR __REG(0x80000500) /* Int Status Register */
30#define IRQ_INTRSR __REG(0x80000504) /* Int Raw (unmasked) Status */
31#define IRQ_INTENS __REG(0x80000508) /* Int Enable Set */
32#define IRQ_INTENC __REG(0x8000050c) /* Int Enable Clear */
33
34/* UART 1 */
35#define UART1_BASE __REG(0x80000600)
36#define UART1_DR __REG(0x80000600) /* Data/FIFO Register */
37#define UART1_LCR __REG(0x80000604) /* Link Control Register */
38#define UART1_BRCR __REG(0x80000608) /* Baud Rate Control Register */
39#define UART1_CR __REG(0x8000060c) /* Control Register */
40#define UART1_SR __REG(0x80000610) /* Status Register */
41#define UART1_INT __REG(0x80000614) /* Interrupt Status Register */
42#define UART1_INTM __REG(0x80000618) /* Interrupt Mask Register */
43#define UART1_INTRES __REG(0x8000061c) /* Int Result (masked status) Register */
44
45/* UART 2 */
46#define UART2_BASE __REG(0x80000700)
47#define UART2_DR __REG(0x80000700) /* Data/FIFO Register */
48#define UART2_LCR __REG(0x80000704) /* Link Control Register */
49#define UART2_BRCR __REG(0x80000708) /* Baud Rate Control Register */
50#define UART2_CR __REG(0x8000070c) /* Control Register */
51#define UART2_SR __REG(0x80000710) /* Status Register */
52#define UART2_INT __REG(0x80000714) /* Interrupt Status Register */
53#define UART2_INTM __REG(0x80000718) /* Interrupt Mask Register */
54#define UART2_INTRES __REG(0x8000071c) /* Int Result (masked status) Register */
55
56/* UART 3 */
57#define UART3_BASE __REG(0x80000800)
58#define UART3_DR __REG(0x80000800) /* Data/FIFO Register */
59#define UART3_LCR __REG(0x80000804) /* Link Control Register */
60#define UART3_BRCR __REG(0x80000808) /* Baud Rate Control Register */
61#define UART3_CR __REG(0x8000080c) /* Control Register */
62#define UART3_SR __REG(0x80000810) /* Status Register */
63#define UART3_INT __REG(0x80000814) /* Interrupt Status Register */
64#define UART3_INTM __REG(0x80000818) /* Interrupt Mask Register */
65#define UART3_INTRES __REG(0x8000081c) /* Int Result (masked status) Register */
66
67/* These are used in some places */
68#define _UART1_BASE __PREG(UART1_BASE)
69#define _UART2_BASE __PREG(UART2_BASE)
70#define _UART3_BASE __PREG(UART3_BASE)
71
72/* UART Registers Offsets */
73#define UART_DR 0x00
74#define UART_LCR 0x04
75#define UART_BRCR 0x08
76#define UART_CR 0x0c
77#define UART_SR 0x10
78#define UART_INT 0x14
79#define UART_INTM 0x18
80#define UART_INTRES 0x1c
81
82/* UART_LCR Bitmask */
83#define UART_LCR_BRK (1 << 0) /* Send Break */
84#define UART_LCR_PEN (1 << 1) /* Parity Enable */
85#define UART_LCR_EP (1 << 2) /* Even/Odd Parity */
86#define UART_LCR_S2 (1 << 3) /* One/Two Stop bits */
87#define UART_LCR_FIFO (1 << 4) /* FIFO Enable */
88#define UART_LCR_WL5 (0 << 5) /* Word Length - 5 bits */
89#define UART_LCR_WL6 (1 << 5) /* Word Length - 6 bits */
90#define UART_LCR_WL7 (1 << 6) /* Word Length - 7 bits */
91#define UART_LCR_WL8 (1 << 7) /* Word Length - 8 bits */
92
93/* UART_CR Bitmask */
94#define UART_CR_EN (1 << 0) /* UART Enable */
95#define UART_CR_SIR (1 << 1) /* IrDA SIR Enable */
96#define UART_CR_SIRLP (1 << 2) /* Low Power IrDA Enable */
97#define UART_CR_RXP (1 << 3) /* Receive Pin Polarity */
98#define UART_CR_TXP (1 << 4) /* Transmit Pin Polarity */
99#define UART_CR_MXP (1 << 5) /* Modem Pin Polarity */
100#define UART_CR_LOOP (1 << 6) /* Loopback Mode */
101
102/* UART_SR Bitmask */
103#define UART_SR_CTS (1 << 0) /* Clear To Send Status */
104#define UART_SR_DSR (1 << 1) /* Data Set Ready Status */
105#define UART_SR_DCD (1 << 2) /* Data Carrier Detect Status */
106#define UART_SR_TxBSY (1 << 3) /* Transmitter Busy Status */
107#define UART_SR_RxFE (1 << 4) /* Receive FIFO Empty Status */
108#define UART_SR_TxFF (1 << 5) /* Transmit FIFO Full Status */
109#define UART_SR_RxFF (1 << 6) /* Receive FIFO Full Status */
110#define UART_SR_TxFE (1 << 7) /* Transmit FIFO Empty Status */
111
112/* UART_INT Bitmask */
113#define UART_INT_RIS (1 << 0) /* Rx Interrupt */
114#define UART_INT_TIS (1 << 1) /* Tx Interrupt */
115#define UART_INT_MIS (1 << 2) /* Modem Interrupt */
116#define UART_INT_RTIS (1 << 3) /* Receive Timeout Interrupt */
117
118/* Timer 1 */
119#define TIMER1_BASE __REG(0x80000c00)
120#define TIMER1_LOAD __REG(0x80000c00) /* Timer 1 Load Register */
121#define TIMER1_VAL __REG(0x80000c04) /* Timer 1 Value Register */
122#define TIMER1_CTRL __REG(0x80000c08) /* Timer 1 Control Register */
123#define TIMER1_CLEAR __REG(0x80000c0c) /* Timer 1 Clear Register */
124
125/* Timer 2 */
126#define TIMER2_BASE __REG(0x80000d00)
127#define TIMER2_LOAD __REG(0x80000d00) /* Timer 2 Load Register */
128#define TIMER2_VAL __REG(0x80000d04) /* Timer 2 Value Register */
129#define TIMER2_CTRL __REG(0x80000d08) /* Timer 2 Control Register */
130#define TIMER2_CLEAR __REG(0x80000d0c) /* Timer 2 Clear Register */
131
132/* Timer 3 */
133#define TIMER3_BASE __REG(0x80000e00)
134#define TIMER3_LOAD __REG(0x80000e00) /* Timer 3 Load Register */
135#define TIMER3_VAL __REG(0x80000e04) /* Timer 3 Value Register */
136#define TIMER3_CTRL __REG(0x80000e08) /* Timer 3 Control Register */
137#define TIMER3_CLEAR __REG(0x80000e0c) /* Timer 3 Clear Register */
138
139/* Timer Control register bits */
140#define TIMER_CTRL_ENABLE (1 << 7) /* Enable (Start° Timer */
141#define TIMER_CTRL_PERIODIC (1 << 6) /* Periodic Running Mode */
142#define TIMER_CTRL_FREE_RUNNING (0 << 6) /* Normal Running Mode */
143#define TIMER_CTRL_CLKSEL_508K (1 << 3) /* 508KHz Clock select (Timer 1, 2) */
144#define TIMER_CTRL_CLKSEL_2K (0 << 3) /* 2KHz Clock Select (Timer 1, 2)*/
145
146/* Power and State Control */
147#define POWER_BASE __REG(0x80000400)
148#define POWER_PWRSR __REG(0x80000400) /* Power Status Register */
149#define POWER_PWRCNT __REG(0x80000404) /* Power/Clock control */
150#define POWER_HALT __REG(0x80000408) /* Power Idle Mode */
151#define POWER_STDBY __REG(0x8000040c) /* Power Standby Mode */
152#define POWER_BLEOI __REG(0x80000410) /* Battery Low End of Interrupt */
153#define POWER_MCEOI __REG(0x80000414) /* Media Changed EoI */
154#define POWER_TEOI __REG(0x80000418) /* Tick EoI */
155#define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */
156#define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */
157
Bellido Nicolas13b1d672005-10-28 16:51:40 +0100158/* GPIO Registers */
159#define AAEC_GPIO_PHYS 0x80000e00
160
161#define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00)
162#define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04)
163#define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08)
164#define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c)
165#define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10)
166#define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14)
167#define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18)
168#define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c)
169#define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20)
170#define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24)
171#define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28)
172#define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c)
173#define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30)
174#define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34)
175#define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38)
176#define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c)
177#define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40)
178#define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44)
179#define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48)
180#define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c)
181#define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50)
182#define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54)
183#define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58)
184#define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c)
185#define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60)
186#define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64)
187#define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68)
188#define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c)
189#define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70)
190#define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74)
191#define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78)
192#define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c)
193#define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80)
194#define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84)
195
196#define AAEC_GPIO_PINMUX_PE0CON (1 << 0)
197#define AAEC_GPIO_PINMUX_PD0CON (1 << 1)
198#define AAEC_GPIO_PINMUX_CODECON (1 << 2)
199#define AAEC_GPIO_PINMUX_UART3CON (1 << 3)
200
Bellido Nicolas038c5b62005-06-20 18:51:05 +0100201#endif /* __ARM_ARCH_AAEC2000_H */