]> git.sur5r.net Git - u-boot/commitdiff
nios2: use dram bank in board info
authorThomas Chou <thomas@wytron.com.tw>
Tue, 27 Oct 2015 02:21:06 +0000 (10:21 +0800)
committerThomas Chou <thomas@wytron.com.tw>
Fri, 6 Nov 2015 01:14:11 +0000 (09:14 +0800)
Use dram bank in board info, so that it displays correct
memory values in bdinfo command.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
common/cmd_bdinfo.c
include/configs/nios2-generic.h

index ed3b9351b1a7a4648ef3bab4c105b0cfe0cf2dc2..adda55a26307d1620ab0e2471b46683e5eeab5c8 100644 (file)
@@ -157,10 +157,15 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
+       int i;
        bd_t *bd = gd->bd;
 
-       print_num("mem start",          (ulong)bd->bi_memstart);
-       print_lnum("mem size",          (u64)bd->bi_memsize);
+       for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
+               print_num("DRAM bank",  i);
+               print_num("-> start",   bd->bi_dram[i].start);
+               print_num("-> size",    bd->bi_dram[i].size);
+       }
+
        print_num("flash start",        (ulong)bd->bi_flashstart);
        print_num("flash size",         (ulong)bd->bi_flashsize);
        print_num("flash offset",       (ulong)bd->bi_flashoffset);
index b38513e99b07bda6a675459def63743499e61f27..53a9f10f4ff26919bebd88be74571fa088928c9a 100644 (file)
@@ -77,6 +77,7 @@
  */
 #define CONFIG_SYS_SDRAM_BASE          0xD0000000
 #define CONFIG_SYS_SDRAM_SIZE          0x08000000
+#define CONFIG_NR_DRAM_BANKS           1
 #define CONFIG_MONITOR_IS_IN_RAM
 #define CONFIG_SYS_MONITOR_LEN         0x40000 /* Reserve 256k */
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_SDRAM_BASE + \