Message ID | 1340583477-14018-4-git-send-email-marex@denx.de |
---|---|
State | Rejected |
Delegated to: | Marek Vasut |
Headers | show |
diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c index 79b1e2f..45b5a0c 100644 --- a/common/cmd_ext2.c +++ b/common/cmd_ext2.c @@ -166,6 +166,9 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return CMD_RET_USAGE; } + if (!cacheline_aligned(addr)) + return 1; + if (!filename) { puts ("** No boot file defined **\n"); return 1;
This prevents the scenario where data cache is on and the device uses DMA to deploy data. In that case, it might not be possible to flush/invalidate data to RAM properly. The other option is to use bounce buffer, but that involves a lot of copying and therefore degrades performance rapidly. Therefore disallow this possibility of unaligned load address altogether if data cache is on. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> --- common/cmd_ext2.c | 3 +++ 1 file changed, 3 insertions(+)