version.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 <timestamp.h>
  9. #include <version.h>
  10. #include <version_string.h>
  11. #include <linux/compiler.h>
  12. #ifdef CONFIG_SYS_COREBOOT
  13. #include <asm/cb_sysinfo.h>
  14. #endif
  15. #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
  16. U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
  17. const char version_string[] = U_BOOT_VERSION_STRING;
  18. static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
  19. char *const argv[])
  20. {
  21. char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
  22. printf(display_options_get_banner(false, buf, sizeof(buf)));
  23. #ifdef CC_VERSION_STRING
  24. puts(CC_VERSION_STRING "\n");
  25. #endif
  26. #ifdef LD_VERSION_STRING
  27. puts(LD_VERSION_STRING "\n");
  28. #endif
  29. #ifdef CONFIG_SYS_COREBOOT
  30. printf("coreboot-%s (%s)\n", lib_sysinfo.version, lib_sysinfo.build);
  31. #endif
  32. return 0;
  33. }
  34. U_BOOT_CMD(
  35. version, 1, 1, do_version,
  36. "print monitor, compiler and linker version",
  37. ""
  38. );