summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@fb.com>2020-06-03 15:55:28 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-06-14 16:45:55 +0000
commitc11059550342999c382385ef0059349802061a99 (patch)
treec08618838d08a06ac63058f8e1e9ba24c0dcb955 /src/soc/intel
parent890cf2299dd9f78c7ea66b7a27ebcbc1d06c0436 (diff)
downloadcoreboot-c11059550342999c382385ef0059349802061a99.tar.xz
soc/intel/xeon_sp/cpx: add cpu entries in ssdt
Signed-off-by: Jonathan Zhang <jonzhang@fb.com> Signed-off-by: Reddy Chagam <anjaneya.chagam@intel.com> Change-Id: I4d057a7c385ca563bfcc7ad44f651ad1f8ca003c Reviewed-on: https://review.coreboot.org/c/coreboot/+/42059 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/xeon_sp/cpx/acpi.c35
-rw-r--r--src/soc/intel/xeon_sp/cpx/chip.c1
2 files changed, 36 insertions, 0 deletions
diff --git a/src/soc/intel/xeon_sp/cpx/acpi.c b/src/soc/intel/xeon_sp/cpx/acpi.c
index 2ecb6aa5fc..085f9dde25 100644
--- a/src/soc/intel/xeon_sp/cpx/acpi.c
+++ b/src/soc/intel/xeon_sp/cpx/acpi.c
@@ -230,6 +230,41 @@ unsigned long acpi_fill_madt(unsigned long current)
return acpi_madt_irq_overrides(current);
}
+void generate_cpu_entries(const struct device *device)
+{
+ int core_id, cpu_id, pcontrol_blk = ACPI_BASE_ADDRESS;
+ int plen = 6;
+ int total_threads = dev_count_cpu();
+ int threads_per_package = get_threads_per_package();
+ int numcpus = total_threads / threads_per_package;
+
+ printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each, totalcores: %d.\n",
+ numcpus, threads_per_package, total_threads);
+
+ for (cpu_id = 0; cpu_id < numcpus; cpu_id++) {
+ for (core_id = 0; core_id < threads_per_package; core_id++) {
+ if (core_id > 0) {
+ pcontrol_blk = 0;
+ plen = 0;
+ }
+
+ /* Generate processor \_PR.CPUx */
+ acpigen_write_processor((cpu_id) * threads_per_package +
+ core_id, pcontrol_blk, plen);
+
+ /* NOTE: Intel idle driver doesn't use ACPI C-state tables */
+
+ /* TODO: Soc specific power states generation */
+ acpigen_pop_len();
+ }
+ }
+ /* PPKG is usually used for thermal management of the first and only package. */
+ acpigen_write_processor_package("PPKG", 0, threads_per_package);
+
+ /* Add a method to notify processor nodes */
+ acpigen_write_processor_cnot(threads_per_package);
+}
+
int soc_madt_sci_irq_polarity(int sci)
{
if (sci >= 20)
diff --git a/src/soc/intel/xeon_sp/cpx/chip.c b/src/soc/intel/xeon_sp/cpx/chip.c
index cded072ccd..c2d448c21c 100644
--- a/src/soc/intel/xeon_sp/cpx/chip.c
+++ b/src/soc/intel/xeon_sp/cpx/chip.c
@@ -504,6 +504,7 @@ static struct device_operations cpu_bus_ops = {
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
.init = cpx_init_cpus,
+ .acpi_fill_ssdt = generate_cpu_entries,
};
/* Attach IIO stack bus numbers with dummy device to PCI DOMAIN 0000 device */