mb/google/nissa/var/rull: add ssd timing and modify ssd GPIO pins of rtd3
[coreboot2.git] / src / mainboard / hp / pro_3500_series / mainboard.c
bloba3b7504e7f2ddd5c029ae44127adeeec39d3ffb8
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <cpu/intel/model_206ax/model_206ax.h>
4 #include <cpu/x86/msr.h>
5 #include <device/device.h>
6 #include <static_devices.h>
7 #include <superio/ite/it8772f/chip.h>
9 static u8 cpu_get_temp_offset(void)
11 msr_t msr = rdmsr(MSR_TEMPERATURE_TARGET);
12 u8 tj_max = (msr.lo >> 16) & 0xFF;
13 u8 tcc_offset = (msr.lo >> 24) & 0xf;
15 msr = rdmsr(MSR_PLATFORM_INFO);
16 if (msr.lo & (1 << 30)) {
17 return tj_max - tcc_offset;
18 } else {
19 return tj_max;
23 static void mainboard_enable(struct device *dev)
25 /* Set PECI TMPIN 3 offset to TJ_MAX temperature */
26 struct superio_ite_it8772f_config *const config = __pnp_002e_04->chip_info;
27 if (config)
28 config->ec.tmpin[2].offset = cpu_get_temp_offset();
31 struct chip_operations mainboard_ops = {
32 .enable_dev = mainboard_enable,