John Su has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86394?usp=email )
Change subject: mb/google/trulo/var/uldrenite: Enable DPTF oem_variables ......................................................................
mb/google/trulo/var/uldrenite: Enable DPTF oem_variables
Support oem_variables and change based on EC notify event.
BUG=b:394177292 BRANCH=firmware-trulo-15217.771.B TEST=emerge-nissa coreboot
Change-Id: Iac18cb968906a9dfe53836432ba8dbefee1dcc8e Signed-off-by: John Su john_su@compal.corp-partner.google.com --- M src/mainboard/google/brya/variants/uldrenite/include/variant/ec.h M src/mainboard/google/brya/variants/uldrenite/overridetree.cb M src/mainboard/google/brya/variants/uldrenite/variant.c 3 files changed, 24 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/86394/1
diff --git a/src/mainboard/google/brya/variants/uldrenite/include/variant/ec.h b/src/mainboard/google/brya/variants/uldrenite/include/variant/ec.h index 7a2a6ff..818cdef 100644 --- a/src/mainboard/google/brya/variants/uldrenite/include/variant/ec.h +++ b/src/mainboard/google/brya/variants/uldrenite/include/variant/ec.h @@ -5,4 +5,7 @@
#include <baseboard/ec.h>
+/* Enable DPTF OEM variable */ +#define DPTF_ENABLE_OEM_VARIABLES + #endif diff --git a/src/mainboard/google/brya/variants/uldrenite/overridetree.cb b/src/mainboard/google/brya/variants/uldrenite/overridetree.cb index 285db4a..dc83425 100644 --- a/src/mainboard/google/brya/variants/uldrenite/overridetree.cb +++ b/src/mainboard/google/brya/variants/uldrenite/overridetree.cb @@ -236,7 +236,11 @@ [3] = { 8, 500 } }"
- device generic 0 on end + register "oem_data.oem_variables" = "{ + [0] = 0x0 + }" + + device generic 0 alias dptf_policy on end end end # DPTF device ref tcss_xhci on diff --git a/src/mainboard/google/brya/variants/uldrenite/variant.c b/src/mainboard/google/brya/variants/uldrenite/variant.c index 41ab7b8..fdc0edf 100644 --- a/src/mainboard/google/brya/variants/uldrenite/variant.c +++ b/src/mainboard/google/brya/variants/uldrenite/variant.c @@ -6,6 +6,8 @@ #include <delay.h> #include <fw_config.h> #include <sar.h> +#include <device/pci.h> +#include <drivers/intel/dptf/chip.h>
#define RW350R_RST_DELAY_MS 20 #define RW350R_PERST_DELAY_MS 30 @@ -83,3 +85,17 @@ mdelay(RW350R_PERST_DELAY_MS); gpio_configure_pads(rw350r_perst_pad, ARRAY_SIZE(rw350r_perst_pad)); } + +WEAK_DEV_PTR(dptf_policy); + +static void update_oem_variables(void) +{ + const struct device *policy_dev = DEV_PTR(dptf_policy); + struct drivers_intel_dptf_config *config = policy_dev->chip_info; + config->oem_data.oem_variables[0] = 1; +} + +void variant_devtree_update(void) +{ + update_oem_variables(); +}