2 * arch/ubicom32/include/asm/uart_tio.h
3 * Ubicom32 architecture UART TIO definitions.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 #ifndef _ASM_UBICOM32_UART_TIO_H
24 #define _ASM_UBICOM32_UART_TIO_H
26 #include <asm/devtree.h>
28 #define UARTTIO_RX_FIFO_SIZE 16
29 #define UARTTIO_TX_FIFO_SIZE 16
34 #define UARTTIO_UART_INT_RX 0x00000001 // set when a character has been recevied (TODO: add watermark)
35 #define UARTTIO_UART_INT_RXOVF 0x00000002 // set when the receive buffer has overflowed
36 #define UARTTIO_UART_INT_RXFRAME 0x00000004 // set when there has been a framing error
38 #define UARTTIO_UART_INT_TX 0x00000100 // set every time a character is transmitted
39 #define UARTTIO_UART_INT_TXBE 0x00000200 // set when the transmit buffer is empty (TODO: add watermark)
41 #define UARTTIO_UART_FLAG_ENABLED 0x80000000
42 #define UARTTIO_UART_FLAG_SET_RATE 0x00000001 // set to update baud rate
43 #define UARTTIO_UART_FLAG_RESET 0x00000002 // set to reset the port
47 volatile u32_t baud_rate
;
48 volatile u32_t current_baud_rate
;
52 * Modem status register
54 volatile u32_t status
;
59 volatile u32_t int_mask
;
60 volatile u32_t int_flags
;
80 * RX state machine data
90 * TX state machine data
102 u8_t rx_fifo
[UARTTIO_RX_FIFO_SIZE
];
103 u8_t tx_fifo
[UARTTIO_TX_FIFO_SIZE
];
106 #define UARTTIO_VP_VERSION 1
107 struct uarttio_regs
{
114 struct uarttio_uart uarts
[0];
117 #define UARTTIO_NODE_VERSION 1
118 struct uarttio_node
{
119 struct devtree_node dn
;
122 struct uarttio_regs
*regs
;
126 #endif /* _ASM_UBICOM32_UART_TIO_H */