aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/root_complex.c
diff options
context:
space:
mode:
authorTim Van Patten <timvp@google.com>2022-08-23 16:06:33 -0600
committerFelix Held <felix-coreboot@felixheld.de>2022-09-12 12:21:01 +0000
commit9244358536aaecff29453b1693fdf202091878ef (patch)
tree4b8136239b03292ffb6d6171af19ca3343a36acf /src/soc/amd/picasso/root_complex.c
parent14bed61ba160093003613fc210b3e6b7af15d964 (diff)
soc/amd: Refactor DPTC Tablet Mode
Refactor AMD DPTC tablet mode in preparation for adding low/no battery DPTC settings. 1. Refactor and simplify acpigen_write_alib_dptc() into the following functions: - acpigen_write_alib_dptc_default() - acpigen_write_alib_dptc_tablet() 2. Add device tree register value dptc_tablet_mode_enable to control whether DPTC tablet mode is enabled for a variant. 3. Add dptc.asl to perform the necessary ACPI checking before modifying the DPTC settings. BRANCH=none BUG=b:217911928 TEST=Build zork TEST=Build nipperkin TEST=Boot skyrim Change-Id: I2518fdd526868c9d5668a6018fd3570392e809c0 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66994 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/soc/amd/picasso/root_complex.c')
-rw-r--r--src/soc/amd/picasso/root_complex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c
index ccf1c45fcd..afa8565515 100644
--- a/src/soc/amd/picasso/root_complex.c
+++ b/src/soc/amd/picasso/root_complex.c
@@ -184,21 +184,24 @@ static void acipgen_dptci(void)
{
const struct soc_amd_picasso_config *config = config_of_soc();
- if (!config->dptc_enable)
+ if (!config->dptc_tablet_mode_enable)
return;
+ /* DPTC is enabled. Always fill out the default DPTC values. */
struct dptc_input default_input = DPTC_INPUTS(config->thermctl_limit_degreeC,
config->sustained_power_limit_mW,
config->fast_ppt_limit_mW,
config->slow_ppt_limit_mW);
+ acpigen_write_alib_dptc_default((uint8_t *)&default_input, sizeof(default_input));
+
+ /* Tablet Mode */
struct dptc_input tablet_mode_input = DPTC_INPUTS(
config->thermctl_limit_tablet_mode_degreeC,
config->sustained_power_limit_tablet_mode_mW,
config->fast_ppt_limit_tablet_mode_mW,
config->slow_ppt_limit_tablet_mode_mW);
-
- acpigen_write_alib_dptc((uint8_t *)&default_input, sizeof(default_input),
- (uint8_t *)&tablet_mode_input, sizeof(tablet_mode_input));
+ acpigen_write_alib_dptc_tablet((uint8_t *)&tablet_mode_input,
+ sizeof(tablet_mode_input));
}
static void root_complex_fill_ssdt(const struct device *device)