blob: f42eb323089994156494f0a99b25bf5ae2e1e33f [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Simon Glass50dd3da2016-03-11 22:06:58 -07002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glass50dd3da2016-03-11 22:06:58 -07004 */
5
6#ifndef __ASM_CPU_COMMON_H
7#define __ASM_CPU_COMMON_H
8
Simon Glass55a6b132019-09-25 08:56:37 -06009/* Standard Intel bus clock is fixed at 100MHz */
10enum {
11 INTEL_BCLK_MHZ = 100
12};
13
Simon Glassd3abc5d2019-09-25 08:11:35 -060014struct cpu_info;
15
Simon Glass50dd3da2016-03-11 22:06:58 -070016/**
17 * cpu_common_init() - Set up common CPU init
18 *
19 * This reports BIST failure, enables the LAPIC, updates microcode, enables
20 * the upper 128-bytes of CROM RAM, probes the northbridge, PCH, LPC and SATA.
21 *
22 * @return 0 if OK, -ve on error
23 */
24int cpu_common_init(void);
25
26/**
27 * cpu_set_flex_ratio_to_tdp_nominal() - Set up the maximum non-turbo rate
28 *
29 * If a change is needed, this function will do a soft reset so it takes
30 * effect.
31 *
32 * Some details are available here:
33 * http://forum.hwbot.org/showthread.php?t=76092
34 *
35 * @return 0 if OK, -ve on error
36 */
37int cpu_set_flex_ratio_to_tdp_nominal(void);
38
Simon Glassd3abc5d2019-09-25 08:11:35 -060039/**
40 * cpu_intel_get_info() - Obtain CPU info for Intel CPUs
41 *
42 * Most Intel CPUs use the same MSR to obtain the clock speed, and use the same
43 * features. This function fills in these values, given the value of the base
44 * clock in MHz (typically this should be set to 100).
45 *
46 * @info: cpu_info struct to fill in
47 * @bclk_mz: the base clock in MHz
48 *
49 * @return 0 always
50 */
51int cpu_intel_get_info(struct cpu_info *info, int bclk_mz);
52
Simon Glass246ac082019-09-25 08:56:36 -060053/**
54 * cpu_configure_thermal_target() - Set the thermal target for a CPU
55 *
56 * This looks up the tcc-offset property and uses it to set the
57 * MSR_TEMPERATURE_TARGET value.
58 *
59 * @dev: CPU device
60 * @return 0 if OK, -ENOENT if no target is given in device tree
61 */
62int cpu_configure_thermal_target(struct udevice *dev);
63
Simon Glass50dd3da2016-03-11 22:06:58 -070064#endif