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> 92e192b24SSimon Glass #include <version.h> 10*772b9e8bSPali Rohár #include <version_string.h> 112e192b24SSimon Glass #include <linux/compiler.h> 122e192b24SSimon Glass #ifdef CONFIG_SYS_COREBOOT 132e192b24SSimon Glass #include <asm/arch/sysinfo.h> 142e192b24SSimon Glass #endif 152e192b24SSimon Glass 162e192b24SSimon Glass const char __weak version_string[] = U_BOOT_VERSION_STRING; 172e192b24SSimon Glass 182e192b24SSimon Glass static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 192e192b24SSimon Glass { 206c519f2dSSimon Glass char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; 216c519f2dSSimon Glass 226c519f2dSSimon Glass printf(display_options_get_banner(false, buf, sizeof(buf))); 232e192b24SSimon Glass #ifdef CC_VERSION_STRING 242e192b24SSimon Glass puts(CC_VERSION_STRING "\n"); 252e192b24SSimon Glass #endif 262e192b24SSimon Glass #ifdef LD_VERSION_STRING 272e192b24SSimon Glass puts(LD_VERSION_STRING "\n"); 282e192b24SSimon Glass #endif 292e192b24SSimon Glass #ifdef CONFIG_SYS_COREBOOT 302e192b24SSimon Glass printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build); 312e192b24SSimon Glass #endif 322e192b24SSimon Glass return 0; 332e192b24SSimon Glass } 342e192b24SSimon Glass 352e192b24SSimon Glass U_BOOT_CMD( 362e192b24SSimon Glass version, 1, 1, do_version, 372e192b24SSimon Glass "print monitor, compiler and linker version", 382e192b24SSimon Glass "" 392e192b24SSimon Glass ); 40