183d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
22e192b24SSimon Glass /*
32e192b24SSimon Glass * Copyright 2000-2009
42e192b24SSimon Glass * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
52e192b24SSimon Glass */
62e192b24SSimon Glass
72e192b24SSimon Glass #include <common.h>
82e192b24SSimon Glass #include <command.h>
9*223bb744SPali Rohár #include <timestamp.h>
102e192b24SSimon Glass #include <version.h>
11f486b9d0SPali Rohár #include <version_string.h>
122e192b24SSimon Glass #include <linux/compiler.h>
132e192b24SSimon Glass #ifdef CONFIG_SYS_COREBOOT
142e192b24SSimon Glass #include <asm/arch/sysinfo.h>
152e192b24SSimon Glass #endif
162e192b24SSimon Glass
172e192b24SSimon Glass const char __weak version_string[] = U_BOOT_VERSION_STRING;
182e192b24SSimon Glass
do_version(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])192e192b24SSimon Glass static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
202e192b24SSimon Glass {
216c519f2dSSimon Glass char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
226c519f2dSSimon Glass
236c519f2dSSimon Glass printf(display_options_get_banner(false, buf, sizeof(buf)));
242e192b24SSimon Glass #ifdef CC_VERSION_STRING
252e192b24SSimon Glass puts(CC_VERSION_STRING "\n");
262e192b24SSimon Glass #endif
272e192b24SSimon Glass #ifdef LD_VERSION_STRING
282e192b24SSimon Glass puts(LD_VERSION_STRING "\n");
292e192b24SSimon Glass #endif
302e192b24SSimon Glass #ifdef CONFIG_SYS_COREBOOT
312e192b24SSimon Glass printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
322e192b24SSimon Glass #endif
332e192b24SSimon Glass return 0;
342e192b24SSimon Glass }
352e192b24SSimon Glass
362e192b24SSimon Glass U_BOOT_CMD(
372e192b24SSimon Glass version, 1, 1, do_version,
382e192b24SSimon Glass "print monitor, compiler and linker version",
392e192b24SSimon Glass ""
402e192b24SSimon Glass );
41