From patchwork Fri Nov 30 23:01:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 203069 X-Patchwork-Delegate: albert.aribaud@free.fr 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 D1FF22C008E for ; Sat, 1 Dec 2012 10:01:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 230074A053; Sat, 1 Dec 2012 00:01:53 +0100 (CET) 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 W+El0YjAer5j; Sat, 1 Dec 2012 00:01:52 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E0424A04E; Sat, 1 Dec 2012 00:01:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9136C4A046 for ; Sat, 1 Dec 2012 00:01:39 +0100 (CET) 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 KgJKaKjvrr8H for ; Sat, 1 Dec 2012 00:01:38 +0100 (CET) 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-gh0-f202.google.com (mail-gh0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 21C0A4A047 for ; Sat, 1 Dec 2012 00:01:36 +0100 (CET) Received: by mail-gh0-f202.google.com with SMTP id z10so112549ghb.3 for ; Fri, 30 Nov 2012 15:01:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=mYI2i81qdEtrqK1hLynJwHy7g9NjQAMStNc9MgS7ixA=; b=pPxmDWH0YlvnQnb0lva1RyzdMAVDzUxBu3Ff3HG27adQjmVuOsZ0r4sR3ve7o3Q/tS hKbXQfh+gtmGbIp679BzN5hCniWYeikhmujLncjeDuxw4fKRuLD8xu3aNNP+H8ytrHqe I1GMeJ3+y6Mp+Om+50OdaS83fSKT05a74gd3Fl/h0+8K1lczXzW5bZoCewFj+LmpMYCq Ztl3tkxkkMr9ZJqew3uDKWTeKqEKhlDKLJ9B2za6gnUdNrGb+Ejj7odgGEfcMNCg8c8E jFAXyoMNR+8K5JiQ3hUTPAYDSKxvV4YxwpKRZgDse7G4TsaVA6e6BtcYim60UYq7DfLH rBOw== Received: by 10.101.8.33 with SMTP id l33mr458820ani.15.1354316494087; Fri, 30 Nov 2012 15:01:34 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i63si410522yhk.5.2012.11.30.15.01.34 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 30 Nov 2012 15:01:34 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id C39B7100047; Fri, 30 Nov 2012 15:01:33 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 13BAD160949; Fri, 30 Nov 2012 15:01:33 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 30 Nov 2012 15:01:19 -0800 Message-Id: <1354316484-23515-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1354316484-23515-1-git-send-email-sjg@chromium.org> References: <1354316484-23515-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmLrY5MMUF1w8qEKqboH/7jnspmtwRDK6XveUW43yPrf7H97eBCyRbnmTK/NBUhKfBtA8YWYZJH15O6qF7pSWTMwQcadL+iRwYXQfaP59MNab3PUDMP2GK83O4qJPkh3BfC86z9IGfiV6X1KiE0umS+UCb1S2lleojQdT/VwudHKVUUGhpDFFo3aJADfWpDASbXCzu7 Subject: [U-Boot] [PATCH v2 06/10] arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD 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 This option displays board info after stdio is running, so that it will appear on the LCD. If it is displayed earlier, the board info will appear on the serial console but not on the LCD. Here follows a blow-by-blow description. 1a. Without CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5-dirty (Nov 15 2012 - 14:29:42) for SMDK5250 CPU: S5PC520 @ 1700MHz Board: Google Snow, rev 0 I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 1b. Without CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is missing): In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2a. With CONFIG_DISPLAY_BOARDINFO_LATE, on serial: U-Boot 2011.12-02550-g037e1c5 (Nov 15 2012 - 14:27:40) for SMDK5250 CPU: S5PC520 @ 1700MHz I2C: ready DRAM: 2 GiB Elpida DDR3 @ 800MHz MMC: S5P MSHC0: 0, S5P MSHC1: 1 SF: Detected W25Q32 with page size 4 KiB, total 4 MiB *** Warning - bad CRC, using default environment Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # 2b. With CONFIG_DISPLAY_BOARDINFO_LATE, on LCD (note machine info is present): Model: Google Snow In: mkbp-keyb Out: lcd Err: lcd Net: No ethernet found. Hit any key to stop autoboot: 0 SMDK5250 # Since the LCD is all that a typical user sees, it is useful to display the model there. We may be able to rearrange things some other way one day, but at present this seems like a convenient way of getting the required behaviour. Signed-off-by: Simon Glass --- Changes in v2: - Update commit message to provide a detailed description README | 5 +++++ arch/arm/lib/board.c | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/README b/README index d8bd784..36853e5 100644 --- a/README +++ b/README @@ -3356,6 +3356,11 @@ use the "saveenv" command to store a valid environment. when U-Boot starts up. The board function checkboard() is called to do this. +- CONFIG_DISPLAY_BOARDINFO_LATE + Similar to the previous option, but display this information + later, once stdio is running and output goes to the LCD, if + present. + Low Level (hardware related) configuration options: --------------------------------------------------- diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 7d1927e..1d563bb 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -498,6 +498,16 @@ static int should_load_env(void) #endif } +#if defined(CONFIG_DISPLAY_BOARDINFO_LATE) && defined(CONFIG_OF_CONTROL) +static void display_fdt_model(const void *blob) +{ + const char *model; + + model = (char *)fdt_getprop(blob, 0, "model", NULL); + printf("Model: %s\n", model ? model : ""); +} +#endif + /************************************************************************ * * This is the next part if the initialization sequence: we are now @@ -625,6 +635,15 @@ void board_init_r(gd_t *id, ulong dest_addr) console_init_r(); /* fully init console as a device */ +#ifdef CONFIG_DISPLAY_BOARDINFO_LATE +# ifdef CONFIG_OF_CONTROL + /* Put this here so it appears on the LCD, now it is ready */ + display_fdt_model(gd->fdt_blob); +# else + checkboard(); +# endif +#endif + #if defined(CONFIG_ARCH_MISC_INIT) /* miscellaneous arch dependent initialisations */ arch_misc_init();