blob: 51649d0aee2a2cdd039664d01d9b810b4ef14c16 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Elyes HAOUASa1e22b82019-03-18 22:49:36 +01002
Eran Mitrani4c9440c2022-11-29 17:46:38 -08003#include <acpi/acpi.h>
Kyösti Mälkki27872372021-01-21 16:05:26 +02004#include <acpi/acpi_pm.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -07005#include <acpi/acpigen.h>
Shaunak Sahabd427802017-07-18 00:19:33 -07006#include <arch/ioapic.h>
7#include <arch/smp/mpspec.h>
Elyes HAOUAS20eaef02019-03-29 17:45:28 +01008#include <console/console.h>
Elyes Haouasdef74aa2022-10-31 13:44:40 +01009#include <cpu/cpu.h>
Michael Niewöhnered21df62020-09-19 00:08:45 +020010#include <cpu/intel/common/common.h>
Elyes Haouasdef74aa2022-10-31 13:44:40 +010011#include <cpu/intel/msr.h>
12#include <cpu/intel/turbo.h>
13#include <cpu/x86/lapic.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070014#include <cpu/x86/smm.h>
Kyösti Mälkkica71e132021-01-15 05:06:35 +020015#include <intelblocks/acpi_wake_source.h>
Elyes Haouasdef74aa2022-10-31 13:44:40 +010016#include <intelblocks/acpi.h>
Marc Jones1403b912020-12-02 14:35:27 -070017#include <intelblocks/lpc_lib.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070018#include <intelblocks/pmclib.h>
Michael Niewöhnerb48caad2021-10-17 15:36:45 +020019#include <intelblocks/sgx.h>
Duncan Laurie93bbd412017-11-11 20:03:29 -080020#include <intelblocks/uart.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070021#include <soc/gpio.h>
22#include <soc/iomap.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070023#include <soc/pm.h>
24
Michael Niewöhnered21df62020-09-19 00:08:45 +020025#define CPUID_6_EAX_ISST (1 << 7)
26
Shaunak Sahabd427802017-07-18 00:19:33 -070027static int acpi_sci_irq(void)
28{
29 int sci_irq = 9;
30 uint32_t scis;
31
32 scis = soc_read_sci_irq_select();
33 scis &= SCI_IRQ_SEL;
34 scis >>= SCI_IRQ_ADJUST;
35
36 /* Determine how SCI is routed. */
37 switch (scis) {
38 case SCIS_IRQ9:
39 case SCIS_IRQ10:
40 case SCIS_IRQ11:
41 sci_irq = scis - SCIS_IRQ9 + 9;
42 break;
43 case SCIS_IRQ20:
44 case SCIS_IRQ21:
45 case SCIS_IRQ22:
46 case SCIS_IRQ23:
47 sci_irq = scis - SCIS_IRQ20 + 20;
48 break;
49 default:
50 printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ9.\n");
51 sci_irq = 9;
52 break;
53 }
54
55 printk(BIOS_DEBUG, "SCI is IRQ%d\n", sci_irq);
56 return sci_irq;
57}
58
59static unsigned long acpi_madt_irq_overrides(unsigned long current)
60{
61 int sci = acpi_sci_irq();
62 uint16_t flags = MP_IRQ_TRIGGER_LEVEL;
63
64 /* INT_SRC_OVR */
65 current += acpi_create_madt_irqoverride((void *)current, 0, 0, 2, 0);
66
67 flags |= soc_madt_sci_irq_polarity(sci);
68
69 /* SCI */
70 current +=
71 acpi_create_madt_irqoverride((void *)current, 0, sci, sci, flags);
72
73 return current;
74}
75
Arthur Heymans8a3e2b82022-12-02 12:42:27 +010076static const uintptr_t default_ioapic_bases[] = { IO_APIC_ADDR };
77
78__weak size_t soc_get_ioapic_info(const uintptr_t *ioapic_bases[])
Marc Jones847043c2020-12-02 11:24:00 -070079{
Arthur Heymans8a3e2b82022-12-02 12:42:27 +010080 *ioapic_bases = default_ioapic_bases;
81 return ARRAY_SIZE(default_ioapic_bases);
Marc Jones847043c2020-12-02 11:24:00 -070082}
83
Shaunak Sahabd427802017-07-18 00:19:33 -070084unsigned long acpi_fill_madt(unsigned long current)
85{
Arthur Heymans8a3e2b82022-12-02 12:42:27 +010086 const uintptr_t *ioapic_table;
Marc Jones847043c2020-12-02 11:24:00 -070087 size_t ioapic_entries;
88
Shaunak Sahabd427802017-07-18 00:19:33 -070089 /* Local APICs */
Kyösti Mälkki69a13962023-04-08 14:10:48 +030090 if (!CONFIG(ACPI_COMMON_MADT_LAPIC))
Sridhar Siricilla7301cfa2023-01-19 18:50:09 +053091 current = acpi_create_madt_lapics_with_nmis_hybrid(current);
Shaunak Sahabd427802017-07-18 00:19:33 -070092
93 /* IOAPIC */
Arthur Heymans8a3e2b82022-12-02 12:42:27 +010094 ioapic_entries = soc_get_ioapic_info(&ioapic_table);
95 for (int i = 0; i < ioapic_entries; i++)
96 current += acpi_create_madt_ioapic_from_hw((void *)current, ioapic_table[i]);
Shaunak Sahabd427802017-07-18 00:19:33 -070097
98 return acpi_madt_irq_overrides(current);
99}
100
Shaunak Sahabd427802017-07-18 00:19:33 -0700101void acpi_fill_fadt(acpi_fadt_t *fadt)
102{
103 const uint16_t pmbase = ACPI_BASE_ADDRESS;
104
Shaunak Sahabd427802017-07-18 00:19:33 -0700105 fadt->sci_int = acpi_sci_irq();
Kyösti Mälkkic328a682019-11-23 07:23:40 +0200106
Kyösti Mälkki0a9e72e2019-08-11 01:22:28 +0300107 if (permanent_smi_handler()) {
Kyösti Mälkkic328a682019-11-23 07:23:40 +0200108 fadt->smi_cmd = APM_CNT;
109 fadt->acpi_enable = APM_CNT_ACPI_ENABLE;
110 fadt->acpi_disable = APM_CNT_ACPI_DISABLE;
111 }
Shaunak Sahabd427802017-07-18 00:19:33 -0700112
113 fadt->pm1a_evt_blk = pmbase + PM1_STS;
Shaunak Sahabd427802017-07-18 00:19:33 -0700114 fadt->pm1a_cnt_blk = pmbase + PM1_CNT;
Shaunak Sahabd427802017-07-18 00:19:33 -0700115
116 fadt->gpe0_blk = pmbase + GPE0_STS(0);
117
118 fadt->pm1_evt_len = 4;
119 fadt->pm1_cnt_len = 2;
120
121 /* GPE0 STS/EN pairs each 32 bits wide. */
122 fadt->gpe0_blk_len = 2 * GPE0_REG_MAX * sizeof(uint32_t);
123
Shaunak Sahabd427802017-07-18 00:19:33 -0700124 fadt->day_alrm = 0xd;
125
Angel Ponsa208c6c2020-07-13 00:02:34 +0200126 fadt->flags |= ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED |
Michael Niewöhner2353cd92021-10-04 16:59:49 +0200127 ACPI_FADT_SLEEP_BUTTON |
Michael Niewöhner5c259642021-09-25 00:40:52 +0200128 ACPI_FADT_SEALED_CASE | ACPI_FADT_S4_RTC_WAKE;
129
Michael Niewöhner586b1be2021-09-27 23:08:59 +0200130 if (CONFIG(USE_PM_ACPI_TIMER))
Michael Niewöhner5c259642021-09-25 00:40:52 +0200131 fadt->flags |= ACPI_FADT_PLATFORM_CLOCK;
Shaunak Sahabd427802017-07-18 00:19:33 -0700132
Elyes HAOUAS04071f42020-07-20 17:05:24 +0200133 fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
Shaunak Sahabd427802017-07-18 00:19:33 -0700134 fadt->x_pm1a_evt_blk.bit_width = fadt->pm1_evt_len * 8;
Felix Held769b6572022-10-14 18:32:52 +0200135 fadt->x_pm1a_evt_blk.addrl = fadt->pm1a_evt_blk;
Angel Pons12a4d052020-07-14 01:31:27 +0200136 fadt->x_pm1a_evt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100137
Elyes HAOUAS04071f42020-07-20 17:05:24 +0200138 fadt->x_pm1a_cnt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
Shaunak Sahabd427802017-07-18 00:19:33 -0700139 fadt->x_pm1a_cnt_blk.bit_width = fadt->pm1_cnt_len * 8;
Elyes Haouasc60f3b22022-10-11 14:02:27 +0200140 fadt->x_pm1a_cnt_blk.addrl = fadt->pm1a_cnt_blk;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100141 fadt->x_pm1a_cnt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
Shaunak Sahabd427802017-07-18 00:19:33 -0700142
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100143 /*
144 * Windows 10 requires x_gpe0_blk to be set starting with FADT revision 5.
145 * The bit_width field intentionally overflows here.
146 * The OSPM can instead use the values in `fadt->gpe0_blk{,_len}`, which
147 * seems to work fine on Linux 5.0 and Windows 10.
148 */
149 fadt->x_gpe0_blk.space_id = ACPI_ADDRESS_SPACE_IO;
150 fadt->x_gpe0_blk.bit_width = fadt->gpe0_blk_len * 8;
151 fadt->x_gpe0_blk.bit_offset = 0;
Angel Ponsa23aff32020-06-21 20:47:54 +0200152 fadt->x_gpe0_blk.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100153 fadt->x_gpe0_blk.addrl = fadt->gpe0_blk;
154 fadt->x_gpe0_blk.addrh = 0;
Shaunak Sahabd427802017-07-18 00:19:33 -0700155}
156
Furquan Shaikh0f007d82020-04-24 06:41:18 -0700157unsigned long southbridge_write_acpi_tables(const struct device *device,
Shaunak Sahabd427802017-07-18 00:19:33 -0700158 unsigned long current,
159 struct acpi_rsdp *rsdp)
160{
Marc Jones5258f4f2020-12-02 11:29:09 -0700161 if (CONFIG(SOC_INTEL_COMMON_BLOCK_UART)) {
162 current = acpi_write_dbg2_pci_uart(rsdp, current,
163 uart_get_device(),
164 ACPI_ACCESS_SIZE_DWORD_ACCESS);
165 }
166
Shaunak Sahabd427802017-07-18 00:19:33 -0700167 return acpi_write_hpet(device, current, rsdp);
168}
169
Aaron Durbin64031672018-04-21 14:45:32 -0600170__weak
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200171void acpi_fill_soc_wake(uint32_t *pm1_en, uint32_t *gpe0_en,
172 const struct chipset_power_state *ps)
Shaunak Sahabd427802017-07-18 00:19:33 -0700173{
Shaunak Sahabd427802017-07-18 00:19:33 -0700174}
175
176/*
177 * Save wake source information for calculating ACPI _SWS values
178 *
179 * @pm1: PM1_STS register with only enabled events set
180 * @gpe0: GPE0_STS registers with only enabled events set
181 *
Kyösti Mälkkif67e67512021-01-22 19:59:07 +0200182 * return the number of registers in the gpe0 array
Shaunak Sahabd427802017-07-18 00:19:33 -0700183 */
184
Kyösti Mälkkica71e132021-01-15 05:06:35 +0200185int soc_fill_acpi_wake(const struct chipset_power_state *ps, uint32_t *pm1, uint32_t **gpe0)
Shaunak Sahabd427802017-07-18 00:19:33 -0700186{
Shaunak Sahabd427802017-07-18 00:19:33 -0700187 static uint32_t gpe0_sts[GPE0_REG_MAX];
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200188 uint32_t gpe0_en[GPE0_REG_MAX];
Shaunak Sahabd427802017-07-18 00:19:33 -0700189 uint32_t pm1_en;
190 int i;
191
Shaunak Sahabd427802017-07-18 00:19:33 -0700192 /*
193 * PM1_EN to check the basic wake events which can happen through
194 * powerbtn or any other wake source like lidopen, key board press etc.
195 */
196 pm1_en = ps->pm1_en;
Michael Niewöhnerf855b8b2021-10-10 16:56:31 +0200197 pm1_en |= WAK_STS | PWRBTN_EN;
Shaunak Sahabd427802017-07-18 00:19:33 -0700198
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200199 memcpy(gpe0_en, ps->gpe0_en, sizeof(gpe0_en));
200
201 acpi_fill_soc_wake(&pm1_en, gpe0_en, ps);
Shaunak Sahabd427802017-07-18 00:19:33 -0700202
203 *pm1 = ps->pm1_sts & pm1_en;
204
205 /* Mask off GPE0 status bits that are not enabled */
206 *gpe0 = &gpe0_sts[0];
207 for (i = 0; i < GPE0_REG_MAX; i++)
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200208 gpe0_sts[i] = ps->gpe0_sts[i] & gpe0_en[i];
Shaunak Sahabd427802017-07-18 00:19:33 -0700209
210 return GPE0_REG_MAX;
211}
212
Marc Jonesa81703c2020-12-18 10:44:47 -0700213int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio)
Shaunak Sahabd427802017-07-18 00:19:33 -0700214{
215 u32 m;
216 u32 power;
217
218 /*
219 * M = ((1.1 - ((p1_ratio - ratio) * 0.00625)) / 1.1) ^ 2
220 *
221 * Power = (ratio / p1_ratio) * m * tdp
222 */
223
224 m = (110000 - ((p1_ratio - ratio) * 625)) / 11;
225 m = (m * m) / 1000;
226
227 power = ((ratio * 100000 / p1_ratio) / 100);
228 power *= (m / 100) * (tdp / 1000);
229 power /= 1000;
230
231 return power;
232}
233
Shaunak Sahabd427802017-07-18 00:19:33 -0700234static void generate_c_state_entries(void)
235{
Angel Ponse9f10ff2021-10-17 13:28:23 +0200236 const acpi_cstate_t *c_state_map;
Shaunak Sahabd427802017-07-18 00:19:33 -0700237 size_t entries;
238
239 c_state_map = soc_get_cstate_map(&entries);
240
241 /* Generate C-state tables */
242 acpigen_write_CST_package(c_state_map, entries);
243}
244
245void generate_p_state_entries(int core, int cores_per_package)
246{
247 int ratio_min, ratio_max, ratio_turbo, ratio_step;
248 int coord_type, power_max, num_entries;
249 int ratio, power, clock, clock_max;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100250 bool turbo;
Shaunak Sahabd427802017-07-18 00:19:33 -0700251
252 coord_type = cpu_get_coord_type();
253 ratio_min = cpu_get_min_ratio();
254 ratio_max = cpu_get_max_ratio();
255 clock_max = (ratio_max * cpu_get_bus_clock()) / KHz;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100256 turbo = (get_turbo_state() == TURBO_ENABLED);
Shaunak Sahabd427802017-07-18 00:19:33 -0700257
258 /* Calculate CPU TDP in mW */
259 power_max = cpu_get_power_max();
260
261 /* Write _PCT indicating use of FFixedHW */
262 acpigen_write_empty_PCT();
263
264 /* Write _PPC with no limit on supported P-state */
265 acpigen_write_PPC_NVS();
266 /* Write PSD indicating configured coordination type */
267 acpigen_write_PSD_package(core, 1, coord_type);
268
269 /* Add P-state entries in _PSS table */
270 acpigen_write_name("_PSS");
271
272 /* Determine ratio points */
273 ratio_step = PSS_RATIO_STEP;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100274 do {
Shaunak Sahabd427802017-07-18 00:19:33 -0700275 num_entries = ((ratio_max - ratio_min) / ratio_step) + 1;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100276 if (((ratio_max - ratio_min) % ratio_step) > 0)
277 num_entries += 1;
278 if (turbo)
279 num_entries += 1;
280 if (num_entries > PSS_MAX_ENTRIES)
281 ratio_step += 1;
282 } while (num_entries > PSS_MAX_ENTRIES);
283
284 /* _PSS package count depends on Turbo */
285 acpigen_write_package(num_entries);
Shaunak Sahabd427802017-07-18 00:19:33 -0700286
287 /* P[T] is Turbo state if enabled */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100288 if (turbo) {
Shaunak Sahabd427802017-07-18 00:19:33 -0700289 ratio_turbo = cpu_get_max_turbo_ratio();
290
291 /* Add entry for Turbo ratio */
292 acpigen_write_PSS_package(clock_max + 1, /* MHz */
293 power_max, /* mW */
294 PSS_LATENCY_TRANSITION,/* lat1 */
295 PSS_LATENCY_BUSMASTER,/* lat2 */
296 ratio_turbo << 8, /* control */
297 ratio_turbo << 8); /* status */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100298 num_entries -= 1;
Shaunak Sahabd427802017-07-18 00:19:33 -0700299 }
300
301 /* First regular entry is max non-turbo ratio */
302 acpigen_write_PSS_package(clock_max, /* MHz */
303 power_max, /* mW */
304 PSS_LATENCY_TRANSITION,/* lat1 */
305 PSS_LATENCY_BUSMASTER,/* lat2 */
306 ratio_max << 8, /* control */
307 ratio_max << 8); /* status */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100308 num_entries -= 1;
Shaunak Sahabd427802017-07-18 00:19:33 -0700309
310 /* Generate the remaining entries */
311 for (ratio = ratio_min + ((num_entries - 1) * ratio_step);
312 ratio >= ratio_min; ratio -= ratio_step) {
313
314 /* Calculate power at this ratio */
Marc Jonesa81703c2020-12-18 10:44:47 -0700315 power = common_calculate_power_ratio(power_max, ratio_max, ratio);
Shaunak Sahabd427802017-07-18 00:19:33 -0700316 clock = (ratio * cpu_get_bus_clock()) / KHz;
317
318 acpigen_write_PSS_package(clock, /* MHz */
319 power, /* mW */
320 PSS_LATENCY_TRANSITION,/* lat1 */
321 PSS_LATENCY_BUSMASTER,/* lat2 */
322 ratio << 8, /* control */
323 ratio << 8); /* status */
324 }
325 /* Fix package length */
326 acpigen_pop_len();
327}
328
Julien Viard de Galbert595202c2018-03-29 14:01:01 +0200329__attribute__ ((weak)) acpi_tstate_t *soc_get_tss_table(int *entries)
Shaunak Sahabd427802017-07-18 00:19:33 -0700330{
331 *entries = 0;
332 return NULL;
333}
334
335void generate_t_state_entries(int core, int cores_per_package)
336{
337 acpi_tstate_t *soc_tss_table;
338 int entries;
339
340 soc_tss_table = soc_get_tss_table(&entries);
341 if (entries == 0)
342 return;
343
344 /* Indicate SW_ALL coordination for T-states */
345 acpigen_write_TSD_package(core, cores_per_package, SW_ALL);
346
347 /* Indicate FixedHW so OS will use MSR */
348 acpigen_write_empty_PTC();
349
350 /* Set NVS controlled T-state limit */
351 acpigen_write_TPC("\\TLVL");
352
353 /* Write TSS table for MSR access */
354 acpigen_write_TSS_package(entries, soc_tss_table);
355}
356
Michael Niewöhnered21df62020-09-19 00:08:45 +0200357static void generate_cppc_entries(int core_id)
358{
Sridhar Siricilla11736122021-11-15 17:12:49 +0530359 u32 version = CPPC_VERSION_2;
360
361 if (CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID))
362 version = CPPC_VERSION_3;
363
Michael Niewöhnered21df62020-09-19 00:08:45 +0200364 if (!(CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPPC) &&
365 cpuid_eax(6) & CPUID_6_EAX_ISST))
366 return;
367
368 /* Generate GCPC package in first logical core */
369 if (core_id == 0) {
370 struct cppc_config cppc_config;
Sridhar Siricilla11736122021-11-15 17:12:49 +0530371 cpu_init_cppc_config(&cppc_config, version);
Michael Niewöhnered21df62020-09-19 00:08:45 +0200372 acpigen_write_CPPC_package(&cppc_config);
373 }
374
375 /* Write _CPC entry for each logical core */
Sridhar Siricilla11736122021-11-15 17:12:49 +0530376 if (CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID))
377 acpigen_write_CPPC_hybrid_method(core_id);
378 else
379 acpigen_write_CPPC_method();
Michael Niewöhnered21df62020-09-19 00:08:45 +0200380}
381
Aaron Durbin64031672018-04-21 14:45:32 -0600382__weak void soc_power_states_generation(int core_id,
Shaunak Sahabd427802017-07-18 00:19:33 -0700383 int cores_per_package)
384{
385}
386
Furquan Shaikh7536a392020-04-24 21:59:21 -0700387void generate_cpu_entries(const struct device *device)
Shaunak Sahabd427802017-07-18 00:19:33 -0700388{
Michael Niewöhner2353cd92021-10-04 16:59:49 +0200389 int core_id, cpu_id;
Shaunak Sahabd427802017-07-18 00:19:33 -0700390 int totalcores = dev_count_cpu();
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100391 unsigned int num_virt;
392 unsigned int num_phys;
Shaunak Sahabd427802017-07-18 00:19:33 -0700393
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100394 cpu_read_topology(&num_phys, &num_virt);
395
396 int numcpus = totalcores / num_virt;
397
398 printk(BIOS_DEBUG, "Found %d CPU(s) with %d/%d physical/logical core(s) each.\n",
399 numcpus, num_phys, num_virt);
Shaunak Sahabd427802017-07-18 00:19:33 -0700400
401 for (cpu_id = 0; cpu_id < numcpus; cpu_id++) {
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100402 for (core_id = 0; core_id < num_virt; core_id++) {
Christian Walterbe3979c2019-12-18 15:07:59 +0100403 /* Generate processor \_SB.CPUx */
Patrick Rudolph0f0b6192023-02-28 07:28:56 +0100404 acpigen_write_processor_device(cpu_id * num_virt + core_id);
Shaunak Sahabd427802017-07-18 00:19:33 -0700405
406 /* Generate C-state tables */
407 generate_c_state_entries();
408
Michael Niewöhnered21df62020-09-19 00:08:45 +0200409 generate_cppc_entries(core_id);
410
Shaunak Sahabd427802017-07-18 00:19:33 -0700411 /* Soc specific power states generation */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100412 soc_power_states_generation(core_id, num_virt);
Shaunak Sahabd427802017-07-18 00:19:33 -0700413
Kyösti Mälkkic77b6072023-04-12 19:18:32 +0300414 acpigen_write_processor_device_end();
Shaunak Sahabd427802017-07-18 00:19:33 -0700415 }
416 }
Arthur Heymans0ac555e2018-11-28 12:25:54 +0100417 /* PPKG is usually used for thermal management
418 of the first and only package. */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100419 acpigen_write_processor_package("PPKG", 0, num_virt);
Arthur Heymans0ac555e2018-11-28 12:25:54 +0100420
421 /* Add a method to notify processor nodes */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100422 acpigen_write_processor_cnot(num_virt);
Michael Niewöhnerb48caad2021-10-17 15:36:45 +0200423
424 if (CONFIG(SOC_INTEL_COMMON_BLOCK_SGX_ENABLE))
425 sgx_fill_ssdt();
Shaunak Sahabd427802017-07-18 00:19:33 -0700426}