blob: 2720b8db10a0f68337856feebae4913a3f3ae422 [file] [log] [blame]
Stefan Reinauer85b0fa12010-12-17 00:08:21 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2003 Eric Biederman
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
Kyösti Mälkkibea6bf02014-01-30 15:45:16 +020020#ifndef UART8250REG_H
21#define UART8250REG_H
Eric Biederman8ca8d762003-04-22 19:02:15 +000022
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000023/* Data */
Gabe Black77ffa0d2013-09-30 21:25:49 -070024#define UART8250_RBR 0x00
25#define UART8250_TBR 0x00
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000026
27/* Control */
Gabe Black77ffa0d2013-09-30 21:25:49 -070028#define UART8250_IER 0x01
29#define UART8250_IER_MSI 0x08 /* Enable Modem status interrupt */
30#define UART8250_IER_RLSI 0x04 /* Enable receiver line status interrupt */
31#define UART8250_IER_THRI 0x02 /* Enable Transmitter holding register int. */
32#define UART8250_IER_RDI 0x01 /* Enable receiver data interrupt */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000033
Gabe Black77ffa0d2013-09-30 21:25:49 -070034#define UART8250_IIR 0x02
35#define UART8250_IIR_NO_INT 0x01 /* No interrupts pending */
36#define UART8250_IIR_ID 0x06 /* Mask for the interrupt ID */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000037
Gabe Black77ffa0d2013-09-30 21:25:49 -070038#define UART8250_IIR_MSI 0x00 /* Modem status interrupt */
39#define UART8250_IIR_THRI 0x02 /* Transmitter holding register empty */
40#define UART8250_IIR_RDI 0x04 /* Receiver data interrupt */
41#define UART8250_IIR_RLSI 0x06 /* Receiver line status interrupt */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000042
Gabe Black77ffa0d2013-09-30 21:25:49 -070043#define UART8250_FCR 0x02
44#define UART8250_FCR_FIFO_EN 0x01 /* Fifo enable */
45#define UART8250_FCR_CLEAR_RCVR 0x02 /* Clear the RCVR FIFO */
46#define UART8250_FCR_CLEAR_XMIT 0x04 /* Clear the XMIT FIFO */
47#define UART8250_FCR_DMA_SELECT 0x08 /* For DMA applications */
48#define UART8250_FCR_TRIGGER_MASK 0xC0 /* Mask for the FIFO trigger range */
49#define UART8250_FCR_TRIGGER_1 0x00 /* Mask for trigger set at 1 */
50#define UART8250_FCR_TRIGGER_4 0x40 /* Mask for trigger set at 4 */
51#define UART8250_FCR_TRIGGER_8 0x80 /* Mask for trigger set at 8 */
52#define UART8250_FCR_TRIGGER_14 0xC0 /* Mask for trigger set at 14 */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000053
Gabe Black77ffa0d2013-09-30 21:25:49 -070054#define UART8250_FCR_RXSR 0x02 /* Receiver soft reset */
55#define UART8250_FCR_TXSR 0x04 /* Transmitter soft reset */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000056
Gabe Black77ffa0d2013-09-30 21:25:49 -070057#define UART8250_LCR 0x03
58#define UART8250_LCR_WLS_MSK 0x03 /* character length select mask */
59#define UART8250_LCR_WLS_5 0x00 /* 5 bit character length */
60#define UART8250_LCR_WLS_6 0x01 /* 6 bit character length */
61#define UART8250_LCR_WLS_7 0x02 /* 7 bit character length */
62#define UART8250_LCR_WLS_8 0x03 /* 8 bit character length */
63#define UART8250_LCR_STB 0x04 /* Number of stop Bits, off = 1, on = 1.5 or 2) */
64#define UART8250_LCR_PEN 0x08 /* Parity enable */
65#define UART8250_LCR_EPS 0x10 /* Even Parity Select */
66#define UART8250_LCR_STKP 0x20 /* Stick Parity */
67#define UART8250_LCR_SBRK 0x40 /* Set Break */
68#define UART8250_LCR_BKSE 0x80 /* Bank select enable */
69#define UART8250_LCR_DLAB 0x80 /* Divisor latch access bit */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000070
Gabe Black77ffa0d2013-09-30 21:25:49 -070071#define UART8250_MCR 0x04
72#define UART8250_MCR_DTR 0x01 /* DTR */
73#define UART8250_MCR_RTS 0x02 /* RTS */
74#define UART8250_MCR_OUT1 0x04 /* Out 1 */
75#define UART8250_MCR_OUT2 0x08 /* Out 2 */
76#define UART8250_MCR_LOOP 0x10 /* Enable loopback test mode */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000077
Gabe Black77ffa0d2013-09-30 21:25:49 -070078#define UART8250_MCR_DMA_EN 0x04
79#define UART8250_MCR_TX_DFR 0x08
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000080
Gabe Black77ffa0d2013-09-30 21:25:49 -070081#define UART8250_DLL 0x00
82#define UART8250_DLM 0x01
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000083
84/* Status */
Gabe Black77ffa0d2013-09-30 21:25:49 -070085#define UART8250_LSR 0x05
86#define UART8250_LSR_DR 0x01 /* Data ready */
87#define UART8250_LSR_OE 0x02 /* Overrun */
88#define UART8250_LSR_PE 0x04 /* Parity error */
89#define UART8250_LSR_FE 0x08 /* Framing error */
90#define UART8250_LSR_BI 0x10 /* Break */
91#define UART8250_LSR_THRE 0x20 /* Xmit holding register empty */
92#define UART8250_LSR_TEMT 0x40 /* Xmitter empty */
93#define UART8250_LSR_ERR 0x80 /* Error */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +000094
Gabe Black77ffa0d2013-09-30 21:25:49 -070095#define UART8250_MSR 0x06
96#define UART8250_MSR_DCD 0x80 /* Data Carrier Detect */
97#define UART8250_MSR_RI 0x40 /* Ring Indicator */
98#define UART8250_MSR_DSR 0x20 /* Data Set Ready */
99#define UART8250_MSR_CTS 0x10 /* Clear to Send */
100#define UART8250_MSR_DDCD 0x08 /* Delta DCD */
101#define UART8250_MSR_TERI 0x04 /* Trailing edge ring indicator */
102#define UART8250_MSR_DDSR 0x02 /* Delta DSR */
103#define UART8250_MSR_DCTS 0x01 /* Delta CTS */
Stefan Reinauer85b0fa12010-12-17 00:08:21 +0000104
Gabe Black77ffa0d2013-09-30 21:25:49 -0700105#define UART8250_SCR 0x07
106#define UART8250_SPR 0x07
Stefan Reinauer85b0fa12010-12-17 00:08:21 +0000107
Kyösti Mälkkibea6bf02014-01-30 15:45:16 +0200108#endif /* UART8250REG_H */