]> git.ipfire.org Git - thirdparty/u-boot.git/blob - cmd/version.c
965ac2e2144d25558d8b2705f33d11e68cb5f0fb
[thirdparty/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 <version.h>
10 #include <version_string.h>
11 #include <linux/compiler.h>
12 #ifdef CONFIG_SYS_COREBOOT
13 #include <asm/cb_sysinfo.h>
14 #endif
15
16 const char __weak version_string[] = U_BOOT_VERSION_STRING;
17
18 static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
19 char *const argv[])
20 {
21 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
22
23 printf(display_options_get_banner(false, buf, sizeof(buf)));
24 #ifdef CC_VERSION_STRING
25 puts(CC_VERSION_STRING "\n");
26 #endif
27 #ifdef LD_VERSION_STRING
28 puts(LD_VERSION_STRING "\n");
29 #endif
30 #ifdef CONFIG_SYS_COREBOOT
31 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
32 #endif
33 return 0;
34 }
35
36 U_BOOT_CMD(
37 version, 1, 1, do_version,
38 "print monitor, compiler and linker version",
39 ""
40 );