summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/bootctrl.h
diff options
context:
space:
mode:
authorzhang sanshan <b51434@freescale.com>2016-04-14 12:06:34 +0800
committerzhang sanshan <b51434@freescale.com>2016-04-14 15:24:14 +0800
commita9289e4c1bfa8af172a77f24410fa0fc4276cf61 (patch)
tree56276041230e17970a85502798048dbf12190a13 /drivers/usb/gadget/bootctrl.h
parent79d4702dd9366e478611a199ea9b7f2c2fb2bf45 (diff)
downloadu-boot-imx-a9289e4c1bfa8af172a77f24410fa0fc4276cf61.zip
u-boot-imx-a9289e4c1bfa8af172a77f24410fa0fc4276cf61.tar.gz
u-boot-imx-a9289e4c1bfa8af172a77f24410fa0fc4276cf61.tar.bz2
MA-7633-1 [Android-SD-EMMC] enable BCB partition in android
1 Add some APIs to operate BCB/command. 2 Add action to check the command of BCB. It can cover the case that power down when do factory-reset\ota in recovery mode. Signed-off-by: zhang sanshan <b51434@freescale.com>
Diffstat (limited to 'drivers/usb/gadget/bootctrl.h')
-rw-r--r--drivers/usb/gadget/bootctrl.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/usb/gadget/bootctrl.h b/drivers/usb/gadget/bootctrl.h
index 2153103..7712f75 100644
--- a/drivers/usb/gadget/bootctrl.h
+++ b/drivers/usb/gadget/bootctrl.h
@@ -7,11 +7,31 @@
#ifndef BOOTCTRL_H
#define BOOTCTRL_H
-void set_mmc_id(unsigned int id);
+#include <common.h>
+#include <g_dnl.h>
+#include <linux/types.h>
+#include <linux/stat.h>
+#include "bcb.h"
+
+#define SLOT_NUM (unsigned int)2
+#define CRC_DATA_OFFSET \
+ (uint32_t)(&(((struct boot_ctl *)0)->a_slot_meta[0]))
+
+struct slot_meta {
+ u8 bootsuc:1;
+ u8 tryremain:3;
+ u8 priority:4;
+};
+
+struct boot_ctl {
+ char magic[4]; /* "\0FSL" */
+ u32 crc;
+ struct slot_meta a_slot_meta[SLOT_NUM];
+ u8 recovery_tryremain;
+};
char *select_slot(void);
bool is_sotvar(char *cmd);
void get_slotvar(char *cmd, char *response, size_t chars_left);
void cb_set_active(struct usb_ep *ep, struct usb_request *req);
const char *get_slot_suffix(void);
-
#endif