bdinfo.c 14.9 KB
Newer Older
wdenk's avatar
wdenk committed
1 2 3 4
/*
 * (C) Copyright 2003
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
5
 * SPDX-License-Identifier:	GPL-2.0+
wdenk's avatar
wdenk committed
6 7 8 9 10 11 12
 */

/*
 * Boot support
 */
#include <common.h>
#include <command.h>
13
#include <linux/compiler.h>
wdenk's avatar
wdenk committed
14

15
DECLARE_GLOBAL_DATA_PTR;
wdenk's avatar
wdenk committed
16

17 18 19 20 21
__maybe_unused
static void print_num(const char *name, ulong value)
{
	printf("%-12s= 0x%08lX\n", name, value);
}
wdenk's avatar
wdenk committed
22

23
__maybe_unused
24 25 26 27 28 29 30 31 32 33 34 35
static void print_eth(int idx)
{
	char name[10], *val;
	if (idx)
		sprintf(name, "eth%iaddr", idx);
	else
		strcpy(name, "ethaddr");
	val = getenv(name);
	if (!val)
		val = "(not set)";
	printf("%-12s= %s\n", name, val);
}
36

37
#ifndef CONFIG_DM_ETH
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
__maybe_unused
static void print_eths(void)
{
	struct eth_device *dev;
	int i = 0;

	do {
		dev = eth_get_dev_by_index(i);
		if (dev) {
			printf("eth%dname    = %s\n", i, dev->name);
			print_eth(i);
			i++;
		}
	} while (dev);

	printf("current eth = %s\n", eth_get_name());
	printf("ip_addr     = %s\n", getenv("ipaddr"));
}
56
#endif
57

58
__maybe_unused
59
static void print_lnum(const char *name, unsigned long long value)
60 61 62 63 64 65 66 67 68 69 70
{
	printf("%-12s= 0x%.8llX\n", name, value);
}

__maybe_unused
static void print_mhz(const char *name, unsigned long hz)
{
	char buf[32];

	printf("%-12s= %6s MHz\n", name, strmhz(buf, hz));
}
wdenk's avatar
wdenk committed
71

72
#if defined(CONFIG_PPC)
York Sun's avatar
York Sun committed
73 74 75 76
void __weak board_detail(void)
{
	/* Please define boot_detail() for your platform */
}
wdenk's avatar
wdenk committed
77

78
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
wdenk's avatar
wdenk committed
79 80 81 82
{
	bd_t *bd = gd->bd;

#ifdef DEBUG
83 84 85 86 87 88 89 90 91 92
	print_num("bd address",		(ulong)bd);
#endif
	print_num("memstart",		bd->bi_memstart);
	print_lnum("memsize",		bd->bi_memsize);
	print_num("flashstart",		bd->bi_flashstart);
	print_num("flashsize",		bd->bi_flashsize);
	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) || \
93
	defined(CONFIG_MPC8260) || defined(CONFIG_E500)
94 95 96
	print_num("immr_base",		bd->bi_immr_base);
#endif
	print_num("bootflags",		bd->bi_bootflags);
97
#if	defined(CONFIG_405EP) || \
98 99 100 101 102
	defined(CONFIG_405GP) || \
	defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
	defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
	defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
	defined(CONFIG_XILINX_405)
103 104
	print_mhz("procfreq",		bd->bi_procfreq);
	print_mhz("plb_busfreq",	bd->bi_plb_busfreq);
105 106 107 108
#if	defined(CONFIG_405EP) || defined(CONFIG_405GP) || \
	defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
	defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
	defined(CONFIG_440SPE) || defined(CONFIG_XILINX_405)
109
	print_mhz("pci_busfreq",	bd->bi_pci_busfreq);
wdenk's avatar
wdenk committed
110
#endif
111
#else	/* ! CONFIG_405GP, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
112
#if defined(CONFIG_CPM2)
113 114 115
	print_mhz("vco",		bd->bi_vco);
	print_mhz("sccfreq",		bd->bi_sccfreq);
	print_mhz("brgfreq",		bd->bi_brgfreq);
wdenk's avatar
wdenk committed
116
#endif
117
	print_mhz("intfreq",		bd->bi_intfreq);
118
#if defined(CONFIG_CPM2)
119
	print_mhz("cpmfreq",		bd->bi_cpmfreq);
wdenk's avatar
wdenk committed
120
#endif
121
	print_mhz("busfreq",		bd->bi_busfreq);
122
#endif /* CONFIG_405GP, CONFIG_405EP, CONFIG_XILINX_405, CONFIG_440EP CONFIG_440GR */
123

124 125 126 127 128 129 130 131
#ifdef CONFIG_ENABLE_36BIT_PHYS
#ifdef CONFIG_PHYS_64BIT
	puts("addressing  = 36-bit\n");
#else
	puts("addressing  = 32-bit\n");
#endif
#endif

132
	print_eth(0);
wdenk's avatar
wdenk committed
133
#if defined(CONFIG_HAS_ETH1)
134
	print_eth(1);
135
#endif
wdenk's avatar
wdenk committed
136
#if defined(CONFIG_HAS_ETH2)
137
	print_eth(2);
138
#endif
wdenk's avatar
wdenk committed
139
#if defined(CONFIG_HAS_ETH3)
140
	print_eth(3);
141
#endif
142
#if defined(CONFIG_HAS_ETH4)
143
	print_eth(4);
144 145
#endif
#if defined(CONFIG_HAS_ETH5)
146
	print_eth(5);
147 148
#endif

Mike Frysinger's avatar
Mike Frysinger committed
149
	printf("IP addr     = %s\n", getenv("ipaddr"));
150
	printf("baudrate    = %6u bps\n", gd->baudrate);
151
	print_num("relocaddr", gd->relocaddr);
York Sun's avatar
York Sun committed
152
	board_detail();
wdenk's avatar
wdenk committed
153 154 155
	return 0;
}

156
#elif defined(CONFIG_NIOS2)
157

158
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
159
{
160
	int i;
161 162
	bd_t *bd = gd->bd;

163 164 165 166 167 168
	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
		print_num("DRAM bank",	i);
		print_num("-> start",	bd->bi_dram[i].start);
		print_num("-> size",	bd->bi_dram[i].size);
	}

169 170 171
	print_num("flash start",	(ulong)bd->bi_flashstart);
	print_num("flash size",		(ulong)bd->bi_flashsize);
	print_num("flash offset",	(ulong)bd->bi_flashoffset);
172

173
#if defined(CONFIG_SYS_SRAM_BASE)
174 175 176 177
	print_num ("sram start",	(ulong)bd->bi_sramstart);
	print_num ("sram size",		(ulong)bd->bi_sramsize);
#endif

178
#if defined(CONFIG_CMD_NET)
179
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
180
	printf("ip_addr     = %s\n", getenv("ipaddr"));
181 182
#endif

183
	printf("baudrate    = %u bps\n", gd->baudrate);
184 185 186

	return 0;
}
187 188

#elif defined(CONFIG_MICROBLAZE)
Michal Simek's avatar
Michal Simek committed
189

190
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Michal Simek's avatar
Michal Simek committed
191 192
{
	bd_t *bd = gd->bd;
193 194 195 196 197 198 199 200
	int i;

	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
		print_num("DRAM bank",	i);
		print_num("-> start",	bd->bi_dram[i].start);
		print_num("-> size",	bd->bi_dram[i].size);
	}

201 202 203
	print_num("flash start    ",	(ulong)bd->bi_flashstart);
	print_num("flash size     ",	(ulong)bd->bi_flashsize);
	print_num("flash offset   ",	(ulong)bd->bi_flashoffset);
204
#if defined(CONFIG_SYS_SRAM_BASE)
205 206
	print_num("sram start     ",	(ulong)bd->bi_sramstart);
	print_num("sram size      ",	(ulong)bd->bi_sramsize);
Michal Simek's avatar
Michal Simek committed
207
#endif
208
#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
209
	print_eths();
Michal Simek's avatar
Michal Simek committed
210
#endif
211
	printf("baudrate    = %u bps\n", gd->baudrate);
212 213
	print_num("relocaddr", gd->relocaddr);
	print_num("reloc off", gd->reloc_off);
214 215 216
	print_num("fdt_blob", (ulong)gd->fdt_blob);
	print_num("new_fdt", (ulong)gd->new_fdt);
	print_num("fdt_size", (ulong)gd->fdt_size);
217

Michal Simek's avatar
Michal Simek committed
218 219
	return 0;
}
220

221 222
#elif defined(CONFIG_SPARC)

223
int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
224 225 226 227 228 229 230
{
	bd_t *bd = gd->bd;

#ifdef DEBUG
	print_num("bd address             ", (ulong) bd);
#endif
	print_num("memstart               ", bd->bi_memstart);
231
	print_lnum("memsize                ", bd->bi_memsize);
232
	print_num("flashstart             ", bd->bi_flashstart);
233
	print_num("CONFIG_SYS_MONITOR_BASE       ", CONFIG_SYS_MONITOR_BASE);
234
	print_num("CONFIG_ENV_ADDR           ", CONFIG_ENV_ADDR);
235
	printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%x (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE,
236
	       CONFIG_SYS_MONITOR_LEN);
237
	printf("CONFIG_SYS_MALLOC_BASE        = 0x%x (%d)\n", CONFIG_SYS_MALLOC_BASE,
238
	       CONFIG_SYS_MALLOC_LEN);
239
	printf("CONFIG_SYS_INIT_SP_OFFSET     = 0x%x (%d)\n", CONFIG_SYS_INIT_SP_OFFSET,
240
	       CONFIG_SYS_STACK_SIZE);
241
	printf("CONFIG_SYS_PROM_OFFSET        = 0x%x (%d)\n", CONFIG_SYS_PROM_OFFSET,
242
	       CONFIG_SYS_PROM_SIZE);
243
	printf("CONFIG_SYS_GBL_DATA_OFFSET    = 0x%x (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET,
244
	       GENERATED_GBL_DATA_SIZE);
245 246

#if defined(CONFIG_CMD_NET)
247
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
248
	printf("ip_addr     = %s\n", getenv("ipaddr"));
249
#endif
250
	printf("baudrate               = %6u bps\n", gd->baudrate);
251 252 253
	return 0;
}

254 255
#elif defined(CONFIG_M68K)

256
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
257 258
{
	bd_t *bd = gd->bd;
259

260 261 262 263 264
	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);
265
#if defined(CONFIG_SYS_INIT_RAM_ADDR)
266 267
	print_num("sramstart",		(ulong)bd->bi_sramstart);
	print_num("sramsize",		(ulong)bd->bi_sramsize);
268
#endif
269
#if defined(CONFIG_SYS_MBAR)
270
	print_num("mbar",		bd->bi_mbar_base);
271
#endif
272 273
	print_mhz("cpufreq",		bd->bi_intfreq);
	print_mhz("busfreq",		bd->bi_busfreq);
274
#ifdef CONFIG_PCI
275
	print_mhz("pcifreq",		bd->bi_pcifreq);
276 277
#endif
#ifdef CONFIG_EXTRA_CLOCK
278 279 280
	print_mhz("flbfreq",		bd->bi_flbfreq);
	print_mhz("inpfreq",		bd->bi_inpfreq);
	print_mhz("vcofreq",		bd->bi_vcofreq);
281
#endif
282
#if defined(CONFIG_CMD_NET)
283
	print_eth(0);
284
#if defined(CONFIG_HAS_ETH1)
285
	print_eth(1);
286 287
#endif
#if defined(CONFIG_HAS_ETH2)
288
	print_eth(2);
289 290
#endif
#if defined(CONFIG_HAS_ETH3)
291
	print_eth(3);
292 293
#endif

Mike Frysinger's avatar
Mike Frysinger committed
294
	printf("ip_addr     = %s\n", getenv("ipaddr"));
295
#endif
296
	printf("baudrate    = %u bps\n", gd->baudrate);
297 298 299 300

	return 0;
}

301
#elif defined(CONFIG_BLACKFIN)
302

303
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
304 305 306 307 308 309
{
	bd_t *bd = gd->bd;

	printf("U-Boot      = %s\n", bd->bi_r_version);
	printf("CPU         = %s\n", bd->bi_cpu);
	printf("Board       = %s\n", bd->bi_board_name);
310 311 312
	print_mhz("VCO",	bd->bi_vco);
	print_mhz("CCLK",	bd->bi_cclk);
	print_mhz("SCLK",	bd->bi_sclk);
313

314 315 316 317 318 319
	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);
320

321
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
322
	printf("ip_addr     = %s\n", getenv("ipaddr"));
323
	printf("baudrate    = %u bps\n", gd->baudrate);
324 325 326 327

	return 0;
}

328
#elif defined(CONFIG_MIPS)
wdenk's avatar
wdenk committed
329

330
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
wdenk's avatar
wdenk committed
331 332 333
{
	bd_t *bd = gd->bd;

334 335 336 337 338 339
	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);
wdenk's avatar
wdenk committed
340

341
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
342
	printf("ip_addr     = %s\n", getenv("ipaddr"));
343
	printf("baudrate    = %u bps\n", gd->baudrate);
344 345
	print_num("relocaddr", gd->relocaddr);
	print_num("reloc off", gd->reloc_off);
wdenk's avatar
wdenk committed
346 347 348 349

	return 0;
}

350 351
#elif defined(CONFIG_AVR32)

352
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
353 354 355
{
	bd_t *bd = gd->bd;

356
	print_num("boot_params",	(ulong)bd->bi_boot_params);
357 358
	print_num("memstart",		(ulong)bd->bi_dram[0].start);
	print_lnum("memsize",		(u64)bd->bi_dram[0].size);
359 360 361
	print_num("flashstart",		(ulong)bd->bi_flashstart);
	print_num("flashsize",		(ulong)bd->bi_flashsize);
	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
362 363

	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
364
	printf("ip_addr     = %s\n", getenv("ipaddr"));
365
	printf("baudrate    = %u bps\n", gd->baudrate);
366 367 368 369 370

	return 0;
}

#elif defined(CONFIG_ARM)
wdenk's avatar
wdenk committed
371

372 373
static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
			char * const argv[])
wdenk's avatar
wdenk committed
374 375 376 377
{
	int i;
	bd_t *bd = gd->bd;

378 379
	print_num("arch_number",	bd->bi_arch_number);
	print_num("boot_params",	(ulong)bd->bi_boot_params);
wdenk's avatar
wdenk committed
380

381
	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
wdenk's avatar
wdenk committed
382 383 384 385 386
		print_num("DRAM bank",	i);
		print_num("-> start",	bd->bi_dram[i].start);
		print_num("-> size",	bd->bi_dram[i].size);
	}

York Sun's avatar
York Sun committed
387 388 389 390 391 392
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
	if (gd->secure_ram & MEM_RESERVE_SECURE_SECURED) {
		print_num("Secure ram",
			  gd->secure_ram & MEM_RESERVE_SECURE_ADDR_MASK);
	}
#endif
393
#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
394
	print_eths();
395
#endif
396
	printf("baudrate    = %u bps\n", gd->baudrate);
397
#if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
398
	print_num("TLB addr", gd->arch.tlb_addr);
Heiko Schocher's avatar
Heiko Schocher committed
399
#endif
400 401 402 403
	print_num("relocaddr", gd->relocaddr);
	print_num("reloc off", gd->reloc_off);
	print_num("irq_sp", gd->irq_sp);	/* irq stack pointer */
	print_num("sp start ", gd->start_addr_sp);
404
#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
405
	print_num("FB base  ", gd->fb_base);
406
#endif
407 408 409 410 411 412 413 414
	/*
	 * TODO: Currently only support for davinci SOC's is added.
	 * Remove this check once all the board implement this.
	 */
#ifdef CONFIG_CLOCKS
	printf("ARM frequency = %ld MHz\n", gd->bd->bi_arm_freq);
	printf("DSP frequency = %ld MHz\n", gd->bd->bi_dsp_freq);
	printf("DDR frequency = %ld MHz\n", gd->bd->bi_ddr_freq);
415 416 417
#endif
#ifdef CONFIG_BOARD_TYPES
	printf("Board Type  = %ld\n", gd->board_type);
418
#endif
wdenk's avatar
wdenk committed
419 420 421
	return 0;
}

422 423
#elif defined(CONFIG_SH)

424
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
425 426
{
	bd_t *bd = gd->bd;
427 428 429 430 431
	print_num("mem start      ",	(ulong)bd->bi_memstart);
	print_lnum("mem size       ",	(u64)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);
432 433 434

#if defined(CONFIG_CMD_NET)
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
435
	printf("ip_addr     = %s\n", getenv("ipaddr"));
436
#endif
437
	printf("baudrate    = %u bps\n", gd->baudrate);
438 439 440
	return 0;
}

Graeme Russ's avatar
Graeme Russ committed
441 442
#elif defined(CONFIG_X86)

443
int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Graeme Russ's avatar
Graeme Russ committed
444 445 446 447
{
	int i;
	bd_t *bd = gd->bd;

448 449 450 451 452 453 454 455 456
	print_num("boot_params",	(ulong)bd->bi_boot_params);
	print_num("bi_memstart",	bd->bi_memstart);
	print_num("bi_memsize",		bd->bi_memsize);
	print_num("bi_flashstart",	bd->bi_flashstart);
	print_num("bi_flashsize",	bd->bi_flashsize);
	print_num("bi_flashoffset",	bd->bi_flashoffset);
	print_num("bi_sramstart",	bd->bi_sramstart);
	print_num("bi_sramsize",	bd->bi_sramsize);
	print_num("bi_bootflags",	bd->bi_bootflags);
457 458
	print_mhz("cpufreq",		bd->bi_intfreq);
	print_mhz("busfreq",		bd->bi_busfreq);
459 460

	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
Graeme Russ's avatar
Graeme Russ committed
461 462 463 464 465 466 467
		print_num("DRAM bank",	i);
		print_num("-> start",	bd->bi_dram[i].start);
		print_num("-> size",	bd->bi_dram[i].size);
	}

#if defined(CONFIG_CMD_NET)
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
468
	printf("ip_addr     = %s\n", getenv("ipaddr"));
469
	print_mhz("ethspeed",	    bd->bi_ethspeed);
Graeme Russ's avatar
Graeme Russ committed
470
#endif
471
	printf("baudrate    = %u bps\n", gd->baudrate);
Graeme Russ's avatar
Graeme Russ committed
472 473 474 475

	return 0;
}

476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
#elif defined(CONFIG_SANDBOX)

int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int i;
	bd_t *bd = gd->bd;

	print_num("boot_params", (ulong)bd->bi_boot_params);

	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
		print_num("DRAM bank", i);
		print_num("-> start", bd->bi_dram[i].start);
		print_num("-> size", bd->bi_dram[i].size);
	}

#if defined(CONFIG_CMD_NET)
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
493
	printf("ip_addr     = %s\n", getenv("ipaddr"));
494
#endif
495
#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
496
	print_num("FB base  ", gd->fb_base);
497
#endif
498 499 500
	return 0;
}

501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
#elif defined(CONFIG_NDS32)

int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int i;
	bd_t *bd = gd->bd;

	print_num("arch_number",	bd->bi_arch_number);
	print_num("boot_params",	(ulong)bd->bi_boot_params);

	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
		print_num("DRAM bank",	i);
		print_num("-> start",	bd->bi_dram[i].start);
		print_num("-> size",	bd->bi_dram[i].size);
	}

#if defined(CONFIG_CMD_NET)
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
519
	printf("ip_addr     = %s\n", getenv("ipaddr"));
520
#endif
521
	printf("baudrate    = %u bps\n", gd->baudrate);
522 523 524 525

	return 0;
}

526 527 528 529 530 531 532 533 534 535 536 537 538 539
#elif defined(CONFIG_OPENRISC)

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);
	print_lnum("mem size",		(u64)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(CONFIG_CMD_NET)
	print_eth(0);
Mike Frysinger's avatar
Mike Frysinger committed
540
	printf("ip_addr     = %s\n", getenv("ipaddr"));
541 542
#endif

543
	printf("baudrate    = %u bps\n", gd->baudrate);
544 545 546 547

	return 0;
}

548
#elif defined(CONFIG_ARC)
549 550 551 552 553 554 555 556 557 558 559 560

int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	bd_t *bd = gd->bd;

	print_num("mem start",		bd->bi_memstart);
	print_lnum("mem size",		bd->bi_memsize);

#if defined(CONFIG_CMD_NET)
	print_eth(0);
	printf("ip_addr     = %s\n", getenv("ipaddr"));
#endif
561
	printf("baudrate    = %d bps\n", gd->baudrate);
562 563 564 565

	return 0;
}

566 567 568
#else
 #error "a case for this architecture does not exist!"
#endif
wdenk's avatar
wdenk committed
569 570 571

/* -------------------------------------------------------------------- */

572 573
U_BOOT_CMD(
	bdinfo,	1,	1,	do_bdinfo,
Peter Tyser's avatar
Peter Tyser committed
574
	"print Board Info structure",
Wolfgang Denk's avatar
Wolfgang Denk committed
575
	""
wdenk's avatar
wdenk committed
576
);