blob: d99a44f19fb378f99e96a656f8410a3e85b64265 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05002/*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05005 */
6
Tom Rinid678a592024-05-18 20:20:43 -06007#include <common.h>
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05008#include <command.h>
Simon Glass4e4bf942022-07-31 12:28:48 -06009#include <display_options.h>
Pali Rohárbdfb6d72021-08-02 15:18:31 +020010#include <version_string.h>
Andreas Bießmann09c2e902011-07-18 20:24:04 +020011#include <linux/compiler.h>
Stefan Reinauere56cdd72012-12-14 13:05:18 +000012#ifdef CONFIG_SYS_COREBOOT
Simon Glasse35b6492021-03-15 18:00:18 +130013#include <asm/cb_sysinfo.h>
Stefan Reinauere56cdd72012-12-14 13:05:18 +000014#endif
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050015
Simon Glass09140112020-05-10 11:40:03 -060016static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
17 char *const argv[])
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050018{
Simon Glass6c519f22017-06-16 12:51:42 -060019 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
20
21 printf(display_options_get_banner(false, buf, sizeof(buf)));
Alexander Holler89ffa8d2011-01-19 00:24:40 +010022#ifdef CC_VERSION_STRING
23 puts(CC_VERSION_STRING "\n");
24#endif
25#ifdef LD_VERSION_STRING
26 puts(LD_VERSION_STRING "\n");
27#endif
Stefan Reinauere56cdd72012-12-14 13:05:18 +000028#ifdef CONFIG_SYS_COREBOOT
29 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
30#endif
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050031 return 0;
32}
33
34U_BOOT_CMD(
35 version, 1, 1, do_version,
Alexander Holler89ffa8d2011-01-19 00:24:40 +010036 "print monitor, compiler and linker version",
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050037 ""
38);