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 struct uart_cpm_port
{
44 struct uart_port port
;
53 volatile cbd_t
*rx_bd_base
;
54 volatile cbd_t
*rx_cur
;
55 volatile cbd_t
*tx_bd_base
;
56 volatile cbd_t
*tx_cur
;
57 unsigned char *tx_buf
;
58 unsigned char *rx_buf
;
60 void (*set_lineif
)(struct uart_cpm_port
*);
68 /* Keep track of 'odd' SMC2 wirings */
72 extern int cpm_uart_port_map
[UART_NR
];
73 extern int cpm_uart_nr
;
74 extern struct uart_cpm_port cpm_uart_ports
[UART_NR
];
76 /* these are located in their respective files */
77 void cpm_line_cr_cmd(int line
, int cmd
);
78 int cpm_uart_init_portdesc(void);
79 int cpm_uart_allocbuf(struct uart_cpm_port
*pinfo
, unsigned int is_con
);
80 void cpm_uart_freebuf(struct uart_cpm_port
*pinfo
);
82 void smc1_lineif(struct uart_cpm_port
*pinfo
);
83 void smc2_lineif(struct uart_cpm_port
*pinfo
);
84 void scc1_lineif(struct uart_cpm_port
*pinfo
);
85 void scc2_lineif(struct uart_cpm_port
*pinfo
);
86 void scc3_lineif(struct uart_cpm_port
*pinfo
);
87 void scc4_lineif(struct uart_cpm_port
*pinfo
);
89 #endif /* CPM_UART_H */