summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorHaoran Wang <elven.wang@nxp.com>2017-04-10 13:47:43 +0800
committerHaoran Wang <elven.wang@nxp.com>2017-04-10 14:15:54 +0800
commit94734eeca56e8d1b9f1baedf67e16cd0397fc178 (patch)
treefe5bb4b50a4deb0fc4932a76f22052a8de0ea40e /drivers/usb/gadget
parentfd6ee4e63dd34c466d2ba1881655f2b6a59add4c (diff)
downloadu-boot-imx-94734eeca56e8d1b9f1baedf67e16cd0397fc178.zip
u-boot-imx-94734eeca56e8d1b9f1baedf67e16cd0397fc178.tar.gz
u-boot-imx-94734eeca56e8d1b9f1baedf67e16cd0397fc178.tar.bz2
libavb: upgrade avb
Upgrade avb libs to: AndroidPartnerRepo/brillo/platform/external/avb: commit 030120cf1c89345deecbd94c9c0d12f61718ba39 Change-Id: I71a84a8b7afa5661a5e008f5a509f8cc790f154f Signed-off-by: Haoran Wang <elven.wang@nxp.com>
Diffstat (limited to 'drivers/usb/gadget')
-rwxr-xr-xdrivers/usb/gadget/f_fastboot.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 271843e..a2481e8 100755
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -1816,6 +1816,26 @@ void board_fastboot_setup(void) \
__attribute__((weak, alias("__def_fastboot_setup")));
+#if defined(CONFIG_AVB_SUPPORT) && defined(CONFIG_MMC)
+static AvbABOps fsl_avb_ab_ops = {
+ .read_ab_metadata = fsl_read_ab_metadata,
+ .write_ab_metadata = fsl_write_ab_metadata,
+ .ops = NULL
+};
+
+static AvbOps fsl_avb_ops = {
+ .ab_ops = &fsl_avb_ab_ops,
+ .read_from_partition = fsl_read_from_partition_multi,
+ .write_to_partition = fsl_write_to_partition,
+ .validate_vbmeta_public_key = fsl_validate_vbmeta_public_key_rpmb,
+ .read_rollback_index = fsl_read_rollback_index_rpmb,
+ .write_rollback_index = fsl_write_rollback_index_rpmb,
+ .read_is_device_unlocked = fsl_read_is_device_unlocked,
+ .get_unique_guid_for_partition = fsl_get_unique_guid_for_partition
+
+};
+#endif
+
void fastboot_setup(void)
{
struct tag_serialnr serialnr;
@@ -1835,6 +1855,10 @@ void fastboot_setup(void)
_fastboot_load_partitions();
parameters_setup();
+
+#ifdef CONFIG_AVB_SUPPORT
+ fsl_avb_ab_ops.ops = &fsl_avb_ops;
+#endif
}
/* Write the bcb with fastboot bootloader commands */
@@ -1981,20 +2005,6 @@ bootimg_print_image_hdr(struct andr_img_hdr *hdr)
static struct andr_img_hdr boothdr __aligned(ARCH_DMA_MINALIGN);
#if defined(CONFIG_AVB_SUPPORT) && defined(CONFIG_MMC)
-static AvbABOps fsl_avb_ab_ops = {
- .ops = {
- .read_from_partition = fsl_read_from_partition_multi,
- .write_to_partition = fsl_write_to_partition,
- .validate_vbmeta_public_key = fsl_validate_vbmeta_public_key_rpmb,
- .read_rollback_index = fsl_read_rollback_index_rpmb,
- .write_rollback_index = fsl_write_rollback_index_rpmb,
- .read_is_device_unlocked = fsl_read_is_device_unlocked,
- .get_unique_guid_for_partition = fsl_get_unique_guid_for_partition
- },
- .read_ab_metadata = fsl_read_ab_metadata,
- .write_ab_metadata = fsl_write_ab_metadata
-};
-
/* we can use avb to verify Trusty if we want */
const char *requested_partitions[] = {"boot", 0};
@@ -2008,7 +2018,6 @@ int do_boota(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
AvbABFlowResult avb_result;
AvbSlotVerifyData *avb_out_data;
AvbPartitionData *avb_loadpart;
- AvbOps fsl_avb_ops = fsl_avb_ab_ops.ops;
#ifdef CONFIG_FASTBOOT_LOCK
/* check lock state */
@@ -2018,8 +2027,9 @@ int do_boota(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {
fastboot_set_lock_stat(FASTBOOT_LOCK);
lock_status = FASTBOOT_LOCK;
}
+ bool allow_fail = (lock_status == FASTBOOT_UNLOCK ? true : false);
/* if in lock state, do avb verify */
- avb_result = avb_ab_flow(&fsl_avb_ab_ops, requested_partitions, &avb_out_data);
+ avb_result = avb_ab_flow(&fsl_avb_ab_ops, requested_partitions, allow_fail, &avb_out_data);
if (avb_result == AVB_AB_FLOW_RESULT_OK) {
assert(avb_out_data != NULL);
/* load the first partition */