timestamp.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * This file is part of the coreboot project.
  3. *
  4. * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
  18. */
  19. #ifndef __COREBOOT_TIMESTAMP_H__
  20. #define __COREBOOT_TIMESTAMP_H__
  21. enum timestamp_id {
  22. /* coreboot specific timestamp IDs */
  23. TS_START_ROMSTAGE = 1,
  24. TS_BEFORE_INITRAM = 2,
  25. TS_AFTER_INITRAM = 3,
  26. TS_END_ROMSTAGE = 4,
  27. TS_START_COPYRAM = 8,
  28. TS_END_COPYRAM = 9,
  29. TS_START_RAMSTAGE = 10,
  30. TS_DEVICE_ENUMERATE = 30,
  31. TS_DEVICE_CONFIGURE = 40,
  32. TS_DEVICE_ENABLE = 50,
  33. TS_DEVICE_INITIALIZE = 60,
  34. TS_DEVICE_DONE = 70,
  35. TS_CBMEM_POST = 75,
  36. TS_WRITE_TABLES = 80,
  37. TS_LOAD_PAYLOAD = 90,
  38. TS_ACPI_WAKE_JUMP = 98,
  39. TS_SELFBOOT_JUMP = 99,
  40. /* U-Boot entry IDs start at 1000 */
  41. TS_U_BOOT_INITTED = 1000, /* This is where u-boot starts */
  42. TS_U_BOOT_START_KERNEL = 1100, /* Right before jumping to kernel. */
  43. };
  44. void timestamp_init(void);
  45. void timestamp_add(enum timestamp_id id, uint64_t ts_time);
  46. void timestamp_add_now(enum timestamp_id id);
  47. /**
  48. * timestamp_add_to_bootstage - Add important coreboot timestamps to bootstage
  49. *
  50. * @return 0 if ok, -1 if no timestamps were found
  51. */
  52. int timestamp_add_to_bootstage(void);
  53. #endif