summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-08-29 20:24:29 +0000
committerhpa <hpa>2005-08-29 20:24:29 +0000
commit33dfda973ac3e937afa23c948e62dd90ec3abd94 (patch)
tree2f87d7c674a6052fbaee0d98e38a485f0cb13ef3
parent75ed4390a205bf02c8391de94c26a6bf147a5275 (diff)
downloadsyslinux-3.11-pre9.tar.gz
Enable the 16550A FIFO when doing serial consolesyslinux-3.11-pre9
-rw-r--r--NEWS2
-rw-r--r--parseconfig.inc23
2 files changed, 24 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index e23fbd9f..ccec82a9 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Changes in 3.11:
problems on some network cards.
* MEMDISK: Try work around a bug on some BIOSes when no
physical floppy disk is present in the system.
+ * Enable the 16550A FIFOs, if present, when doing serial
+ console.
Changes in 3.10:
* gcc 4.0.1 compilation fixes.
diff --git a/parseconfig.inc b/parseconfig.inc
index 30fd5443..09712b9c 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -197,18 +197,26 @@ pc_serial: call getint
mov di,[di+serial_base] ; Get the I/O port from the BIOS
.port_is_io:
mov [SerialPort],di
+
+ ;
+ ; Begin code to actually set up the serial port
+ ;
lea dx,[di+3] ; DX -> LCR
mov al,83h ; Enable DLAB
call slow_out
+
pop ax ; Divisor
mov dx,di ; DX -> LS
call slow_out
+
inc dx ; DX -> MS
mov al,ah
call slow_out
+
mov al,03h ; Disable DLAB
add dx,byte 2 ; DX -> LCR
call slow_out
+
in al,dx ; Read back LCR (detect missing hw)
cmp al,03h ; If nothing here we'll read 00 or FF
jne .serial_port_bad ; Assume serial port busted
@@ -216,7 +224,20 @@ pc_serial: call getint
xor al,al ; IRQ disable
call slow_out
- add dx,byte 3 ; DX -> MCR
+ inc dx
+ inc dx ; DX -> FCR
+ mov al,01h
+ call slow_out ; Enable FIFOs if present
+ dec dx ; DX -> IIR
+ in al,dx
+ inc dx ; DX -> FCR
+ cmp al,0C0h ; FIFOs enabled and usable?
+ jae .fifo_ok
+ xor ax,ax ; Disable FIFO if unusable
+ call slow_out
+.fifo_ok:
+
+ inc dx ; DX -> MCR
in al,dx
or al,[FlowOutput] ; Assert bits
call slow_out