wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2003 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | /* |
| 25 | * Boot support |
| 26 | */ |
| 27 | #include <common.h> |
| 28 | #include <command.h> |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 29 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 30 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 31 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 32 | static void print_num(const char *, ulong); |
| 33 | |
Philippe De Muyter | 004a6ff | 2009-09-21 22:20:29 -0600 | [diff] [blame] | 34 | #if !(defined(CONFIG_ARM) || defined(CONFIG_M68K)) || defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 35 | static void print_eth(int idx); |
Wolfgang Denk | 770a188 | 2009-03-29 00:54:21 +0100 | [diff] [blame] | 36 | #endif |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 37 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 38 | #ifndef CONFIG_ARM /* PowerPC and other */ |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 39 | static void print_lnum(const char *, u64); |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 40 | #endif |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 41 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 42 | #if defined(CONFIG_PPC) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 43 | static void print_str(const char *, const char *); |
| 44 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 45 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 46 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 47 | bd_t *bd = gd->bd; |
| 48 | char buf[32]; |
| 49 | |
| 50 | #ifdef DEBUG |
| 51 | print_num ("bd address", (ulong)bd ); |
| 52 | #endif |
| 53 | print_num ("memstart", bd->bi_memstart ); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 54 | print_lnum ("memsize", bd->bi_memsize ); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 55 | print_num ("flashstart", bd->bi_flashstart ); |
| 56 | print_num ("flashsize", bd->bi_flashsize ); |
| 57 | print_num ("flashoffset", bd->bi_flashoffset ); |
| 58 | print_num ("sramstart", bd->bi_sramstart ); |
| 59 | print_num ("sramsize", bd->bi_sramsize ); |
wdenk | a445ddf | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 60 | #if defined(CONFIG_5xx) || defined(CONFIG_8xx) || \ |
| 61 | defined(CONFIG_8260) || defined(CONFIG_E500) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 62 | print_num ("immr_base", bd->bi_immr_base ); |
| 63 | #endif |
| 64 | print_num ("bootflags", bd->bi_bootflags ); |
wdenk | a445ddf | 2004-06-09 00:34:46 +0000 | [diff] [blame] | 65 | #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \ |
Michal Simek | 594c7b5 | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 66 | defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \ |
Marian Balakowicz | 49d0eee | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 67 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || \ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 68 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
| 69 | defined(CONFIG_440SP) || defined(CONFIG_440SPE) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 70 | print_str ("procfreq", strmhz(buf, bd->bi_procfreq)); |
wdenk | 337f565 | 2004-10-28 00:09:35 +0000 | [diff] [blame] | 71 | print_str ("plb_busfreq", strmhz(buf, bd->bi_plb_busfreq)); |
Michal Simek | 594c7b5 | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 72 | #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined(CONFIG_XILINX_405) || \ |
Stefan Roese | 42fbddd | 2006-09-07 11:51:23 +0200 | [diff] [blame] | 73 | defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE) || \ |
| 74 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) |
wdenk | 337f565 | 2004-10-28 00:09:35 +0000 | [diff] [blame] | 75 | print_str ("pci_busfreq", strmhz(buf, bd->bi_pci_busfreq)); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 76 | #endif |
Michal Simek | 594c7b5 | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 77 | #else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */ |
Jon Loeliger | f5ad378 | 2005-07-23 10:37:35 -0500 | [diff] [blame] | 78 | #if defined(CONFIG_CPM2) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 79 | print_str ("vco", strmhz(buf, bd->bi_vco)); |
| 80 | print_str ("sccfreq", strmhz(buf, bd->bi_sccfreq)); |
| 81 | print_str ("brgfreq", strmhz(buf, bd->bi_brgfreq)); |
| 82 | #endif |
| 83 | print_str ("intfreq", strmhz(buf, bd->bi_intfreq)); |
Jon Loeliger | f5ad378 | 2005-07-23 10:37:35 -0500 | [diff] [blame] | 84 | #if defined(CONFIG_CPM2) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 85 | print_str ("cpmfreq", strmhz(buf, bd->bi_cpmfreq)); |
| 86 | #endif |
| 87 | print_str ("busfreq", strmhz(buf, bd->bi_busfreq)); |
Michal Simek | 594c7b5 | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 88 | #endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */ |
wdenk | 337f565 | 2004-10-28 00:09:35 +0000 | [diff] [blame] | 89 | #if defined(CONFIG_MPC8220) |
| 90 | print_str ("inpfreq", strmhz(buf, bd->bi_inpfreq)); |
| 91 | print_str ("flbfreq", strmhz(buf, bd->bi_flbfreq)); |
| 92 | print_str ("pcifreq", strmhz(buf, bd->bi_pcifreq)); |
| 93 | print_str ("vcofreq", strmhz(buf, bd->bi_vcofreq)); |
| 94 | print_str ("pevfreq", strmhz(buf, bd->bi_pevfreq)); |
| 95 | #endif |
wdenk | 0aeb853 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 96 | |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 97 | print_eth(0); |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 98 | #if defined(CONFIG_HAS_ETH1) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 99 | print_eth(1); |
wdenk | 0aeb853 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 100 | #endif |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 101 | #if defined(CONFIG_HAS_ETH2) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 102 | print_eth(2); |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 103 | #endif |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 104 | #if defined(CONFIG_HAS_ETH3) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 105 | print_eth(3); |
wdenk | 0aeb853 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 106 | #endif |
richardretanubun | e5167f1 | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 107 | #if defined(CONFIG_HAS_ETH4) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 108 | print_eth(4); |
richardretanubun | e5167f1 | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 109 | #endif |
richardretanubun | e5167f1 | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 110 | #if defined(CONFIG_HAS_ETH5) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 111 | print_eth(5); |
richardretanubun | e5167f1 | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 112 | #endif |
| 113 | |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 114 | #ifdef CONFIG_HERMES |
| 115 | print_str ("ethspeed", strmhz(buf, bd->bi_ethspeed)); |
| 116 | #endif |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 117 | printf ("IP addr = %pI4\n", &bd->bi_ip_addr); |
| 118 | printf ("baudrate = %6ld bps\n", bd->bi_baudrate ); |
Richard Retanubun | 92bc263 | 2010-01-15 10:06:06 -0500 | [diff] [blame] | 119 | print_num ("relocaddr", gd->relocaddr); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 120 | return 0; |
| 121 | } |
| 122 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 123 | #elif defined(CONFIG_NIOS2) |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 124 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 125 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 126 | { |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 127 | bd_t *bd = gd->bd; |
| 128 | |
| 129 | print_num ("mem start", (ulong)bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 130 | print_lnum ("mem size", (u64)bd->bi_memsize); |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 131 | print_num ("flash start", (ulong)bd->bi_flashstart); |
| 132 | print_num ("flash size", (ulong)bd->bi_flashsize); |
| 133 | print_num ("flash offset", (ulong)bd->bi_flashoffset); |
| 134 | |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 135 | #if defined(CONFIG_SYS_SRAM_BASE) |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 136 | print_num ("sram start", (ulong)bd->bi_sramstart); |
| 137 | print_num ("sram size", (ulong)bd->bi_sramsize); |
| 138 | #endif |
| 139 | |
Jon Loeliger | d704d91 | 2007-07-10 11:02:44 -0500 | [diff] [blame] | 140 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 141 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 142 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 143 | #endif |
| 144 | |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 145 | printf ("baudrate = %ld bps\n", bd->bi_baudrate); |
wdenk | ef3386f | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 146 | |
| 147 | return 0; |
| 148 | } |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 149 | |
| 150 | #elif defined(CONFIG_MICROBLAZE) |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 151 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 152 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 153 | { |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 154 | bd_t *bd = gd->bd; |
| 155 | print_num ("mem start ", (ulong)bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 156 | print_lnum ("mem size ", (u64)bd->bi_memsize); |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 157 | print_num ("flash start ", (ulong)bd->bi_flashstart); |
| 158 | print_num ("flash size ", (ulong)bd->bi_flashsize); |
| 159 | print_num ("flash offset ", (ulong)bd->bi_flashoffset); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 160 | #if defined(CONFIG_SYS_SRAM_BASE) |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 161 | print_num ("sram start ", (ulong)bd->bi_sramstart); |
| 162 | print_num ("sram size ", (ulong)bd->bi_sramsize); |
| 163 | #endif |
Jon Loeliger | d704d91 | 2007-07-10 11:02:44 -0500 | [diff] [blame] | 164 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 165 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 166 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 167 | #endif |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 168 | printf ("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); |
Michal Simek | 922ce20 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 169 | return 0; |
| 170 | } |
wdenk | 60164a8 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 171 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 172 | #elif defined(CONFIG_SPARC) |
| 173 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 174 | int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 175 | { |
| 176 | bd_t *bd = gd->bd; |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 177 | |
| 178 | #ifdef DEBUG |
| 179 | print_num("bd address ", (ulong) bd); |
| 180 | #endif |
| 181 | print_num("memstart ", bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 182 | print_lnum("memsize ", bd->bi_memsize); |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 183 | print_num("flashstart ", bd->bi_flashstart); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 184 | print_num("CONFIG_SYS_MONITOR_BASE ", CONFIG_SYS_MONITOR_BASE); |
Jean-Christophe PLAGNIOL-VILLARD | 7e1cda6 | 2008-09-10 22:48:06 +0200 | [diff] [blame] | 185 | print_num("CONFIG_ENV_ADDR ", CONFIG_ENV_ADDR); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 186 | printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE, |
| 187 | CONFIG_SYS_MONITOR_LEN); |
| 188 | printf("CONFIG_SYS_MALLOC_BASE = 0x%lx (%d)\n", CONFIG_SYS_MALLOC_BASE, |
| 189 | CONFIG_SYS_MALLOC_LEN); |
| 190 | printf("CONFIG_SYS_INIT_SP_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_INIT_SP_OFFSET, |
| 191 | CONFIG_SYS_STACK_SIZE); |
| 192 | printf("CONFIG_SYS_PROM_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_PROM_OFFSET, |
| 193 | CONFIG_SYS_PROM_SIZE); |
| 194 | printf("CONFIG_SYS_GBL_DATA_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET, |
| 195 | CONFIG_SYS_GBL_DATA_SIZE); |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 196 | |
| 197 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 198 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 199 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 200 | #endif |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 201 | printf("baudrate = %6ld bps\n", bd->bi_baudrate); |
Daniel Hellstrom | 83eb3cc | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 202 | return 0; |
| 203 | } |
| 204 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 205 | #elif defined(CONFIG_M68K) |
| 206 | |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 207 | static void print_str(const char *, const char *); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 208 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 209 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 210 | { |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 211 | bd_t *bd = gd->bd; |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 212 | char buf[32]; |
| 213 | |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 214 | print_num ("memstart", (ulong)bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 215 | print_lnum ("memsize", (u64)bd->bi_memsize); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 216 | print_num ("flashstart", (ulong)bd->bi_flashstart); |
| 217 | print_num ("flashsize", (ulong)bd->bi_flashsize); |
| 218 | print_num ("flashoffset", (ulong)bd->bi_flashoffset); |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 219 | #if defined(CONFIG_SYS_INIT_RAM_ADDR) |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 220 | print_num ("sramstart", (ulong)bd->bi_sramstart); |
| 221 | print_num ("sramsize", (ulong)bd->bi_sramsize); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 222 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 0383694 | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 223 | #if defined(CONFIG_SYS_MBAR) |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 224 | print_num ("mbar", bd->bi_mbar_base); |
| 225 | #endif |
Richard Retanubun | 9e4c9d3 | 2009-01-23 09:45:34 -0500 | [diff] [blame] | 226 | print_str ("cpufreq", strmhz(buf, bd->bi_intfreq)); |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 227 | print_str ("busfreq", strmhz(buf, bd->bi_busfreq)); |
| 228 | #ifdef CONFIG_PCI |
| 229 | print_str ("pcifreq", strmhz(buf, bd->bi_pcifreq)); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 230 | #endif |
TsiChungLiew | fc3ca3b6 | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 231 | #ifdef CONFIG_EXTRA_CLOCK |
| 232 | print_str ("flbfreq", strmhz(buf, bd->bi_flbfreq)); |
| 233 | print_str ("inpfreq", strmhz(buf, bd->bi_inpfreq)); |
| 234 | print_str ("vcofreq", strmhz(buf, bd->bi_vcofreq)); |
| 235 | #endif |
Stefan Roese | addc447 | 2007-08-18 14:37:52 +0200 | [diff] [blame] | 236 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 237 | print_eth(0); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 238 | #if defined(CONFIG_HAS_ETH1) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 239 | print_eth(1); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 240 | #endif |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 241 | #if defined(CONFIG_HAS_ETH2) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 242 | print_eth(2); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 243 | #endif |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 244 | #if defined(CONFIG_HAS_ETH3) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 245 | print_eth(3); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 246 | #endif |
| 247 | |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 248 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Stefan Roese | addc447 | 2007-08-18 14:37:52 +0200 | [diff] [blame] | 249 | #endif |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 250 | printf ("baudrate = %ld bps\n", bd->bi_baudrate); |
TsiChung Liew | f6afe72 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 251 | |
| 252 | return 0; |
| 253 | } |
| 254 | |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 255 | #elif defined(CONFIG_BLACKFIN) |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 256 | |
Mike Frysinger | a267207 | 2008-10-20 16:15:04 -0400 | [diff] [blame] | 257 | static void print_str(const char *, const char *); |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 258 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 259 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 260 | { |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 261 | bd_t *bd = gd->bd; |
Mike Frysinger | a267207 | 2008-10-20 16:15:04 -0400 | [diff] [blame] | 262 | char buf[32]; |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 263 | |
| 264 | printf("U-Boot = %s\n", bd->bi_r_version); |
| 265 | printf("CPU = %s\n", bd->bi_cpu); |
| 266 | printf("Board = %s\n", bd->bi_board_name); |
Mike Frysinger | a267207 | 2008-10-20 16:15:04 -0400 | [diff] [blame] | 267 | print_str("VCO", strmhz(buf, bd->bi_vco)); |
| 268 | print_str("CCLK", strmhz(buf, bd->bi_cclk)); |
| 269 | print_str("SCLK", strmhz(buf, bd->bi_sclk)); |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 270 | |
| 271 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 272 | print_num("memstart", (ulong)bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 273 | print_lnum("memsize", (u64)bd->bi_memsize); |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 274 | print_num("flashstart", (ulong)bd->bi_flashstart); |
| 275 | print_num("flashsize", (ulong)bd->bi_flashsize); |
| 276 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
| 277 | |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 278 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 279 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 280 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
Mike Frysinger | f443d3c | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 281 | |
| 282 | return 0; |
| 283 | } |
| 284 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 285 | #elif defined(CONFIG_MIPS) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 286 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 287 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 288 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 289 | bd_t *bd = gd->bd; |
| 290 | |
| 291 | print_num ("boot_params", (ulong)bd->bi_boot_params); |
| 292 | print_num ("memstart", (ulong)bd->bi_memstart); |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 293 | print_lnum ("memsize", (u64)bd->bi_memsize); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 294 | print_num ("flashstart", (ulong)bd->bi_flashstart); |
| 295 | print_num ("flashsize", (ulong)bd->bi_flashsize); |
| 296 | print_num ("flashoffset", (ulong)bd->bi_flashoffset); |
| 297 | |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 298 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 299 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 300 | printf ("baudrate = %d bps\n", bd->bi_baudrate); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 301 | |
| 302 | return 0; |
| 303 | } |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 304 | |
| 305 | #elif defined(CONFIG_AVR32) |
| 306 | |
| 307 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
| 308 | { |
| 309 | bd_t *bd = gd->bd; |
| 310 | |
| 311 | print_num ("boot_params", (ulong)bd->bi_boot_params); |
| 312 | print_num ("memstart", (ulong)bd->bi_memstart); |
| 313 | print_lnum ("memsize", (u64)bd->bi_memsize); |
| 314 | print_num ("flashstart", (ulong)bd->bi_flashstart); |
| 315 | print_num ("flashsize", (ulong)bd->bi_flashsize); |
| 316 | print_num ("flashoffset", (ulong)bd->bi_flashoffset); |
| 317 | |
| 318 | print_eth(0); |
| 319 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 320 | printf ("baudrate = %lu bps\n", bd->bi_baudrate); |
| 321 | |
| 322 | return 0; |
| 323 | } |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 324 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 325 | #elif defined(CONFIG_ARM) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 326 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 327 | int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 328 | { |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 329 | int i; |
| 330 | bd_t *bd = gd->bd; |
| 331 | |
| 332 | print_num ("arch_number", bd->bi_arch_number); |
| 333 | print_num ("env_t", (ulong)bd->bi_env); |
| 334 | print_num ("boot_params", (ulong)bd->bi_boot_params); |
| 335 | |
| 336 | for (i=0; i<CONFIG_NR_DRAM_BANKS; ++i) { |
| 337 | print_num("DRAM bank", i); |
| 338 | print_num("-> start", bd->bi_dram[i].start); |
| 339 | print_num("-> size", bd->bi_dram[i].size); |
| 340 | } |
| 341 | |
Hebbar | e6c8528 | 2007-12-18 16:03:07 -0800 | [diff] [blame] | 342 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 343 | print_eth(0); |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 344 | printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Hebbar | e6c8528 | 2007-12-18 16:03:07 -0800 | [diff] [blame] | 345 | #endif |
Mike Frysinger | d5695f4 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 346 | printf ("baudrate = %d bps\n", bd->bi_baudrate); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 347 | |
| 348 | return 0; |
| 349 | } |
| 350 | |
Reinhard Meyer | 0f8337b | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 351 | #else |
| 352 | #error "a case for this architecture does not exist!" |
| 353 | #endif |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 354 | |
| 355 | static void print_num(const char *name, ulong value) |
| 356 | { |
| 357 | printf ("%-12s= 0x%08lX\n", name, value); |
| 358 | } |
| 359 | |
Philippe De Muyter | 004a6ff | 2009-09-21 22:20:29 -0600 | [diff] [blame] | 360 | #if !(defined(CONFIG_ARM) || defined(CONFIG_M68K)) || defined(CONFIG_CMD_NET) |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 361 | static void print_eth(int idx) |
| 362 | { |
| 363 | char name[10], *val; |
| 364 | if (idx) |
| 365 | sprintf(name, "eth%iaddr", idx); |
| 366 | else |
| 367 | strcpy(name, "ethaddr"); |
| 368 | val = getenv(name); |
| 369 | if (!val) |
| 370 | val = "(not set)"; |
| 371 | printf("%-12s= %s\n", name, val); |
| 372 | } |
Wolfgang Denk | 770a188 | 2009-03-29 00:54:21 +0100 | [diff] [blame] | 373 | #endif |
Mike Frysinger | 9335cc7 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 374 | |
Becky Bruce | a36601e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 375 | #ifndef CONFIG_ARM |
| 376 | static void print_lnum(const char *name, u64 value) |
| 377 | { |
| 378 | printf ("%-12s= 0x%.8llX\n", name, value); |
| 379 | } |
| 380 | #endif |
| 381 | |
Mike Frysinger | a267207 | 2008-10-20 16:15:04 -0400 | [diff] [blame] | 382 | #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_BLACKFIN) |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 383 | static void print_str(const char *name, const char *str) |
| 384 | { |
| 385 | printf ("%-12s= %6s MHz\n", name, str); |
| 386 | } |
| 387 | #endif /* CONFIG_PPC */ |
| 388 | |
| 389 | |
| 390 | /* -------------------------------------------------------------------- */ |
| 391 | |
wdenk | f287a24 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 392 | U_BOOT_CMD( |
| 393 | bdinfo, 1, 1, do_bdinfo, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 394 | "print Board Info structure", |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 395 | "" |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 396 | ); |