diff options
author | Luo Ji <ji.luo@nxp.com> | 2018-05-15 17:53:04 +0800 |
---|---|---|
committer | Luo Ji <ji.luo@nxp.com> | 2018-07-04 13:52:48 +0800 |
commit | 3e633edb7b0ba93c0917b8015be82eeec73bbc6e (patch) | |
tree | 9fca6281a77a7464551f63f42c52856aa3d95ebf /include | |
parent | 887735f52bc2374e324c0d75ef62963db473da7f (diff) |
[iot] Update libavb in u-boot
This commit did:
1. Sync AVB lib with external/avb, head of commit is:
commit 6d5326a945c2d17d5d0e7718d5cb97663c3b33a2
Author: Neal Ostrem <nealo@google.com>
Date: Tue Apr 24 13:09:45 2018 -0700
Merge fix/changes required after merge from AOSP ToT.
Change library name to one used by AT.
Test: Built successfully and unit tests pass.
Change-Id: I5e5fc9a6010d96cfecfc6faf0858ba930cba65a0
2. Change product id in ATX to be full zeros to sync with
external/avb.
3. Fix build errors and implement ops fsl_set_key_version.
4. Move most nxp modified code to lib/avb/fsl/.
Test: build and boot successfully for imx7d_pico and imx8m_phanbell.
Change-Id: I199a035fe8267b10955299a4b745458d40a2e754
Signed-off-by: Luo Ji <ji.luo@nxp.com>
Diffstat (limited to 'include')
22 files changed, 66 insertions, 1 deletions
diff --git a/include/configs/imx8mm_evk_android.h b/include/configs/imx8mm_evk_android.h index c1f9fe1a40..5db73bd92a 100644 --- a/include/configs/imx8mm_evk_android.h +++ b/include/configs/imx8mm_evk_android.h @@ -58,4 +58,6 @@ #define ANDROID_MCU_FIRMWARE_HEADER_STACK 0x20020000 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8MM_EVK_ANDROID_H */ diff --git a/include/configs/imx8mq_evk_android.h b/include/configs/imx8mq_evk_android.h index 1f96cdcd01..09ac0ea8d7 100644 --- a/include/configs/imx8mq_evk_android.h +++ b/include/configs/imx8mq_evk_android.h @@ -58,4 +58,6 @@ #define ANDROID_MCU_FIRMWARE_HEADER_STACK 0x20020000 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8MQ_EVK_ANDROID_H */ diff --git a/include/configs/imx8mq_evk_androidthings.h b/include/configs/imx8mq_evk_androidthings.h index cf68349d7b..9b33fcb8b7 100644 --- a/include/configs/imx8mq_evk_androidthings.h +++ b/include/configs/imx8mq_evk_androidthings.h @@ -50,4 +50,6 @@ "fdt_high=0xffffffffffffffff\0" \ "initrd_high=0xffffffffffffffff\0" \ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8MQ_EVK_ANDROID_THINGS_H */ diff --git a/include/configs/imx8qm_arm2_android.h b/include/configs/imx8qm_arm2_android.h index 8f6c4e16a1..4b7b92cc0d 100644 --- a/include/configs/imx8qm_arm2_android.h +++ b/include/configs/imx8qm_arm2_android.h @@ -61,4 +61,6 @@ #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_FASTBOOT_BUF_SIZE 0x19000000 +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* MX6_SABRE_ANDROID_COMMON_H */ diff --git a/include/configs/imx8qm_mek_android.h b/include/configs/imx8qm_mek_android.h index 97f433c03d..b87af8ba0f 100644 --- a/include/configs/imx8qm_mek_android.h +++ b/include/configs/imx8qm_mek_android.h @@ -66,4 +66,6 @@ #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_FASTBOOT_BUF_SIZE 0x19000000 +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QM_MEK_ANDROID_H */ diff --git a/include/configs/imx8qm_mek_android_auto.h b/include/configs/imx8qm_mek_android_auto.h index 2708d54dab..83885778cb 100644 --- a/include/configs/imx8qm_mek_android_auto.h +++ b/include/configs/imx8qm_mek_android_auto.h @@ -94,4 +94,6 @@ #include "imx8qm_mek_android_auto_xen.h" #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QM_MEK_ANDROID_AUTO_H */ diff --git a/include/configs/imx8qm_mek_android_auto_xen.h b/include/configs/imx8qm_mek_android_auto_xen.h index c84fe09c39..df50425da1 100644 --- a/include/configs/imx8qm_mek_android_auto_xen.h +++ b/include/configs/imx8qm_mek_android_auto_xen.h @@ -37,4 +37,6 @@ /* This needs to be stay same in iomem in domu.cfg */ #define SC_IPC_CH 0x15d1d0000 +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QM_MEK_ANDROID_AUTO_XEN_H */ diff --git a/include/configs/imx8qxp_arm2_android.h b/include/configs/imx8qxp_arm2_android.h index f1850c62ee..f948a5fe5f 100644 --- a/include/configs/imx8qxp_arm2_android.h +++ b/include/configs/imx8qxp_arm2_android.h @@ -61,4 +61,6 @@ #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_FASTBOOT_BUF_SIZE 0x19000000 +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QXP_ARM2_ANDROID_H */ diff --git a/include/configs/imx8qxp_mek_android.h b/include/configs/imx8qxp_mek_android.h index 0c3b54fbfb..b2435d948d 100644 --- a/include/configs/imx8qxp_mek_android.h +++ b/include/configs/imx8qxp_mek_android.h @@ -62,4 +62,6 @@ #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR #define CONFIG_FASTBOOT_BUF_SIZE 0x19000000 +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QXP_MEK_ANDROID_H */ diff --git a/include/configs/imx8qxp_mek_android_auto.h b/include/configs/imx8qxp_mek_android_auto.h index 05d9ad6117..d0f7f82594 100644 --- a/include/configs/imx8qxp_mek_android_auto.h +++ b/include/configs/imx8qxp_mek_android_auto.h @@ -88,4 +88,6 @@ #undef CONFIG_USB_HOST_ETHER #undef CONFIG_USB_FUNCTION_MASS_STORAGE +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* IMX8QXP_MEK_ANDROID_AUTO_H */ diff --git a/include/configs/multa-imx7d_androidthings.h b/include/configs/multa-imx7d_androidthings.h index 40730804cc..c70146edcc 100644 --- a/include/configs/multa-imx7d_androidthings.h +++ b/include/configs/multa-imx7d_androidthings.h @@ -62,4 +62,6 @@ #define CONFIG_AVB_FUSE_BANK_END 0 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif diff --git a/include/configs/mx6sabreandroid_common.h b/include/configs/mx6sabreandroid_common.h index d6272aa5ec..d480a59b9b 100644 --- a/include/configs/mx6sabreandroid_common.h +++ b/include/configs/mx6sabreandroid_common.h @@ -35,4 +35,6 @@ #endif /* CONFIG_AVB_SUPPORT */ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* MX6_SABRE_ANDROID_COMMON_H */ diff --git a/include/configs/mx6slevkandroid.h b/include/configs/mx6slevkandroid.h index 50acd5f8b8..0f88e8bb36 100644 --- a/include/configs/mx6slevkandroid.h +++ b/include/configs/mx6slevkandroid.h @@ -49,4 +49,6 @@ #endif /* CONFIG_AVB_SUPPORT */ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif diff --git a/include/configs/mx6sxsabreautoandroid.h b/include/configs/mx6sxsabreautoandroid.h index 62a69bc002..94bf73b29a 100644 --- a/include/configs/mx6sxsabreautoandroid.h +++ b/include/configs/mx6sxsabreautoandroid.h @@ -36,4 +36,6 @@ #endif /* CONFIG_AVB_SUPPORT */ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif diff --git a/include/configs/mx6sxsabresdandroid.h b/include/configs/mx6sxsabresdandroid.h index e7dd7696f3..6650e1b0b4 100644 --- a/include/configs/mx6sxsabresdandroid.h +++ b/include/configs/mx6sxsabresdandroid.h @@ -39,4 +39,6 @@ #endif /* CONFIG_AVB_SUPPORT */ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif diff --git a/include/configs/mx6ul_nxpu_iopb_android_things.h b/include/configs/mx6ul_nxpu_iopb_android_things.h index fe31b49cf3..4e7befb280 100644 --- a/include/configs/mx6ul_nxpu_iopb_android_things.h +++ b/include/configs/mx6ul_nxpu_iopb_android_things.h @@ -56,5 +56,7 @@ #define CONFIG_AVB_FUSE_BANK_END 15 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* __MX6UL_NXPU_IOPB_ANDROID_THINGS_H */ diff --git a/include/configs/mx6ul_spriot_android_things.h b/include/configs/mx6ul_spriot_android_things.h index 67682f9b10..9acaf3c188 100644 --- a/include/configs/mx6ul_spriot_android_things.h +++ b/include/configs/mx6ul_spriot_android_things.h @@ -49,5 +49,7 @@ #define CONFIG_AVB_FUSE_BANK_END 15 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* __MX6UL_SPRIOT_ANDROID_THINGS_H */ diff --git a/include/configs/mx7dsabresdandroid.h b/include/configs/mx7dsabresdandroid.h index 82a94a2291..399abf6dfe 100644 --- a/include/configs/mx7dsabresdandroid.h +++ b/include/configs/mx7dsabresdandroid.h @@ -34,4 +34,6 @@ #endif /* CONFIG_AVB_SUPPORT */ +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif /* __MX7D_SABRESD_ANDROID_H */ diff --git a/include/configs/mx7ulp_evk_android.h b/include/configs/mx7ulp_evk_android.h index 3ce0ca9621..6741a7465a 100644 --- a/include/configs/mx7ulp_evk_android.h +++ b/include/configs/mx7ulp_evk_android.h @@ -38,4 +38,6 @@ #define ANDROID_MCU_FIRMWARE_SIZE 0x20000 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + #endif diff --git a/include/configs/pico-imx7dandroidthings.h b/include/configs/pico-imx7dandroidthings.h index 87370b1224..e32e50ae8c 100644 --- a/include/configs/pico-imx7dandroidthings.h +++ b/include/configs/pico-imx7dandroidthings.h @@ -62,7 +62,7 @@ #ifdef CONFIG_SYS_MALLOC_LEN #undef CONFIG_SYS_MALLOC_LEN -#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) +#define CONFIG_SYS_MALLOC_LEN (64 * SZ_1M) #endif /* fuse bank size in word */ /* infact 7D have no enough bits @@ -73,6 +73,8 @@ #define CONFIG_AVB_FUSE_BANK_END 14 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED + /* Disable U-Boot logo */ #undef CONFIG_VIDEO_LOGO diff --git a/include/configs/picosom-imx6ul_android_things.h b/include/configs/picosom-imx6ul_android_things.h index a0c580a6a1..bb323ddac7 100644 --- a/include/configs/picosom-imx6ul_android_things.h +++ b/include/configs/picosom-imx6ul_android_things.h @@ -57,6 +57,7 @@ #define CONFIG_AVB_FUSE_BANK_END 15 #endif +#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED #endif /* __PICOSOM_IMX6UL_ANDROID_THINGS_H */ diff --git a/include/fsl_avb.h b/include/fsl_avb.h index 9cf3249cd7..2bb3d427cc 100644 --- a/include/fsl_avb.h +++ b/include/fsl_avb.h @@ -195,4 +195,28 @@ AvbIOResult fsl_read_permanent_attributes( */ AvbIOResult fsl_read_permanent_attributes_hash( AvbAtxOps* atx_ops, uint8_t hash[AVB_SHA256_DIGEST_SIZE]); + +/* Provides the key version of a key used during verification. This may be + * useful for managing the minimum key version. + */ +void fsl_set_key_version(AvbAtxOps* atx_ops, + size_t rollback_index_location, + uint64_t key_version); + +/* This is the fast version of avb_ab_flow(), this function will + * not check another slot if one slot can pass the verify (or verify + * fail is acceptable). */ +AvbABFlowResult avb_ab_flow_fast(AvbABOps* ab_ops, + const char* const* requested_partitions, + AvbSlotVerifyFlags flags, + AvbHashtreeErrorMode hashtree_error_mode, + AvbSlotVerifyData** out_data); + +/* This is for legacy i.mx6/7 which don't enable A/B but want to + * verify boot/recovery with AVB */ +AvbABFlowResult avb_single_flow(AvbABOps* ab_ops, + const char* const* requested_partitions, + AvbSlotVerifyFlags flags, + AvbHashtreeErrorMode hashtree_error_mode, + AvbSlotVerifyData** out_data); #endif /* __FSL_AVB_H__ */ |