diff options
author | Ji Luo <ji.luo@nxp.com> | 2019-10-08 21:22:24 +0800 |
---|---|---|
committer | Ji Luo <ji.luo@nxp.com> | 2020-05-18 09:45:08 +0800 |
commit | 2380630c9031b3b07db1c23fd96d0d94dd5825e2 (patch) | |
tree | 50f385865e433a7bd70d35718c5569780be6afe5 /drivers | |
parent | 946769ebefe3058e51b994796e2ba0aa0f58f68d (diff) |
MA-15575-3 Add support for oemlock 1.0 hal
Add commands to read oem device unlock state from
trusty avb app. Use the oem device unlock state to
determine if the device can be unlocked instead of
the state in persistdata part.
Test: Read oem device unlock state from avb app.
Change-Id: Ifccaa788ba0f681c2b3a47151c8474e8da5a2559
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit c6eaf8e32987f120c0c5441ea39aa0f39a65b50d)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/fastboot/fb_fsl/fastboot_lock_unlock.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/fastboot/fb_fsl/fastboot_lock_unlock.c b/drivers/fastboot/fb_fsl/fastboot_lock_unlock.c index 3a9d44f092..164b5b5da4 100644 --- a/drivers/fastboot/fb_fsl/fastboot_lock_unlock.c +++ b/drivers/fastboot/fb_fsl/fastboot_lock_unlock.c @@ -449,18 +449,28 @@ fail: } FbLockEnableResult fastboot_lock_enable() { - struct blk_desc *fs_dev_desc; - disk_partition_t fs_partition; - unsigned char *bdata; - int mmc_id; - FbLockEnableResult ret; - #ifdef CONFIG_DUAL_BOOTLOADER /* Always allow unlock device in spl recovery mode. */ if (is_spl_recovery()) return FASTBOOT_UL_ENABLE; #endif +#ifdef CONFIG_IMX_TRUSTY_OS + int ret; + uint8_t oem_device_unlock; + + ret = trusty_read_oem_unlock_device_permission(&oem_device_unlock); + if (ret < 0) + return FASTBOOT_UL_ERROR; + else + return oem_device_unlock; +#else /* CONFIG_IMX_TRUSTY_OS */ + FbLockEnableResult ret; + struct blk_desc *fs_dev_desc; + disk_partition_t fs_partition; + unsigned char *bdata; + int mmc_id; + bdata = (unsigned char *)memalign(ALIGN_BYTES, SECTOR_SIZE); if (bdata == NULL) return FASTBOOT_UL_ERROR; @@ -500,6 +510,7 @@ FbLockEnableResult fastboot_lock_enable() { fail: free(bdata); return ret; +#endif /* CONFIG_IMX_TRUSTY_OS */ } #endif |