Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/59271 )
Change subject: soc/intel/alderlake: Hook up common code for thermal configuration
......................................................................
soc/intel/alderlake: Hook up common code for thermal configuration
Thermal configuration registers are now located behind PMC PWRMBASE
for Alder Lake Point PCH. Hence, ADL SoC to select
SOC_INTEL_COMMON_BLOCK_THERMAL_BEHIND_PMC to let thermal low threshold
is being set as per mainboard provided `pch_thermal_trip`.
Note: These thermal configuration registers are RW/O hence, setting
those early prior to FSP-S helps coreboot to set the desired low
thermal threshold for the platform.
BUG=b:193774296
TEST=Dump thermal configuration registers PWRMBASE+0x150c etc. prior
to FSP-S shows that registers are now programmed based on
'pch_thermal_trip' and lock register BIT31 is set.
Change-Id: I0f972f47845c123f4f74fd75091c9703d54db796
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59271
Reviewed-by: Felix Singer <felixsinger(a)posteo.net>
Reviewed-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M src/soc/intel/alderlake/Kconfig
M src/soc/intel/alderlake/romstage/romstage.c
2 files changed, 12 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Felix Singer: Looks good to me, but someone else must approve
Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/soc/intel/alderlake/Kconfig b/src/soc/intel/alderlake/Kconfig
index 58b9051..2cbff00 100644
--- a/src/soc/intel/alderlake/Kconfig
+++ b/src/soc/intel/alderlake/Kconfig
@@ -68,6 +68,7 @@
select SOC_INTEL_COMMON_BLOCK_SMM
select SOC_INTEL_COMMON_BLOCK_SMM_IO_TRAP
select SOC_INTEL_COMMON_BLOCK_TCSS
+ select SOC_INTEL_COMMON_BLOCK_THERMAL_BEHIND_PMC
select SOC_INTEL_COMMON_BLOCK_USB4
select SOC_INTEL_COMMON_BLOCK_USB4_PCIE
select SOC_INTEL_COMMON_BLOCK_USB4_XHCI
diff --git a/src/soc/intel/alderlake/romstage/romstage.c b/src/soc/intel/alderlake/romstage/romstage.c
index d7ef14d..e84eca8 100644
--- a/src/soc/intel/alderlake/romstage/romstage.c
+++ b/src/soc/intel/alderlake/romstage/romstage.c
@@ -8,6 +8,7 @@
#include <intelblocks/cse.h>
#include <intelblocks/pmclib.h>
#include <intelblocks/smbus.h>
+#include <intelblocks/thermal.h>
#include <memory_info.h>
#include <soc/intel/common/smbios.h>
#include <soc/iomap.h>
@@ -127,6 +128,16 @@
heci_init(HECI1_BASE_ADDRESS);
s3wake = pmc_fill_power_state(ps) == ACPI_S3;
+
+ /*
+ * Set low maximum temp threshold value used for dynamic thermal sensor
+ * shutdown consideration.
+ *
+ * If Dynamic Thermal Shutdown is enabled then PMC logic shuts down the
+ * thermal sensor when CPU is in a C-state and LTT >= DTS Temp.
+ */
+ pch_thermal_configuration();
+
fsp_memory_init(s3wake);
pmc_set_disb();
if (!s3wake) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/59271
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0f972f47845c123f4f74fd75091c9703d54db796
Gerrit-Change-Number: 59271
Gerrit-PatchSet: 8
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/59270 )
Change subject: soc/intel/alderlake: Set `pch_thermal_trip` for Dynamic Thermal Shutdown
......................................................................
soc/intel/alderlake: Set `pch_thermal_trip` for Dynamic Thermal Shutdown
Set low maximum temp threshold value used for dynamic thermal sensor
shutdown consideration.
BUG=b:193774296
Change-Id: I7ee199c19a9d926a4135eeef3b3b481fbff74a79
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59270
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
---
M src/soc/intel/alderlake/chipset.cb
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
EricR Lai: Looks good to me, approved
diff --git a/src/soc/intel/alderlake/chipset.cb b/src/soc/intel/alderlake/chipset.cb
index 9a752dd..fc73a89 100644
--- a/src/soc/intel/alderlake/chipset.cb
+++ b/src/soc/intel/alderlake/chipset.cb
@@ -48,6 +48,11 @@
.tdp_pl4 = 123,
}"
+ # NOTE: if any variant wants to override this value, use the same format
+ # as register "common_soc_config.pch_thermal_trip" = "value", instead of
+ # putting it under register "common_soc_config" in overridetree.cb file.
+ register "common_soc_config.pch_thermal_trip" = "100"
+
device domain 0 on
device gpio 0 alias pch_gpio on end
device pci 00.0 alias system_agent on end
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://review.coreboot.org/c/coreboot/+/59270
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7ee199c19a9d926a4135eeef3b3b481fbff74a79
Gerrit-Change-Number: 59270
Gerrit-PatchSet: 8
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Attention is currently required from: Raul Rangel, Julius Werner, Rob Barnes, Karthik Ramasubramanian.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59320 )
Change subject: lib: Add a mutex
......................................................................
Patch Set 6:
(2 comments)
File src/lib/mutex.c:
https://review.coreboot.org/c/coreboot/+/59320/comment/56b84a91_c57defba
PS5, Line 24: #if ENV_X86
No arch-dependency under lib/ please. We should enforce symmetry of headers placed under arch/, this could possibly be <arch/cpu.h> with cpu_relax().
https://review.coreboot.org/c/coreboot/+/59320/comment/7d896ffc_139930af
PS5, Line 37: assert(thread_yield() >= 0);
Are the assert() here and below why you did not want to change printk() to mutex?
We have other places where printk() is not allowed, like inside udelay() and cbmem_top(), thread_yield() could be made one of them?
--
To view, visit https://review.coreboot.org/c/coreboot/+/59320
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41e02a54a17b1f6513b36a0274e43fc715472d78
Gerrit-Change-Number: 59320
Gerrit-PatchSet: 6
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Sat, 20 Nov 2021 17:00:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Raul Rangel, Julius Werner, Rob Barnes, Patrick Rudolph, Karthik Ramasubramanian.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59321 )
Change subject: treewide: Replace spinlock calls with mutex
......................................................................
Patch Set 5:
(6 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/59321/comment/f5399dd0_099e85ab
PS5, Line 22:
I think printk() is exactly where you would want to yield in romstage for DMA performance, and that was the only case where I had expected to see use of a mutex.
File src/cpu/intel/microcode/microcode.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/91885047_71caf618
PS5, Line 14: struct mutex microcode_lock;
static
File src/cpu/x86/lapic/lapic_cpu_init.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/b9674204_8752875a
PS5, Line 218: struct mutex start_cpu_lock;
static
File src/cpu/x86/mp_init.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/770dbf3e_a5bd440f
PS5, Line 662: struct mutex smm_relocation_lock;
static
File src/device/device.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/20a4bfbc_f9a0feb7
PS5, Line 74: struct mutex dev_lock;
static
File src/drivers/pc80/rtc/post.c:
https://review.coreboot.org/c/coreboot/+/59321/comment/7dca46ad_39f9855b
PS5, Line 38: struct mutex cmos_post_lock;
static
--
To view, visit https://review.coreboot.org/c/coreboot/+/59321
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibee331a9ccd491e819c7f2c9a19bca7dc4379d9d
Gerrit-Change-Number: 59321
Gerrit-PatchSet: 5
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Sat, 20 Nov 2021 16:21:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Raul Rangel, Julius Werner, Rob Barnes, Karthik Ramasubramanian.
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59320 )
Change subject: lib: Add a mutex
......................................................................
Patch Set 6:
(2 comments)
File src/include/mutex.h:
https://review.coreboot.org/c/coreboot/+/59320/comment/e7f9117f_f72a440d
PS6, Line 32: }
I put the following in <rules.h>
#if ENV_X86
#define STAGE_HAS_SPINLOCKS !ENV_ROMSTAGE_OR_BEFORE
#elif ENV_RISCV
#define STAGE_HAS_SPINLOCKS 1
#else
#define STAGE_HAS_SPINLOCKS 0
#endif
/* When set <arch/smp/spinlock.h> is
included for the spinlock implementation. */
#define ENV_STAGE_SUPPORTS_SMP (CONFIG(SMP) && STAGE_HAS_SPINLOCKS)
The implementation of spinlock needed .data while mutex can do with .bss?
With that taken into account, you would never call the non-smp variants _mutex_lock_coop() or _mutex_unlock_coop() since romstage would also see ENV_STAGE_SUPPORTS_SMP=y ?
File src/lib/mutex.c:
https://review.coreboot.org/c/coreboot/+/59320/comment/9fcfa56c_42563eea
PS6, Line 23: if (thread_yield() < 0) {
This path already handles COOP_MULTITHREADING=y, do you really want a separate _mutex_lock_coop() below that does not quarantee atomicity?
--
To view, visit https://review.coreboot.org/c/coreboot/+/59320
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I41e02a54a17b1f6513b36a0274e43fc715472d78
Gerrit-Change-Number: 59320
Gerrit-PatchSet: 6
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Rob Barnes <robbarnes(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Rob Barnes <robbarnes(a)google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Comment-Date: Sat, 20 Nov 2021 16:06:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Maulik V Vaghela, Subrata Banik, Patrick Rudolph.
EricR Lai has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59209 )
Change subject: soc/intel/common/thermal: Allow thermal configuration over PMC
......................................................................
Patch Set 13: Code-Review+2
(2 comments)
Patchset:
PS13:
LGTM 👍
File src/soc/intel/common/block/thermal/thermal_pmc.c:
https://review.coreboot.org/c/coreboot/+/59209/comment/55fe573e_5d221979
PS13, Line 21: static uint8_t get_thermal_trip_temp(void)
> Yes Eric, I will address this in follow up CL, hope that is okay with you. […]
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/59209
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0c6ae72610da39fc18ff252c440d006e83c570a0
Gerrit-Change-Number: 59209
Gerrit-PatchSet: 13
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Attention: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Comment-Date: Sat, 20 Nov 2021 14:55:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Subrata Banik <subrata.banik(a)intel.com>
Comment-In-Reply-To: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-MessageType: comment