blob: 1be0667f0938982158b34aedc3fb6c22c444db91 [file] [log] [blame]
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05001/*
2 * Copyright 2000-2009
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Peter Tyser6b8f5ad2009-10-16 17:36:25 -05006 */
7
8#include <common.h>
9#include <command.h>
Alexander Holler89ffa8d2011-01-19 00:24:40 +010010#include <version.h>
Andreas Bießmann09c2e902011-07-18 20:24:04 +020011#include <linux/compiler.h>
Stefan Reinauere56cdd72012-12-14 13:05:18 +000012#ifdef CONFIG_SYS_COREBOOT
13#include <asm/arch/sysinfo.h>
14#endif
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050015
Andreas Bießmann09c2e902011-07-18 20:24:04 +020016const char __weak version_string[] = U_BOOT_VERSION_STRING;
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050017
Kim Phillips088f1b12012-10-29 13:34:31 +000018static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050019{
20 printf("\n%s\n", version_string);
Alexander Holler89ffa8d2011-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 Reinauere56cdd72012-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 Tyser6b8f5ad2009-10-16 17:36:25 -050030 return 0;
31}
32
33U_BOOT_CMD(
34 version, 1, 1, do_version,
Alexander Holler89ffa8d2011-01-19 00:24:40 +010035 "print monitor, compiler and linker version",
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050036 ""
37);