public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Daniel Hellstrom <daniel@gaisler.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 2/13] SPARC: Added SPARC board information to bdinfo command
Date: Fri, 28 Mar 2008 13:23:05 +0100	[thread overview]
Message-ID: <47ECE329.1080707@gaisler.com> (raw)

Hello Wolfgang,

This patch adds support for the U-Boot command 'bdinfo' for SPARC boards,
the output is as shown below.

######################
U-Boot 1.3.2-00273-gf85e20a (Mar 28 2008 - 13:13:48)GAISLER LEON3 
GR-XC3S-1500

CPU: LEON3
Board: GRSIM/TSIM
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   GRETH 10/100

Type "run flash_nfs" to mount root filesystem over NFS

Hit any key to stop autoboot:  0
=> bdinfo
memstart               = 0x40000000
memsize                = 0x04000000
flashstart             = 0x00000000
CFG_MONITOR_BASE       = 0x00000000
CFG_ENV_ADDR           = 0x007F8000
CFG_RELOC_MONITOR_BASE = 0x43f8e000 (262144)
CFG_MALLOC_BASE        = 0x43fce000 (131072)
CFG_INIT_SP_OFFSET     = 0x43ffdfe0 (65504)
CFG_PROM_OFFSET        = 0x43ffe000 (8064)
CFG_GBL_DATA_OFFSET    = 0x43ffff80 (128)
ethaddr                = 00:00:7A:CC:00:12
IP addr                = 192.168.0.80
baudrate               =  38400 bps
=>
######################

This patch is also available at 
ftp://ftp.gaisler.com/gaisler.com/u-boot/patches.

Best Regards,
Daniel Hellstrom




 common/cmd_bdinfo.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)


diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index bbb0192..731c1d2 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -208,6 +208,45 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int 
argc, char *argv[])
     return 0;
 }
 
+#elif defined(CONFIG_SPARC)    /* SPARC */
+int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+    bd_t *bd = gd->bd;
+#if defined(CONFIG_CMD_NET)
+    int i;
+#endif
+
+#ifdef DEBUG
+    print_num("bd address             ", (ulong) bd);
+#endif
+    print_num("memstart               ", bd->bi_memstart);
+    print_num("memsize                ", bd->bi_memsize);
+    print_num("flashstart             ", bd->bi_flashstart);
+    print_num("CFG_MONITOR_BASE       ", CFG_MONITOR_BASE);
+    print_num("CFG_ENV_ADDR           ", CFG_ENV_ADDR);
+    printf("CFG_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CFG_RELOC_MONITOR_BASE,
+           CFG_MONITOR_LEN);
+    printf("CFG_MALLOC_BASE        = 0x%lx (%d)\n", CFG_MALLOC_BASE,
+           CFG_MALLOC_LEN);
+    printf("CFG_INIT_SP_OFFSET     = 0x%lx (%d)\n", CFG_INIT_SP_OFFSET,
+           CFG_STACK_SIZE);
+    printf("CFG_PROM_OFFSET        = 0x%lx (%d)\n", CFG_PROM_OFFSET,
+           CFG_PROM_SIZE);
+    printf("CFG_GBL_DATA_OFFSET    = 0x%lx (%d)\n", CFG_GBL_DATA_OFFSET,
+           CFG_GBL_DATA_SIZE);
+
+#if defined(CONFIG_CMD_NET)
+    puts("ethaddr                =");
+    for (i = 0; i < 6; ++i) {
+        printf("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
+    }
+    puts("\nIP addr                = ");
+    print_IPaddr(bd->bi_ip_addr);
+#endif
+    printf("\nbaudrate               = %6ld bps\n", bd->bi_baudrate);
+    return 0;
+}
+
 #elif defined(CONFIG_M68K) /* M68K */
 static void print_str(const char *, const char *);
 

             reply	other threads:[~2008-03-28 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 12:23 Daniel Hellstrom [this message]
2008-03-28 14:41 ` [U-Boot-Users] [PATCH 2/13] SPARC: Added SPARC board information to bdinfo command Wolfgang Denk

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=47ECE329.1080707@gaisler.com \
    --to=daniel@gaisler.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