console: Revise serial console configuration names.

The console drivers (especially serial drivers) in Kconfig were named in
different styles. This change will rename configuration names to a better naming
style.

 - EARLY_CONSOLE:
        Enable output in pre-ram stage. (Renamed from EARLY_SERIAL_CONSOLE
        because it also supports non-serial)

 - CONSOLE_SERIAL:
        Enable serial output console, from one of the serial drivers. (Renamed
        from SERIAL_CONSOLE because other non-serial drivers are named as
        CONSOLE_XXX like CONSOLE_CBMEM)

 - CONSOLE_SERIAL_UART:
	Device-specific UART driver. (Renamed from
	CONSOLE_SERIAL_NONSTANDARD_MEM because it may be not memory-mapped)

 - HAVE_UART_SPECIAL:
        A dependency for CONSOLE_SERIAL_UART.

Verified to boot on x86/qemu and armv7/snow, and still seeing console
messages in romstage for both platforms.

Change-Id: I4bea3c8fea05bbb7d78df6bc22f82414ac66f973
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2299
Tested-by: build bot (Jenkins)
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
Hung-Te Lin 2013-02-06 21:24:12 +08:00 committed by David Hendricks
parent 1c3187932d
commit ad173ea70b
10 changed files with 41 additions and 34 deletions

View File

@ -277,6 +277,10 @@ config HAVE_UART_MEMORY_MAPPED
bool bool
default n default n
config HAVE_UART_SPECIAL
bool
default n
config HAVE_ACPI_RESUME config HAVE_ACPI_RESUME
bool bool
default n default n

View File

@ -20,7 +20,7 @@
#include <console/console.h> #include <console/console.h>
#include <console/vtxprintf.h> #include <console/vtxprintf.h>
// TODO Unify with x86 (CONFIG_CONSOLE_SERIAL8250) // TODO Unify with x86 (CONFIG_CONSOLE_SERIAL8250)
#if CONFIG_SERIAL_CONSOLE #if CONFIG_CONSOLE_SERIAL
#include <uart.h> #include <uart.h>
#endif #endif
#if CONFIG_USBDEBUG #if CONFIG_USBDEBUG
@ -33,7 +33,7 @@ void console_tx_byte(unsigned char byte)
if (byte == '\n') if (byte == '\n')
console_tx_byte('\r'); console_tx_byte('\r');
#if CONFIG_SERIAL_CONSOLE #if CONFIG_CONSOLE_SERIAL_UART
uart_tx_byte(byte); uart_tx_byte(byte);
#endif #endif
#if CONFIG_USBDEBUG #if CONFIG_USBDEBUG
@ -46,7 +46,7 @@ void console_tx_byte(unsigned char byte)
static void _console_tx_flush(void) static void _console_tx_flush(void)
{ {
#if CONFIG_SERIAL_CONSOLE #if CONFIG_CONSOLE_SERIAL_UART
uart_tx_flush(); uart_tx_flush();
#endif #endif
#if CONFIG_USBDEBUG #if CONFIG_USBDEBUG

View File

@ -1,20 +1,21 @@
menu "Console" menu "Console"
config SERIAL_CONSOLE
config EARLY_CONSOLE
bool "Enable early (pre-RAM) console output."
default n
help
Use console during early (pre-RAM) boot stages
config CONSOLE_SERIAL
bool "Serial port console output" bool "Serial port console output"
default y default y
help help
Send coreboot debug output to a serial port Send coreboot debug output to a serial port (should be one or more of
CONSOLE_SERIAL8250, CONSOLE_SERIAL8250MEM, CONSOLE_SERIAL_UART)
config EARLY_SERIAL_CONSOLE
bool
depends on SERIAL_CONSOLE
default n
help
Use serial console during early (pre-RAM) boot stages
config CONSOLE_SERIAL8250 config CONSOLE_SERIAL8250
bool "Serial port console output (I/O mapped, 8250-compatible)" bool "Serial port console output (I/O mapped, 8250-compatible)"
depends on SERIAL_CONSOLE depends on CONSOLE_SERIAL
depends on HAVE_UART_IO_MAPPED depends on HAVE_UART_IO_MAPPED
default y default y
help help
@ -22,21 +23,21 @@ config CONSOLE_SERIAL8250
config CONSOLE_SERIAL8250MEM config CONSOLE_SERIAL8250MEM
bool "Serial port console output (memory mapped, 8250-compatible)" bool "Serial port console output (memory mapped, 8250-compatible)"
depends on SERIAL_CONSOLE depends on CONSOLE_SERIAL
depends on HAVE_UART_MEMORY_MAPPED depends on HAVE_UART_MEMORY_MAPPED
help help
Send coreboot debug output to a memory mapped serial port console. Send coreboot debug output to a memory mapped serial port console.
config CONSOLE_SERIAL_NONSTANDARD_MEM config CONSOLE_SERIAL_UART
bool "Serial port console output (memory-mapped, device-specific)" bool "Serial port console output (device-specific UART)"
depends on SERIAL_CONSOLE depends on CONSOLE_SERIAL
depends on HAVE_UART_MEMORY_MAPPED depends on HAVE_UART_SPECIAL
default y
help help
Send coreboot debug output to a memory mapped serial port console Send coreboot debug output to a device-specific serial port console.
on a device-specific UART.
choice choice
prompt "Serial port" prompt "Serial port for 8250"
default CONSOLE_SERIAL_COM1 default CONSOLE_SERIAL_COM1
depends on CONSOLE_SERIAL8250 depends on CONSOLE_SERIAL8250
@ -72,7 +73,7 @@ config TTYS0_BASE
choice choice
prompt "Baud rate" prompt "Baud rate"
default CONSOLE_SERIAL_115200 default CONSOLE_SERIAL_115200
depends on SERIAL_CONSOLE depends on CONSOLE_SERIAL
config CONSOLE_SERIAL_115200 config CONSOLE_SERIAL_115200
bool "115200" bool "115200"

View File

@ -10,13 +10,13 @@ smm-y += vtxprintf.c
smm-$(CONFIG_SMM_TSEG) += die.c smm-$(CONFIG_SMM_TSEG) += die.c
romstage-y += vtxprintf.c romstage-y += vtxprintf.c
romstage-$(CONFIG_EARLY_SERIAL_CONSOLE) += console.c romstage-$(CONFIG_EARLY_CONSOLE) += console.c
romstage-y += post.c romstage-y += post.c
romstage-y += die.c romstage-y += die.c
# TODO Add vtxprintf.c only when early console is required. # TODO Add vtxprintf.c only when early console is required.
bootblock-y += vtxprintf.c bootblock-y += vtxprintf.c
bootblock-$(CONFIG_EARLY_SERIAL_CONSOLE) += console.c bootblock-$(CONFIG_EARLY_CONSOLE) += console.c
bootblock-y += die.c bootblock-y += die.c
ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250_console.c ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250_console.c

View File

@ -107,7 +107,7 @@ void console_init(void)
enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT); enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT);
early_usbdebug_init(); early_usbdebug_init();
#endif #endif
#if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM #if CONFIG_CONSOLE_SERIAL
uart_init(); uart_init();
#endif #endif
#if CONFIG_DRIVERS_OXFORD_OXPCIE && CONFIG_CONSOLE_SERIAL8250MEM #if CONFIG_DRIVERS_OXFORD_OXPCIE && CONFIG_CONSOLE_SERIAL8250MEM

View File

@ -16,7 +16,7 @@ source src/cpu/x86/Kconfig
config CACHE_AS_RAM config CACHE_AS_RAM
bool bool
select EARLY_SERIAL_CONSOLE select EARLY_CONSOLE
default !ROMCC default !ROMCC
config DCACHE_RAM_BASE config DCACHE_RAM_BASE

View File

@ -5,7 +5,10 @@ config CPU_SAMSUNG_EXYNOS
config CPU_SAMSUNG_EXYNOS5 config CPU_SAMSUNG_EXYNOS5
depends on ARCH_ARMV7 depends on ARCH_ARMV7
select CPU_SAMSUNG_EXYNOS select CPU_SAMSUNG_EXYNOS
select EARLY_SERIAL_CONSOLE select HAVE_UART_SPECIAL
# TODO remove EARLY_CONSOLE when we can run ramstage without early UART
# init.
select EARLY_CONSOLE
bool bool
default n default n

View File

@ -24,8 +24,8 @@
#include <console/loglevel.h> #include <console/loglevel.h>
#include <console/post_codes.h> #include <console/post_codes.h>
#if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM #if CONFIG_CONSOLE_SERIAL
#include <uart8250.h> #include <uart.h>
#endif #endif
#if CONFIG_USBDEBUG #if CONFIG_USBDEBUG
#include <usbdebug.h> #include <usbdebug.h>

View File

@ -24,7 +24,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select ARCH_ARMV7 select ARCH_ARMV7
select CPU_SAMSUNG_EXYNOS5 select CPU_SAMSUNG_EXYNOS5
select HAVE_UART_MEMORY_MAPPED select HAVE_UART_MEMORY_MAPPED
select CONSOLE_SERIAL_NONSTANDARD_MEM # enable serial debugging
# select EC_GOOGLE_CHROMEEC # select EC_GOOGLE_CHROMEEC
select BOARD_ROMSIZE_KB_4096 select BOARD_ROMSIZE_KB_4096
select DRIVER_MAXIM_MAX77686 select DRIVER_MAXIM_MAX77686
@ -71,7 +70,7 @@ config NR_DRAM_BANKS
choice choice
prompt "Serial Console UART" prompt "Serial Console UART"
default CONSOLE_SERIAL_UART3 default CONSOLE_SERIAL_UART3
depends on CONSOLE_SERIAL_NONSTANDARD_MEM depends on CONSOLE_SERIAL_UART
config CONSOLE_SERIAL_UART0 config CONSOLE_SERIAL_UART0
bool "UART0" bool "UART0"
@ -97,7 +96,7 @@ endchoice
config CONSOLE_SERIAL_UART_ADDRESS config CONSOLE_SERIAL_UART_ADDRESS
hex hex
depends on CONSOLE_SERIAL_NONSTANDARD_MEM depends on CONSOLE_SERIAL_UART
default 0x12c00000 if CONSOLE_SERIAL_UART0 default 0x12c00000 if CONSOLE_SERIAL_UART0
default 0x12c10000 if CONSOLE_SERIAL_UART1 default 0x12c10000 if CONSOLE_SERIAL_UART1
default 0x12c20000 if CONSOLE_SERIAL_UART2 default 0x12c20000 if CONSOLE_SERIAL_UART2

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#if CONFIG_EARLY_SERIAL_CONSOLE #if CONFIG_EARLY_CONSOLE
#include <types.h> #include <types.h>
#include <arch/io.h> #include <arch/io.h>
#include <cbfs.h> #include <cbfs.h>
@ -40,7 +40,7 @@ void bootblock_mainboard_init(void)
arm_ratios = get_arm_clk_ratios(); arm_ratios = get_arm_clk_ratios();
system_clock_init(mem, arm_ratios); system_clock_init(mem, arm_ratios);
#if CONFIG_EARLY_SERIAL_CONSOLE #if CONFIG_EARLY_CONSOLE
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
uart_init(); uart_init();
printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__); printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__);