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