Attention is currently required from: Tim Wawrzynczak, Patrick Rudolph.
Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59362 )
Change subject: soc/intel/alderlake: Define the helper functions
......................................................................
soc/intel/alderlake: Define the helper functions
The patch defines following helper functions:
get_cpu_scaling_factor(): Returns scaling factors of big and small core.
cpu_is_nominal_freq_supported(): Returns TRUE if cpu supports Nominal
Frequency, otherwise FASLE.
get_cpu_type(): It returns type of core that is executing the function.
TEST=Verified on Brya
Signed-off-by: Sridahr Siricilla <sridhar.siricilla(a)intel.com>
Change-Id: I963690a4fadad322095d202bcc08c92dcd845360
---
M src/soc/intel/alderlake/acpi.c
M src/soc/intel/alderlake/cpu.c
M src/soc/intel/alderlake/include/soc/cpu.h
3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/59362/1
diff --git a/src/soc/intel/alderlake/acpi.c b/src/soc/intel/alderlake/acpi.c
index ab25646..0e13b32 100644
--- a/src/soc/intel/alderlake/acpi.c
+++ b/src/soc/intel/alderlake/acpi.c
@@ -278,6 +278,10 @@
/* Fill in Above 4GB MMIO resource */
sa_fill_gnvs(gnvs);
+
+ /* Fill core info */
+ if (CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID))
+ core_fill_gnvs(gnvs);
}
int soc_madt_sci_irq_polarity(int sci)
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c
index be8b011..259374e 100644
--- a/src/soc/intel/alderlake/cpu.c
+++ b/src/soc/intel/alderlake/cpu.c
@@ -87,6 +87,17 @@
return CPUID_CORE_TYPE_INTEL_CORE;
}
+void get_cpu_scaling_factor(uint16_t *big_core_scal_factor, uint16_t *small_core_scal_factor)
+{
+ *big_core_scal_factor = 1.27;
+ *small_core_scal_factor = 1;
+}
+
+bool cpu_is_nominal_freq_supported(void)
+{
+ return TRUE;
+}
+
/* All CPUs including BSP will run the following function. */
void soc_core_init(struct device *cpu)
{
diff --git a/src/soc/intel/alderlake/include/soc/cpu.h b/src/soc/intel/alderlake/include/soc/cpu.h
index 06b44a2..24428fd 100644
--- a/src/soc/intel/alderlake/include/soc/cpu.h
+++ b/src/soc/intel/alderlake/include/soc/cpu.h
@@ -33,4 +33,10 @@
/* It returns the cpu type - big or small core */
uint8_t get_cpu_type(void);
+
+/* Get scaling factors for big and small cores */
+void get_cpu_scaling_factor(uint16_t *big_core_scal_factor, uint16_t *small_core_scale_factor);
+
+/* Check cpu supports Nominal Frequency or not */
+bool cpu_is_nominal_freq_supported(void);
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/59362
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I963690a4fadad322095d202bcc08c92dcd845360
Gerrit-Change-Number: 59362
Gerrit-PatchSet: 1
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Attention is currently required from: Tim Wawrzynczak, Patrick Rudolph.
Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59361 )
Change subject: soc/intel/alderlake: Define a method to return a cpu type
......................................................................
soc/intel/alderlake: Define a method to return a cpu type
The patch implements get_cpu_type() function returns the type of cpu
that executing the function.
TEST=Verified on Brya
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Change-Id: Ifecedac822de71ebbdd43afe8431fd8aa1cdba4c
---
M src/soc/intel/alderlake/cpu.c
M src/soc/intel/alderlake/include/soc/cpu.h
2 files changed, 27 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/59361/1
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c
index 59f50f1..be8b011 100644
--- a/src/soc/intel/alderlake/cpu.c
+++ b/src/soc/intel/alderlake/cpu.c
@@ -62,6 +62,31 @@
wrmsr(MSR_POWER_CTL, msr);
}
+static uint32_t cpu_get_family(void)
+{
+ return cpuid_eax(1) & 0x0FFF0FF0;
+}
+
+uint8_t get_cpu_type(void)
+{
+ if (cpu_is_hybrid_supported()) {
+ union cpuid_nat_model_id_and_core_type {
+ struct {
+ unsigned int native_mode_id:24;
+ unsigned int core_type:8;
+ } bits;
+ unsigned int hybrid_info;
+ };
+ union cpuid_nat_model_id_and_core_type eax;
+
+ eax.hybrid_info = cpuid_eax(CPUID_HYBRID_INFORMATION);
+ return (UINT8) eax.bits.core_type & 0xFF;
+ } else if (cpu_get_family() == CPUID_FULL_FAMILY_MODEL_ALDERLAKE_ATOM)
+ return CPUID_CORE_TYPE_INTEL_ATOM;
+ else
+ return CPUID_CORE_TYPE_INTEL_CORE;
+}
+
/* All CPUs including BSP will run the following function. */
void soc_core_init(struct device *cpu)
{
diff --git a/src/soc/intel/alderlake/include/soc/cpu.h b/src/soc/intel/alderlake/include/soc/cpu.h
index 233e0c2..06b44a2 100644
--- a/src/soc/intel/alderlake/include/soc/cpu.h
+++ b/src/soc/intel/alderlake/include/soc/cpu.h
@@ -31,4 +31,6 @@
/* Get a bitmask of supported LPM states */
uint8_t get_supported_lpm_mask(void);
+/* It returns the cpu type - big or small core */
+uint8_t get_cpu_type(void);
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/59361
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifecedac822de71ebbdd43afe8431fd8aa1cdba4c
Gerrit-Change-Number: 59361
Gerrit-PatchSet: 1
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Attention is currently required from: Sridhar Siricilla, Tim Wawrzynczak, Patrick Rudolph.
Hello Sridhar Siricilla,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/59360
to review the following change.
Change subject: soc/intel, soc/common: Add method to determine the cpu type mask
......................................................................
soc/intel, soc/common: Add method to determine the cpu type mask
The patch adds below functions:
get_cpu_type_bitmask(): It returns the cpu type mask.
set_cpu_type_bitmask(): It determines the cpu type (big or small) that is
executing the function, and marks the bit location which is corresponds to
the executing cpu's index if the cpu type is big.
Also, it calls the set_cpu_type_bitmask() from soc/alderlake/cpu.c
TEST=verified on Brya
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Change-Id: If4ceb24d9bb1e808750bf618c29b2b9ea6d4191b
---
M src/soc/intel/alderlake/cpu.c
M src/soc/intel/common/block/acpi/cpu_hybrid.c
M src/soc/intel/common/block/include/intelblocks/acpi.h
3 files changed, 37 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/59360/1
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c
index 94658c7..59f50f1 100644
--- a/src/soc/intel/alderlake/cpu.c
+++ b/src/soc/intel/alderlake/cpu.c
@@ -19,6 +19,7 @@
#include <intelblocks/cpulib.h>
#include <intelblocks/mp_init.h>
#include <intelblocks/msr.h>
+#include <intelblocks/acpi.h>
#include <soc/cpu.h>
#include <soc/msr.h>
#include <soc/pci_devs.h>
@@ -87,6 +88,10 @@
/* Enable Turbo */
enable_turbo();
+
+ /* Set CPU Type bitmask */
+ if (CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID))
+ set_cpu_type_bitmask();
}
static void per_cpu_smm_trigger(void)
diff --git a/src/soc/intel/common/block/acpi/cpu_hybrid.c b/src/soc/intel/common/block/acpi/cpu_hybrid.c
index 83b9c47..4a46433 100644
--- a/src/soc/intel/common/block/acpi/cpu_hybrid.c
+++ b/src/soc/intel/common/block/acpi/cpu_hybrid.c
@@ -2,9 +2,29 @@
#include <intelblocks/acpi.h>
#include <soc/cpu.h>
#include <stdlib.h>
+#include <cpu/x86/mp.h>
+#include <smp/spinlock.h>
#define XPPC_PACKAGE_NAME "XCPC"
+DECLARE_SPIN_LOCK(cpu_lock);
+static unsigned int global_cpu_type_bitmask;
+
+void set_cpu_type_bitmask(void)
+{
+ spin_lock(&cpu_lock);
+
+ /* if cpu type is big, mark the bit location corresponds to the cpu index */
+ if (get_cpu_type() == CPUID_CORE_TYPE_INTEL_CORE)
+ global_cpu_type_bitmask |= (1 << get_cpu_index());
+ spin_unlock(&cpu_lock);
+}
+
+uint32_t get_cpu_type_bitmask(void)
+{
+ return global_cpu_type_bitmask;
+}
+
void core_fill_gnvs(struct global_nvs *gnvs)
{
uint16_t big_core_scal_factor, small_core_scal_factor;
diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h
index 516c66f..8a5b10e 100644
--- a/src/soc/intel/common/block/include/intelblocks/acpi.h
+++ b/src/soc/intel/common/block/include/intelblocks/acpi.h
@@ -9,6 +9,9 @@
#include <soc/pm.h>
#include <stdint.h>
+#define CPUID_CORE_TYPE_INTEL_ATOM 0x20
+#define CPUID_CORE_TYPE_INTEL_CORE 0x40
+
/* It generates ACPI code to set Nominal Frequency and Nominal Performance */
void acpi_write_xppc_method(int core_id);
@@ -116,4 +119,13 @@
/* Fill SSDT for SGX status, EPC base and length */
void sgx_fill_ssdt(void);
+/*
+ * It determins type (big or small) of cpu that is executing the function, and marks
+ * the bit location which is corresponds to executing cpu's index if the cpu type is big
+ */
+void set_cpu_type_bitmask(void);
+
+/* Returns CPU type mask */
+uint32_t get_cpu_type_bitmask(void);
+
#endif /* _SOC_INTEL_COMMON_BLOCK_ACPI_H_ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/59360
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If4ceb24d9bb1e808750bf618c29b2b9ea6d4191b
Gerrit-Change-Number: 59360
Gerrit-PatchSet: 1
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59357 )
Change subject: cpu/intel: Get cpu index based on LAPIC id
......................................................................
cpu/intel: Get cpu index based on LAPIC id
The patch adds a method to provide cpu index based on LAPCI Id.
The function determines the cpu's LAPIC id and returns the position of the
cpu's LAPIC id among the other cores' LAPIC ids.
`
TEST=Verified on Brya
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Change-Id: If18116472aaa78cfa88350f313c246a28f67303d
---
M src/cpu/x86/mp_init.c
M src/include/cpu/x86/mp.h
2 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/59357/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index c99732f..e8df692 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -207,6 +207,19 @@
park_this_cpu(NULL);
}
+uint32_t get_cpu_index(void)
+{
+ int i;
+ uint32_t cpu_index = 0;
+ uint32_t my_apic_id = lapicid();
+
+ for (i = 0; i < global_num_aps + 1; i++)
+ if (my_apic_id >= cpus_dev[i]->path.apic.apic_id)
+ cpu_index++;
+
+ return cpu_index;
+}
+
static void setup_default_sipi_vector_params(struct sipi_params *sp)
{
sp->gdt = (uintptr_t)&gdt;
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index 7ed82dd..12241fc 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -146,4 +146,10 @@
/* Send SMI to self with single execution. */
void smm_initiate_relocation(void);
+/*
+ * Returns cpu's index based on the position of the cpu's lapic id among other cpus'
+ * lapic ids.
+ */
+uint32_t get_cpu_index(void);
+
#endif /* _X86_MP_H_ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/59357
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If18116472aaa78cfa88350f313c246a28f67303d
Gerrit-Change-Number: 59357
Gerrit-PatchSet: 1
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Maulik V Vaghela, Sugnan Prabhu S, Tim Wawrzynczak, Sridhar Siricilla, Patrick Rudolph.
Hello Nico Huber, Maulik V Vaghela, Sugnan Prabhu S, Tim Wawrzynczak, Subrata Banik, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/59124
to look at the new patch set (#2).
Change subject: soc/intel/common: Add CPU related APIs
......................................................................
soc/intel/common: Add CPU related APIs
The patch defines below APIs :
cpu_is_hybrid_supported() : Check whether CPU supports hybrid
cores or not.
cpu_get_bus_frequency() : Get CPU's bus frequency
cpu_get_max_non_turbo_ratio() : Get CPU's max non-turbo ration
TEST=Verified on Brya
Signed-off-by: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Change-Id: I680f43952ab4abce6e342206688ad32814970a91
---
M src/soc/intel/common/block/cpu/cpulib.c
M src/soc/intel/common/block/include/intelblocks/cpulib.h
2 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/59124/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/59124
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I680f43952ab4abce6e342206688ad32814970a91
Gerrit-Change-Number: 59124
Gerrit-PatchSet: 2
Gerrit-Owner: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-CC: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-CC: Sridhar Siricilla <sridhar.siricilla(a)intel.corp-partner.google.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Attention: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Maulik V Vaghela, Angel Pons, Subrata Banik, Patrick Rudolph.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59310 )
Change subject: soc/intel/../thermal: Use `clrsetbits32` API for setting LTT
......................................................................
Patch Set 4: Code-Review+2
(1 comment)
File src/soc/intel/common/block/thermal/thermal.c:
https://review.coreboot.org/c/coreboot/+/59310/comment/ea8d257c_e80da896
PS3, Line 67: ~
> because of integer promotion rules
Aha, that makes sense! I just like the interface 😊
--
To view, visit https://review.coreboot.org/c/coreboot/+/59310
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I51fea7bd2146ea29ef476218c006f7350b32c006
Gerrit-Change-Number: 59310
Gerrit-PatchSet: 4
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.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: 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: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Comment-Date: Tue, 16 Nov 2021 20:19:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: comment
Attention is currently required from: Maulik V Vaghela, Subrata Banik.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/59270 )
Change subject: mb/{adlrvp, brya, sm}: Set `pch_thermal_trip` for Dynamic Thermal Shutdown
......................................................................
Patch Set 4:
(1 comment)
File src/mainboard/google/brya/variants/baseboard/brask/devicetree.cb:
https://review.coreboot.org/c/coreboot/+/59270/comment/b64b2896_239ab510
PS4, Line 95: .pch_thermal_trip = 100,
> > Isn't there usually a recommended value per-chipset? […]
It would still be overrideable by any given mainboard in their overridetree or devicetree files too 👍
--
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: 4
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: 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-Comment-Date: Tue, 16 Nov 2021 20:18:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: comment