Stefan Roese | 45993ea | 2006-11-29 15:42:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. |
| 4 | * |
| 5 | * modified for marvell db64360 eval board by |
| 6 | * Ingo Assmus <ingo.assmus@keymile.com> |
| 7 | * |
| 8 | * See file CREDITS for list of people who contributed to this |
| 9 | * project. |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU General Public License as |
| 13 | * published by the Free Software Foundation; either version 2 of |
| 14 | * the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 24 | * MA 02111-1307 USA |
| 25 | */ |
| 26 | |
| 27 | /* serial.h - mostly useful for DUART serial_init in serial.c */ |
| 28 | |
| 29 | #ifndef __SERIAL_H__ |
| 30 | #define __SERIAL_H__ |
| 31 | |
| 32 | #if 0 |
| 33 | |
| 34 | #define B230400 1 |
| 35 | #define B115200 2 |
| 36 | #define B57600 4 |
| 37 | #define B38400 82 |
| 38 | #define B19200 163 |
| 39 | #define B9600 24 |
| 40 | #define B4800 651 |
| 41 | #define B2400 1302 |
| 42 | #define B1200 2604 |
| 43 | #define B600 5208 |
| 44 | #define B300 10417 |
| 45 | #define B150 20833 |
| 46 | #define B110 28409 |
| 47 | #define BDEFAULT B115200 |
| 48 | |
| 49 | /* this stuff is important to initialize |
| 50 | the DUART channels */ |
| 51 | |
| 52 | #define Scale 0x01L /* distance between port addresses */ |
| 53 | #define COM1 0x000003f8 /* Keyboard */ |
| 54 | #define COM2 0x000002f8 /* Host */ |
| 55 | |
| 56 | |
| 57 | /* Port Definitions relative to base COM port addresses */ |
| 58 | #define DataIn (0x00*Scale) /* data input port */ |
| 59 | #define DataOut (0x00*Scale) /* data output port */ |
| 60 | #define BaudLsb (0x00*Scale) /* baud rate divisor least significant byte */ |
| 61 | #define BaudMsb (0x01*Scale) /* baud rate divisor most significant byte */ |
| 62 | #define Ier (0x01*Scale) /* interrupt enable register */ |
| 63 | #define Iir (0x02*Scale) /* interrupt identification register */ |
| 64 | #define Lcr (0x03*Scale) /* line control register */ |
| 65 | #define Mcr (0x04*Scale) /* modem control register */ |
| 66 | #define Lsr (0x05*Scale) /* line status register */ |
| 67 | #define Msr (0x06*Scale) /* modem status register */ |
| 68 | |
| 69 | /* Bit Definitions for above ports */ |
| 70 | #define LcrDlab 0x80 /* b7: enable baud rate divisor registers */ |
| 71 | #define LcrDflt 0x03 /* b6-0: no parity, 1 stop, 8 data */ |
| 72 | |
| 73 | #define McrRts 0x02 /* b1: request to send (I am ready to xmit) */ |
| 74 | #define McrDtr 0x01 /* b0: data terminal ready (I am alive ready to rcv) */ |
| 75 | #define McrDflt (McrRts|McrDtr) |
| 76 | |
| 77 | #define LsrTxD 0x6000 /* b5: transmit holding register empty (i.e. xmit OK!)*/ |
| 78 | /* b6: transmitter empty */ |
| 79 | #define LsrRxD 0x0100 /* b0: received data ready (i.e. got a byte!) */ |
| 80 | |
| 81 | #define MsrRi 0x0040 /* b6: ring indicator (other guy is ready to rcv) */ |
| 82 | #define MsrDsr 0x0020 /* b5: data set ready (other guy is alive ready to rcv */ |
| 83 | #define MsrCts 0x0010 /* b4: clear to send (other guy is ready to rcv) */ |
| 84 | |
| 85 | #define IerRda 0xf /* b0: Enable received data available interrupt */ |
| 86 | |
| 87 | #endif |
| 88 | |
| 89 | #endif /* __SERIAL_H__ */ |