Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2000-2009 |
| 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
Alexander Holler | b472d6b | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 10 | #include <version.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 |
| 13 | #include <asm/arch/sysinfo.h> |
| 14 | #endif |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 15 | |
Andreas Bießmann | 61d0195 | 2011-07-18 20:24:04 +0200 | [diff] [blame] | 16 | const char __weak version_string[] = U_BOOT_VERSION_STRING; |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 17 | |
Kim Phillips | dc00a68 | 2012-10-29 13:34:31 +0000 | [diff] [blame] | 18 | static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 19 | { |
| 20 | printf("\n%s\n", version_string); |
Alexander Holler | b472d6b | 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 | 52d9b90 | 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 | eabe6d9 | 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 | b472d6b | 2011-01-19 00:24:40 +0100 | [diff] [blame] | 35 | "print monitor, compiler and linker version", |
Peter Tyser | eabe6d9 | 2009-10-16 17:36:25 -0500 | [diff] [blame] | 36 | "" |
| 37 | ); |