|
@@ -93,6 +93,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
93
|
93
|
#define uart_writeb(val,addr) outb((val),(addr))
|
94
|
94
|
#endif
|
95
|
95
|
|
|
96
|
+/* Boolean for the state of serial driver initialization */
|
|
97
|
+int serial_initialized = 0;
|
|
98
|
+
|
96
|
99
|
/*
|
97
|
100
|
* void serial_putc(int ch);
|
98
|
101
|
* Write character `ch' to port UART_BASE.
|
|
@@ -207,7 +210,6 @@ static void serial_init ( void ) {
|
207
|
210
|
/* Set clear to send, so flow control works... */
|
208
|
211
|
uart_writeb((1<<1), UART_BASE + UART_MCR);
|
209
|
212
|
|
210
|
|
-
|
211
|
213
|
/* Flush the input buffer. */
|
212
|
214
|
do {
|
213
|
215
|
/* rx buffer reg
|
|
@@ -217,6 +219,9 @@ static void serial_init ( void ) {
|
217
|
219
|
/* line status reg */
|
218
|
220
|
status = uart_readb(UART_BASE + UART_LSR);
|
219
|
221
|
} while(status & UART_LSR_DR);
|
|
222
|
+
|
|
223
|
+ /* Note that serial support has been initialized */
|
|
224
|
+ serial_initialized = 1;
|
220
|
225
|
out:
|
221
|
226
|
return;
|
222
|
227
|
}
|