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 
20 #ifndef __COREBOOT_TIMESTAMP_H__
21 #define __COREBOOT_TIMESTAMP_H__
22 
23 enum timestamp_id {
24 	/* coreboot specific timestamp IDs */
25 	TS_START_ROMSTAGE = 1,
26 	TS_BEFORE_INITRAM = 2,
27 	TS_AFTER_INITRAM = 3,
28 	TS_END_ROMSTAGE = 4,
29 	TS_START_COPYRAM = 8,
30 	TS_END_COPYRAM = 9,
31 	TS_START_RAMSTAGE = 10,
32 	TS_DEVICE_ENUMERATE = 30,
33 	TS_DEVICE_CONFIGURE = 40,
34 	TS_DEVICE_ENABLE = 50,
35 	TS_DEVICE_INITIALIZE = 60,
36 	TS_DEVICE_DONE = 70,
37 	TS_CBMEM_POST = 75,
38 	TS_WRITE_TABLES = 80,
39 	TS_LOAD_PAYLOAD = 90,
40 	TS_ACPI_WAKE_JUMP = 98,
41 	TS_SELFBOOT_JUMP = 99,
42 
43 	/* U-Boot entry IDs start at 1000 */
44 	TS_U_BOOT_INITTED = 1000, /* This is where u-boot starts */
45 	TS_U_BOOT_START_KERNEL = 1100, /* Right before jumping to kernel. */
46 };
47 
48 void timestamp_init(void);
49 void timestamp_add(enum timestamp_id id, uint64_t ts_time);
50 void timestamp_add_now(enum timestamp_id id);
51 
52 /**
53  * timestamp_add_to_bootstage - Add important coreboot timestamps to bootstage
54  *
55  * @return 0 if ok, -1 if no timestamps were found
56  */
57 int timestamp_add_to_bootstage(void);
58 
59 #endif
60