summaryrefslogtreecommitdiff
path: root/include/bootstage.h
blob: 7838230dddae7942ab09c8ff94cf8cc3bf255553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (c) 2011, Google Inc. All rights reserved.
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

#ifndef __BOOTSTAGE_H
#define __BOOTSTAGE_H

/*
 * These are the things that can be timestamped. There are some pre-defined
 * by U-Boot, and some which are user defined.
 */
enum bootstage_id {
	BOOTSTAGE_AWAKE,
	BOOTSTAGE_START_UBOOT,
	BOOTSTAGE_USB_START,
	BOOTSTAGE_ETH_START,
	BOOTSTAGE_BOOTP_START,
	BOOTSTAGE_BOOTP_STOP,
	BOOTSTAGE_KERNELREAD_START,
	BOOTSTAGE_KERNELREAD_STOP,
	BOOTSTAGE_BOOTM_START,
	BOOTSTAGE_BOOTM_HANDOFF,

	/* a few spare for the user, from here */
	BOOTSTAGE_USER,

	/*
	 * Total number of entries - increase this at the cost of some BSS
	 * and ATAG space.
	 */
	BOOTSTAGE_COUNT = 10
};

#ifdef CONFIG_BOOTSTAGE

/*
 * Mark a time stamp for the current boot stage.
 */
uint32_t bootstage_mark(enum bootstage_id id, const char *name);

/* Print a report about boot time */
void bootstage_report(void);

#else

static inline uint32_t bootstage_mark(enum bootstage_id id, const char *name)
{ return 0; }

#endif

#endif