aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/samsung/exynos5420/bootblock.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-08-13 21:05:43 -0700
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-08-07 23:05:10 +0200
commitee4bfbf3e142b17bf263f5ddb3840ed683a04635 (patch)
tree80433718c219d0f3186d57bf952782ab68ce7cfd /src/cpu/samsung/exynos5420/bootblock.c
parente10ef42a55705530f54e1f04bc25b21aeda5693a (diff)
exynos: Set up caching in the bootblock.
This improves firmware boot time substantially. Because cbmem isn't available yet, we need to allocate some space in sram for the ttb. Doing cache initialization in the bootblock means we can implement this once per CPU instead of once per mainboard. Old-Change-Id: Iad339de24df8ec2e23f91fe7bf57744e4cc766c5 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/65938 Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit c32b9b32ad933e627b9ea98434b392239b1fea73) exynos5420: flush caches and disable MMU in resume path This patch flushes the caches and disables the MMU before resuming. c32b9b3 ("Set up caching in the bootblock.") had a bug where the dcache and MMU remained enabled in the resume path. This caused the machine to hang on resume. However, other bugs were preventing us from testing this properly earlier on so it went unnoticed until now. Signed-off-by: David Hendricks <dhendrix@chromium.org> Old-Change-Id: Ib1774f09d286a4d659da9fc2dad1d7a6fc1ebe5e Reviewed-on: https://chromium-review.googlesource.com/67007 Reviewed-by: ron minnich <rminnich@chromium.org> Commit-Queue: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org> (cherry picked from commit 4fdf9763d25f70fd1e3591f6ff9785f78dd6170d) Squashed two related commits. Change-Id: Ibd42b28bb06930159248130e5ceaddb3b4b6cc2a Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6511 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/cpu/samsung/exynos5420/bootblock.c')
-rw-r--r--src/cpu/samsung/exynos5420/bootblock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cpu/samsung/exynos5420/bootblock.c b/src/cpu/samsung/exynos5420/bootblock.c
index 5cc9ef6af2..3df51a7421 100644
--- a/src/cpu/samsung/exynos5420/bootblock.c
+++ b/src/cpu/samsung/exynos5420/bootblock.c
@@ -17,10 +17,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <arch/cache.h>
+
#include "clk.h"
#include "wakeup.h"
#include "cpu.h"
+/* convenient shorthand (in MB) */
+#define SRAM_START (0x02020000 >> 20)
+#define SRAM_SIZE 1
+#define SRAM_END (SRAM_START + SRAM_SIZE) /* plus one... */
+
void bootblock_cpu_init(void);
void bootblock_cpu_init(void)
{
@@ -51,6 +58,14 @@ void bootblock_cpu_init(void)
/* Never returns. */
}
+ /* set up dcache and MMU */
+ mmu_init();
+ 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
* (ex, SPI, SD/MMC, or eMMC) now; but for Exynos platform, that is
* already handled by iROM so there's no need to setup again.