From e9c28a6a7a88c8286e62764ee5ad2694da2e822f Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 21 Aug 2013 17:33:31 -0700 Subject: [PATCH] exynos5420: Make USB A-A booting work with early data cache Apparently the IROM doesn't like data caches... the recently added dcache-in-bootblock makes A-A booting fail, and flushes/invalidations alone don't seem to fix it. It's pretty fast anyway, so we just disable the cache again for the duration of the IROM call. Also removes a superfluous invalidation line from the bootblock code... dcache_mmu_enable/disable already take care of that. BUG=chrome-os-partner:18733 TEST=cros_write_firmware -i -b peach_pit (with CL:65276) Change-Id: I35580d15664c7b4197d4ed14028720147adbf918 Signed-off-by: Julius Werner Reviewed-on: https://gerrit.chromium.org/gerrit/66602 Reviewed-by: Gabe Black Reviewed-by: David Hendricks --- src/cpu/samsung/exynos5420/alternate_cbfs.c | 4 ++++ src/cpu/samsung/exynos5420/bootblock.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/samsung/exynos5420/alternate_cbfs.c b/src/cpu/samsung/exynos5420/alternate_cbfs.c index 49c9d4c194..3b50b66a00 100644 --- a/src/cpu/samsung/exynos5420/alternate_cbfs.c +++ b/src/cpu/samsung/exynos5420/alternate_cbfs.c @@ -22,6 +22,7 @@ #include /* This driver serves as a CBFS media source. */ #include #include +#include #include #include "alternate_cbfs.h" #include "spi.h" @@ -52,10 +53,13 @@ static int usb_cbfs_open(struct cbfs_media *media) if (!first_run) return 0; + dcache_mmu_disable(); if (!irom_load_usb()) { + dcache_mmu_enable(); printk(BIOS_ERR, "Unable to load CBFS image via USB!\n"); return -1; } + dcache_mmu_enable(); /* * We need to trust the host/irom to copy the image to our diff --git a/src/cpu/samsung/exynos5420/bootblock.c b/src/cpu/samsung/exynos5420/bootblock.c index 3df51a7421..1ad75ef493 100644 --- a/src/cpu/samsung/exynos5420/bootblock.c +++ b/src/cpu/samsung/exynos5420/bootblock.c @@ -63,7 +63,6 @@ void bootblock_cpu_init(void) mmu_config_range(0, SRAM_START, DCACHE_OFF); mmu_config_range(SRAM_START, SRAM_SIZE, DCACHE_WRITEBACK); mmu_config_range(SRAM_END, 4096 - SRAM_END, DCACHE_OFF); - dcache_invalidate_all(); dcache_mmu_enable(); /* For most ARM systems, we have to initialize firmware media source