blob: 3686b87332498ebfa63c5b20100d28d2fb9b5157 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Peter Tysereabe6d92009-10-16 17:36:25 -05002/*
3 * Copyright 2000-2009
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
Peter Tysereabe6d92009-10-16 17:36:25 -05005 */
6
7#include <common.h>
8#include <command.h>
Alexander Hollerb472d6b2011-01-19 00:24:40 +01009#include <version.h>
Andreas Bießmann61d01952011-07-18 20:24:04 +020010#include <linux/compiler.h>
Stefan Reinauer52d9b902012-12-14 13:05:18 +000011#ifdef CONFIG_SYS_COREBOOT
12#include <asm/arch/sysinfo.h>
13#endif
Peter Tysereabe6d92009-10-16 17:36:25 -050014
Andreas Bießmann61d01952011-07-18 20:24:04 +020015const char __weak version_string[] = U_BOOT_VERSION_STRING;
Peter Tysereabe6d92009-10-16 17:36:25 -050016
Simon Glassed38aef2020-05-10 11:40:03 -060017static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
18 char *const argv[])
Peter Tysereabe6d92009-10-16 17:36:25 -050019{
Simon Glasse8583f92017-06-16 12:51:42 -060020 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
21
22 printf(display_options_get_banner(false, buf, sizeof(buf)));
Alexander Hollerb472d6b2011-01-19 00:24:40 +010023#ifdef CC_VERSION_STRING
24 puts(CC_VERSION_STRING "\n");
25#endif
26#ifdef LD_VERSION_STRING
27 puts(LD_VERSION_STRING "\n");
28#endif
Stefan Reinauer52d9b902012-12-14 13:05:18 +000029#ifdef CONFIG_SYS_COREBOOT
30 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
31#endif
Peter Tysereabe6d92009-10-16 17:36:25 -050032 return 0;
33}
34
35U_BOOT_CMD(
36 version, 1, 1, do_version,
Alexander Hollerb472d6b2011-01-19 00:24:40 +010037 "print monitor, compiler and linker version",
Peter Tysereabe6d92009-10-16 17:36:25 -050038 ""
39);