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 | |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 7 | #include <command.h> |
Simon Glass | 4e4bf94 | 2022-07-31 12:28:48 -0600 | [diff] [blame] | 8 | #include <display_options.h> |
Pali Rohár | bdfb6d7 | 2021-08-02 15:18:31 +0200 | [diff] [blame] | 9 | #include <version_string.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 |
Simon Glass | e35b649 | 2021-03-15 18:00:18 +1300 | [diff] [blame] | 12 | #include <asm/cb_sysinfo.h> |
Stefan Reinauer | e56cdd7 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 13 | #endif |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 14 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 15 | static int do_version(struct cmd_tbl *cmdtp, int flag, int argc, |
| 16 | char *const argv[]) |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 17 | { |
Simon Glass | 6c519f2 | 2017-06-16 12:51:42 -0600 | [diff] [blame] | 18 | char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; |
| 19 | |
| 20 | printf(display_options_get_banner(false, buf, sizeof(buf))); |
Alexander Holler | 89ffa8d | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 21 | #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 Reinauer | e56cdd7 | 2012-12-14 13:05:18 +0000 | [diff] [blame] | 27 | #ifdef CONFIG_SYS_COREBOOT |
| 28 | printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build); |
| 29 | #endif |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 30 | return 0; |
| 31 | } |
| 32 | |
| 33 | U_BOOT_CMD( |
| 34 | version, 1, 1, do_version, |
Alexander Holler | 89ffa8d | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 35 | "print monitor, compiler and linker version", |
Peter Tyser | 6b8f5ad | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 36 | "" |
| 37 | ); |