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 #ifndef CONFIG_SERIAL_8250
21 #define SERIAL_CPM_MAJOR TTY_MAJOR
22 #define SERIAL_CPM_MINOR 64
24 #define SERIAL_CPM_MAJOR 204
25 #define SERIAL_CPM_MINOR 42
28 #define IS_SMC(pinfo) (pinfo->flags & FLAG_SMC)
29 #define IS_DISCARDING(pinfo) (pinfo->flags & FLAG_DISCARDING)
30 #define FLAG_DISCARDING 0x00000004 /* when set, don't discard */
31 #define FLAG_SMC 0x00000002
32 #define FLAG_CONSOLE 0x00000001
44 #define RX_BUF_SIZE 32
46 #define TX_BUF_SIZE 32
48 struct uart_cpm_port
{
49 struct uart_port port
;
58 volatile cbd_t
*rx_bd_base
;
59 volatile cbd_t
*rx_cur
;
60 volatile cbd_t
*tx_bd_base
;
61 volatile cbd_t
*tx_cur
;
62 unsigned char *tx_buf
;
63 unsigned char *rx_buf
;
65 void (*set_lineif
)(struct uart_cpm_port
*);
75 extern int cpm_uart_port_map
[UART_NR
];
76 extern int cpm_uart_nr
;
77 extern struct uart_cpm_port cpm_uart_ports
[UART_NR
];
79 /* these are located in their respective files */
80 void cpm_line_cr_cmd(int line
, int cmd
);
81 int cpm_uart_init_portdesc(void);
82 int cpm_uart_allocbuf(struct uart_cpm_port
*pinfo
, unsigned int is_con
);
83 void cpm_uart_freebuf(struct uart_cpm_port
*pinfo
);
85 void smc1_lineif(struct uart_cpm_port
*pinfo
);
86 void smc2_lineif(struct uart_cpm_port
*pinfo
);
87 void scc1_lineif(struct uart_cpm_port
*pinfo
);
88 void scc2_lineif(struct uart_cpm_port
*pinfo
);
89 void scc3_lineif(struct uart_cpm_port
*pinfo
);
90 void scc4_lineif(struct uart_cpm_port
*pinfo
);
92 #endif /* CPM_UART_H */