U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: andrew at bradfordembedded.com <andrew@bradfordembedded.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] meminfo cmd: Enable printing >=4GiB SDRAM sizes
Date: Fri, 22 May 2015 08:30:14 -0400	[thread overview]
Message-ID: <1432297814-16527-1-git-send-email-andrew@bradfordembedded.com> (raw)

From: Andrew Bradford <andrew.bradford@kodakalaris.com>

gd->ram_size is stored as phys_size_t type which can be bigger than an
unsigned long on some architectures.  When using unsigned long type,
SDRAM of 4GiB or larger will not print the correct size, but using
phys_size_t will.

Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
---
 common/cmd_mem.c | 2 +-
 include/common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 2e85d53..43c3fb6 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1325,7 +1325,7 @@ U_BOOT_CMD(
 #endif
 
 #ifdef CONFIG_CMD_MEMINFO
-__weak void board_show_dram(ulong size)
+__weak void board_show_dram(phys_size_t size)
 {
 	puts("DRAM:  ");
 	print_size(size, "\n");
diff --git a/include/common.h b/include/common.h
index d4d704a..ea5aeb0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -274,7 +274,7 @@ __weak int arch_reserve_stacks(void);
  *
  * @param size	Size of DRAM (which should be displayed along with other info)
  */
-void board_show_dram(ulong size);
+void board_show_dram(phys_size_t size);
 
 /**
  * arch_fixup_fdt() - Write arch-specific information to fdt
-- 
1.9.1

             reply	other threads:[~2015-05-22 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 12:30 andrew at bradfordembedded.com [this message]
2015-05-28 13:24 ` [U-Boot] meminfo cmd: Enable printing >=4GiB SDRAM sizes Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432297814-16527-1-git-send-email-andrew@bradfordembedded.com \
    --to=andrew@bradfordembedded.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox