So now we just need a little refactor in order to get the board-specific power limit overrides out of their SoC configuration structs from the respective chip.h files.

How about creating a new struct for this? I'm thinking something like:
struct soc_power_limits {
/* PL1 Override value in Watts */
uint32_t tdp_pl1_override;
/* PL2 Override value in Watts */
uint32_t tdp_pl2_override;
/* SysPL2 Value in Watts */
uint32_t tdp_psyspl2;
/* SysPL3 Value in Watts */
uint32_t tdp_psyspl3;
/* SysPL3 window size */
uint32_t tdp_psyspl3_time;
/* SysPL3 duty cycle */
uint32_t tdp_psyspl3_dutycycle;
/* PL4 Value in Watts */
uint32_t tdp_pl4;
/* Estimated maximum platform power in Watts */
uint16_t psys_pmax;
};

Then soc_systemagent_init() could grab the config, get this new soc_power_limits out of it, and then pass that into set_power_limits().

What do you think?

View Change

1 comment:

To view, visit change 39346. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41fd95949aa2b02828aa2d13d29b962cb579904a
Gerrit-Change-Number: 39346
Gerrit-PatchSet: 12
Gerrit-Owner: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Gerrit-Reviewer: Caveh Jalali <caveh@chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie@chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Puthikorn Voravootivat <puthik@chromium.org>
Gerrit-Reviewer: Roy Mingi Park <roy.mingi.park@intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik@intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: Venkata Krishna Nimmagadda <Venkata.krishna.nimmagadda@intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Mon, 30 Mar 2020 19:52:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment