Merge tag 'tpm-master-28012025' of https://source.denx.de/u-boot/custodians/u-boot-tpm
[u-boot.git] / cmd / version.c
blob53db1a0b6bd187fb1a52bc586f26914ea8fceed5
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 */
7 #include <command.h>
8 #include <display_options.h>
9 #include <version_string.h>
10 #include <linux/compiler.h>
11 #ifdef CONFIG_SYS_COREBOOT
12 #include <asm/cb_sysinfo.h>
13 #endif
15 static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
16 char *const argv[])
18 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
20 printf(display_options_get_banner(false, buf, sizeof(buf)));
21 #ifdef CC_VERSION_STRING
22 puts(CC_VERSION_STRING "\n");
23 #endif
24 #ifdef LD_VERSION_STRING
25 puts(LD_VERSION_STRING "\n");
26 #endif
27 #ifdef CONFIG_SYS_COREBOOT
28 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
29 #endif
30 return 0;
33 U_BOOT_CMD(
34 version, 1, 1, do_version,
35 "print monitor, compiler and linker version",