summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorfang hui <hui.fang@nxp.com>2017-04-27 14:50:03 +0800
committerfang hui <hui.fang@nxp.com>2017-04-27 15:16:25 +0800
commit71dc860a61a936eca242c2badaad8815b352905b (patch)
tree32469833d886b05dae2ddee032a74bb8d8081a7b /drivers
parent4dc1d71d0da1d07913ef91e60f54338db70caa69 (diff)
downloadu-boot-imx-71dc860a61a936eca242c2badaad8815b352905b.zip
u-boot-imx-71dc860a61a936eca242c2badaad8815b352905b.tar.gz
u-boot-imx-71dc860a61a936eca242c2badaad8815b352905b.tar.bz2
MA-9530-2 [iot] Revet avb in ubootimx_v2015.04_brillo
Revert "libavb: upgrade avb" This reverts commit 94734eeca56e8d1b9f1baedf67e16cd0397fc178. Change-Id: I6eae3fa9579fb43fa6956c450011b230875d0a96
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/usb/gadget/f_fastboot.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 9ce2b66..20f8add 100755
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -1822,26 +1822,6 @@ 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;
@@ -1861,10 +1841,6 @@ 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 */
@@ -2011,6 +1987,20 @@ 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};
@@ -2024,6 +2014,7 @@ 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 */
@@ -2033,9 +2024,8 @@ 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, allow_fail, &avb_out_data);
+ avb_result = avb_ab_flow(&fsl_avb_ab_ops, requested_partitions, &avb_out_data);
if (avb_result == AVB_AB_FLOW_RESULT_OK) {
assert(avb_out_data != NULL);
/* load the first partition */