2018-05-07 06:58:06 +09:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2009-10-17 07:36:25 +09:00
|
|
|
/*
|
|
|
|
* Copyright 2000-2009
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
2011-01-19 08:24:40 +09:00
|
|
|
#include <version.h>
|
2011-07-19 03:24:04 +09:00
|
|
|
#include <linux/compiler.h>
|
2012-12-14 22:05:18 +09:00
|
|
|
#ifdef CONFIG_SYS_COREBOOT
|
|
|
|
#include <asm/arch/sysinfo.h>
|
|
|
|
#endif
|
2009-10-17 07:36:25 +09:00
|
|
|
|
2011-07-19 03:24:04 +09:00
|
|
|
const char __weak version_string[] = U_BOOT_VERSION_STRING;
|
2009-10-17 07:36:25 +09:00
|
|
|
|
2020-05-11 02:40:03 +09:00
|
|
|
static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
|
|
|
|
char *const argv[])
|
2009-10-17 07:36:25 +09:00
|
|
|
{
|
2017-06-17 03:51:42 +09:00
|
|
|
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
|
|
|
|
|
|
|
|
printf(display_options_get_banner(false, buf, sizeof(buf)));
|
2011-01-19 08:24:40 +09:00
|
|
|
#ifdef CC_VERSION_STRING
|
|
|
|
puts(CC_VERSION_STRING "\n");
|
|
|
|
#endif
|
|
|
|
#ifdef LD_VERSION_STRING
|
|
|
|
puts(LD_VERSION_STRING "\n");
|
|
|
|
#endif
|
2012-12-14 22:05:18 +09:00
|
|
|
#ifdef CONFIG_SYS_COREBOOT
|
|
|
|
printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
|
|
|
|
#endif
|
2009-10-17 07:36:25 +09:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
U_BOOT_CMD(
|
|
|
|
version, 1, 1, do_version,
|
2011-01-19 08:24:40 +09:00
|
|
|
"print monitor, compiler and linker version",
|
2009-10-17 07:36:25 +09:00
|
|
|
""
|
|
|
|
);
|