version.c 802 Bytes
Newer Older
1 2 3 4
/*
 * Copyright 2000-2009
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
5
 * SPDX-License-Identifier:	GPL-2.0+
6 7 8 9
 */

#include <common.h>
#include <command.h>
10
#include <version.h>
Andreas Bießmann's avatar
Andreas Bießmann committed
11
#include <linux/compiler.h>
12 13 14
#ifdef CONFIG_SYS_COREBOOT
#include <asm/arch/sysinfo.h>
#endif
15

Andreas Bießmann's avatar
Andreas Bießmann committed
16
const char __weak version_string[] = U_BOOT_VERSION_STRING;
17

18
static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
19 20
{
	printf("\n%s\n", version_string);
21 22 23 24 25 26
#ifdef CC_VERSION_STRING
	puts(CC_VERSION_STRING "\n");
#endif
#ifdef LD_VERSION_STRING
	puts(LD_VERSION_STRING "\n");
#endif
27 28 29
#ifdef CONFIG_SYS_COREBOOT
	printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
#endif
30 31 32 33 34
	return 0;
}

U_BOOT_CMD(
	version,	1,		1,	do_version,
35
	"print monitor, compiler and linker version",
36 37
	""
);