xref: /rk3399_rockchip-uboot/include/fastboot.h (revision 8dd9db5d1cd5826638c3cdb5f681300ff2f29f3b)
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 #ifdef CONFIG_RK_AVB_LIBAVB_USER
38 	FB_HAS_COUNT,
39 	FB_HAS_SLOT,
40 	FB_CURR_SLOT,
41 	FB_SLOT_SUFFIXES,
42 	FB_SLOT_SUCCESSFUL,
43 	FB_SLOT_UNBOOTABLE,
44 	FB_SLOT_RETRY_COUNT,
45 	FB_AT_VBST,
46 #endif
47 #ifdef CONFIG_OPTEE_CLIENT
48 	FB_AT_DH,
49 	FB_AT_UUID,
50 #endif
51 } fb_getvar_t;
52 
53 void fastboot_fail(const char *reason, char *response);
54 void fastboot_okay(const char *reason, char *response);
55 
56 /**
57  * Send an INFO packet during long commands based on timer. If
58  * CONFIG_UDP_FUNCTION_FASTBOOT is defined, an INFO packet is sent
59  * if the time is 30 seconds after start. Else, noop.
60  *
61  * TODO: Handle the situation where both UDP and USB fastboot are
62  *       enabled.
63  *
64  * @param start:  Time since last INFO packet was sent.
65  * @param msg:    String describing the reason for waiting
66  */
67 void timed_send_info(ulong *start, const char *msg);
68 
69 #endif /* _FASTBOOT_H_ */
70