uart: Support multiple ports

The port for console remains to be a compile time constant.
The Kconfig option is changed to select an UART port with index
to avoid putting map of UART base addresses in Kconfigs.

With this change it is possible to have other than debug console
on different UART port.

Change-Id: Ie1845a946f8d3b2604ef5404edb31b2e811f3ccd
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5342
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Kyösti Mälkki
2014-03-14 22:28:29 +02:00
parent a8d089d3ac
commit 70342a7f51
19 changed files with 147 additions and 311 deletions

View File

@ -48,39 +48,21 @@ if CONSOLE_SERIAL
comment "device-specific UART"
depends on HAVE_UART_SPECIAL
choice
prompt "Serial port for 8250"
default CONSOLE_SERIAL_COM1
depends on DRIVERS_UART_8250IO
config CONSOLE_SERIAL_COM1
bool "COM1/ttyS0, I/O port 0x3f8"
help
Serial console on COM1/ttyS0 at I/O port 0x3f8.
config CONSOLE_SERIAL_COM2
bool "COM2/ttyS1, I/O port 0x2f8"
help
Serial console on COM2/ttyS1 at I/O port 0x2f8.
config CONSOLE_SERIAL_COM3
bool "COM3/ttyS2, I/O port 0x3e8"
help
Serial console on COM3/ttyS2 at I/O port 0x3e8.
config CONSOLE_SERIAL_COM4
bool "COM4/ttyS3, I/O port 0x2e8"
help
Serial console on COM4/ttyS3 at I/O port 0x2e8.
endchoice
config UART_FOR_CONSOLE
prompt "Index for UART port to use for console"
default 0
# FIXME: Early programming in romstage is incorrect as we should
# program different LDN to actually change the physical port.
config TTYS0_BASE
hex
depends on DRIVERS_UART_8250IO
default 0x3f8 if CONSOLE_SERIAL_COM1
default 0x2f8 if CONSOLE_SERIAL_COM2
default 0x3e8 if CONSOLE_SERIAL_COM3
default 0x2e8 if CONSOLE_SERIAL_COM4
default 0x3f8 if UART_FOR_CONSOLE = 0
default 0x2f8 if UART_FOR_CONSOLE = 1
default 0x3e8 if UART_FOR_CONSOLE = 2
default 0x2e8 if UART_FOR_CONSOLE = 3
help
Map the COM port names to the respective I/O port.
Map the COM port number to the respective I/O port.
choice
prompt "Baud rate"