From 1a1a826276117514d7a9faf06d6ee8e1c0d099d9 Mon Sep 17 00:00:00 2001 From: Ionela Voinescu Date: Wed, 20 May 2015 17:03:23 +0100 Subject: mips: implement arch_segment_loaded callback This change adds cache management after loading stages. Before jumping to a new stage we should flush the data caches to memory and invalidate instruction cache. After all segments are loaded CBFS cache is also flushed. With this change all stages of coreboot are now executed successfully. This was tested on Pistachio bring up board, also known as Urara. Change-Id: I86e07432c21a803ef1cfc41b633c5df42b99de90 Signed-off-by: Ionela Voinescu Reviewed-on: http://review.coreboot.org/10456 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Paul Menzel --- src/arch/mips/cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/arch/mips/cache.c b/src/arch/mips/cache.c index 7d96426c9a..c7a125f8d4 100644 --- a/src/arch/mips/cache.c +++ b/src/arch/mips/cache.c @@ -20,6 +20,7 @@ #include #include #include +#include #include /* cache_op: issues cache operation for specified address */ @@ -109,3 +110,10 @@ void cache_invalidate_all(uintptr_t start, size_t size) perform_cache_operation(start, size, CACHE_CODE(DCACHE, WB_INVD)); perform_cache_operation(start, size, CACHE_CODE(L2CACHE, WB_INVD)); } + +void arch_segment_loaded(uintptr_t start, size_t size, int flags) +{ + cache_invalidate_all(start, size); + if (flags & SEG_FINAL) + cache_invalidate_all((uintptr_t)_cbfs_cache, _cbfs_cache_size); +} -- cgit v1.2.3