fix(io_stm32image): invalidate cache on local buf
When retrieving data from stm32 image file, the header is removed with a memcpy that shifts the data to overwrite the useless header for next binary. STM32 binary from boot device: |-------------------------------------| | header | payload | |-------------------------------------| After the memcpy: |-------------------------------------| | payload | remain | |-------------------------------------| But the remaining data after the shifted payload is still in the cache. As it is of no use for anyone, just invalidate the cache at this address. This is required if the DDR is mapped secure in BL2, and the secure access is forbidden in BL33, or else TZC-400 issues an error. Change-Id: Ice2af3b1ca49eccb79bfc62db60437e259d344ca Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
parent
b6561c1217
commit
a5bcf82402
|
@ -346,6 +346,9 @@ static int stm32image_partition_read(io_entity_t *entity, uintptr_t buffer,
|
|||
return result;
|
||||
}
|
||||
|
||||
inv_dcache_range(round_up((uintptr_t)(local_buffer + length - hdr_sz),
|
||||
CACHE_WRITEBACK_GRANULE), *length_read - length + hdr_sz);
|
||||
|
||||
io_close(backend_handle);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue