3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
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.
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.
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,
29 #include <linux/compiler.h>
31 DECLARE_GLOBAL_DATA_PTR;
34 static void print_num(const char *name, ulong value)
36 printf("%-12s= 0x%08lX\n", name, value);
39 static void print_eth(int idx)
43 sprintf(name, "eth%iaddr", idx);
45 strcpy(name, "ethaddr");
49 printf("%-12s= %s\n", name, val);
53 static void print_lnum(const char *name, u64 value)
55 printf("%-12s= 0x%.8llX\n", name, value);
59 static void print_mhz(const char *name, unsigned long hz)
63 printf("%-12s= %6s MHz\n", name, strmhz(buf, hz));
66 #if defined(CONFIG_PPC)
68 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
73 print_num("bd address", (ulong)bd);
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);
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)
93 print_mhz("procfreq", bd->bi_procfreq);
94 print_mhz("plb_busfreq", bd->bi_plb_busfreq);
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)
99 print_mhz("pci_busfreq", bd->bi_pci_busfreq);
101 #else /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
102 #if defined(CONFIG_CPM2)
103 print_mhz("vco", bd->bi_vco);
104 print_mhz("sccfreq", bd->bi_sccfreq);
105 print_mhz("brgfreq", bd->bi_brgfreq);
107 print_mhz("intfreq", bd->bi_intfreq);
108 #if defined(CONFIG_CPM2)
109 print_mhz("cpmfreq", bd->bi_cpmfreq);
111 print_mhz("busfreq", bd->bi_busfreq);
112 #endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
113 #if defined(CONFIG_MPC8220)
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);
122 #if defined(CONFIG_HAS_ETH1)
125 #if defined(CONFIG_HAS_ETH2)
128 #if defined(CONFIG_HAS_ETH3)
131 #if defined(CONFIG_HAS_ETH4)
134 #if defined(CONFIG_HAS_ETH5)
139 print_mhz("ethspeed", bd->bi_ethspeed);
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);
147 #elif defined(CONFIG_NIOS2)
149 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
159 #if defined(CONFIG_SYS_SRAM_BASE)
160 print_num ("sram start", (ulong)bd->bi_sramstart);
161 print_num ("sram size", (ulong)bd->bi_sramsize);
164 #if defined(CONFIG_CMD_NET)
166 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
169 printf("baudrate = %ld bps\n", bd->bi_baudrate);
174 #elif defined(CONFIG_MICROBLAZE)
176 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
184 #if defined(CONFIG_SYS_SRAM_BASE)
185 print_num("sram start ", (ulong)bd->bi_sramstart);
186 print_num("sram size ", (ulong)bd->bi_sramsize);
188 #if defined(CONFIG_CMD_NET)
190 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
192 printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate);
196 #elif defined(CONFIG_SPARC)
198 int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
203 print_num("bd address ", (ulong) bd);
205 print_num("memstart ", bd->bi_memstart);
206 print_lnum("memsize ", bd->bi_memsize);
207 print_num("flashstart ", bd->bi_flashstart);
208 print_num("CONFIG_SYS_MONITOR_BASE ", CONFIG_SYS_MONITOR_BASE);
209 print_num("CONFIG_ENV_ADDR ", CONFIG_ENV_ADDR);
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,
219 GENERATED_GBL_DATA_SIZE);
221 #if defined(CONFIG_CMD_NET)
223 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
225 printf("baudrate = %6ld bps\n", bd->bi_baudrate);
229 #elif defined(CONFIG_M68K)
231 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
240 #if defined(CONFIG_SYS_INIT_RAM_ADDR)
241 print_num("sramstart", (ulong)bd->bi_sramstart);
242 print_num("sramsize", (ulong)bd->bi_sramsize);
244 #if defined(CONFIG_SYS_MBAR)
245 print_num("mbar", bd->bi_mbar_base);
247 print_mhz("cpufreq", bd->bi_intfreq);
248 print_mhz("busfreq", bd->bi_busfreq);
250 print_mhz("pcifreq", bd->bi_pcifreq);
252 #ifdef CONFIG_EXTRA_CLOCK
253 print_mhz("flbfreq", bd->bi_flbfreq);
254 print_mhz("inpfreq", bd->bi_inpfreq);
255 print_mhz("vcofreq", bd->bi_vcofreq);
257 #if defined(CONFIG_CMD_NET)
259 #if defined(CONFIG_HAS_ETH1)
262 #if defined(CONFIG_HAS_ETH2)
265 #if defined(CONFIG_HAS_ETH3)
269 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
271 printf("baudrate = %ld bps\n", bd->bi_baudrate);
276 #elif defined(CONFIG_BLACKFIN)
278 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
285 print_mhz("VCO", bd->bi_vco);
286 print_mhz("CCLK", bd->bi_cclk);
287 print_mhz("SCLK", bd->bi_sclk);
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);
297 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
298 printf("baudrate = %d bps\n", bd->bi_baudrate);
303 #elif defined(CONFIG_MIPS)
305 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
317 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
318 printf("baudrate = %d bps\n", bd->bi_baudrate);
323 #elif defined(CONFIG_AVR32)
325 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
337 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
338 printf("baudrate = %lu bps\n", bd->bi_baudrate);
343 #elif defined(CONFIG_ARM)
345 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
350 print_num("arch_number", bd->bi_arch_number);
351 print_num("boot_params", (ulong)bd->bi_boot_params);
353 for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
354 print_num("DRAM bank", i);
355 print_num("-> start", bd->bi_dram[i].start);
356 print_num("-> size", bd->bi_dram[i].size);
359 #if defined(CONFIG_CMD_NET)
361 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
363 printf("baudrate = %d bps\n", bd->bi_baudrate);
364 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
365 print_num("TLB addr", gd->tlb_addr);
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);
375 #elif defined(CONFIG_SH)
377 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
386 #if defined(CONFIG_CMD_NET)
388 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
390 printf("baudrate = %ld bps\n", (ulong)bd->bi_baudrate);
394 #elif defined(CONFIG_X86)
396 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
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);
410 print_mhz("cpufreq", bd->bi_intfreq);
411 print_mhz("busfreq", bd->bi_busfreq);
413 for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
414 print_num("DRAM bank", i);
415 print_num("-> start", bd->bi_dram[i].start);
416 print_num("-> size", bd->bi_dram[i].size);
419 #if defined(CONFIG_CMD_NET)
421 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
422 print_mhz("ethspeed", bd->bi_ethspeed);
424 printf("baudrate = %d bps\n", bd->bi_baudrate);
429 #elif defined(CONFIG_SANDBOX)
431 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
436 print_num("boot_params", (ulong)bd->bi_boot_params);
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);
444 #if defined(CONFIG_CMD_NET)
446 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
448 print_num("FB base ", gd->fb_base);
452 #elif defined(CONFIG_NDS32)
454 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
459 print_num("arch_number", bd->bi_arch_number);
460 print_num("boot_params", (ulong)bd->bi_boot_params);
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);
468 #if defined(CONFIG_CMD_NET)
470 printf("ip_addr = %pI4\n", &bd->bi_ip_addr);
472 printf("baudrate = %d bps\n", bd->bi_baudrate);
478 #error "a case for this architecture does not exist!"
481 /* -------------------------------------------------------------------- */
484 bdinfo, 1, 1, do_bdinfo,
485 "print Board Info structure",