From: Simon Glass Date: Wed, 17 Apr 2013 16:13:34 +0000 (+0000) Subject: x86: Implement panic output for coreboot X-Git-Tag: v2013.07-rc1~1^2~54^2~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c78a62acdfbc0a1cc75ee934f7897b9e99bd3e8d;p=u-boot x86: Implement panic output for coreboot panic_puts() can be called in early boot to display a message. It might help with early debugging. Signed-off-by: Simon Glass Reviewed-by: Tom Wai-Hong Tam --- diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index f8e28f0c82..4a7dae4936 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -135,3 +136,12 @@ int board_final_cleanup(void) return 0; } + +void panic_puts(const char *str) +{ + NS16550_t port = (NS16550_t)0x3f8; + + NS16550_init(port, 1); + while (*str) + NS16550_putc(port, *str++); +} diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index ae0c3883e4..5a59db61bf 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -33,6 +33,7 @@ void init_gd(gd_t *id, u64 *gdt_addr); void setup_gdt(gd_t *id, u64 *gdt_addr); int init_cache(void); int cleanup_before_linux(void); +void panic_puts(const char *str); /* cpu/.../timer.c */ void timer_isr(void *);