hc
2024-08-16 a24a44ff9ca902811b99aa9663d697cf452e08ef
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
71
/*
 * (C) Copyright 2008 - 2009
 * Windriver, <www.windriver.com>
 * Tom Rix <Tom.Rix@windriver.com>
 *
 * Copyright 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
 *
 * Copyright 2014 Linaro, Ltd.
 * Rob Herring <robh@kernel.org>
 *
 * SPDX-License-Identifier:    GPL-2.0+
 */
#ifndef _FASTBOOT_H_
#define _FASTBOOT_H_
 
/* The 64 defined bytes plus \0 */
#define FASTBOOT_RESPONSE_LEN (64 + 1)
 
/* Fastboot getvar variables */
typedef enum {
   FB_VERSION,
   FB_BOOTLOADER_VERSION,
   FB_BASEBAND_VERSION,
   FB_PRODUCT,
   FB_SERIAL_NO,
   FB_SECURE,
   FB_DWNLD_SIZE,
   FB_BLK_SIZE,
   FB_ERASE_SIZE,
   FB_PART_TYPE,
   FB_PART_SIZE,
   FB_UNLOCKED,
   FB_VARIANT,
   FB_OFF_MODE_CHARGE,
   FB_BATT_VOLTAGE,
   FB_BATT_SOC_OK,
   FB_IS_USERSPACE,
#ifdef CONFIG_RK_AVB_LIBAVB_USER
   FB_HAS_COUNT,
   FB_HAS_SLOT,
   FB_CURR_SLOT,
   FB_SLOT_SUFFIXES,
   FB_SLOT_SUCCESSFUL,
   FB_SLOT_UNBOOTABLE,
   FB_SLOT_RETRY_COUNT,
   FB_AT_VBST,
   FB_SNAPSHOT_STATUS,
#endif
#ifdef CONFIG_OPTEE_CLIENT
   FB_AT_DH,
   FB_AT_UUID,
#endif
} fb_getvar_t;
 
void fastboot_fail(const char *reason, char *response);
void fastboot_okay(const char *reason, char *response);
 
/**
 * Send an INFO packet during long commands based on timer. If
 * CONFIG_UDP_FUNCTION_FASTBOOT is defined, an INFO packet is sent
 * if the time is 30 seconds after start. Else, noop.
 *
 * TODO: Handle the situation where both UDP and USB fastboot are
 *       enabled.
 *
 * @param start:  Time since last INFO packet was sent.
 * @param msg:    String describing the reason for waiting
 */
void timed_send_info(ulong *start, const char *msg);
 
#endif /* _FASTBOOT_H_ */