ARM: Separate the early console (romstage) from the bootblock console.
It might be that you want an early console in romstage before RAM is up, but you can't or don't want to support the console all the way back in the bootblock. By making the console in those two different environments configurable seperately that becomes possible. On the 5250 console output as early as the bootblock works, but on the 5420 it only starts working in the ROM stage after clocks have been initialized. Change-Id: I68ae3fcb4d828fa8a328a30001c23c81a4423bb8 Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3671 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
c2c4f84644
commit
fbb11cf979
|
@ -163,7 +163,7 @@ $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDD
|
||||||
ramstage-y += exception.c
|
ramstage-y += exception.c
|
||||||
ramstage-y += exception_asm.S
|
ramstage-y += exception_asm.S
|
||||||
|
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += early_console.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += early_console.c
|
||||||
bootblock-y += cache.c
|
bootblock-y += cache.c
|
||||||
|
|
||||||
romstage-y += cache.c
|
romstage-y += cache.c
|
||||||
|
|
|
@ -68,7 +68,7 @@ void main(void)
|
||||||
bootblock_mainboard_init();
|
bootblock_mainboard_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_EARLY_CONSOLE
|
#ifdef CONFIG_BOOTBLOCK_CONSOLE
|
||||||
console_init();
|
console_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
menu "Console"
|
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
|
config DEFAULT_EARLY_CONSOLE
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -14,7 +14,7 @@ romstage-y += console.c
|
||||||
romstage-y += post.c
|
romstage-y += post.c
|
||||||
romstage-y += die.c
|
romstage-y += die.c
|
||||||
|
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += vtxprintf.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += vtxprintf.c
|
||||||
bootblock-y += console.c
|
bootblock-y += console.c
|
||||||
bootblock-y += die.c
|
bootblock-y += die.c
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,8 @@ int console_tst_byte(void)
|
||||||
|
|
||||||
void console_init(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
|
#if CONFIG_USBDEBUG
|
||||||
enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT);
|
enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT);
|
||||||
|
|
|
@ -2,6 +2,7 @@ config CPU_SAMSUNG_EXYNOS5250
|
||||||
depends on ARCH_ARMV7
|
depends on ARCH_ARMV7
|
||||||
select HAVE_MONOTONIC_TIMER
|
select HAVE_MONOTONIC_TIMER
|
||||||
select HAVE_UART_SPECIAL
|
select HAVE_UART_SPECIAL
|
||||||
|
select DEFAULT_BOOTBLOCK_CONSOLE
|
||||||
select DEFAULT_EARLY_CONSOLE
|
select DEFAULT_EARLY_CONSOLE
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
|
@ -6,14 +6,14 @@ INTERMEDIATE += exynos5250_add_bl1
|
||||||
bootblock-y += spi.c
|
bootblock-y += spi.c
|
||||||
bootblock-y += pinmux.c mct.c power.c
|
bootblock-y += pinmux.c mct.c power.c
|
||||||
# Clock is required for UART
|
# Clock is required for UART
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += clock_init.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock_init.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += clock.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += monotonic_timer.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += monotonic_timer.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c
|
||||||
bootblock-y += wakeup.c
|
bootblock-y += wakeup.c
|
||||||
bootblock-y += gpio.c
|
bootblock-y += gpio.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += pwm.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += pwm.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += timer.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += timer.c
|
||||||
|
|
||||||
romstage-y += spi.c
|
romstage-y += spi.c
|
||||||
romstage-y += clock.c
|
romstage-y += clock.c
|
||||||
|
|
|
@ -6,14 +6,14 @@ INTERMEDIATE += exynos5420_add_bl1
|
||||||
bootblock-y += spi.c
|
bootblock-y += spi.c
|
||||||
bootblock-y += pinmux.c mct.c power.c
|
bootblock-y += pinmux.c mct.c power.c
|
||||||
# Clock is required for UART
|
# Clock is required for UART
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += clock_init.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock_init.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += clock.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += clock.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += monotonic_timer.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += monotonic_timer.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += uart.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c
|
||||||
bootblock-y += wakeup.c
|
bootblock-y += wakeup.c
|
||||||
bootblock-y += gpio.c
|
bootblock-y += gpio.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += pwm.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += pwm.c
|
||||||
bootblock-$(CONFIG_EARLY_CONSOLE) += timer.c
|
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += timer.c
|
||||||
|
|
||||||
romstage-y += spi.c
|
romstage-y += spi.c
|
||||||
romstage-y += clock.c
|
romstage-y += clock.c
|
||||||
|
|
|
@ -77,7 +77,8 @@ void mainboard_post(u8 value);
|
||||||
void __attribute__ ((noreturn)) die(const char *msg);
|
void __attribute__ ((noreturn)) die(const char *msg);
|
||||||
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
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, ...);
|
||||||
static inline void printk(int LEVEL, const char *fmt, ...) {
|
static inline void printk(int LEVEL, const char *fmt, ...) {
|
||||||
|
|
|
@ -22,6 +22,6 @@ bootblock-y += timer.c
|
||||||
romstage-y += timer.c
|
romstage-y += timer.c
|
||||||
ramstage-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
|
romstage-$(CONFIG_EARLY_CONSOLE) += uart.c
|
||||||
ramstage-y += uart.c
|
ramstage-y += uart.c
|
||||||
|
|
Loading…
Reference in New Issue