From patchwork Thu Apr 18 02:13:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 237392 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5DDBF2C0195 for ; Thu, 18 Apr 2013 12:14:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F3A24A2D0; Thu, 18 Apr 2013 04:14:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5GKk5JoFNKi0; Thu, 18 Apr 2013 04:14:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9598D4A2D5; Thu, 18 Apr 2013 04:14:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 744864A2D3 for ; Thu, 18 Apr 2013 04:14:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fzd8kuVUB3A3 for ; Thu, 18 Apr 2013 04:14:36 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-yh0-f73.google.com (mail-yh0-f73.google.com [209.85.213.73]) by theia.denx.de (Postfix) with ESMTPS id 479634A23A for ; Thu, 18 Apr 2013 04:14:32 +0200 (CEST) Received: by mail-yh0-f73.google.com with SMTP id i21so236208yha.0 for ; Wed, 17 Apr 2013 19:14:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=CfC2x97g5OWBBvfLBl0EmXVQsZz6HmI5WBgvxXReBTY=; b=FGCvC+GBkxxw5PRnTRZSj7HnCbMI/hiWk4y2mFjc29Y7ikItqiqLPeBkEQBSCYfCXf Ueh0I34Myw3aXl43wlOjqR5tun7sjwETOaz2DluMVXlgXOkaW4GMUrFZvaFLOz4T5cRr Rh8KHyukKDK7hgpa2x05CL0gAOh7nIPx35mPnBAHj53w5ZB719QVTjYNgVgBDppZxvtj OOkVuv0Vxl7TOUxdCVWGRIg1n/qmGzkwwFbT+u86WaXJc3ameXpJvFQ1SYz9na4oQmtm nUrUXetDJHPvzgs8r4hc9jDZ5tCGU76mapbwCaRPEAe2uqhGavrx3BXF8rY5txbPM6ax ftDQ== X-Received: by 10.236.135.65 with SMTP id t41mr4513016yhi.42.1366251270714; Wed, 17 Apr 2013 19:14:30 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id p70si2106946yhd.5.2013.04.17.19.14.30 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 17 Apr 2013 19:14:30 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id B87A232B063; Wed, 17 Apr 2013 19:14:10 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 4DFFA160897; Wed, 17 Apr 2013 19:14:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 17 Apr 2013 19:13:34 -0700 Message-Id: <1366251228-19884-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1366251228-19884-1-git-send-email-sjg@chromium.org> References: <1366251228-19884-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkvYJEErfaX0dSQ5xIgDNmuqS4pj3MS6UBV+bXloYXgl5mpLKOuM9hWDONhcaSl/acYmUXA5zhI9rxhCQOU8HfwFNK/KyjS+3gZkF2XykA86AqrGOvhzzjslyo4bIuEwG0MDIaFytpeO2ML813j7WgfMj273fn9MHvEBjzvYeS+XRW4CVcwiJ20gRtWOFvU9JwmOV/+ Cc: Graeme Russ , u-boot-review@google.com Subject: [U-Boot] [PATCH 05/19] x86: Implement panic output for coreboot X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- arch/x86/cpu/coreboot/coreboot.c | 10 ++++++++++ arch/x86/include/asm/u-boot-x86.h | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index f8e28f0..4a7dae49 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 ae0c388..5a59db6 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 *);