aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/broadwell/bootblock
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-10-26 00:27:09 +0100
committerMichael Niewöhner <foss@mniewoehner.de>2020-11-13 13:17:49 +0000
commit3bd017356a7766c4884e55a28ca481c8a9110ceb (patch)
tree3d9ebcf9af8d5cbf5c3c63b25ed3bc2800baf573 /src/soc/intel/broadwell/bootblock
parenta0426267e330c60aa74528a06a0e130efe2ad32f (diff)
soc/intel/broadwell: Relocate CPU files
Change-Id: Ib2ddce78db21db9c8deac632a77ecd71eb9887c2 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46794 Reviewed-by: Michael Niewöhner <foss@mniewoehner.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/broadwell/bootblock')
-rw-r--r--src/soc/intel/broadwell/bootblock/cpu.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/soc/intel/broadwell/bootblock/cpu.c b/src/soc/intel/broadwell/bootblock/cpu.c
deleted file mode 100644
index d6883c6436..0000000000
--- a/src/soc/intel/broadwell/bootblock/cpu.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#include <stdint.h>
-#include <arch/bootblock.h>
-#include <arch/io.h>
-#include <cpu/x86/msr.h>
-#include <halt.h>
-#include <soc/rcba.h>
-#include <soc/msr.h>
-#include <delay.h>
-
-static void set_flex_ratio_to_tdp_nominal(void)
-{
- msr_t flex_ratio, msr;
- u32 soft_reset;
- u8 nominal_ratio;
-
- /* Check for Flex Ratio support */
- flex_ratio = rdmsr(MSR_FLEX_RATIO);
- if (!(flex_ratio.lo & FLEX_RATIO_EN))
- return;
-
- /* Check for >0 configurable TDPs */
- msr = rdmsr(MSR_PLATFORM_INFO);
- if (((msr.hi >> 1) & 3) == 0)
- return;
-
- /* Use nominal TDP ratio for flex ratio */
- msr = rdmsr(MSR_CONFIG_TDP_NOMINAL);
- nominal_ratio = msr.lo & 0xff;
-
- /* See if flex ratio is already set to nominal TDP ratio */
- if (((flex_ratio.lo >> 8) & 0xff) == nominal_ratio)
- return;
-
- /* Set flex ratio to nominal TDP ratio */
- flex_ratio.lo &= ~0xff00;
- flex_ratio.lo |= nominal_ratio << 8;
- flex_ratio.lo |= FLEX_RATIO_LOCK;
- wrmsr(MSR_FLEX_RATIO, flex_ratio);
-
- /* Set flex ratio in soft reset data register bits 11:6.
- * RCBA region is enabled in southbridge bootblock */
- soft_reset = RCBA32(SOFT_RESET_DATA);
- soft_reset &= ~(0x3f << 6);
- soft_reset |= (nominal_ratio & 0x3f) << 6;
- RCBA32(SOFT_RESET_DATA) = soft_reset;
-
- /* Set soft reset control to use register value */
- RCBA32_OR(SOFT_RESET_CTRL, 1);
-
- /* Delay before reset to avoid potential TPM lockout */
- mdelay(30);
-
- /* Issue warm reset, will be "CPU only" due to soft reset data */
- outb(0x0, 0xcf9);
- outb(0x6, 0xcf9);
- halt();
-}
-
-void bootblock_early_cpu_init(void)
-{
- /* Set flex ratio and reset if needed */
- set_flex_ratio_to_tdp_nominal();
-}