From 5be350b9fbaa9c49b25a482199bdd3d8fadc91e3 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 31 Mar 2016 13:26:46 -0500 Subject: soc/intel/apollolake: use arch_segment_loaded() for CAR code coherency Instead of using platform_prog_run() for flushing programs from L1D to L2 for code coherency purposes use arch_segment_loaded() instead as that it's primary purpose. The arch_segment_loaded() is called within the infrastructure at the appropriate places when loading programs. Therefore use that to perform the L1D flush instead of when something is just about to run. Change-Id: Ib0a6be6f676dcf2c946ef5702471af65d89133e9 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/14212 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Andrey Petrov --- src/soc/intel/apollolake/car.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/soc') diff --git a/src/soc/intel/apollolake/car.c b/src/soc/intel/apollolake/car.c index 7646865ca2..c49d7ef187 100644 --- a/src/soc/intel/apollolake/car.c +++ b/src/soc/intel/apollolake/car.c @@ -26,8 +26,9 @@ static void flush_l1d_to_l2(void) wrmsr(MSR_POWER_MISC, msr); } -void platform_prog_run(struct prog *prog) +void arch_segment_loaded(uintptr_t start, size_t size, int flags) { - /* Flush L1D cache to L2 */ - flush_l1d_to_l2(); + /* Flush L1D cache to L2 on final segment loaded */ + if (flags & SEG_FINAL) + flush_l1d_to_l2(); } -- cgit v1.2.3