summaryrefslogtreecommitdiff
path: root/common/cmd_bdinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_bdinfo.c')
-rw-r--r--common/cmd_bdinfo.c77
1 files changed, 42 insertions, 35 deletions
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index d22eb66..fbe73f1 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -37,11 +37,12 @@ static void print_eth(int idx);
#ifndef CONFIG_ARM /* PowerPC and other */
static void print_lnum(const char *, u64);
+#endif
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC)
static void print_str(const char *, const char *);
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
char buf[32];
@@ -119,28 +120,9 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#elif defined(CONFIG_NIOS) /* NIOS*/
+#elif defined(CONFIG_NIOS2)
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
- bd_t *bd = gd->bd;
-
- print_num ("memstart", (ulong)bd->bi_memstart);
- print_lnum ("memsize", (u64)bd->bi_memsize);
- print_num ("flashstart", (ulong)bd->bi_flashstart);
- print_num ("flashsize", (ulong)bd->bi_flashsize);
- print_num ("flashoffset", (ulong)bd->bi_flashoffset);
-
- print_eth(0);
- printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
- printf ("baudrate = %ld bps\n", bd->bi_baudrate);
-
- return 0;
-}
-
-#elif defined(CONFIG_NIOS2) /* Nios-II */
-
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
@@ -164,9 +146,10 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#elif defined(CONFIG_MICROBLAZE) /* ! PPC, which leaves Microblaze */
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+#elif defined(CONFIG_MICROBLAZE)
+
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
print_num ("mem start ", (ulong)bd->bi_memstart);
@@ -186,8 +169,9 @@ 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[])
+#elif defined(CONFIG_SPARC)
+
+int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
@@ -218,10 +202,11 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#elif defined(CONFIG_M68K) /* M68K */
+#elif defined(CONFIG_M68K)
+
static void print_str(const char *, const char *);
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
char buf[32];
@@ -268,9 +253,10 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
#elif defined(CONFIG_BLACKFIN)
+
static void print_str(const char *, const char *);
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
char buf[32];
@@ -296,9 +282,9 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#else /* ! PPC, which leaves MIPS */
+#elif defined(CONFIG_MIPS)
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
@@ -315,12 +301,31 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#endif /* MIPS */
-#else /* ARM */
+#elif defined(CONFIG_AVR32)
int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+ bd_t *bd = gd->bd;
+
+ print_num ("boot_params", (ulong)bd->bi_boot_params);
+ print_num ("memstart", (ulong)bd->bi_memstart);
+ print_lnum ("memsize", (u64)bd->bi_memsize);
+ print_num ("flashstart", (ulong)bd->bi_flashstart);
+ print_num ("flashsize", (ulong)bd->bi_flashsize);
+ print_num ("flashoffset", (ulong)bd->bi_flashoffset);
+
+ print_eth(0);
+ printf ("ip_addr = %pI4\n", &bd->bi_ip_addr);
+ printf ("baudrate = %lu bps\n", bd->bi_baudrate);
+
+ return 0;
+}
+
+#elif defined(CONFIG_ARM)
+
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
int i;
bd_t *bd = gd->bd;
@@ -343,7 +348,9 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#else
+ #error "a case for this architecture does not exist!"
+#endif
static void print_num(const char *name, ulong value)
{