| 1 |
|
| 2 |
|
| 3 |
#include <baseboard/variants.h> |
| 4 |
#include <chip.h> |
| 5 |
#include <ec/google/chromeec/ec.h> |
| 6 |
#include <fw_config.h> |
| 7 |
#include <sar.h> |
| 8 |
|
| 9 |
const char *get_wifi_sar_cbfs_filename(void) |
| 10 |
{ |
| 11 |
return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_SAR_ID)); |
| 12 |
} |
| 13 |
|
| 14 |
void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config) |
| 15 |
{ |
| 16 |
if (fw_config_probe(FW_CONFIG(AUDIO, ALC1019_ALC5682I_I2S))) |
| 17 |
config->cnvi_bt_audio_offload = true; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
if (fw_config_probe(FW_CONFIG(MB_CONFIG, MB_TYPEC))) { |
| 28 |
config->typec_aux_bias_pads[1].pad_auxp_dc = GPP_C16; |
| 29 |
config->typec_aux_bias_pads[1].pad_auxn_dc = GPP_C17; |
| 30 |
config->tcss_aux_ori = 0x04; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
const struct cpu_tdp_power_limits variant_perf_efficient_limits[] = { |
| 35 |
{ |
| 36 |
.mch_id = PCI_DID_INTEL_MTL_P_ID_2, |
| 37 |
.cpu_tdp = 15, |
| 38 |
.power_limits_index = MTL_P_282_242_CORE, |
| 39 |
.pl1_min_power = 10000, |
| 40 |
.pl1_max_power = 15000, |
| 41 |
.pl2_min_power = 40000, |
| 42 |
.pl2_max_power = 40000, |
| 43 |
.pl4_power = 84000 |
| 44 |
}, |
| 45 |
{ |
| 46 |
.mch_id = PCI_DID_INTEL_MTL_P_ID_5, |
| 47 |
.cpu_tdp = 15, |
| 48 |
.power_limits_index = MTL_P_282_242_CORE, |
| 49 |
.pl1_min_power = 10000, |
| 50 |
.pl1_max_power = 15000, |
| 51 |
.pl2_min_power = 40000, |
| 52 |
.pl2_max_power = 40000, |
| 53 |
.pl4_power = 84000 |
| 54 |
}, |
| 55 |
}; |
| 56 |
|
| 57 |
const struct cpu_tdp_power_limits variant_power_efficient_limits[] = { |
| 58 |
{ |
| 59 |
.mch_id = PCI_DID_INTEL_MTL_P_ID_2, |
| 60 |
.cpu_tdp = 15, |
| 61 |
.pl1_min_power = 10000, |
| 62 |
.pl1_max_power = 15000, |
| 63 |
.pl2_min_power = 40000, |
| 64 |
.pl2_max_power = 40000, |
| 65 |
.pl4_power = 47000 |
| 66 |
}, |
| 67 |
{ |
| 68 |
.mch_id = PCI_DID_INTEL_MTL_P_ID_5, |
| 69 |
.cpu_tdp = 15, |
| 70 |
.pl1_min_power = 10000, |
| 71 |
.pl1_max_power = 15000, |
| 72 |
.pl2_min_power = 40000, |
| 73 |
.pl2_max_power = 40000, |
| 74 |
.pl4_power = 47000 |
| 75 |
}, |
| 76 |
}; |
| 77 |
|
| 78 |
void variant_devtree_update(void) |
| 79 |
{ |
| 80 |
const struct cpu_tdp_power_limits *limits = variant_perf_efficient_limits; |
| 81 |
size_t limits_size = ARRAY_SIZE(variant_perf_efficient_limits); |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
if (CONFIG(EC_GOOGLE_CHROMEEC)) { |
| 89 |
if (!google_chromeec_is_battery_present_and_above_critical_threshold()) { |
| 90 |
limits = variant_power_efficient_limits; |
| 91 |
limits_size = ARRAY_SIZE(variant_power_efficient_limits); |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
variant_update_cpu_power_limits(limits, limits_size); |
| 96 |
} |