diff --git a/src/mainboard/google/fizz/board.h b/src/mainboard/google/fizz/board.h new file mode 100644 index 0000000000..fe7d320364 --- /dev/null +++ b/src/mainboard/google/fizz/board.h @@ -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 diff --git a/src/mainboard/google/fizz/cfr.c b/src/mainboard/google/fizz/cfr.c index 10df17757c..99cb3fb36f 100644 --- a/src/mainboard/google/fizz/cfr.c +++ b/src/mainboard/google/fizz/cfr.c @@ -5,6 +5,37 @@ #include #include #include +#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 }, }; diff --git a/src/mainboard/google/fizz/mainboard.c b/src/mainboard/google/fizz/mainboard.c index d0e2ed86ce..06b877ecc6 100644 --- a/src/mainboard/google/fizz/mainboard.c +++ b/src/mainboard/google/fizz/mainboard.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,8 @@ #include +#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; }