Reputation: 6057
I am trying to copy a file from a MMC/SD card in a global variable (struct) of U-Boot SPL, which is in OCRAM. So far I am trying to use
mmc->block_dev.block_read(0, file_sector, 4, &my_struct);
Since copying to DRAM (DDR3/DDR4) works (if I replace &my_struct
with an address in RAM, the call succeed and I can correctly read the file back from RAM), I am certain that my file is located at the beginning of sector file_sector
.
However, with this code, I get:
ERROR: v7_dcache_inval_range - start address is not aligned - 0x100082f4
ERROR: v7_dcache_inval_range - start address is not aligned - 0x10008af4
Are there some requirements/limitations I should be aware off on the location of the destination of block_read
?
Upvotes: 2
Views: 482
Reputation: 2173
So, part of the answer is what it says right there in the error message. Where 'mystruct' is, is not cache aligned so the flushing that we do isn't valid. You should use the ALLOC_CACHE_ALIGN_BUFFER macro and as @LPs mentioned, be copying into a character buffer.
Upvotes: 1