2 * File: include/asm-blackfin/mach-bf548/blackfin.h
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #ifndef _MACH_BLACKFIN_H_
33 #define _MACH_BLACKFIN_H_
59 #if !defined(__ASSEMBLY__)
61 #include "cdefBF542.h"
64 #include "cdefBF544.h"
67 #include "cdefBF547.h"
70 #include "cdefBF548.h"
73 #include "cdefBF549.h"
77 #define bfin_read_UART_THR() bfin_read_UART1_THR()
78 #define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
79 #define bfin_read_UART_RBR() bfin_read_UART1_RBR()
80 #define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
81 #define bfin_read_UART_DLL() bfin_read_UART1_DLL()
82 #define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
83 #define bfin_read_UART_IER() bfin_read_UART1_IER()
84 #define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
85 #define bfin_read_UART_DLH() bfin_read_UART1_DLH()
86 #define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
87 #define bfin_read_UART_IIR() bfin_read_UART1_IIR()
88 #define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
89 #define bfin_read_UART_LCR() bfin_read_UART1_LCR()
90 #define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
91 #define bfin_read_UART_MCR() bfin_read_UART1_MCR()
92 #define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
93 #define bfin_read_UART_LSR() bfin_read_UART1_LSR()
94 #define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
95 #define bfin_read_UART_SCR() bfin_read_UART1_SCR()
96 #define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
97 #define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
98 #define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
102 /* MAP used DEFINES from BF533 to BF54x - so we don't need to change
103 * them in the driver, kernel, etc. */
105 /* UART_IIR Register */
106 #define STATUS(x) ((x << 1) & 0x06)
107 #define STATUS_P1 0x02
108 #define STATUS_P0 0x01
113 #define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX()
114 #define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val)
115 #define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX()
116 #define bfin_write_CH_UART_TX(val) bfin_write_CH_UART1_TX(val)
117 #define CH_UART_RX CH_UART1_RX
118 #define CH_UART_TX CH_UART1_TX
120 /* System Interrupt Controller */
121 #define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART1_RX()
122 #define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART1_RX(val)
123 #define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART1_TX()
124 #define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART1_TX(val)
125 #define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART1_ERROR()
126 #define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART1_ERROR(val)
127 #define IRQ_UART_RX IRQ_UART1_RX
128 #define IRQ_UART_TX IRQ_UART1_TX
129 #define IRQ_UART_ERROR IRQ_UART1_ERROR
132 #define bfin_read_UART_THR() bfin_read_UART1_THR()
133 #define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
134 #define bfin_read_UART_RBR() bfin_read_UART1_RBR()
135 #define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
136 #define bfin_read_UART_DLL() bfin_read_UART1_DLL()
137 #define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
138 #define bfin_read_UART_IER() bfin_read_UART1_IER()
139 #define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
140 #define bfin_read_UART_DLH() bfin_read_UART1_DLH()
141 #define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
142 #define bfin_read_UART_IIR() bfin_read_UART1_IIR()
143 #define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
144 #define bfin_read_UART_LCR() bfin_read_UART1_LCR()
145 #define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
146 #define bfin_read_UART_MCR() bfin_read_UART1_MCR()
147 #define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
148 #define bfin_read_UART_LSR() bfin_read_UART1_LSR()
149 #define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
150 #define bfin_read_UART_SCR() bfin_read_UART1_SCR()
151 #define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
152 #define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
153 #define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
155 #define BFIN_UART_THR UART1_THR
156 #define BFIN_UART_RBR UART1_RBR
157 #define BFIN_UART_DLL UART1_DLL
158 #define BFIN_UART_IER UART1_IER
159 #define BFIN_UART_DLH UART1_DLH
160 #define BFIN_UART_IIR UART1_IIR
161 #define BFIN_UART_LCR UART1_LCR
162 #define BFIN_UART_MCR UART1_MCR
163 #define BFIN_UART_LSR UART1_LSR
164 #define BFIN_UART_SCR UART1_SCR
165 #define BFIN_UART_GCTL UART1_GCTL
167 #define BFIN_UART_NR_PORTS 4
169 #define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
170 #define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
171 #define OFFSET_GCTL 0x08 /* Global Control Register */
172 #define OFFSET_LCR 0x0C /* Line Control Register */
173 #define OFFSET_MCR 0x10 /* Modem Control Register */
174 #define OFFSET_LSR 0x14 /* Line Status Register */
175 #define OFFSET_MSR 0x18 /* Modem Status Register */
176 #define OFFSET_SCR 0x1C /* SCR Scratch Register */
177 #define OFFSET_IER_SET 0x20 /* Set Interrupt Enable Register */
178 #define OFFSET_IER_CLEAR 0x24 /* Clear Interrupt Enable Register */
179 #define OFFSET_THR 0x28 /* Transmit Holding register */
180 #define OFFSET_RBR 0x2C /* Receive Buffer register */
183 #define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
184 #define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
185 #define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
186 #define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */