From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/10] arm: Add option to display customised memory information
Date: Thu, 1 Nov 2012 16:42:07 -0700 [thread overview]
Message-ID: <1351813330-23741-7-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1351813330-23741-1-git-send-email-sjg@chromium.org>
Some boards want to report more than just memory size. For example, it
might be useful to display the memory type (DDR2, DDR3) or manufacturer.
Add a weak function to support this requirement.
Any example of the DRAM: output is below, just for illustration:
U-Boot 2011.12-02470-gd64a0f8-dirty (Sep 14 2012 - 10:46:39) for SMDK5250
CPU: S5PC520 @ 1700MHz
I2C: ready
DRAM: 2 GiB Samsung DDR3 @ 800MHz
MMC: S5P MSHC0: 0, S5P MSHC1: 1
Using default environment
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/arm/lib/board.c | 12 ++++++++++--
include/common.h | 9 +++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index b879507..d420307 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -133,6 +133,15 @@ static int display_banner(void)
return (0);
}
+inline void __board_show_dram(ulong size)
+{
+ puts("DRAM: ");
+ print_size(size, "\n");
+}
+
+void board_show_dram(ulong size)
+ __attribute__((weak, alias("__board_show_dram")));
+
/*
* WARNING: this code looks "cleaner" than the PowerPC version, but
* has the disadvantage that you either get nothing, or everything.
@@ -157,8 +166,7 @@ static int display_dram_config(void)
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
size += gd->bd->bi_dram[i].size;
- puts("DRAM: ");
- print_size(size, "\n");
+ board_show_dram(size);
#endif
return (0);
diff --git a/include/common.h b/include/common.h
index b23e90b..6270b44 100644
--- a/include/common.h
+++ b/include/common.h
@@ -311,6 +311,15 @@ int mac_read_from_eeprom(void);
extern u8 _binary_dt_dtb_start[]; /* embedded device tree blob */
int set_cpu_clk_info(void);
+/**
+ * Show the DRAM size in a board-specific way
+ *
+ * This is used by boards to display DRAM information in their own way.
+ *
+ * @param size Size of DRAM (which should be displayed along with other info)
+ */
+void board_show_dram(ulong size);
+
/* common/flash.c */
void flash_perror (int);
--
1.7.7.3
next prev parent reply other threads:[~2012-11-01 23:42 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 23:42 [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 02/10] arm: move flush_dcache_all() to just before disable cache Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 03/10] arm: Keep track of the tlb size as well as its location Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 04/10] arm: Move fdt check earlier so that board_early_init_f() can use it Simon Glass
2012-11-03 14:56 ` Wolfgang Denk
2012-11-03 21:53 ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 05/10] arm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loading Simon Glass
2012-11-03 12:30 ` Wolfgang Denk
2012-11-07 0:16 ` Simon Glass
2013-01-18 12:06 ` Lucas Stach
2013-01-18 13:29 ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 06/10] arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD Simon Glass
2012-11-03 12:33 ` Wolfgang Denk
2012-11-15 22:37 ` Simon Glass
2012-11-01 23:42 ` Simon Glass [this message]
2012-11-03 14:54 ` [U-Boot] [PATCH 07/10] arm: Add option to display customised memory information Wolfgang Denk
2012-11-15 22:45 ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 08/10] arm: Make interrupts.o and reset.o in libarm also appear in SPL Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 09/10] arm: Move bootstage record for board_init_f() to after arch_cpu_init() Simon Glass
2012-11-03 14:55 ` Wolfgang Denk
2012-11-07 0:51 ` Simon Glass
2012-11-07 13:18 ` Wolfgang Denk
2012-11-22 14:57 ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 10/10] arm: Tabify code for MMC initialization Simon Glass
2012-11-03 8:32 ` [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure Marek Vasut
2012-11-03 12:29 ` Wolfgang Denk
2012-11-07 0:45 ` Simon Glass
2012-11-07 12:55 ` Wolfgang Denk
2012-11-07 15:42 ` Simon Glass
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=1351813330-23741-7-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--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