]> git.ipfire.org Git - thirdparty/u-boot.git/blame - cmd/version.c
Merge tag 'dm-pull-9aug22-take2' of https://source.denx.de/u-boot/custodians/u-boot-dm
[thirdparty/u-boot.git] / cmd / version.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
6b8f5ad1
PT
2/*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6b8f5ad1
PT
5 */
6
7#include <common.h>
8#include <command.h>
4e4bf944 9#include <display_options.h>
121a165c 10#include <timestamp.h>
89ffa8db 11#include <version.h>
bdfb6d70 12#include <version_string.h>
09c2e90c 13#include <linux/compiler.h>
e56cdd77 14#ifdef CONFIG_SYS_COREBOOT
e35b6497 15#include <asm/cb_sysinfo.h>
e56cdd77 16#endif
6b8f5ad1 17
bc21ccba
T
18#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
19 U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
20
7629b52a 21const char version_string[] = U_BOOT_VERSION_STRING;
6b8f5ad1 22
09140113
SG
23static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
24 char *const argv[])
6b8f5ad1 25{
6c519f2d
SG
26 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
27
28 printf(display_options_get_banner(false, buf, sizeof(buf)));
89ffa8db
AH
29#ifdef CC_VERSION_STRING
30 puts(CC_VERSION_STRING "\n");
31#endif
32#ifdef LD_VERSION_STRING
33 puts(LD_VERSION_STRING "\n");
34#endif
e56cdd77
SR
35#ifdef CONFIG_SYS_COREBOOT
36 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
37#endif
6b8f5ad1
PT
38 return 0;
39}
40
41U_BOOT_CMD(
42 version, 1, 1, do_version,
89ffa8db 43 "print monitor, compiler and linker version",
6b8f5ad1
PT
44 ""
45);