wdenk | 8bde7f7 | 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> |
Mike Frysinger | d88af4d | 2011-12-04 17:45:22 +0000 | [diff] [blame] | 29 | #include <linux/compiler.h> |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 30 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 31 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 32 | |
Mike Frysinger | d88af4d | 2011-12-04 17:45:22 +0000 | [diff] [blame] | 33 | __maybe_unused |
| 34 | static void print_num(const char *name, ulong value) |
| 35 | { |
| 36 | printf("%-12s= 0x%08lX\n", name, value); |
| 37 | } |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 38 | |
Mike Frysinger | d88af4d | 2011-12-04 17:45:22 +0000 | [diff] [blame] | 39 | static void print_eth(int idx) |
| 40 | { |
| 41 | char name[10], *val; |
| 42 | if (idx) |
| 43 | sprintf(name, "eth%iaddr", idx); |
| 44 | else |
| 45 | strcpy(name, "ethaddr"); |
| 46 | val = getenv(name); |
| 47 | if (!val) |
| 48 | val = "(not set)"; |
| 49 | printf("%-12s= %s\n", name, val); |
| 50 | } |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 51 | |
Mike Frysinger | d88af4d | 2011-12-04 17:45:22 +0000 | [diff] [blame] | 52 | __maybe_unused |
| 53 | static void print_lnum(const char *name, u64 value) |
| 54 | { |
| 55 | printf("%-12s= 0x%.8llX\n", name, value); |
| 56 | } |
| 57 | |
| 58 | __maybe_unused |
| 59 | static void print_mhz(const char *name, unsigned long hz) |
| 60 | { |
| 61 | char buf[32]; |
| 62 | |
| 63 | printf("%-12s= %6s MHz\n", name, strmhz(buf, hz)); |
| 64 | } |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 65 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 66 | #if defined(CONFIG_PPC) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 67 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 68 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 69 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 70 | bd_t *bd = gd->bd; |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 71 | |
| 72 | #ifdef DEBUG |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 73 | print_num("bd address", (ulong)bd); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 74 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 75 | print_num("memstart", bd->bi_memstart); |
| 76 | print_lnum("memsize", bd->bi_memsize); |
| 77 | print_num("flashstart", bd->bi_flashstart); |
| 78 | print_num("flashsize", bd->bi_flashsize); |
| 79 | print_num("flashoffset", bd->bi_flashoffset); |
| 80 | print_num("sramstart", bd->bi_sramstart); |
| 81 | print_num("sramsize", bd->bi_sramsize); |
| 82 | #if defined(CONFIG_5xx) || defined(CONFIG_8xx) || \ |
| 83 | defined(CONFIG_8260) || defined(CONFIG_E500) |
| 84 | print_num("immr_base", bd->bi_immr_base); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 85 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 86 | print_num("bootflags", bd->bi_bootflags); |
| 87 | #if defined(CONFIG_405CR) || defined(CONFIG_405EP) || \ |
| 88 | defined(CONFIG_405GP) || \ |
| 89 | defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 90 | defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \ |
| 91 | defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \ |
| 92 | defined(CONFIG_XILINX_405) |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 93 | print_mhz("procfreq", bd->bi_procfreq); |
| 94 | print_mhz("plb_busfreq", bd->bi_plb_busfreq); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 95 | #if defined(CONFIG_405EP) || defined(CONFIG_405GP) || \ |
| 96 | defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \ |
| 97 | defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \ |
| 98 | defined(CONFIG_440SPE) || defined(CONFIG_XILINX_405) |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 99 | print_mhz("pci_busfreq", bd->bi_pci_busfreq); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 100 | #endif |
Michal Simek | 9fea65a | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 101 | #else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */ |
Jon Loeliger | 9c4c5ae | 2005-07-23 10:37:35 -0500 | [diff] [blame] | 102 | #if defined(CONFIG_CPM2) |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 103 | print_mhz("vco", bd->bi_vco); |
| 104 | print_mhz("sccfreq", bd->bi_sccfreq); |
| 105 | print_mhz("brgfreq", bd->bi_brgfreq); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 106 | #endif |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 107 | print_mhz("intfreq", bd->bi_intfreq); |
Jon Loeliger | 9c4c5ae | 2005-07-23 10:37:35 -0500 | [diff] [blame] | 108 | #if defined(CONFIG_CPM2) |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 109 | print_mhz("cpmfreq", bd->bi_cpmfreq); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 110 | #endif |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 111 | print_mhz("busfreq", bd->bi_busfreq); |
Michal Simek | 9fea65a | 2008-06-24 09:54:09 +0200 | [diff] [blame] | 112 | #endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */ |
wdenk | 983fda8 | 2004-10-28 00:09:35 +0000 | [diff] [blame] | 113 | #if defined(CONFIG_MPC8220) |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 114 | print_mhz("inpfreq", bd->bi_inpfreq); |
| 115 | print_mhz("flbfreq", bd->bi_flbfreq); |
| 116 | print_mhz("pcifreq", bd->bi_pcifreq); |
| 117 | print_mhz("vcofreq", bd->bi_vcofreq); |
| 118 | print_mhz("pevfreq", bd->bi_pevfreq); |
wdenk | 983fda8 | 2004-10-28 00:09:35 +0000 | [diff] [blame] | 119 | #endif |
wdenk | 03f5c55 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 120 | |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 121 | print_eth(0); |
wdenk | e2ffd59 | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 122 | #if defined(CONFIG_HAS_ETH1) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 123 | print_eth(1); |
wdenk | 03f5c55 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 124 | #endif |
wdenk | e2ffd59 | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 125 | #if defined(CONFIG_HAS_ETH2) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 126 | print_eth(2); |
wdenk | 42d1f03 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 127 | #endif |
wdenk | e2ffd59 | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 128 | #if defined(CONFIG_HAS_ETH3) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 129 | print_eth(3); |
wdenk | 03f5c55 | 2004-10-10 21:21:55 +0000 | [diff] [blame] | 130 | #endif |
richardretanubun | c68a05f | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 131 | #if defined(CONFIG_HAS_ETH4) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 132 | print_eth(4); |
richardretanubun | c68a05f | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 133 | #endif |
richardretanubun | c68a05f | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 134 | #if defined(CONFIG_HAS_ETH5) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 135 | print_eth(5); |
richardretanubun | c68a05f | 2008-09-29 18:28:23 -0400 | [diff] [blame] | 136 | #endif |
| 137 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 138 | #ifdef CONFIG_HERMES |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 139 | print_mhz("ethspeed", bd->bi_ethspeed); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 140 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 141 | printf("IP addr = %pI4\n", &bd->bi_ip_addr); |
| 142 | printf("baudrate = %6ld bps\n", bd->bi_baudrate); |
| 143 | print_num("relocaddr", gd->relocaddr); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 144 | return 0; |
| 145 | } |
| 146 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 147 | #elif defined(CONFIG_NIOS2) |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 148 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 149 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 150 | { |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 151 | bd_t *bd = gd->bd; |
| 152 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 153 | print_num("mem start", (ulong)bd->bi_memstart); |
| 154 | print_lnum("mem size", (u64)bd->bi_memsize); |
| 155 | print_num("flash start", (ulong)bd->bi_flashstart); |
| 156 | print_num("flash size", (ulong)bd->bi_flashsize); |
| 157 | print_num("flash offset", (ulong)bd->bi_flashoffset); |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 158 | |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 159 | #if defined(CONFIG_SYS_SRAM_BASE) |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 160 | print_num ("sram start", (ulong)bd->bi_sramstart); |
| 161 | print_num ("sram size", (ulong)bd->bi_sramsize); |
| 162 | #endif |
| 163 | |
Jon Loeliger | 9025317 | 2007-07-10 11:02:44 -0500 | [diff] [blame] | 164 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 165 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 166 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 167 | #endif |
| 168 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 169 | printf("baudrate = %ld bps\n", bd->bi_baudrate); |
wdenk | 5c952cf | 2004-10-10 21:27:30 +0000 | [diff] [blame] | 170 | |
| 171 | return 0; |
| 172 | } |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 173 | |
| 174 | #elif defined(CONFIG_MICROBLAZE) |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 175 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 176 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 177 | { |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 178 | bd_t *bd = gd->bd; |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 179 | print_num("mem start ", (ulong)bd->bi_memstart); |
| 180 | print_lnum("mem size ", (u64)bd->bi_memsize); |
| 181 | print_num("flash start ", (ulong)bd->bi_flashstart); |
| 182 | print_num("flash size ", (ulong)bd->bi_flashsize); |
| 183 | print_num("flash offset ", (ulong)bd->bi_flashoffset); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 184 | #if defined(CONFIG_SYS_SRAM_BASE) |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 185 | print_num("sram start ", (ulong)bd->bi_sramstart); |
| 186 | print_num("sram size ", (ulong)bd->bi_sramsize); |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 187 | #endif |
Jon Loeliger | 9025317 | 2007-07-10 11:02:44 -0500 | [diff] [blame] | 188 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 189 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 190 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 191 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 192 | printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); |
Michal Simek | cfc6711 | 2007-03-11 13:48:24 +0100 | [diff] [blame] | 193 | return 0; |
| 194 | } |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 195 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 196 | #elif defined(CONFIG_SPARC) |
| 197 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 198 | int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 199 | { |
| 200 | bd_t *bd = gd->bd; |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 201 | |
| 202 | #ifdef DEBUG |
| 203 | print_num("bd address ", (ulong) bd); |
| 204 | #endif |
| 205 | print_num("memstart ", bd->bi_memstart); |
Becky Bruce | b57ca3e | 2008-06-09 20:37:16 -0500 | [diff] [blame] | 206 | print_lnum("memsize ", bd->bi_memsize); |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 207 | print_num("flashstart ", bd->bi_flashstart); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 208 | print_num("CONFIG_SYS_MONITOR_BASE ", CONFIG_SYS_MONITOR_BASE); |
Jean-Christophe PLAGNIOL-VILLARD | 0e8d158 | 2008-09-10 22:48:06 +0200 | [diff] [blame] | 209 | print_num("CONFIG_ENV_ADDR ", CONFIG_ENV_ADDR); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 210 | printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE, |
| 211 | CONFIG_SYS_MONITOR_LEN); |
| 212 | printf("CONFIG_SYS_MALLOC_BASE = 0x%lx (%d)\n", CONFIG_SYS_MALLOC_BASE, |
| 213 | CONFIG_SYS_MALLOC_LEN); |
| 214 | printf("CONFIG_SYS_INIT_SP_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_INIT_SP_OFFSET, |
| 215 | CONFIG_SYS_STACK_SIZE); |
| 216 | printf("CONFIG_SYS_PROM_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_PROM_OFFSET, |
| 217 | CONFIG_SYS_PROM_SIZE); |
| 218 | printf("CONFIG_SYS_GBL_DATA_OFFSET = 0x%lx (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET, |
Wolfgang Denk | 25ddd1f | 2010-10-26 14:34:52 +0200 | [diff] [blame] | 219 | GENERATED_GBL_DATA_SIZE); |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 220 | |
| 221 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 222 | print_eth(0); |
Mike Frysinger | b6446b6 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 223 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 224 | #endif |
Mike Frysinger | b6446b6 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 225 | printf("baudrate = %6ld bps\n", bd->bi_baudrate); |
Daniel Hellstrom | 00ab32c | 2008-03-26 22:36:03 +0100 | [diff] [blame] | 226 | return 0; |
| 227 | } |
| 228 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 229 | #elif defined(CONFIG_M68K) |
| 230 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 231 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 232 | { |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 233 | bd_t *bd = gd->bd; |
TsiChungLiew | 8ae158c | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 234 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 235 | print_num("memstart", (ulong)bd->bi_memstart); |
| 236 | print_lnum("memsize", (u64)bd->bi_memsize); |
| 237 | print_num("flashstart", (ulong)bd->bi_flashstart); |
| 238 | print_num("flashsize", (ulong)bd->bi_flashsize); |
| 239 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 240 | #if defined(CONFIG_SYS_INIT_RAM_ADDR) |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 241 | print_num("sramstart", (ulong)bd->bi_sramstart); |
| 242 | print_num("sramsize", (ulong)bd->bi_sramsize); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 243 | #endif |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 244 | #if defined(CONFIG_SYS_MBAR) |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 245 | print_num("mbar", bd->bi_mbar_base); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 246 | #endif |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 247 | print_mhz("cpufreq", bd->bi_intfreq); |
| 248 | print_mhz("busfreq", bd->bi_busfreq); |
TsiChungLiew | 8ae158c | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 249 | #ifdef CONFIG_PCI |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 250 | print_mhz("pcifreq", bd->bi_pcifreq); |
TsiChungLiew | 8ae158c | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 251 | #endif |
| 252 | #ifdef CONFIG_EXTRA_CLOCK |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 253 | print_mhz("flbfreq", bd->bi_flbfreq); |
| 254 | print_mhz("inpfreq", bd->bi_inpfreq); |
| 255 | print_mhz("vcofreq", bd->bi_vcofreq); |
TsiChungLiew | 8ae158c | 2007-08-16 15:05:11 -0500 | [diff] [blame] | 256 | #endif |
Stefan Roese | 26667b7 | 2007-08-18 14:37:52 +0200 | [diff] [blame] | 257 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 258 | print_eth(0); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 259 | #if defined(CONFIG_HAS_ETH1) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 260 | print_eth(1); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 261 | #endif |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 262 | #if defined(CONFIG_HAS_ETH2) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 263 | print_eth(2); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 264 | #endif |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 265 | #if defined(CONFIG_HAS_ETH3) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 266 | print_eth(3); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 267 | #endif |
| 268 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 269 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Stefan Roese | 26667b7 | 2007-08-18 14:37:52 +0200 | [diff] [blame] | 270 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 271 | printf("baudrate = %ld bps\n", bd->bi_baudrate); |
TsiChung Liew | 8e585f0 | 2007-06-18 13:50:13 -0500 | [diff] [blame] | 272 | |
| 273 | return 0; |
| 274 | } |
| 275 | |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 276 | #elif defined(CONFIG_BLACKFIN) |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 277 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 278 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 279 | { |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 280 | bd_t *bd = gd->bd; |
| 281 | |
| 282 | printf("U-Boot = %s\n", bd->bi_r_version); |
| 283 | printf("CPU = %s\n", bd->bi_cpu); |
| 284 | printf("Board = %s\n", bd->bi_board_name); |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 285 | print_mhz("VCO", bd->bi_vco); |
| 286 | print_mhz("CCLK", bd->bi_cclk); |
| 287 | print_mhz("SCLK", bd->bi_sclk); |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 288 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 289 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 290 | print_num("memstart", (ulong)bd->bi_memstart); |
| 291 | print_lnum("memsize", (u64)bd->bi_memsize); |
| 292 | print_num("flashstart", (ulong)bd->bi_flashstart); |
| 293 | print_num("flashsize", (ulong)bd->bi_flashsize); |
| 294 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 295 | |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 296 | print_eth(0); |
Mike Frysinger | b6446b6 | 2009-02-17 00:00:53 -0500 | [diff] [blame] | 297 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 298 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
Mike Frysinger | 8dc48d7 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 299 | |
| 300 | return 0; |
| 301 | } |
| 302 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 303 | #elif defined(CONFIG_MIPS) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 304 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 305 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 306 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 307 | bd_t *bd = gd->bd; |
| 308 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 309 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 310 | print_num("memstart", (ulong)bd->bi_memstart); |
| 311 | print_lnum("memsize", (u64)bd->bi_memsize); |
| 312 | print_num("flashstart", (ulong)bd->bi_flashstart); |
| 313 | print_num("flashsize", (ulong)bd->bi_flashsize); |
| 314 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 315 | |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 316 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 317 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 318 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 319 | |
| 320 | return 0; |
| 321 | } |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 322 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 323 | #elif defined(CONFIG_AVR32) |
| 324 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 325 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 326 | { |
| 327 | bd_t *bd = gd->bd; |
| 328 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 329 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 330 | print_num("memstart", (ulong)bd->bi_memstart); |
| 331 | print_lnum("memsize", (u64)bd->bi_memsize); |
| 332 | print_num("flashstart", (ulong)bd->bi_flashstart); |
| 333 | print_num("flashsize", (ulong)bd->bi_flashsize); |
| 334 | print_num("flashoffset", (ulong)bd->bi_flashoffset); |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 335 | |
| 336 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 337 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 338 | printf("baudrate = %lu bps\n", bd->bi_baudrate); |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 339 | |
| 340 | return 0; |
| 341 | } |
| 342 | |
| 343 | #elif defined(CONFIG_ARM) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 344 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 345 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 346 | { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 347 | int i; |
| 348 | bd_t *bd = gd->bd; |
| 349 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 350 | print_num("arch_number", bd->bi_arch_number); |
| 351 | print_num("boot_params", (ulong)bd->bi_boot_params); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 352 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 353 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 354 | print_num("DRAM bank", i); |
| 355 | print_num("-> start", bd->bi_dram[i].start); |
| 356 | print_num("-> size", bd->bi_dram[i].size); |
| 357 | } |
| 358 | |
Hebbar | a41dbbd | 2007-12-18 16:03:07 -0800 | [diff] [blame] | 359 | #if defined(CONFIG_CMD_NET) |
Mike Frysinger | de2dff6 | 2009-02-11 18:50:10 -0500 | [diff] [blame] | 360 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 361 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Hebbar | a41dbbd | 2007-12-18 16:03:07 -0800 | [diff] [blame] | 362 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 363 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
Aneesh V | e47f2db | 2011-06-16 23:30:48 +0000 | [diff] [blame] | 364 | #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 365 | print_num("TLB addr", gd->tlb_addr); |
Heiko Schocher | f1d2b31 | 2010-09-17 13:10:39 +0200 | [diff] [blame] | 366 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 367 | print_num("relocaddr", gd->relocaddr); |
| 368 | print_num("reloc off", gd->reloc_off); |
| 369 | print_num("irq_sp", gd->irq_sp); /* irq stack pointer */ |
| 370 | print_num("sp start ", gd->start_addr_sp); |
| 371 | print_num("FB base ", gd->fb_base); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 372 | return 0; |
| 373 | } |
| 374 | |
Nobuhiro Iwamatsu | ebd0d06 | 2010-07-22 16:05:32 +0900 | [diff] [blame] | 375 | #elif defined(CONFIG_SH) |
| 376 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 377 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Nobuhiro Iwamatsu | ebd0d06 | 2010-07-22 16:05:32 +0900 | [diff] [blame] | 378 | { |
| 379 | bd_t *bd = gd->bd; |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 380 | print_num("mem start ", (ulong)bd->bi_memstart); |
| 381 | print_lnum("mem size ", (u64)bd->bi_memsize); |
| 382 | print_num("flash start ", (ulong)bd->bi_flashstart); |
| 383 | print_num("flash size ", (ulong)bd->bi_flashsize); |
| 384 | print_num("flash offset ", (ulong)bd->bi_flashoffset); |
Nobuhiro Iwamatsu | ebd0d06 | 2010-07-22 16:05:32 +0900 | [diff] [blame] | 385 | |
| 386 | #if defined(CONFIG_CMD_NET) |
| 387 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 388 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Nobuhiro Iwamatsu | ebd0d06 | 2010-07-22 16:05:32 +0900 | [diff] [blame] | 389 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 390 | printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate); |
Nobuhiro Iwamatsu | ebd0d06 | 2010-07-22 16:05:32 +0900 | [diff] [blame] | 391 | return 0; |
| 392 | } |
| 393 | |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 394 | #elif defined(CONFIG_X86) |
| 395 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 396 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 397 | { |
| 398 | int i; |
| 399 | bd_t *bd = gd->bd; |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 400 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 401 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 402 | print_num("bi_memstart", bd->bi_memstart); |
| 403 | print_num("bi_memsize", bd->bi_memsize); |
| 404 | print_num("bi_flashstart", bd->bi_flashstart); |
| 405 | print_num("bi_flashsize", bd->bi_flashsize); |
| 406 | print_num("bi_flashoffset", bd->bi_flashoffset); |
| 407 | print_num("bi_sramstart", bd->bi_sramstart); |
| 408 | print_num("bi_sramsize", bd->bi_sramsize); |
| 409 | print_num("bi_bootflags", bd->bi_bootflags); |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 410 | print_mhz("cpufreq", bd->bi_intfreq); |
| 411 | print_mhz("busfreq", bd->bi_busfreq); |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 412 | |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 413 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 414 | print_num("DRAM bank", i); |
| 415 | print_num("-> start", bd->bi_dram[i].start); |
| 416 | print_num("-> size", bd->bi_dram[i].size); |
| 417 | } |
| 418 | |
| 419 | #if defined(CONFIG_CMD_NET) |
| 420 | print_eth(0); |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 421 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
Timur Tabi | 0c277ef | 2011-10-05 17:08:07 -0500 | [diff] [blame] | 422 | print_mhz("ethspeed", bd->bi_ethspeed); |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 423 | #endif |
Macpaul Lin | 5902e8f | 2011-04-27 16:28:35 +0000 | [diff] [blame] | 424 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
Graeme Russ | a806ee6 | 2010-08-22 16:25:58 +1000 | [diff] [blame] | 425 | |
| 426 | return 0; |
| 427 | } |
| 428 | |
Simon Glass | 6fcc3be | 2011-09-17 06:48:47 +0000 | [diff] [blame] | 429 | #elif defined(CONFIG_SANDBOX) |
| 430 | |
| 431 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 432 | { |
| 433 | int i; |
| 434 | bd_t *bd = gd->bd; |
| 435 | |
| 436 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 437 | |
| 438 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { |
| 439 | print_num("DRAM bank", i); |
| 440 | print_num("-> start", bd->bi_dram[i].start); |
| 441 | print_num("-> size", bd->bi_dram[i].size); |
| 442 | } |
| 443 | |
| 444 | #if defined(CONFIG_CMD_NET) |
| 445 | print_eth(0); |
| 446 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 447 | #endif |
| 448 | print_num("FB base ", gd->fb_base); |
| 449 | return 0; |
| 450 | } |
| 451 | |
Macpaul Lin | 64d6146 | 2011-10-19 20:41:09 +0000 | [diff] [blame] | 452 | #elif defined(CONFIG_NDS32) |
| 453 | |
| 454 | int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 455 | { |
| 456 | int i; |
| 457 | bd_t *bd = gd->bd; |
| 458 | |
| 459 | print_num("arch_number", bd->bi_arch_number); |
| 460 | print_num("boot_params", (ulong)bd->bi_boot_params); |
| 461 | |
| 462 | for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) { |
| 463 | print_num("DRAM bank", i); |
| 464 | print_num("-> start", bd->bi_dram[i].start); |
| 465 | print_num("-> size", bd->bi_dram[i].size); |
| 466 | } |
| 467 | |
| 468 | #if defined(CONFIG_CMD_NET) |
| 469 | print_eth(0); |
| 470 | printf("ip_addr = %pI4\n", &bd->bi_ip_addr); |
| 471 | #endif |
| 472 | printf("baudrate = %d bps\n", bd->bi_baudrate); |
| 473 | |
| 474 | return 0; |
| 475 | } |
| 476 | |
Reinhard Meyer | c99ea79 | 2010-06-06 19:01:59 +0200 | [diff] [blame] | 477 | #else |
| 478 | #error "a case for this architecture does not exist!" |
| 479 | #endif |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 480 | |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 481 | /* -------------------------------------------------------------------- */ |
| 482 | |
wdenk | 0d49839 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 483 | U_BOOT_CMD( |
| 484 | bdinfo, 1, 1, do_bdinfo, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 485 | "print Board Info structure", |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 486 | "" |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 487 | ); |