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 FB_SNAPSHOT_STATUS, 48 #endif 49 #ifdef CONFIG_OPTEE_CLIENT 50 FB_AT_DH, 51 FB_AT_UUID, 52 #endif 53 } fb_getvar_t; 54 55 void fastboot_fail(const char *reason, char *response); 56 void fastboot_okay(const char *reason, char *response); 57 58 /** 59 * Send an INFO packet during long commands based on timer. If 60 * CONFIG_UDP_FUNCTION_FASTBOOT is defined, an INFO packet is sent 61 * if the time is 30 seconds after start. Else, noop. 62 * 63 * TODO: Handle the situation where both UDP and USB fastboot are 64 * enabled. 65 * 66 * @param start: Time since last INFO packet was sent. 67 * @param msg: String describing the reason for waiting 68 */ 69 void timed_send_info(ulong *start, const char *msg); 70 71 #endif /* _FASTBOOT_H_ */ 72