diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:54:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 15:02:44 -0400 |
commit | 1bb2687c3bad13a061e98887bdfb1a6b9ad79542 (patch) | |
tree | be58f831907fef67f96804a3b80059eae44c7368 /drivers/tty/serial | |
parent | 107afb7a50726cb8ea9ed74d62311ddc59fef1da (diff) |
TTY: 68328serial, remove 68328serial.h
All the needed stuff is moved to 68328serial.c now.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/68328serial.c | 79 | ||||
-rw-r--r-- | drivers/tty/serial/68328serial.h | 94 |
2 files changed, 76 insertions, 97 deletions
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c index f0d5039a7b34..116d932401ed 100644 --- a/drivers/tty/serial/68328serial.c +++ b/drivers/tty/serial/68328serial.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #endif /* CONFIG_M68VZ328 */ | 57 | #endif /* CONFIG_M68VZ328 */ |
58 | #endif /* CONFIG_M68EZ328 */ | 58 | #endif /* CONFIG_M68EZ328 */ |
59 | 59 | ||
60 | #include "68328serial.h" | ||
61 | |||
62 | /* Turn off usage of real serial interrupt code, to "support" Copilot */ | 60 | /* Turn off usage of real serial interrupt code, to "support" Copilot */ |
63 | #ifdef CONFIG_XCOPILOT_BUGS | 61 | #ifdef CONFIG_XCOPILOT_BUGS |
64 | #undef USE_INTS | 62 | #undef USE_INTS |
@@ -66,9 +64,84 @@ | |||
66 | #define USE_INTS | 64 | #define USE_INTS |
67 | #endif | 65 | #endif |
68 | 66 | ||
67 | /* | ||
68 | * I believe this is the optimal setting that reduces the number of interrupts. | ||
69 | * At high speeds the output might become a little "bursted" (use USTCNT_TXHE | ||
70 | * if that bothers you), but in most cases it will not, since we try to | ||
71 | * transmit characters every time rs_interrupt is called. Thus, quite often | ||
72 | * you'll see that a receive interrupt occures before the transmit one. | ||
73 | * -- Vladimir Gurevich | ||
74 | */ | ||
75 | #define USTCNT_TX_INTR_MASK (USTCNT_TXEE) | ||
76 | |||
77 | /* | ||
78 | * 68328 and 68EZ328 UARTS are a little bit different. EZ328 has special | ||
79 | * "Old data interrupt" which occures whenever the data stay in the FIFO | ||
80 | * longer than 30 bits time. This allows us to use FIFO without compromising | ||
81 | * latency. '328 does not have this feature and without the real 328-based | ||
82 | * board I would assume that RXRE is the safest setting. | ||
83 | * | ||
84 | * For EZ328 I use RXHE (Half empty) interrupt to reduce the number of | ||
85 | * interrupts. RXFE (receive queue full) causes the system to lose data | ||
86 | * at least at 115200 baud | ||
87 | * | ||
88 | * If your board is busy doing other stuff, you might consider to use | ||
89 | * RXRE (data ready intrrupt) instead. | ||
90 | * | ||
91 | * The other option is to make these INTR masks run-time configurable, so | ||
92 | * that people can dynamically adapt them according to the current usage. | ||
93 | * -- Vladimir Gurevich | ||
94 | */ | ||
95 | |||
96 | /* (es) */ | ||
97 | #if defined(CONFIG_M68EZ328) || defined(CONFIG_M68VZ328) | ||
98 | #define USTCNT_RX_INTR_MASK (USTCNT_RXHE | USTCNT_ODEN) | ||
99 | #elif defined(CONFIG_M68328) | ||
100 | #define USTCNT_RX_INTR_MASK (USTCNT_RXRE) | ||
101 | #else | ||
102 | #error Please, define the Rx interrupt events for your CPU | ||
103 | #endif | ||
104 | /* (/es) */ | ||
105 | |||
106 | /* | ||
107 | * This is our internal structure for each serial port's state. | ||
108 | * | ||
109 | * For definitions of the flags field, see serial.h | ||
110 | */ | ||
111 | struct m68k_serial { | ||
112 | char is_cons; /* Is this our console. */ | ||
113 | int magic; | ||
114 | int baud_base; | ||
115 | int port; | ||
116 | int irq; | ||
117 | int flags; /* defined in tty.h */ | ||
118 | int type; /* UART type */ | ||
119 | struct tty_struct *tty; | ||
120 | int custom_divisor; | ||
121 | int x_char; /* xon/xoff character */ | ||
122 | int close_delay; | ||
123 | unsigned short closing_wait; | ||
124 | int line; | ||
125 | int count; /* # of fd on device */ | ||
126 | int blocked_open; /* # of blocked opens */ | ||
127 | unsigned char *xmit_buf; | ||
128 | int xmit_head; | ||
129 | int xmit_tail; | ||
130 | int xmit_cnt; | ||
131 | wait_queue_head_t open_wait; | ||
132 | wait_queue_head_t close_wait; | ||
133 | }; | ||
134 | |||
135 | #define SERIAL_MAGIC 0x5301 | ||
136 | |||
137 | /* | ||
138 | * Define the number of ports supported and their irqs. | ||
139 | */ | ||
140 | #define NR_PORTS 1 | ||
141 | |||
69 | static struct m68k_serial m68k_soft[NR_PORTS]; | 142 | static struct m68k_serial m68k_soft[NR_PORTS]; |
70 | 143 | ||
71 | static unsigned int uart_irqs[NR_PORTS] = UART_IRQ_DEFNS; | 144 | static unsigned int uart_irqs[NR_PORTS] = { UART_IRQ_NUM }; |
72 | 145 | ||
73 | /* multiple ports are contiguous in memory */ | 146 | /* multiple ports are contiguous in memory */ |
74 | m68328_uart *uart_addr = (m68328_uart *)USTCNT_ADDR; | 147 | m68328_uart *uart_addr = (m68328_uart *)USTCNT_ADDR; |
diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h deleted file mode 100644 index 971ead5a3918..000000000000 --- a/drivers/tty/serial/68328serial.h +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* 68328serial.h: Definitions for the mc68328 serial driver. | ||
2 | * | ||
3 | * Copyright (C) 1995 David S. Miller <davem@caip.rutgers.edu> | ||
4 | * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com> | ||
5 | * Copyright (C) 1998, 1999 D. Jeff Dionne <jeff@uclinux.org> | ||
6 | * Copyright (C) 1999 Vladimir Gurevich <vgurevic@cisco.com> | ||
7 | * | ||
8 | * VZ Support/Fixes Evan Stawnyczy <e@lineo.ca> | ||
9 | */ | ||
10 | |||
11 | #ifndef _MC683XX_SERIAL_H | ||
12 | #define _MC683XX_SERIAL_H | ||
13 | |||
14 | /* | ||
15 | * I believe this is the optimal setting that reduces the number of interrupts. | ||
16 | * At high speeds the output might become a little "bursted" (use USTCNT_TXHE | ||
17 | * if that bothers you), but in most cases it will not, since we try to | ||
18 | * transmit characters every time rs_interrupt is called. Thus, quite often | ||
19 | * you'll see that a receive interrupt occures before the transmit one. | ||
20 | * -- Vladimir Gurevich | ||
21 | */ | ||
22 | #define USTCNT_TX_INTR_MASK (USTCNT_TXEE) | ||
23 | |||
24 | /* | ||
25 | * 68328 and 68EZ328 UARTS are a little bit different. EZ328 has special | ||
26 | * "Old data interrupt" which occures whenever the data stay in the FIFO | ||
27 | * longer than 30 bits time. This allows us to use FIFO without compromising | ||
28 | * latency. '328 does not have this feature and without the real 328-based | ||
29 | * board I would assume that RXRE is the safest setting. | ||
30 | * | ||
31 | * For EZ328 I use RXHE (Half empty) interrupt to reduce the number of | ||
32 | * interrupts. RXFE (receive queue full) causes the system to lose data | ||
33 | * at least at 115200 baud | ||
34 | * | ||
35 | * If your board is busy doing other stuff, you might consider to use | ||
36 | * RXRE (data ready intrrupt) instead. | ||
37 | * | ||
38 | * The other option is to make these INTR masks run-time configurable, so | ||
39 | * that people can dynamically adapt them according to the current usage. | ||
40 | * -- Vladimir Gurevich | ||
41 | */ | ||
42 | |||
43 | /* (es) */ | ||
44 | #if defined(CONFIG_M68EZ328) || defined(CONFIG_M68VZ328) | ||
45 | #define USTCNT_RX_INTR_MASK (USTCNT_RXHE | USTCNT_ODEN) | ||
46 | #elif defined(CONFIG_M68328) | ||
47 | #define USTCNT_RX_INTR_MASK (USTCNT_RXRE) | ||
48 | #else | ||
49 | #error Please, define the Rx interrupt events for your CPU | ||
50 | #endif | ||
51 | /* (/es) */ | ||
52 | |||
53 | /* | ||
54 | * This is our internal structure for each serial port's state. | ||
55 | * | ||
56 | * Many fields are paralleled by the structure used by the serial_struct | ||
57 | * structure. | ||
58 | * | ||
59 | * For definitions of the flags field, see tty.h | ||
60 | */ | ||
61 | |||
62 | struct m68k_serial { | ||
63 | char is_cons; /* Is this our console. */ | ||
64 | int magic; | ||
65 | int baud_base; | ||
66 | int port; | ||
67 | int irq; | ||
68 | int flags; /* defined in tty.h */ | ||
69 | int type; /* UART type */ | ||
70 | struct tty_struct *tty; | ||
71 | int custom_divisor; | ||
72 | int x_char; /* xon/xoff character */ | ||
73 | int close_delay; | ||
74 | unsigned short closing_wait; | ||
75 | int line; | ||
76 | int count; /* # of fd on device */ | ||
77 | int blocked_open; /* # of blocked opens */ | ||
78 | unsigned char *xmit_buf; | ||
79 | int xmit_head; | ||
80 | int xmit_tail; | ||
81 | int xmit_cnt; | ||
82 | wait_queue_head_t open_wait; | ||
83 | wait_queue_head_t close_wait; | ||
84 | }; | ||
85 | |||
86 | #define SERIAL_MAGIC 0x5301 | ||
87 | |||
88 | /* | ||
89 | * Define the number of ports supported and their irqs. | ||
90 | */ | ||
91 | #define NR_PORTS 1 | ||
92 | #define UART_IRQ_DEFNS {UART_IRQ_NUM} | ||
93 | |||
94 | #endif /* !(_MC683XX_SERIAL_H) */ | ||