X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_bdinfo.c;h=04fa4facae1bacd6c4d733574aad56072f1962c6;hb=512f8d5d7863474ead9728698faf1e5f6e2f52d7;hp=f1adeaa7bc6ac6d94beda15161ccf85190bc25ec;hpb=945af8d723a29e9b6289d84250745ed0dc16fc81;p=u-boot diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index f1adeaa7bc..04fa4facae 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -28,6 +28,7 @@ #include #include /* for print_IPaddr */ +DECLARE_GLOBAL_DATA_PTR; #if (CONFIG_COMMANDS & CFG_CMD_BDI) static void print_num(const char *, ulong); @@ -39,8 +40,6 @@ static void print_str(const char *, const char *); int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { - DECLARE_GLOBAL_DATA_PTR; - int i; bd_t *bd = gd->bd; char buf[32]; @@ -55,52 +54,134 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num ("flashoffset", bd->bi_flashoffset ); print_num ("sramstart", bd->bi_sramstart ); print_num ("sramsize", bd->bi_sramsize ); -#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) +#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || \ + defined(CONFIG_8260) || defined(CONFIG_E500) print_num ("immr_base", bd->bi_immr_base ); #endif print_num ("bootflags", bd->bi_bootflags ); -#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_405EP) +#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ + defined(CONFIG_405EP) || defined(CONFIG_XILINX_ML300) || \ + defined(CONFIG_440EP) || defined(CONFIG_440GR) print_str ("procfreq", strmhz(buf, bd->bi_procfreq)); - print_str ("plb_busfreq", strmhz(buf, bd->bi_plb_busfreq)); -#if defined(CONFIG_405GP) || defined(CONFIG_405EP) - print_str ("pci_busfreq", strmhz(buf, bd->bi_pci_busfreq)); + print_str ("plb_busfreq", strmhz(buf, bd->bi_plb_busfreq)); +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined(CONFIG_XILINX_ML300) || \ + defined(CONFIG_440EP) || defined(CONFIG_440GR) + print_str ("pci_busfreq", strmhz(buf, bd->bi_pci_busfreq)); #endif -#else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP */ -#if defined(CONFIG_8260) +#else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_ML300, CONFIG_440EP CONFIG_440GR */ +#if defined(CONFIG_CPM2) print_str ("vco", strmhz(buf, bd->bi_vco)); print_str ("sccfreq", strmhz(buf, bd->bi_sccfreq)); print_str ("brgfreq", strmhz(buf, bd->bi_brgfreq)); #endif print_str ("intfreq", strmhz(buf, bd->bi_intfreq)); -#if defined(CONFIG_8260) +#if defined(CONFIG_CPM2) print_str ("cpmfreq", strmhz(buf, bd->bi_cpmfreq)); #endif print_str ("busfreq", strmhz(buf, bd->bi_busfreq)); -#endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP */ - printf ("ethaddr ="); +#endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_ML300, CONFIG_440EP CONFIG_440GR */ +#if defined(CONFIG_MPC8220) + print_str ("inpfreq", strmhz(buf, bd->bi_inpfreq)); + print_str ("flbfreq", strmhz(buf, bd->bi_flbfreq)); + print_str ("pcifreq", strmhz(buf, bd->bi_pcifreq)); + print_str ("vcofreq", strmhz(buf, bd->bi_vcofreq)); + print_str ("pevfreq", strmhz(buf, bd->bi_pevfreq)); +#endif + + puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); } -#ifdef CONFIG_PN62 - printf ("\neth1addr ="); + +#if defined(CONFIG_HAS_ETH1) + puts ("\neth1addr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enet1addr[i]); } -#endif /* CONFIG_PN62 */ +#endif + +#if defined(CONFIG_HAS_ETH2) + puts ("\neth2addr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enet2addr[i]); + } +#endif + +#if defined(CONFIG_HAS_ETH3) + puts ("\neth3addr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enet3addr[i]); + } +#endif + #ifdef CONFIG_HERMES print_str ("ethspeed", strmhz(buf, bd->bi_ethspeed)); #endif - printf ("\nIP addr = "); print_IPaddr (bd->bi_ip_addr); + puts ("\nIP addr = "); print_IPaddr (bd->bi_ip_addr); printf ("\nbaudrate = %6ld bps\n", bd->bi_baudrate ); return 0; } -#else /* ! PPC, which leaves MIPS */ +#elif defined(CONFIG_NIOS) /* NIOS*/ + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + int i; + bd_t *bd = gd->bd; + + print_num ("memstart", (ulong)bd->bi_memstart); + print_num ("memsize", (ulong)bd->bi_memsize); + print_num ("flashstart", (ulong)bd->bi_flashstart); + print_num ("flashsize", (ulong)bd->bi_flashsize); + print_num ("flashoffset", (ulong)bd->bi_flashoffset); + + 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); + printf ("\nbaudrate = %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[]) { - DECLARE_GLOBAL_DATA_PTR; + int i; + bd_t *bd = gd->bd; + + print_num ("mem start", (ulong)bd->bi_memstart); + print_num ("mem size", (ulong)bd->bi_memsize); + print_num ("flash start", (ulong)bd->bi_flashstart); + print_num ("flash size", (ulong)bd->bi_flashsize); + print_num ("flash offset", (ulong)bd->bi_flashoffset); + +#if defined(CFG_SRAM_BASE) + print_num ("sram start", (ulong)bd->bi_sramstart); + print_num ("sram size", (ulong)bd->bi_sramsize); +#endif +#if defined(CFG_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 = %ld bps\n", bd->bi_baudrate); + + return 0; +} + +#else /* ! PPC, which leaves MIPS */ + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ int i; bd_t *bd = gd->bd; @@ -111,11 +192,11 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num ("flashsize", (ulong)bd->bi_flashsize); print_num ("flashoffset", (ulong)bd->bi_flashoffset); - printf ("ethaddr ="); + puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); } - printf ("\nip_addr = "); + puts ("\nip_addr = "); print_IPaddr (bd->bi_ip_addr); printf ("\nbaudrate = %d bps\n", bd->bi_baudrate); @@ -127,8 +208,6 @@ 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 *argv[]) { - DECLARE_GLOBAL_DATA_PTR; - int i; bd_t *bd = gd->bd; @@ -142,11 +221,11 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) print_num("-> size", bd->bi_dram[i].size); } - printf ("ethaddr ="); + puts ("ethaddr ="); for (i=0; i<6; ++i) { printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); } - printf ("\n" + puts ( "\n" "ip_addr = "); print_IPaddr (bd->bi_ip_addr); printf ("\n"