From patchwork Fri Jun 16 03:37:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 776551 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wpmLf0pylz9s8J for ; Fri, 16 Jun 2017 13:38:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="kp/Fp7zr"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id B94CBC21C4E; Fri, 16 Jun 2017 03:38:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DDAA6C21C5A; Fri, 16 Jun 2017 03:38:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 15CC5C21C48; Fri, 16 Jun 2017 03:38:06 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.denx.de (Postfix) with ESMTPS id B2A84C21C3E for ; Fri, 16 Jun 2017 03:38:05 +0000 (UTC) Received: by mail-oi0-f42.google.com with SMTP id e11so18025868oia.2 for ; Thu, 15 Jun 2017 20:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=pQY1AgPGY6k/L/QMoWtmvoC6ZoXxzJ8jQOFD6OtvtN8=; b=kp/Fp7zr8eDh9Je0ot8uDK507S7TdJGhtBd+KdXlBU0jKZTR3jdV6HbbsdWtsl+z20 RCFayqut5rQJYpH1SYZ9hYMsUD0MXbgqULYqFrzUgppVcyPHADHbvyeoRZI3TvM3wNk6 HYr5kEpTQCqtmRenHZdPVAHaWu/qHun8N4q2GP93+25NYdAxVurBEisRcpI4g3oNke+M rnk1sk9SbuV7ZL0pyF6nci1AD8Et0qlri+fVRT43Fi2J0MTKg2yTjKalu5afQ+jeFuGL p0XyEVRWXYGYFk01YjJR2hZRAjW8H8BbYaPi42MZ81owPo8wMgnQJKYCugyJiTxq4GWb crTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=pQY1AgPGY6k/L/QMoWtmvoC6ZoXxzJ8jQOFD6OtvtN8=; b=HQpuwZUUAVBMeKuT21E8pA9kr9VxFSyrctnPxHd5tc+7fitwg5RZ16p6SIjRbSZBG3 fFL6meW3Q5yoUC1zI+RwkDmK09hIUmPGBs8a4Oip2Ddrfn32ERwrhqP6abKXGgNg5bRD pEq+81YtXcpG6qQZGDR38Pl3ze1CZW+E28KeV33gv50Vl7ZeTutW5SqE7nVzVrseKTwH tZKkh1KD3N1FidxQlWO5OhWvuYV/7Jwxq3SlzLxuNFtKbqT7xYCGiGxUOSbd6ZhODfqK DB2dRDEiJlUS1EFpjrQfFLXoXQTzcV3yz+7iAzdQgck6Av2TTJRXJGuzk7JgT1EDN2oy oMkA== X-Gm-Message-State: AKS2vOwizD9KIOXEe8w8ST208iqzXHTR9u7+EpmR1LI0PTuA4IeXxRBx Z3DpvOkfVKL5MW3z X-Received: by 10.202.177.67 with SMTP id a64mr409953oif.140.1497584284199; Thu, 15 Jun 2017 20:38:04 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:10f2:12:cd90:8924:43d7:15c]) by smtp.gmail.com with ESMTPSA id y16sm208216oie.18.2017.06.15.20.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 20:38:01 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 68D234013A; Thu, 15 Jun 2017 21:38:00 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 15 Jun 2017 21:37:50 -0600 Message-Id: <20170616033754.20963-2-sjg@chromium.org> X-Mailer: git-send-email 2.13.1.518.g3df882009-goog In-Reply-To: <20170616033754.20963-1-sjg@chromium.org> References: <20170616033754.20963-1-sjg@chromium.org> Cc: Tom Rini , Stephen Warren , Tom Warren Subject: [U-Boot] [PATCH v3 2/6] Allow displaying the U-Boot banner on a video display X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present the U-Boot banner is only displayed on the serial console. If this is not visible to the user, the banner does not show. Some devices have a video display which can usefully display this information. Add a banner which is printed after relocation only on non-serial devices if CONFIG_DISPLAY_BOARDINFO_LATE is defined. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Bin Meng Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes in v3: None Changes in v2: - Reword function comment for console_announce_r() slighty common/board_r.c | 1 + common/console.c | 17 +++++++++++++---- include/console.h | 12 ++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index adc1f1937e..8d9f0a3c5e 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -832,6 +832,7 @@ static init_fnc_t init_sequence_r[] = { #endif console_init_r, /* fully init console as a device */ #ifdef CONFIG_DISPLAY_BOARDINFO_LATE + console_announce_r, show_board_info, #endif #ifdef CONFIG_ARCH_MISC_INIT diff --git a/common/console.c b/common/console.c index 1232808df5..60e7a94a56 100644 --- a/common/console.c +++ b/common/console.c @@ -202,7 +202,6 @@ static void console_putc(int file, const char c) } } -#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER) static void console_puts_noserial(int file, const char *s) { int i; @@ -214,7 +213,6 @@ static void console_puts_noserial(int file, const char *s) dev->puts(dev, s); } } -#endif static void console_puts(int file, const char *s) { @@ -248,13 +246,11 @@ static inline void console_putc(int file, const char c) stdio_devices[file]->putc(stdio_devices[file], c); } -#if CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER) static inline void console_puts_noserial(int file, const char *s) { if (strcmp(stdio_devices[file]->name, "serial") != 0) stdio_devices[file]->puts(stdio_devices[file], s); } -#endif static inline void console_puts(int file, const char *s) { @@ -699,6 +695,19 @@ static void console_update_silent(void) #endif } +int console_announce_r(void) +{ +#if !CONFIG_IS_ENABLED(PRE_CONSOLE_BUFFER) + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + + display_options_get_banner(false, buf, sizeof(buf)); + + console_puts_noserial(stdout, buf); +#endif + + return 0; +} + /* Called before relocation - use serial functions */ int console_init_f(void) { diff --git a/include/console.h b/include/console.h index 3d37f6a53b..cea29ed6dc 100644 --- a/include/console.h +++ b/include/console.h @@ -42,6 +42,18 @@ void console_record_reset(void); */ void console_record_reset_enable(void); +/** + * console_announce_r() - print a U-Boot console on non-serial consoles + * + * When U-Boot starts up with a display it generally does not announce itself + * on the display. The banner is instead emitted on the UART before relocation. + * This function prints a banner on devices which (we assume) did not receive + * it before relocation. + * + * @return 0 (meaning no errors) + */ +int console_announce_r(void); + /* * CONSOLE multiplexing. */