Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Peter Tyser | 6b8f5ad | 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 | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <command.h> |
Alexander Holler | 89ffa8d | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 9 | #include <version.h> |
Andreas Bießmann | 09c2e90 | 2011-07-18 20:24:04 +0200 | [diff] [blame] | 10 | #include <linux/compiler.h> |
Stefan Reinauer | e56cdd7 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 11 | #ifdef CONFIG_SYS_COREBOOT |
| 12 | #include <asm/arch/sysinfo.h> |
| 13 | #endif |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 14 | |
Andreas Bießmann | 09c2e90 | 2011-07-18 20:24:04 +0200 | [diff] [blame] | 15 | const char __weak version_string[] = U_BOOT_VERSION_STRING; |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 16 | |
Kim Phillips | 088f1b1 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 17 | static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 18 | { |
Simon Glass | 6c519f2 | 2017-06-16 12:51:42 -0600 | [diff] [blame] | 19 | char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; |
| 20 | |
| 21 | printf(display_options_get_banner(false, buf, sizeof(buf))); |
Alexander Holler | 89ffa8d | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 22 | #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 Reinauer | e56cdd7 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 28 | #ifdef CONFIG_SYS_COREBOOT |
| 29 | printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build); |
| 30 | #endif |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | U_BOOT_CMD( |
| 35 | version, 1, 1, do_version, |
Alexander Holler | 89ffa8d | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 36 | "print monitor, compiler and linker version", |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 37 | "" |
| 38 | ); |