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