From 1eb746f2749f09ab7e1f8e83bc5cda7fb24bafbc Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 16 Feb 2010 22:40:53 +0100 Subject: [PATCH] Initialise remaining UART registers on Yeeloong --- include/grub/serial.h | 10 ++++++++-- term/serial.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/grub/serial.h b/include/grub/serial.h index 1c35b4093..758b6fb3e 100644 --- a/include/grub/serial.h +++ b/include/grub/serial.h @@ -59,9 +59,15 @@ #define UART_DLAB 0x80 /* Enable the FIFO. */ -#define UART_ENABLE_FIFO 0xC7 +#define UART_ENABLE_FIFO_TRIGGER14 0xC7 + +/* Enable the FIFO. */ +#define UART_ENABLE_FIFO_TRIGGER1 0x07 /* Turn on DTR, RTS, and OUT2. */ -#define UART_ENABLE_MODEM 0x0B +#define UART_ENABLE_DTRRTS 0x03 + +/* Turn on DTR, RTS, and OUT2. */ +#define UART_ENABLE_OUT2 0x08 #endif /* ! GRUB_SERIAL_MACHINE_HEADER */ diff --git a/term/serial.c b/term/serial.c index 05497ce40..2dbebc2f1 100644 --- a/term/serial.c +++ b/term/serial.c @@ -300,10 +300,17 @@ serial_hw_init (void) /* In Yeeloong serial port has only 3 wires. */ #ifndef GRUB_MACHINE_MIPS_YEELOONG /* Enable the FIFO. */ - grub_outb (UART_ENABLE_FIFO, serial_settings.port + UART_FCR); + grub_outb (UART_ENABLE_FIFO_TRIGGER1, serial_settings.port + UART_FCR); + + /* Turn on DTR and RTS. */ + grub_outb (UART_ENABLE_DTRRTS, serial_settings.port + UART_MCR); +#else + /* Enable the FIFO. */ + grub_outb (UART_ENABLE_FIFO_TRIGGER14, serial_settings.port + UART_FCR); /* Turn on DTR, RTS, and OUT2. */ - grub_outb (UART_ENABLE_MODEM, serial_settings.port + UART_MCR); + grub_outb (UART_ENABLE_DTRRTS | UART_ENABLE_OUT2, + serial_settings.port + UART_MCR); #endif /* Drain the input buffer. */