2 * linux/drivers/serial/cpm_uart.h
4 * Driver for CPM (SCC/SMC) serial ports
6 * Copyright (C) 2004 Freescale Semiconductor, Inc.
12 #include <linux/config.h>
14 #if defined(CONFIG_CPM2)
15 #include "cpm_uart_cpm2.h"
16 #elif defined(CONFIG_8xx)
17 #include "cpm_uart_cpm1.h"
20 #define SERIAL_CPM_MAJOR 204
21 #define SERIAL_CPM_MINOR 46
23 #define IS_SMC(pinfo) (pinfo->flags & FLAG_SMC)
24 #define IS_DISCARDING(pinfo) (pinfo->flags & FLAG_DISCARDING)
25 #define FLAG_DISCARDING 0x00000004 /* when set, don't discard */
26 #define FLAG_SMC 0x00000002
27 #define FLAG_CONSOLE 0x00000001
39 #define RX_BUF_SIZE 32
41 #define TX_BUF_SIZE 32
43 #define SCC_WAIT_CLOSING 100
45 struct uart_cpm_port
{
46 struct uart_port port
;
55 volatile cbd_t
*rx_bd_base
;
56 volatile cbd_t
*rx_cur
;
57 volatile cbd_t
*tx_bd_base
;
58 volatile cbd_t
*tx_cur
;
59 unsigned char *tx_buf
;
60 unsigned char *rx_buf
;
62 void (*set_lineif
)(struct uart_cpm_port
*);
70 /* Keep track of 'odd' SMC2 wirings */
72 /* wait on close if needed */
76 extern int cpm_uart_port_map
[UART_NR
];
77 extern int cpm_uart_nr
;
78 extern struct uart_cpm_port cpm_uart_ports
[UART_NR
];
80 /* these are located in their respective files */
81 void cpm_line_cr_cmd(int line
, int cmd
);
82 int cpm_uart_init_portdesc(void);
83 int cpm_uart_allocbuf(struct uart_cpm_port
*pinfo
, unsigned int is_con
);
84 void cpm_uart_freebuf(struct uart_cpm_port
*pinfo
);
86 void smc1_lineif(struct uart_cpm_port
*pinfo
);
87 void smc2_lineif(struct uart_cpm_port
*pinfo
);
88 void scc1_lineif(struct uart_cpm_port
*pinfo
);
89 void scc2_lineif(struct uart_cpm_port
*pinfo
);
90 void scc3_lineif(struct uart_cpm_port
*pinfo
);
91 void scc4_lineif(struct uart_cpm_port
*pinfo
);
93 #endif /* CPM_UART_H */