version.c 802 B

12345678910111213141516171819202122232425262728293031323334353637
  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. printf("\n%s\n", version_string);
  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. );