blob: 53db1a0b6bd187fb1a52bc586f26914ea8fceed5 [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
Peter Tysereabe6d92009-10-16 17:36:25 -05007#include <command.h>
Simon Glass1ab16922022-07-31 12:28:48 -06008#include <display_options.h>
Pali Rohárba87ddf2021-08-02 15:18:31 +02009#include <version_string.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
Simon Glass9a01fd92021-03-15 18:00:18 +130012#include <asm/cb_sysinfo.h>
Stefan Reinauer52d9b902012-12-14 13:05:18 +000013#endif
Peter Tysereabe6d92009-10-16 17:36:25 -050014
Simon Glassed38aef2020-05-10 11:40:03 -060015static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
16 char *const argv[])
Peter Tysereabe6d92009-10-16 17:36:25 -050017{
Simon Glasse8583f92017-06-16 12:51:42 -060018 char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
19
20 printf(display_options_get_banner(false, buf, sizeof(buf)));
Alexander Hollerb472d6b2011-01-19 00:24:40 +010021#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
Stefan Reinauer52d9b902012-12-14 13:05:18 +000027#ifdef CONFIG_SYS_COREBOOT
28 printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
29#endif
Peter Tysereabe6d92009-10-16 17:36:25 -050030 return 0;
31}
32
33U_BOOT_CMD(
34 version, 1, 1, do_version,
Alexander Hollerb472d6b2011-01-19 00:24:40 +010035 "print monitor, compiler and linker version",
Peter Tysereabe6d92009-10-16 17:36:25 -050036 ""
37);