]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/bootretry.h
bootstage: Record the time taken to set up driver model
[people/ms/u-boot.git] / include / bootretry.h
CommitLineData
0098e179
SG
1/*
2 * (C) Copyright 2000
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
b26440f1
SG
8#ifndef __BOOTRETRY_H
9#define __BOOTRETRY_H
0098e179
SG
10
11#ifdef CONFIG_BOOT_RETRY_TIME
12/**
13 * bootretry_tstc_timeout() - ensure we get a keypress before timeout
14 *
15 * Check for a keypress repeatedly, resetting the watchdog each time. If a
16 * keypress is not received within the command timeout, return an error.
17 *
18 * @return 0 if a key is received in time, -ETIMEDOUT if not
19 */
20int bootretry_tstc_timeout(void);
b26440f1
SG
21
22/**
23 * bootretry_init_cmd_timeout() - set up command timeout
24 *
25 * Get the required command timeout from the environment.
26 */
27void bootretry_init_cmd_timeout(void);
28
29/**
30 * bootretry_reset_cmd_timeout() - reset command timeout
31 *
32 * Reset the command timeout so that the user has a fresh start. This is
33 * typically used when input is received from the user.
34 */
35void bootretry_reset_cmd_timeout(void);
36
37/** bootretry_dont_retry() - Indicate that we should not retry the boot */
38void bootretry_dont_retry(void);
0098e179
SG
39#else
40static inline int bootretry_tstc_timeout(void)
41{
42 return 0;
43}
0098e179 44
b26440f1
SG
45static inline void bootretry_init_cmd_timeout(void)
46{
47}
48
49static inline void bootretry_reset_cmd_timeout(void)
50{
51}
52
53static inline void bootretry_dont_retry(void)
54{
55}
56
57#endif
0098e179
SG
58
59#endif