1 /* 2 * Copyright (C) 2011 by Vladimir Zapolskiy <vz@mleia.com> 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 * MA 02110-1301, USA. 18 */ 19 20 #ifndef _LPC32XX_UART_H 21 #define _LPC32XX_UART_H 22 23 #include <asm/types.h> 24 25 /* UART Control Registers */ 26 struct uart_ctrl_regs { 27 u32 ctrl; /* Control Register */ 28 u32 clkmode; /* Clock Mode Register */ 29 u32 loop; /* Loopback Control Register */ 30 }; 31 32 /* UART Control Register bits */ 33 #define UART_CTRL_UART3_MD_CTRL (1 << 11) 34 #define UART_CTRL_HDPX_INV (1 << 10) 35 #define UART_CTRL_HDPX_EN (1 << 9) 36 #define UART_CTRL_UART6_IRDA (1 << 5) 37 #define UART_CTRL_IR_TX6_INV (1 << 4) 38 #define UART_CTRL_IR_RX6_INV (1 << 3) 39 #define UART_CTRL_IR_RX_LENGTH (1 << 2) 40 #define UART_CTRL_IR_TX_LENGTH (1 << 1) 41 #define UART_CTRL_UART5_USB_MODE (1 << 0) 42 43 /* UART Clock Mode Register bits */ 44 #define UART_CLKMODE_STATX(n) (1 << ((n) + 16)) 45 #define UART_CLKMODE_STAT (1 << 14) 46 #define UART_CLKMODE_MASK(n) (0x3 << (2 * (n) - 2)) 47 #define UART_CLKMODE_AUTO(n) (0x2 << (2 * (n) - 2)) 48 #define UART_CLKMODE_ON(n) (0x1 << (2 * (n) - 2)) 49 #define UART_CLKMODE_OFF(n) (0x0 << (2 * (n) - 2)) 50 51 /* UART Loopback Control Register bits */ 52 #define UART_LOOPBACK(n) (1 << ((n) - 1)) 53 54 #endif /* _LPC32XX_UART_H */ 55