mb/google/fizz: Add CFR PL1/PL2 package power overrides
Expose PL1 and PL2 overrides in the Power CFR form, allowing users to adjust the values within safe limits. Expose CFR option to lock the programmed values. TEST=build/boot Fizz, verify adjusted values reflected in cbmem log, MSR 0x610, and MCHBAR registers. Change-Id: Iab7b2cdf815cadfbc93e1d8395380706243ec203 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91847 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
6c10b07146
commit
0d95bb5158
3 changed files with 46 additions and 1 deletions
8
src/mainboard/google/fizz/board.h
Normal file
8
src/mainboard/google/fizz/board.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef MAINBOARD_GOOGLE_FIZZ_BOARD_H
|
||||
#define MAINBOARD_GOOGLE_FIZZ_BOARD_H
|
||||
|
||||
unsigned int fizz_default_pl2_watts(void);
|
||||
|
||||
#endif
|
||||
|
|
@ -5,6 +5,37 @@
|
|||
#include <ec/google/chromeec/cfr.h>
|
||||
#include <intelblocks/cfr.h>
|
||||
#include <soc/cfr.h>
|
||||
#include "board.h"
|
||||
|
||||
static const struct sm_object tdp_pl1_override = SM_DECLARE_NUMBER({
|
||||
.opt_name = "tdp_pl1_override",
|
||||
.ui_name = "CPU PL1 power limit (W)",
|
||||
.ui_helptext = "Long-duration CPU package power limit.\n"
|
||||
"Default: 15 W. Range: 15-35 W.",
|
||||
.default_value = 15,
|
||||
.min = 15,
|
||||
.max = 35,
|
||||
.step = 1,
|
||||
.display_flags = 0,
|
||||
});
|
||||
|
||||
static void update_tdp_pl2_default(struct sm_object *new)
|
||||
{
|
||||
new->sm_number.default_value = fizz_default_pl2_watts();
|
||||
}
|
||||
|
||||
static const struct sm_object tdp_pl2_override = SM_DECLARE_NUMBER({
|
||||
.opt_name = "tdp_pl2_override",
|
||||
.ui_name = "CPU PL2 power limit (W)",
|
||||
.ui_helptext = "Short-duration CPU package power limit.\n"
|
||||
"Default: 29 W (U22 SKUs) or 44 W (U42 SKUs). Range: 29-51 W.\n"
|
||||
"Must be >= PL1 (enforced at boot).",
|
||||
.default_value = 29,
|
||||
.min = 29,
|
||||
.max = 51,
|
||||
.step = 1,
|
||||
.display_flags = 0,
|
||||
}, WITH_CALLBACK(update_tdp_pl2_default));
|
||||
|
||||
static struct sm_obj_form system = {
|
||||
.ui_name = "System",
|
||||
|
|
@ -37,6 +68,9 @@ static struct sm_obj_form power = {
|
|||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&power_on_after_fail,
|
||||
&tdp_pl1_override,
|
||||
&tdp_pl2_override,
|
||||
&pkg_power_limit_lock,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <ec/google/chromeec/ec.h>
|
||||
#include <gpio.h>
|
||||
#include <intelblocks/power_limit.h>
|
||||
#include <option.h>
|
||||
#include <smbios.h>
|
||||
#include <soc/pci_devs.h>
|
||||
#include <soc/nhlt.h>
|
||||
|
|
@ -20,6 +21,8 @@
|
|||
|
||||
#include <variant/gpio.h>
|
||||
|
||||
#include "board.h"
|
||||
|
||||
#define FIZZ_SKU_ID_I7_U42 0x4
|
||||
#define FIZZ_SKU_ID_I5_U42 0x5
|
||||
#define FIZZ_SKU_ID_I3_U42 0x6
|
||||
|
|
@ -77,7 +80,7 @@ static bool is_u42_sku(void)
|
|||
sku == FIZZ_SKU_ID_I3_U42;
|
||||
}
|
||||
|
||||
static unsigned int fizz_default_pl2_watts(void)
|
||||
unsigned int fizz_default_pl2_watts(void)
|
||||
{
|
||||
return is_u42_sku() ? FIZZ_PL2_U42 : FIZZ_PL2_U22;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue