version.c 869 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright 2000-2009
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. */
  6. #include <common.h>
  7. #include <command.h>
  8. #include <version.h>
  9. #include <linux/compiler.h>
  10. #ifdef CONFIG_SYS_COREBOOT
  11. #include <asm/arch/sysinfo.h>
  12. #endif
  13. const char __weak version_string[] = U_BOOT_VERSION_STRING;
  14. static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  15. {
  16. char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
  17. printf(display_options_get_banner(false, buf, sizeof(buf)));
  18. #ifdef CC_VERSION_STRING
  19. puts(CC_VERSION_STRING "\n");
  20. #endif
  21. #ifdef LD_VERSION_STRING
  22. puts(LD_VERSION_STRING "\n");
  23. #endif
  24. #ifdef CONFIG_SYS_COREBOOT
  25. printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
  26. #endif
  27. return 0;
  28. }
  29. U_BOOT_CMD(
  30. version, 1, 1, do_version,
  31. "print monitor, compiler and linker version",
  32. ""
  33. );