Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * U-boot bf533_serial.h |
| 3 | * |
| 4 | * Copyright (c) 2005 blackfin.uclinux.org |
| 5 | * |
| 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 |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | |
| 26 | #ifndef _BF533_SERIAL_H_ |
| 27 | #define _BF533_SERIAL_H_ |
| 28 | |
| 29 | #define BYTE_REF(addr) (*((volatile char*)addr)) |
| 30 | #define HALFWORD_REF(addr) (*((volatile short*)addr)) |
| 31 | #define WORD_REF(addr) (*((volatile long*)addr)) |
| 32 | |
| 33 | #define UART_THR_LO HALFWORD_REF(UART_THR) |
| 34 | #define UART_RBR_LO HALFWORD_REF(UART_RBR) |
| 35 | #define UART_DLL_LO HALFWORD_REF(UART_DLL) |
| 36 | #define UART_IER_LO HALFWORD_REF(UART_IER) |
| 37 | #define UART_IER_ERBFI 0x01 |
| 38 | #define UART_IER_ETBEI 0x02 |
| 39 | #define UART_IER_ELSI 0x04 |
| 40 | #define UART_IER_EDDSI 0x08 |
| 41 | |
| 42 | #define UART_DLH_LO HALFWORD_REF(UART_DLH) |
| 43 | #define UART_IIR_LO HALFWORD_REF(UART_IIR) |
| 44 | #define UART_IIR_NOINT 0x01 |
| 45 | #define UART_IIR_STATUS 0x06 |
| 46 | #define UART_IIR_LSR 0x06 |
| 47 | #define UART_IIR_RBR 0x04 |
| 48 | #define UART_IIR_THR 0x02 |
| 49 | #define UART_IIR_MSR 0x00 |
| 50 | |
| 51 | #define UART_LCR_LO HALFWORD_REF(UART_LCR) |
| 52 | #define UART_LCR_WLS5 0 |
| 53 | #define UART_LCR_WLS6 0x01 |
| 54 | #define UART_LCR_WLS7 0x02 |
| 55 | #define UART_LCR_WLS8 0x03 |
| 56 | #define UART_LCR_STB 0x04 |
| 57 | #define UART_LCR_PEN 0x08 |
| 58 | #define UART_LCR_EPS 0x10 |
| 59 | #define UART_LCR_SP 0x20 |
| 60 | #define UART_LCR_SB 0x40 |
| 61 | #define UART_LCR_DLAB 0x80 |
| 62 | |
| 63 | #define UART_MCR_LO HALFWORD_REF(UART_MCR) |
| 64 | |
| 65 | #define UART_LSR_LO HALFWORD_REF(UART_LSR) |
| 66 | #define UART_LSR_DR 0x01 |
| 67 | #define UART_LSR_OE 0x02 |
| 68 | #define UART_LSR_PE 0x04 |
| 69 | #define UART_LSR_FE 0x08 |
| 70 | #define UART_LSR_BI 0x10 |
| 71 | #define UART_LSR_THRE 0x20 |
| 72 | #define UART_LSR_TEMT 0x40 |
| 73 | |
| 74 | #define UART_MSR_LO HALFWORD_REF(UART_MSR) |
| 75 | #define UART_SCR_LO HALFWORD_REF(UART_SCR) |
| 76 | #define UART_GCTL_LO HALFWORD_REF(UART_GCTL) |
| 77 | #define UART_GCTL_UCEN 0x01 |
| 78 | |
| 79 | #endif |