diff options
Diffstat (limited to 'lib/avb/fsl')
-rw-r--r-- | lib/avb/fsl/fsl_avb_ab_flow.c | 13 | ||||
-rw-r--r-- | lib/avb/fsl/fsl_avbkey.h | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/avb/fsl/fsl_avb_ab_flow.c b/lib/avb/fsl/fsl_avb_ab_flow.c index 8a67de79eb..eeb908fb8d 100644 --- a/lib/avb/fsl/fsl_avb_ab_flow.c +++ b/lib/avb/fsl/fsl_avb_ab_flow.c @@ -208,6 +208,9 @@ static int spl_verify_rbidx(struct mmc *mmc, AvbABSlotData *slot, kblb_hdr_t hdr; kblb_tag_t *rbk; uint64_t extract_idx; +#ifdef CONFIG_AVB_ATX + struct bl_rbindex_package *bl_rbindex; +#endif /* Make sure rollback index has been initialized before verify */ if (rpmb_init()) { @@ -241,6 +244,16 @@ static int spl_verify_rbidx(struct mmc *mmc, AvbABSlotData *slot, return -1; } +#ifdef CONFIG_AVB_ATX + /* Pass bootloader rbindex to u-boot here. */ + bl_rbindex = (struct bl_rbindex_package *)BL_RBINDEX_LOAD_ADDR; + memcpy(bl_rbindex->magic, BL_RBINDEX_MAGIC, BL_RBINDEX_MAGIC_LEN); + if (slot->successful_boot != 0) + bl_rbindex->rbindex = spl_image->rbindex; + else + bl_rbindex->rbindex = extract_idx; +#endif + return 0; } else { printf("Rollback index verify rejected!\n"); diff --git a/lib/avb/fsl/fsl_avbkey.h b/lib/avb/fsl/fsl_avbkey.h index 73b0c52718..863d8b1dbf 100644 --- a/lib/avb/fsl/fsl_avbkey.h +++ b/lib/avb/fsl/fsl_avbkey.h @@ -31,6 +31,15 @@ #define AVB_KBLB_MAGIC "\0KBLB!" #define AVB_KBLB_MAGIC_LEN 6 +#if defined(CONFIG_AVB_ATX) && defined(CONFIG_DUAL_BOOTLOADER) +#define BL_RBINDEX_MAGIC "BL_RBINDEX" +#define BL_RBINDEX_MAGIC_LEN 11 +struct bl_rbindex_package { + char magic[BL_RBINDEX_MAGIC_LEN]; + uint32_t rbindex; +}; +#endif + #ifdef CONFIG_ANDROID_AUTO_SUPPORT #define RPMB_KEY_MAGIC "RPMB" #endif |