diff options
author | Konrad Zapalowicz <bergo.torino@gmail.com> | 2014-11-03 13:52:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-06 18:01:03 -0500 |
commit | d7685ca7c4f5d22dd9b045992e82c1c444a92187 (patch) | |
tree | f98de2f84f1130a87af1ac095eba5c5204dbfd30 | |
parent | 1511316fbd1c690ad0a16324d88fb5ec45d6be36 (diff) |
drivers: serial: jsm: Add Classic board UART structure
This commit adds the UART structure for the Digi Classic cards. This
code comes from the staging/dgnc driver.
Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/jsm/jsm.h | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h index af7013488aeb..9861639d838f 100644 --- a/drivers/tty/serial/jsm/jsm.h +++ b/drivers/tty/serial/jsm/jsm.h | |||
@@ -222,7 +222,10 @@ struct jsm_channel { | |||
222 | u8 ch_mostat; /* FEP output modem status */ | 222 | u8 ch_mostat; /* FEP output modem status */ |
223 | u8 ch_mistat; /* FEP input modem status */ | 223 | u8 ch_mistat; /* FEP input modem status */ |
224 | 224 | ||
225 | struct neo_uart_struct __iomem *ch_neo_uart; /* Pointer to the "mapped" UART struct */ | 225 | /* Pointers to the "mapped" UART structs */ |
226 | struct neo_uart_struct __iomem *ch_neo_uart; /* NEO card */ | ||
227 | struct cls_uart_struct __iomem *ch_cls_uart; /* Classic card */ | ||
228 | |||
226 | u8 ch_cached_lsr; /* Cached value of the LSR register */ | 229 | u8 ch_cached_lsr; /* Cached value of the LSR register */ |
227 | 230 | ||
228 | u8 *ch_rqueue; /* Our read queue buffer - malloc'ed */ | 231 | u8 *ch_rqueue; /* Our read queue buffer - malloc'ed */ |
@@ -254,6 +257,60 @@ struct jsm_channel { | |||
254 | u64 ch_xoff_sends; /* Count of xoffs transmitted */ | 257 | u64 ch_xoff_sends; /* Count of xoffs transmitted */ |
255 | }; | 258 | }; |
256 | 259 | ||
260 | /************************************************************************ | ||
261 | * Per channel/port Classic UART structures * | ||
262 | ************************************************************************ | ||
263 | * Base Structure Entries Usage Meanings to Host * | ||
264 | * * | ||
265 | * W = read write R = read only * | ||
266 | * U = Unused. * | ||
267 | ************************************************************************/ | ||
268 | |||
269 | struct cls_uart_struct { | ||
270 | u8 txrx; /* WR RHR/THR - Holding Reg */ | ||
271 | u8 ier; /* WR IER - Interrupt Enable Reg */ | ||
272 | u8 isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg*/ | ||
273 | u8 lcr; /* WR LCR - Line Control Reg */ | ||
274 | u8 mcr; /* WR MCR - Modem Control Reg */ | ||
275 | u8 lsr; /* WR LSR - Line Status Reg */ | ||
276 | u8 msr; /* WR MSR - Modem Status Reg */ | ||
277 | u8 spr; /* WR SPR - Scratch Pad Reg */ | ||
278 | }; | ||
279 | |||
280 | /* Where to read the interrupt register (8bits) */ | ||
281 | #define UART_CLASSIC_POLL_ADDR_OFFSET 0x40 | ||
282 | |||
283 | #define UART_EXAR654_ENHANCED_REGISTER_SET 0xBF | ||
284 | |||
285 | #define UART_16654_FCR_TXTRIGGER_8 0x0 | ||
286 | #define UART_16654_FCR_TXTRIGGER_16 0x10 | ||
287 | #define UART_16654_FCR_TXTRIGGER_32 0x20 | ||
288 | #define UART_16654_FCR_TXTRIGGER_56 0x30 | ||
289 | |||
290 | #define UART_16654_FCR_RXTRIGGER_8 0x0 | ||
291 | #define UART_16654_FCR_RXTRIGGER_16 0x40 | ||
292 | #define UART_16654_FCR_RXTRIGGER_56 0x80 | ||
293 | #define UART_16654_FCR_RXTRIGGER_60 0xC0 | ||
294 | |||
295 | #define UART_IIR_CTSRTS 0x20 /* Received CTS/RTS change of state */ | ||
296 | #define UART_IIR_RDI_TIMEOUT 0x0C /* Receiver data TIMEOUT */ | ||
297 | |||
298 | /* | ||
299 | * These are the EXTENDED definitions for the Exar 654's Interrupt | ||
300 | * Enable Register. | ||
301 | */ | ||
302 | #define UART_EXAR654_EFR_ECB 0x10 /* Enhanced control bit */ | ||
303 | #define UART_EXAR654_EFR_IXON 0x2 /* Receiver compares Xon1/Xoff1 */ | ||
304 | #define UART_EXAR654_EFR_IXOFF 0x8 /* Transmit Xon1/Xoff1 */ | ||
305 | #define UART_EXAR654_EFR_RTSDTR 0x40 /* Auto RTS/DTR Flow Control Enable */ | ||
306 | #define UART_EXAR654_EFR_CTSDSR 0x80 /* Auto CTS/DSR Flow COntrol Enable */ | ||
307 | |||
308 | #define UART_EXAR654_XOFF_DETECT 0x1 /* Indicates whether chip saw an incoming XOFF char */ | ||
309 | #define UART_EXAR654_XON_DETECT 0x2 /* Indicates whether chip saw an incoming XON char */ | ||
310 | |||
311 | #define UART_EXAR654_IER_XOFF 0x20 /* Xoff Interrupt Enable */ | ||
312 | #define UART_EXAR654_IER_RTSDTR 0x40 /* Output Interrupt Enable */ | ||
313 | #define UART_EXAR654_IER_CTSDSR 0x80 /* Input Interrupt Enable */ | ||
257 | 314 | ||
258 | /************************************************************************ | 315 | /************************************************************************ |
259 | * Per channel/port NEO UART structure * | 316 | * Per channel/port NEO UART structure * |