MA-16203 Load boot/dtbo image to fixed memory
authorJi Luo <ji.luo@nxp.com>
Fri, 6 Dec 2019 09:34:46 +0000 (17:34 +0800)
committerJi Luo <ji.luo@nxp.com>
Thu, 13 May 2021 01:49:18 +0000 (09:49 +0800)
commitc9e9af7549662633d70d48cb8d55845a066d9bc0
tree5c630a0c9a5daf8bb3c236d022059d92a940f406
parent1692c3ecc6af3d743c936db40ecd90a9161b119f
MA-16203 Load boot/dtbo image to fixed memory

When the device is locked, avb will try to verify one slot
first, it will continue to verify another if the first slot
returns failure. Function load_full_partition() will alloc memory
to load boot/dtbo images from heap (which is a big and continuous
memory region), this memory will be freed if the first slot returns
verify failure. but because part of the continous memory region
will be used in following verify process, even total available memory
is enough, u-boot can't find a continous memory region to load the
boot/dtbo image for another slot and will return error "Failed to
allocate memory".

Instead, this commit use fixed memory region start from 96MB offset of
CONFIG_FASTBOOT_BUF_ADDR to load the boot/dtbo images.

Test: slot verify and A/B slot switch.

Change-Id: Ifc83bed5a6be37196c0fd109d942eaf9b07b6a74
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit d13752e831957fb84c71f8ca24fd1979d3605cde)
(cherry picked from commit 11f79ca63338a00960e90763d4764956907fdcb5)
lib/avb/fsl/fsl_avb_ab_flow.c
lib/libavb/avb_slot_verify.c