From patchwork Thu Nov 22 19:13:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 201149 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 72A3D2C0089 for ; Fri, 23 Nov 2012 06:17:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 866B44A08F; Thu, 22 Nov 2012 20:16:51 +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 o3l8NWzzN1QX; Thu, 22 Nov 2012 20:16:51 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5ADD04A0EF; Thu, 22 Nov 2012 20:15:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 291C84A0A1 for ; Thu, 22 Nov 2012 20:15:05 +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 tHk771WC6FB6 for ; Thu, 22 Nov 2012 20:15:01 +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-ea0-f202.google.com (mail-ea0-f202.google.com [209.85.215.202]) by theia.denx.de (Postfix) with ESMTPS id 9761C4A044 for ; Thu, 22 Nov 2012 20:14:47 +0100 (CET) Received: by mail-ea0-f202.google.com with SMTP id j12so243408eaa.3 for ; Thu, 22 Nov 2012 11:14:47 -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=VojbciIjg7SvpXZWM/ayq12V/9XDKAaezoHOatVd1QM=; b=Bz23Q0nb5PNqdl2+pmsvtEDGJDjzkfRxF2tEy7uEyKbSzVmweCPx2NDvjLxJWF3GHL +/gVFYLNXXEYHUCMB8gmSUxn7CQ3Cd98N6IwUe0ibEgZf3cv0BOF9KR5l3gL8Q7jH1CC Ahq/xxd40ZWm0MoNgSAq8PJu3ZVB35SVfE7j0hhkeGT4RFKx/AMmCi5fee9hxw6BjkfG 5P5ZUSZug1fDiiv94iuO8lvfmuQnYOabYGj6MGR39dJDqqGWutyQAJBuE+A6SNsqTXjT VsfQCS3mHfL/9X1wrLAQ6yUeLaanH1fdaCi2C6rDoEkNXJUrJr5DaCMoQOkCEXCx4eaU +QSg== Received: by 10.14.213.135 with SMTP id a7mr2199128eep.2.1353611687562; Thu, 22 Nov 2012 11:14:47 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si1008090een.1.2012.11.22.11.14.47 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 22 Nov 2012 11:14:47 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 35230200061; Thu, 22 Nov 2012 11:14:47 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id E7305160C8A; Thu, 22 Nov 2012 11:14:46 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 22 Nov 2012 11:13:04 -0800 Message-Id: <1353611587-18186-21-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1353611587-18186-1-git-send-email-sjg@chromium.org> References: <1353611587-18186-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQmbFLRW2nVogDwEGczXrrtkqaK32Yr6NwArFZyqLTGJhddWQ8jQesFcuea03/eju6qhJ5Rqt3hgORT8ytmag8PImc3Tj/kiZQAufDS5n9o8SkHUpM0LfOjiuIuy5ZU0ZRGTy0nVUD0fpqFuK3EvVenvhnSR6NDbKxzzXdgExfgXDnHs/pZhB2KgwdwX/XGXrSc0lj9b Cc: Tom Rini Subject: [U-Boot] [PATCH v2 20/23] Add command to show DRAM configuration 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 The new meminfo command shows details memory information. It is implemented by board_show_dram(), which should be implemented by the board. This is a rewrite of the patch: arm: Add option to display customised memory information according to feedback on the mailing list. Signed-off-by: Simon Glass --- Changes in v2: - Rework DRAM info feature to use a command instead of updating arm code README | 8 ++++++++ common/cmd_mem.c | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/README b/README index b1379a6..7a81cd4 100644 --- a/README +++ b/README @@ -2414,6 +2414,14 @@ CBFS (Coreboot Filesystem) support Note: There is also a sha1sum command, which should perhaps be deprecated in favour of 'hash sha1'. +- Detailed memory information + CONFIG_CMD_MEMINFO + + Define this to provide a 'meminfo' command. This prints + information on system memory. You can provide a + board-specific function board_show_dram() to print this + information if the standard message is insufficient. + - Show boot progress: CONFIG_SHOW_BOOT_PROGRESS diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 4d64cff..4727abd 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -33,6 +33,9 @@ #include #endif #include +#include + +DECLARE_GLOBAL_DATA_PTR; static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); @@ -1243,3 +1246,25 @@ U_BOOT_CMD( "[.b, .w, .l] address value delay(ms)" ); #endif /* CONFIG_MX_CYCLIC */ + +#ifdef CONFIG_CMD_MEMINFO +__weak void board_show_dram(ulong size) +{ + puts("DRAM: "); + print_size(size, "\n"); +} + +static int do_mem_info(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + board_show_dram(gd->ram_size); + + return 0; +} + +U_BOOT_CMD( + meminfo, 3, 1, do_mem_info, + "display memory information", + "" +); +#endif