binman: doc: Remove incomplete sentence
[platform/kernel/u-boot.git] / cmd / version.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2000-2009
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5  */
6
7 #include <common.h>
8 #include <command.h>
9 #include <display_options.h>
10 #include <timestamp.h>
11 #include <version.h>
12 #include <version_string.h>
13 #include <linux/compiler.h>
14 #ifdef CONFIG_SYS_COREBOOT
15 #include <asm/cb_sysinfo.h>
16 #endif
17
18 #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
19         U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
20
21 const char version_string[] = U_BOOT_VERSION_STRING;
22 const unsigned short version_num = U_BOOT_VERSION_NUM;
23 const unsigned char version_num_patch = U_BOOT_VERSION_NUM_PATCH;
24
25 static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
26                       char *const argv[])
27 {
28         char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
29
30         printf(display_options_get_banner(false, buf, sizeof(buf)));
31 #ifdef CC_VERSION_STRING
32         puts(CC_VERSION_STRING "\n");
33 #endif
34 #ifdef LD_VERSION_STRING
35         puts(LD_VERSION_STRING "\n");
36 #endif
37 #ifdef CONFIG_SYS_COREBOOT
38         printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
39 #endif
40         return 0;
41 }
42
43 U_BOOT_CMD(
44         version,        1,              1,      do_version,
45         "print monitor, compiler and linker version",
46         ""
47 );