Enable the 16550A FIFO when doing serial console
authorhpa <hpa>
Mon, 29 Aug 2005 20:24:29 +0000 (20:24 +0000)
committerhpa <hpa>
Mon, 29 Aug 2005 20:24:29 +0000 (20:24 +0000)
NEWS
parseconfig.inc

diff --git a/NEWS b/NEWS
index e23fbd9..ccec82a 100644 (file)
--- 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.
index 30fd544..09712b9 100644 (file)
@@ -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