coreboot-kgpe-d16/src/soc/intel/apollolake/car.c
Aaron Durbin faa74b0fb8 soc/intel/apollolake: use platform_segment_loaded() for CAR coherency
Instead of using arch_segment_loaded() implement
platform_segment_loaded() so as not to tangle the notion of
arch and the chipset. Lastly, add a TODO to allow filtering
of the L1D to L2 flush depending on the region loaded.

Change-Id: I52e7cd2ae6e2d95f21bdd2fe1a471a10565309cb
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/14215
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Andrey Petrov <andrey.petrov@intel.com>
2016-04-02 03:57:37 +02:00

36 lines
964 B
C

/*
* This file is part of the coreboot project.
*
* Copyright (C) 2016 Intel Corp.
* Copyright 2016 Google Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include <arch/cpu.h>
#include <program_loading.h>
#include <soc/cpu.h>
/*
* This file supports the necessary hoops one needs to jump through since
* early FSP component and early stages are running from cache-as-ram.
*/
static void flush_l1d_to_l2(void)
{
msr_t msr = rdmsr(MSR_POWER_MISC);
msr.lo |= (1 << 8);
wrmsr(MSR_POWER_MISC, msr);
}
void platform_segment_loaded(uintptr_t start, size_t size, int flags)
{
/* TODO: filter on address to see if L1D flushing required. */
/* Flush L1D cache to L2 on final segment loaded */
if (flags & SEG_FINAL)
flush_l1d_to_l2();
}