xref: /rk3399_rockchip-uboot/include/fastboot.h (revision b27ae02dfdf0e26d23901e9b898629d6ec470a60)
1 /*
2  * (C) Copyright 2008 - 2009
3  * Windriver, <www.windriver.com>
4  * Tom Rix <Tom.Rix@windriver.com>
5  *
6  * Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
7  *
8  * Copyright 2014 Linaro, Ltd.
9  * Rob Herring <robh@kernel.org>
10  *
11  * SPDX-License-Identifier:	GPL-2.0+
12  */
13 #ifndef _FASTBOOT_H_
14 #define _FASTBOOT_H_
15 
16 /* The 64 defined bytes plus \0 */
17 #define FASTBOOT_RESPONSE_LEN (64 + 1)
18 
19 /* Fastboot getvar variables */
20 typedef enum {
21 	FB_VERSION,
22 	FB_BOOTLOADER_VERSION,
23 	FB_BASEBAND_VERSION,
24 	FB_PRODUCT,
25 	FB_SERIAL_NO,
26 	FB_SECURE,
27 	FB_DWNLD_SIZE,
28 	FB_BLK_SIZE,
29 	FB_ERASE_SIZE,
30 	FB_PART_TYPE,
31 	FB_PART_SIZE,
32 	FB_UNLOCKED,
33 	FB_VARIANT,
34 	FB_OFF_MODE_CHARGE,
35 	FB_BATT_VOLTAGE,
36 	FB_BATT_SOC_OK,
37 	FB_IS_USERSPACE,
38 #ifdef CONFIG_RK_AVB_LIBAVB_USER
39 	FB_HAS_COUNT,
40 	FB_HAS_SLOT,
41 	FB_CURR_SLOT,
42 	FB_SLOT_SUFFIXES,
43 	FB_SLOT_SUCCESSFUL,
44 	FB_SLOT_UNBOOTABLE,
45 	FB_SLOT_RETRY_COUNT,
46 	FB_AT_VBST,
47 #endif
48 #ifdef CONFIG_OPTEE_CLIENT
49 	FB_AT_DH,
50 	FB_AT_UUID,
51 #endif
52 } fb_getvar_t;
53 
54 void fastboot_fail(const char *reason, char *response);
55 void fastboot_okay(const char *reason, char *response);
56 
57 /**
58  * Send an INFO packet during long commands based on timer. If
59  * CONFIG_UDP_FUNCTION_FASTBOOT is defined, an INFO packet is sent
60  * if the time is 30 seconds after start. Else, noop.
61  *
62  * TODO: Handle the situation where both UDP and USB fastboot are
63  *       enabled.
64  *
65  * @param start:  Time since last INFO packet was sent.
66  * @param msg:    String describing the reason for waiting
67  */
68 void timed_send_info(ulong *start, const char *msg);
69 
70 #endif /* _FASTBOOT_H_ */
71