diff --git a/src/arch/armv7/Makefile.inc b/src/arch/armv7/Makefile.inc index 216770d6b4..3d2847422e 100644 --- a/src/arch/armv7/Makefile.inc +++ b/src/arch/armv7/Makefile.inc @@ -163,7 +163,7 @@ $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDD ramstage-y += exception.c ramstage-y += exception_asm.S -bootblock-$(CONFIG_EARLY_CONSOLE) += early_console.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c bootblock-y += cache.c romstage-y += cache.c diff --git a/src/arch/armv7/bootblock_simple.c b/src/arch/armv7/bootblock_simple.c index 5d0fe7ecaa..541175cc8a 100644 --- a/src/arch/armv7/bootblock_simple.c +++ b/src/arch/armv7/bootblock_simple.c @@ -68,7 +68,7 @@ void main(void) bootblock_mainboard_init(); } -#ifdef CONFIG_EARLY_CONSOLE +#ifdef CONFIG_BOOTBLOCK_CONSOLE console_init(); #endif diff --git a/src/console/Kconfig b/src/console/Kconfig index 02514f1a96..c5539226f7 100644 --- a/src/console/Kconfig +++ b/src/console/Kconfig @@ -1,5 +1,15 @@ menu "Console" +config DEFAULT_BOOTBLOCK_CONSOLE + bool + default n + +config BOOTBLOCK_CONSOLE + bool "Enable early (bootblock) console output." + default DEFAULT_BOOTBLOCK_CONSOLE + help + Use console during the bootblock if supported + config DEFAULT_EARLY_CONSOLE bool default n diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc index 40bf357abf..96305ec06f 100644 --- a/src/console/Makefile.inc +++ b/src/console/Makefile.inc @@ -14,7 +14,7 @@ romstage-y += console.c romstage-y += post.c romstage-y += die.c -bootblock-$(CONFIG_EARLY_CONSOLE) += vtxprintf.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += vtxprintf.c bootblock-y += console.c bootblock-y += die.c diff --git a/src/console/console.c b/src/console/console.c index afbba9dd4f..64056b43ea 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -101,7 +101,8 @@ int console_tst_byte(void) void console_init(void) { -#if CONFIG_EARLY_CONSOLE +#if defined(__BOOT_BLOCK__) && CONFIG_BOOTBLOCK_CONSOLE || \ + !defined(__BOOT_BLOCK__) && CONFIG_EARLY_CONSOLE #if CONFIG_USBDEBUG enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT); diff --git a/src/cpu/samsung/Kconfig b/src/cpu/samsung/Kconfig index 3b6df9ec61..54f4ed1a21 100644 --- a/src/cpu/samsung/Kconfig +++ b/src/cpu/samsung/Kconfig @@ -2,6 +2,7 @@ config CPU_SAMSUNG_EXYNOS5250 depends on ARCH_ARMV7 select HAVE_MONOTONIC_TIMER select HAVE_UART_SPECIAL + select DEFAULT_BOOTBLOCK_CONSOLE select DEFAULT_EARLY_CONSOLE bool default n diff --git a/src/cpu/samsung/exynos5250/Makefile.inc b/src/cpu/samsung/exynos5250/Makefile.inc index dcc783dc2e..663f5329dd 100644 --- a/src/cpu/samsung/exynos5250/Makefile.inc +++ b/src/cpu/samsung/exynos5250/Makefile.inc @@ -6,14 +6,14 @@ INTERMEDIATE += exynos5250_add_bl1 bootblock-y += spi.c bootblock-y += pinmux.c mct.c power.c # Clock is required for UART -bootblock-$(CONFIG_EARLY_CONSOLE) += clock_init.c -bootblock-$(CONFIG_EARLY_CONSOLE) += clock.c -bootblock-$(CONFIG_EARLY_CONSOLE) += monotonic_timer.c -bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock_init.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += monotonic_timer.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c bootblock-y += wakeup.c bootblock-y += gpio.c -bootblock-$(CONFIG_EARLY_CONSOLE) += pwm.c -bootblock-$(CONFIG_EARLY_CONSOLE) += timer.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += pwm.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += timer.c romstage-y += spi.c romstage-y += clock.c diff --git a/src/cpu/samsung/exynos5420/Makefile.inc b/src/cpu/samsung/exynos5420/Makefile.inc index c3416c4cf7..1dddd21ebd 100644 --- a/src/cpu/samsung/exynos5420/Makefile.inc +++ b/src/cpu/samsung/exynos5420/Makefile.inc @@ -6,14 +6,14 @@ INTERMEDIATE += exynos5420_add_bl1 bootblock-y += spi.c bootblock-y += pinmux.c mct.c power.c # Clock is required for UART -bootblock-$(CONFIG_EARLY_CONSOLE) += clock_init.c -bootblock-$(CONFIG_EARLY_CONSOLE) += clock.c -bootblock-$(CONFIG_EARLY_CONSOLE) += monotonic_timer.c -bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock_init.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += monotonic_timer.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c bootblock-y += wakeup.c bootblock-y += gpio.c -bootblock-$(CONFIG_EARLY_CONSOLE) += pwm.c -bootblock-$(CONFIG_EARLY_CONSOLE) += timer.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += pwm.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += timer.c romstage-y += spi.c romstage-y += clock.c diff --git a/src/include/console/console.h b/src/include/console/console.h index 04ad139e08..18ec6c7c85 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -84,7 +84,8 @@ void mainboard_post(u8 value); void __attribute__ ((noreturn)) die(const char *msg); int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); -#if defined(__PRE_RAM__) && !CONFIG_EARLY_CONSOLE +#if defined(__BOOT_BLOCK__) && !CONFIG_BOOTBLOCK_CONSOLE || \ + (defined(__PRE_RAM__) && !defined(__BOOT_BLOCK__)) && !CONFIG_EARLY_CONSOLE static inline void printk(int LEVEL, const char *fmt, ...); static inline void printk(int LEVEL, const char *fmt, ...) { diff --git a/src/mainboard/emulation/qemu-armv7/Makefile.inc b/src/mainboard/emulation/qemu-armv7/Makefile.inc index 46ecfed9cd..431d9ab865 100644 --- a/src/mainboard/emulation/qemu-armv7/Makefile.inc +++ b/src/mainboard/emulation/qemu-armv7/Makefile.inc @@ -22,6 +22,6 @@ bootblock-y += timer.c romstage-y += timer.c ramstage-y += timer.c -bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c +bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c romstage-$(CONFIG_EARLY_CONSOLE) += uart.c ramstage-y += uart.c