Srinidhi N Kaushik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
soc/intel/tigerlake: Update Cpu Ratio settings
Add config to override CpuRatio or setting CpuRatio to allowed maximum processor non-turbo ratio.
BUG=151175469 BRANCH=none TEST=Build and boot tglrvp and observe there is no extra reset in meminit.
Signed-off-by: Srinidhi N Kaushik srinidhi.n.kaushik@intel.com Change-Id: I2fa883b443d0a4c77d62275faeacd1ed2c67a97c --- M src/soc/intel/tigerlake/chip.h M src/soc/intel/tigerlake/romstage/fsp_params_tgl.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/39493/1
diff --git a/src/soc/intel/tigerlake/chip.h b/src/soc/intel/tigerlake/chip.h index 9fc70f8..8d593dc 100644 --- a/src/soc/intel/tigerlake/chip.h +++ b/src/soc/intel/tigerlake/chip.h @@ -285,6 +285,18 @@ * This mode makes FSP detect Optane and NVME and set PCIe lane mode * accordingly */ uint8_t HybridStorageMode; + + /* + * Override CPU flex ratio value: + * CPU ratio value controls the maximum processor non-turbo ratio. + * Valid Range 0 to 63. + * In general descriptor provides option to set default cpu flex ratio. + * Default cpu flex ratio 0 ensures booting with non-turbo max frequency. + * Thats the reason FSP skips cpu_ratio override if cpu_ratio is 0. + * Only override CPU flex ratio to not boot with non-turbo max. + */ + uint8_t cpu_ratio_override; + };
typedef struct soc_intel_tigerlake_config config_t; diff --git a/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c b/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c index 072c99e..bfaffd2 100644 --- a/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c +++ b/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c @@ -14,10 +14,12 @@ */
#include <assert.h> +#include <cpu/x86/msr.h> #include <console/console.h> #include <fsp/util.h> #include <soc/gpio_soc_defs.h> #include <soc/iomap.h> +#include <soc/msr.h> #include <soc/pci_devs.h> #include <soc/romstage.h> #include <soc/soc_chip.h> @@ -38,6 +40,16 @@ m_cfg->UserBd = BOARD_TYPE_ULT_ULX; m_cfg->RMT = config->RMT;
+ /* CpuRatio Settings */ + if (config->cpu_ratio_override) { + m_cfg->CpuRatio = config->cpu_ratio_override; + } else { + /* Set CpuRatio to match existing MSR value */ + msr_t flex_ratio; + flex_ratio = rdmsr(MSR_FLEX_RATIO); + m_cfg->CpuRatio = (flex_ratio.lo >> 8) & 0xff; + } + for (i = 0; i < ARRAY_SIZE(config->PcieRpEnable); i++) { if (config->PcieRpEnable[i]) mask |= (1 << i);
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39493/1/src/soc/intel/tigerlake/chi... File src/soc/intel/tigerlake/chip.h:
https://review.coreboot.org/c/coreboot/+/39493/1/src/soc/intel/tigerlake/chi... PS1, Line 295: * Thats the reason FSP skips cpu_ratio override if cpu_ratio is 0. 'Thats' may be misspelled - perhaps 'That's'?
Hello Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39493
to look at the new patch set (#2).
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
soc/intel/tigerlake: Update Cpu Ratio settings
Add config to override CpuRatio or setting CpuRatio to allowed maximum processor non-turbo ratio.
BUG=151175469 BRANCH=none TEST=Build and boot tglrvp and observe there is no extra reset in meminit.
Signed-off-by: Srinidhi N Kaushik srinidhi.n.kaushik@intel.com Change-Id: I2fa883b443d0a4c77d62275faeacd1ed2c67a97c --- M src/soc/intel/tigerlake/chip.h M src/soc/intel/tigerlake/romstage/fsp_params_tgl.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/39493/2
Srinidhi N Kaushik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 2: Code-Review+1
Caveh Jalali has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 2: Code-Review+1
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39493/2/src/soc/intel/tigerlake/rom... File src/soc/intel/tigerlake/romstage/fsp_params_tgl.c:
https://review.coreboot.org/c/coreboot/+/39493/2/src/soc/intel/tigerlake/rom... PS2, Line 17: cpu Please put in alphabetical order
Hello build bot (Jenkins), Shaunak Saha, Patrick Georgi, Furquan Shaikh, Wonkyu Kim, Caveh Jalali, Nick Vaccaro, Raj Astekar, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39493
to look at the new patch set (#3).
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
soc/intel/tigerlake: Update Cpu Ratio settings
Add config to override CpuRatio or setting CpuRatio to allowed maximum processor non-turbo ratio.
BUG=151175469 BRANCH=none TEST=Build and boot tglrvp and observe there is no extra reset in meminit.
Signed-off-by: Srinidhi N Kaushik srinidhi.n.kaushik@intel.com Change-Id: I2fa883b443d0a4c77d62275faeacd1ed2c67a97c --- M src/soc/intel/tigerlake/chip.h M src/soc/intel/tigerlake/romstage/fsp_params_tgl.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/39493/3
Srinidhi N Kaushik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 3: Code-Review+1
Wonkyu Kim has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 3: Code-Review+2
Srinidhi N Kaushik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 3:
(1 comment)
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39493/2/src/soc/intel/tigerlake/rom... File src/soc/intel/tigerlake/romstage/fsp_params_tgl.c:
https://review.coreboot.org/c/coreboot/+/39493/2/src/soc/intel/tigerlake/rom... PS2, Line 17: cpu
Please put in alphabetical order
Done
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 3: Code-Review+2
Caveh Jalali has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
Patch Set 3: Code-Review+1
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39493 )
Change subject: soc/intel/tigerlake: Update Cpu Ratio settings ......................................................................
soc/intel/tigerlake: Update Cpu Ratio settings
Add config to override CpuRatio or setting CpuRatio to allowed maximum processor non-turbo ratio.
BUG=151175469 BRANCH=none TEST=Build and boot tglrvp and observe there is no extra reset in meminit.
Signed-off-by: Srinidhi N Kaushik srinidhi.n.kaushik@intel.com Change-Id: I2fa883b443d0a4c77d62275faeacd1ed2c67a97c Reviewed-on: https://review.coreboot.org/c/coreboot/+/39493 Reviewed-by: Wonkyu Kim wonkyu.kim@intel.com Reviewed-by: Nick Vaccaro nvaccaro@google.com Reviewed-by: Caveh Jalali caveh@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/intel/tigerlake/chip.h M src/soc/intel/tigerlake/romstage/fsp_params_tgl.c 2 files changed, 24 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nick Vaccaro: Looks good to me, approved Srinidhi N Kaushik: Looks good to me, but someone else must approve Caveh Jalali: Looks good to me, but someone else must approve Wonkyu Kim: Looks good to me, approved
diff --git a/src/soc/intel/tigerlake/chip.h b/src/soc/intel/tigerlake/chip.h index 9fc70f8..5e010bd 100644 --- a/src/soc/intel/tigerlake/chip.h +++ b/src/soc/intel/tigerlake/chip.h @@ -285,6 +285,18 @@ * This mode makes FSP detect Optane and NVME and set PCIe lane mode * accordingly */ uint8_t HybridStorageMode; + + /* + * Override CPU flex ratio value: + * CPU ratio value controls the maximum processor non-turbo ratio. + * Valid Range 0 to 63. + * In general descriptor provides option to set default cpu flex ratio. + * Default cpu flex ratio 0 ensures booting with non-turbo max frequency. + * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0. + * Only override CPU flex ratio to not boot with non-turbo max. + */ + uint8_t cpu_ratio_override; + };
typedef struct soc_intel_tigerlake_config config_t; diff --git a/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c b/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c index 3872b61..c5629a5 100644 --- a/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c +++ b/src/soc/intel/tigerlake/romstage/fsp_params_tgl.c @@ -15,9 +15,11 @@
#include <assert.h> #include <console/console.h> +#include <cpu/x86/msr.h> #include <fsp/util.h> #include <soc/gpio_soc_defs.h> #include <soc/iomap.h> +#include <soc/msr.h> #include <soc/pci_devs.h> #include <soc/romstage.h> #include <soc/soc_chip.h> @@ -38,6 +40,16 @@ m_cfg->UserBd = BOARD_TYPE_ULT_ULX; m_cfg->RMT = config->RMT;
+ /* CpuRatio Settings */ + if (config->cpu_ratio_override) { + m_cfg->CpuRatio = config->cpu_ratio_override; + } else { + /* Set CpuRatio to match existing MSR value */ + msr_t flex_ratio; + flex_ratio = rdmsr(MSR_FLEX_RATIO); + m_cfg->CpuRatio = (flex_ratio.lo >> 8) & 0xff; + } + for (i = 0; i < ARRAY_SIZE(config->PcieRpEnable); i++) { if (config->PcieRpEnable[i]) mask |= (1 << i);