diff mbox

[U-Boot,03/18] bootm: Align cache flush end address correctly

Message ID 1462257612-28746-4-git-send-email-sjg@chromium.org
State Accepted
Commit b4d956f6bc0fe6ff9a5776cbce0fe97a344737a3
Delegated to: Andreas Bießmann
Headers show

Commit Message

Simon Glass May 3, 2016, 6:39 a.m. UTC
Flushing part of the cache should be done on cache boundaries. Trying to
flush part of a cache line is not supported and the request may be ignored
or print warnings.

Adjust the bootm code to align the end address to prevent this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/bootm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heiko Schocher May 3, 2016, 7:51 a.m. UTC | #1
Hello Simon,

Am 03.05.2016 um 08:39 schrieb Simon Glass:
> Flushing part of the cache should be done on cache boundaries. Trying to
> flush part of a cache line is not supported and the request may be ignored
> or print warnings.
>
> Adjust the bootm code to align the end address to prevent this problem.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>   common/bootm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

Reviewed-by: Heiko Schocher <hs@denx.de>

tested on the smartweb, corvus, taurus and axm board

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/common/bootm.c b/common/bootm.c
> index c965326..7469c61 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -435,7 +435,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
>   		bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
>   		return err;
>   	}
> -	flush_cache(load, *load_end - load);
> +	flush_cache(load, ALIGN(*load_end - load, ARCH_DMA_MINALIGN));
>
>   	debug("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
>   	bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);
>
Joe Hershberger May 3, 2016, 7:39 p.m. UTC | #2
On Tue, May 3, 2016 at 1:39 AM, Simon Glass <sjg@chromium.org> wrote:
> Flushing part of the cache should be done on cache boundaries. Trying to
> flush part of a cache line is not supported and the request may be ignored
> or print warnings.
>
> Adjust the bootm code to align the end address to prevent this problem.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/common/bootm.c b/common/bootm.c
index c965326..7469c61 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -435,7 +435,7 @@  static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
 		bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE);
 		return err;
 	}
-	flush_cache(load, *load_end - load);
+	flush_cache(load, ALIGN(*load_end - load, ARCH_DMA_MINALIGN));
 
 	debug("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
 	bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);