blob: 65749ee458cdd899e57d2310db5a83a549ebcbec [file] [log] [blame]
Wolfgang Denk6cb142f2006-03-12 02:12:27 +01001/*
2 * U-boot bf533_serial.h
3 *
Aubrey Li155fd762007-04-05 18:31:18 +08004 * Copyright (c) 2005-2007 Analog Devices Inc.
Wolfgang Denk6cb142f2006-03-12 02:12:27 +01005 *
6 * See file CREDITS for list of people who contributed to this
7 * project.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
Aubrey Li155fd762007-04-05 18:31:18 +080021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22 * MA 02110-1301 USA
Wolfgang Denk6cb142f2006-03-12 02:12:27 +010023 */
24
Wolfgang Denk6cb142f2006-03-12 02:12:27 +010025#ifndef _BF533_SERIAL_H_
26#define _BF533_SERIAL_H_
27
28#define BYTE_REF(addr) (*((volatile char*)addr))
29#define HALFWORD_REF(addr) (*((volatile short*)addr))
30#define WORD_REF(addr) (*((volatile long*)addr))
31
32#define UART_THR_LO HALFWORD_REF(UART_THR)
33#define UART_RBR_LO HALFWORD_REF(UART_RBR)
34#define UART_DLL_LO HALFWORD_REF(UART_DLL)
35#define UART_IER_LO HALFWORD_REF(UART_IER)
36#define UART_IER_ERBFI 0x01
37#define UART_IER_ETBEI 0x02
38#define UART_IER_ELSI 0x04
39#define UART_IER_EDDSI 0x08
40
41#define UART_DLH_LO HALFWORD_REF(UART_DLH)
42#define UART_IIR_LO HALFWORD_REF(UART_IIR)
43#define UART_IIR_NOINT 0x01
44#define UART_IIR_STATUS 0x06
45#define UART_IIR_LSR 0x06
46#define UART_IIR_RBR 0x04
47#define UART_IIR_THR 0x02
48#define UART_IIR_MSR 0x00
49
50#define UART_LCR_LO HALFWORD_REF(UART_LCR)
51#define UART_LCR_WLS5 0
52#define UART_LCR_WLS6 0x01
53#define UART_LCR_WLS7 0x02
54#define UART_LCR_WLS8 0x03
55#define UART_LCR_STB 0x04
56#define UART_LCR_PEN 0x08
57#define UART_LCR_EPS 0x10
58#define UART_LCR_SP 0x20
59#define UART_LCR_SB 0x40
60#define UART_LCR_DLAB 0x80
61
62#define UART_MCR_LO HALFWORD_REF(UART_MCR)
63
64#define UART_LSR_LO HALFWORD_REF(UART_LSR)
65#define UART_LSR_DR 0x01
66#define UART_LSR_OE 0x02
67#define UART_LSR_PE 0x04
68#define UART_LSR_FE 0x08
69#define UART_LSR_BI 0x10
70#define UART_LSR_THRE 0x20
71#define UART_LSR_TEMT 0x40
72
73#define UART_MSR_LO HALFWORD_REF(UART_MSR)
74#define UART_SCR_LO HALFWORD_REF(UART_SCR)
75#define UART_GCTL_LO HALFWORD_REF(UART_GCTL)
76#define UART_GCTL_UCEN 0x01
77
78#endif