timestamp.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * This file is part of the coreboot project.
  3. *
  4. * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0
  7. */
  8. #ifndef __COREBOOT_TIMESTAMP_H__
  9. #define __COREBOOT_TIMESTAMP_H__
  10. enum timestamp_id {
  11. /* coreboot specific timestamp IDs */
  12. TS_START_ROMSTAGE = 1,
  13. TS_BEFORE_INITRAM = 2,
  14. TS_AFTER_INITRAM = 3,
  15. TS_END_ROMSTAGE = 4,
  16. TS_START_COPYRAM = 8,
  17. TS_END_COPYRAM = 9,
  18. TS_START_RAMSTAGE = 10,
  19. TS_DEVICE_ENUMERATE = 30,
  20. TS_DEVICE_CONFIGURE = 40,
  21. TS_DEVICE_ENABLE = 50,
  22. TS_DEVICE_INITIALIZE = 60,
  23. TS_DEVICE_DONE = 70,
  24. TS_CBMEM_POST = 75,
  25. TS_WRITE_TABLES = 80,
  26. TS_LOAD_PAYLOAD = 90,
  27. TS_ACPI_WAKE_JUMP = 98,
  28. TS_SELFBOOT_JUMP = 99,
  29. /* U-Boot entry IDs start at 1000 */
  30. TS_U_BOOT_INITTED = 1000, /* This is where u-boot starts */
  31. TS_U_BOOT_START_KERNEL = 1100, /* Right before jumping to kernel. */
  32. };
  33. void timestamp_init(void);
  34. void timestamp_add(enum timestamp_id id, uint64_t ts_time);
  35. void timestamp_add_now(enum timestamp_id id);
  36. /**
  37. * timestamp_add_to_bootstage - Add important coreboot timestamps to bootstage
  38. *
  39. * @return 0 if ok, -1 if no timestamps were found
  40. */
  41. int timestamp_add_to_bootstage(void);
  42. #endif