version.c 872 B

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