Hello Seunghwan Kim,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/35533
to review the following change.
Change subject: mb/google/hatch: Support separate fixed PL1 setting for tablet mode ......................................................................
mb/google/hatch: Support separate fixed PL1 setting for tablet mode
Some variants need separate PL1 setting since thier thermal tuning, but DPTF passive policy 1.0 cannot support it.
So we would use MMIO PL1 register which is currently unused, it can reserve another PL1 setting for tablet mode.
If the MMIO PL1 setting is lower than DPTF PL1 max setting, it will limit PL1 when DPTF sets higher PL1 in tablet mode. Otherwise, if the MMIO PL1 setting is lower than DPTF PL1 min setting, system will have a fixed PL1 value in tablet mode.
BUG=b:138395625 BRANCH=none TEST=Verified MMIO PL1 value and it's enabled in tablet mode when it set
Change-Id: I81c33f9df3e5431f04a08395141b5dc989474289 Signed-off-by: Seunghwan Kim sh_.kim@samsung.com --- M src/ec/google/chromeec/acpi/ec.asl M src/mainboard/google/hatch/mainboard.asl M src/mainboard/google/hatch/variants/kohaku/include/variant/ec.h M src/soc/intel/cannonlake/chip.h M src/soc/intel/cannonlake/cpu.c 5 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35533/1
diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl index 962988e..0c4cc35 100644 --- a/src/ec/google/chromeec/acpi/ec.asl +++ b/src/ec/google/chromeec/acpi/ec.asl @@ -378,6 +378,9 @@ #ifdef EC_ENABLE_TBMC_DEVICE Notify (TBMC, 0x80) #endif +#ifdef EC_ENABLE_MAINBOERD_TABLET_MODE_EVENT + _SB.MTME(^TBMD) +#endif }
/* diff --git a/src/mainboard/google/hatch/mainboard.asl b/src/mainboard/google/hatch/mainboard.asl index dff1a75..769d429 100644 --- a/src/mainboard/google/hatch/mainboard.asl +++ b/src/mainboard/google/hatch/mainboard.asl @@ -55,3 +55,22 @@ LOCL (0) } } + +/* + * Additional action for tablet mode switch event + * Called from _SB.PCI0.LPCB.EC0._Q1D + */ +Method (MTME, 1, Serialized) +{ + OperationRegion (MCHB, + SystemMemory, Add (_SB.PCI0.GMHB(), 0x5000), 0x1000) + Field (MCHB, DWordAcc, Lock, Preserve) + { + Offset (0x9a0), /* PKG_POWER_LIMIT_LO */ + , 15, /* PKG_POWER_LIMIT_MASK */ + MP1E, 1, /* PKG_POWER_LIMIT_EN */ + } + + /* Enable MMIO PL1 at tablet mode */ + Store(Arg0, MP1E) +} diff --git a/src/mainboard/google/hatch/variants/kohaku/include/variant/ec.h b/src/mainboard/google/hatch/variants/kohaku/include/variant/ec.h index 84e050e..7cc5269 100644 --- a/src/mainboard/google/hatch/variants/kohaku/include/variant/ec.h +++ b/src/mainboard/google/hatch/variants/kohaku/include/variant/ec.h @@ -19,5 +19,6 @@ #include <baseboard/ec.h>
#define EC_ENABLE_MULTIPLE_DPTF_PROFILES +#define EC_ENABLE_MAINBOERD_TABLET_MODE_EVENT
#endif diff --git a/src/soc/intel/cannonlake/chip.h b/src/soc/intel/cannonlake/chip.h index 451c920..df6be35 100644 --- a/src/soc/intel/cannonlake/chip.h +++ b/src/soc/intel/cannonlake/chip.h @@ -232,6 +232,8 @@
/* PL1 Override value in Watts */ uint32_t tdp_pl1_override; + /* PL1 MMIO Override value in Watts */ + uint32_t mmio_pl1_override; /* PL2 Override value in Watts */ uint32_t tdp_pl2_override; /* SysPL2 Value in Watts */ diff --git a/src/soc/intel/cannonlake/cpu.c b/src/soc/intel/cannonlake/cpu.c index 0f4d52e..4ec45e5 100644 --- a/src/soc/intel/cannonlake/cpu.c +++ b/src/soc/intel/cannonlake/cpu.c @@ -160,6 +160,13 @@ limit.hi |= PKG_POWER_LIMIT_CLAMP; limit.hi |= PKG_POWER_LIMIT_EN;
+ /* Set PL1 MMIO override value */ + if (conf->mmio_pl1_override) { + tdp_pl1 = (conf->mmio_pl1_override * power_unit); + limit.lo &= (~(PKG_POWER_LIMIT_MASK)); + limit.lo |= tdp_pl1 & PKG_POWER_LIMIT_MASK; + } + /* Power limit 2 time is only programmable on server SKU */ wrmsr(MSR_PKG_POWER_LIMIT, limit);