Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2000-2009 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <command.h> |
Alexander Holler | b472d6b | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 9 | #include <version.h> |
Pali Rohár | ba87ddf | 2021-08-02 15:18:31 +0200 | [diff] [blame] | 10 | #include <version_string.h> |
Andreas Bießmann | 61d0195 | 2011-07-18 20:24:04 +0200 | [diff] [blame] | 11 | #include <linux/compiler.h> |
Stefan Reinauer | 52d9b90 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 12 | #ifdef CONFIG_SYS_COREBOOT |
Simon Glass | 9a01fd9 | 2021-03-15 18:00:18 +1300 | [diff] [blame] | 13 | #include <asm/cb_sysinfo.h> |
Stefan Reinauer | 52d9b90 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 14 | #endif |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 15 | |
Pali Rohár | d81f2c4 | 2021-08-02 15:18:37 +0200 | [diff] [blame^] | 16 | #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \ |
| 17 | U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING |
| 18 | |
Pali Rohár | 5a06a52 | 2021-08-02 15:18:35 +0200 | [diff] [blame] | 19 | const char version_string[] = U_BOOT_VERSION_STRING; |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 20 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 21 | static int do_version(struct cmd_tbl *cmdtp, int flag, int argc, |
| 22 | char *const argv[]) |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 23 | { |
Simon Glass | e8583f9 | 2017-06-16 12:51:42 -0600 | [diff] [blame] | 24 | char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; |
| 25 | |
| 26 | printf(display_options_get_banner(false, buf, sizeof(buf))); |
Alexander Holler | b472d6b | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 27 | #ifdef CC_VERSION_STRING |
| 28 | puts(CC_VERSION_STRING "\n"); |
| 29 | #endif |
| 30 | #ifdef LD_VERSION_STRING |
| 31 | puts(LD_VERSION_STRING "\n"); |
| 32 | #endif |
Stefan Reinauer | 52d9b90 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 33 | #ifdef CONFIG_SYS_COREBOOT |
| 34 | printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build); |
| 35 | #endif |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | U_BOOT_CMD( |
| 40 | version, 1, 1, do_version, |
Alexander Holler | b472d6b | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 41 | "print monitor, compiler and linker version", |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 42 | "" |
| 43 | ); |