blob: ac8157e570440c2899bfc8f3959ea6ad1d646da5 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass66ded172014-04-10 20:01:28 -06002/*
3 * (C) Copyright 2000
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 *
6 * Add to readline cmdline-editing by
7 * (C) Copyright 2005
8 * JinHua Luo, GuangDong Linux Center, <luo.jinhua@gd-linux.com>
Simon Glass66ded172014-04-10 20:01:28 -06009 */
10
11#ifndef __AUTOBOOT_H
12#define __AUTOBOOT_H
13
Masahiro Yamada41598c82016-06-20 17:33:39 +090014#ifdef CONFIG_AUTOBOOT
Simon Glassaffb2152014-04-10 20:01:35 -060015/**
16 * bootdelay_process() - process the bootd delay
17 *
18 * Process the boot delay, boot limit, then get the value of either
19 * bootcmd, failbootcmd or altbootcmd depending on the current state.
20 * Return this command so it can be executed.
21 *
22 * @return command to executed
23 */
24const char *bootdelay_process(void);
25
26/**
27 * autoboot_command() - run the autoboot command
28 *
29 * If enabled, run the autoboot command returned from bootdelay_process().
Simon Glass8fc31e22019-07-20 20:51:21 -060030 * Also do the CONFIG_AUTOBOOT_MENUKEY processing if enabled.
Simon Glassaffb2152014-04-10 20:01:35 -060031 *
32 * @cmd: Command to run
33 */
34void autoboot_command(const char *cmd);
Simon Glass66ded172014-04-10 20:01:28 -060035#else
Simon Glassaffb2152014-04-10 20:01:35 -060036static inline const char *bootdelay_process(void)
37{
38 return NULL;
39}
40
41static inline void autoboot_command(const char *s)
Simon Glass66ded172014-04-10 20:01:28 -060042{
43}
44#endif
45
46#endif