aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya/variants/baseboard/include
diff options
context:
space:
mode:
authorAlan Huang <alan-huang@quanta.corp-partner.google.com>2021-10-12 16:34:52 +0800
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-12-02 21:00:00 +0000
commitb974dd96b6bcefb21435c0afe19f8184aff2c74f (patch)
treedba3bad51507e58598324465475101f8f87ef77d /src/mainboard/google/brya/variants/baseboard/include
parent44577683008010b4470c42bf7c10ba9d92780f30 (diff)
mb/google/brya/var/baseboard/brask: Add power limits functions
Copy function variant_update_power_limits from brya to set power limits. Add function variant_update_psys_power_limits and copy the algorithm from puff. Add structure system_power_limits and psys_config to define and configure the psys power limits. BUG=b:193864533 BRANCH=none TEST=Build pass Signed-off-by: Alan Huang <alan-huang@quanta.corp-partner.google.com> Change-Id: I183017068e9c78acb9fa7073c53593d304ba9248 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58241 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/brya/variants/baseboard/include')
-rw-r--r--src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
index 3e0fd05105..b3a10e0a64 100644
--- a/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/brya/variants/baseboard/include/baseboard/variants.h
@@ -37,8 +37,40 @@ struct cpu_power_limits {
unsigned int pl4_power;
};
+struct system_power_limits {
+ uint16_t mchid;
+ u8 cpu_tdp;
+ /* PsysPL2 in Watts */
+ unsigned int psys_pl2_power;
+};
+
+struct psys_config {
+ /*
+ * The efficiency of type-c chargers
+ * For example, 'efficiency = 97' means setting 97% of max power to account for
+ * cable loss and FET Rdson loss in the path from the source.
+ */
+ unsigned int efficiency;
+
+ /* The maximum current maps to the Psys signal */
+ unsigned int psys_imax_ma;
+
+ /* The voltage of barrel jack */
+ unsigned int bj_volts_mv;
+};
+
/* Modify Power Limit devictree settings during ramstage */
void variant_update_power_limits(const struct cpu_power_limits *limits,
size_t num_entries);
+
+/*
+ * Modify Power Limit and PsysPL devictree settings during ramstage.
+ * Note, this function must be called in front of calling variant_update_power_limits.
+ */
+void variant_update_psys_power_limits(const struct cpu_power_limits *limits,
+ const struct system_power_limits *sys_limits,
+ size_t num_entries,
+ const struct psys_config *config);
+
#endif /*__BASEBOARD_VARIANTS_H__ */