blob: 6f7412740a7c7aa4a3a74859e85d12af23660174 [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
Kyösti Mälkki27872372021-01-21 16:05:26 +02003#include <acpi/acpi_pm.h>
Furquan Shaikh76cedd22020-05-02 10:24:23 -07004#include <acpi/acpigen.h>
Michael Niewöhnered21df62020-09-19 00:08:45 +02005#include <arch/cpu.h>
Shaunak Sahabd427802017-07-18 00:19:33 -07006#include <arch/ioapic.h>
7#include <arch/smp/mpspec.h>
Patrick Rudolphf677d172018-10-01 19:17:11 +02008#include <cf9_reset.h>
Elyes HAOUAS20eaef02019-03-29 17:45:28 +01009#include <console/console.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070010#include <cpu/intel/turbo.h>
Michael Niewöhnerf0a44ae2021-01-01 21:04:09 +010011#include <cpu/intel/msr.h>
Michael Niewöhnered21df62020-09-19 00:08:45 +020012#include <cpu/intel/common/common.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070013#include <cpu/x86/smm.h>
14#include <intelblocks/acpi.h>
Kyösti Mälkkica71e132021-01-15 05:06:35 +020015#include <intelblocks/acpi_wake_source.h>
Marc Jones1403b912020-12-02 14:35:27 -070016#include <intelblocks/lpc_lib.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070017#include <intelblocks/pmclib.h>
Duncan Laurie93bbd412017-11-11 20:03:29 -080018#include <intelblocks/uart.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070019#include <soc/gpio.h>
20#include <soc/iomap.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070021#include <soc/pm.h>
Wonkyu Kim0aeedd42021-03-22 20:07:15 -070022#include <cpu/x86/lapic.h>
Shaunak Sahabd427802017-07-18 00:19:33 -070023
Michael Niewöhnered21df62020-09-19 00:08:45 +020024#define CPUID_6_EAX_ISST (1 << 7)
25
Julien Viard de Galbertcf2b72f2018-04-05 11:24:45 +020026__attribute__((weak)) unsigned long acpi_fill_mcfg(unsigned long current)
Shaunak Sahabd427802017-07-18 00:19:33 -070027{
28 /* PCI Segment Group 0, Start Bus Number 0, End Bus Number is 255 */
29 current += acpi_create_mcfg_mmconfig((void *)current,
30 CONFIG_MMCONF_BASE_ADDRESS, 0, 0,
Angel Pons98494882021-01-29 11:35:16 +010031 CONFIG_MMCONF_BUS_NUMBER - 1);
Shaunak Sahabd427802017-07-18 00:19:33 -070032 return current;
33}
34
35static int acpi_sci_irq(void)
36{
37 int sci_irq = 9;
38 uint32_t scis;
39
40 scis = soc_read_sci_irq_select();
41 scis &= SCI_IRQ_SEL;
42 scis >>= SCI_IRQ_ADJUST;
43
44 /* Determine how SCI is routed. */
45 switch (scis) {
46 case SCIS_IRQ9:
47 case SCIS_IRQ10:
48 case SCIS_IRQ11:
49 sci_irq = scis - SCIS_IRQ9 + 9;
50 break;
51 case SCIS_IRQ20:
52 case SCIS_IRQ21:
53 case SCIS_IRQ22:
54 case SCIS_IRQ23:
55 sci_irq = scis - SCIS_IRQ20 + 20;
56 break;
57 default:
58 printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ9.\n");
59 sci_irq = 9;
60 break;
61 }
62
63 printk(BIOS_DEBUG, "SCI is IRQ%d\n", sci_irq);
64 return sci_irq;
65}
66
67static unsigned long acpi_madt_irq_overrides(unsigned long current)
68{
69 int sci = acpi_sci_irq();
70 uint16_t flags = MP_IRQ_TRIGGER_LEVEL;
71
72 /* INT_SRC_OVR */
73 current += acpi_create_madt_irqoverride((void *)current, 0, 0, 2, 0);
74
75 flags |= soc_madt_sci_irq_polarity(sci);
76
77 /* SCI */
78 current +=
79 acpi_create_madt_irqoverride((void *)current, 0, sci, sci, flags);
80
Michael Niewöhner14512f92020-11-23 15:53:28 +010081 /* NMI */
82 current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, 0xff, 5, 1);
83
Wonkyu Kim0aeedd42021-03-22 20:07:15 -070084 if (is_x2apic_mode())
85 current += acpi_create_madt_lx2apic_nmi((acpi_madt_lx2apic_nmi_t *)current,
Kyösti Mälkki6c7e9452021-06-03 14:48:52 +030086 0xffffffff, 0x5, 1);
Wonkyu Kim0aeedd42021-03-22 20:07:15 -070087
Shaunak Sahabd427802017-07-18 00:19:33 -070088 return current;
89}
90
Marc Jones847043c2020-12-02 11:24:00 -070091__weak const struct madt_ioapic_info *soc_get_ioapic_info(size_t *entries)
92{
93 *entries = 0;
94 return NULL;
95}
96
Shaunak Sahabd427802017-07-18 00:19:33 -070097unsigned long acpi_fill_madt(unsigned long current)
98{
Marc Jones847043c2020-12-02 11:24:00 -070099 const struct madt_ioapic_info *ioapic_table;
100 size_t ioapic_entries;
101
Shaunak Sahabd427802017-07-18 00:19:33 -0700102 /* Local APICs */
103 current = acpi_create_madt_lapics(current);
104
105 /* IOAPIC */
Marc Jones847043c2020-12-02 11:24:00 -0700106 ioapic_table = soc_get_ioapic_info(&ioapic_entries);
107 if (ioapic_entries) {
108 for (int i = 0; i < ioapic_entries; i++) {
109 current += acpi_create_madt_ioapic(
110 (void *)current,
111 ioapic_table[i].id,
112 ioapic_table[i].addr,
113 ioapic_table[i].gsi_base);
114 }
115 } else {
116 /* Default SOC IOAPIC entry */
117 current += acpi_create_madt_ioapic((void *)current, 2, IO_APIC_ADDR, 0);
118 }
Shaunak Sahabd427802017-07-18 00:19:33 -0700119
120 return acpi_madt_irq_overrides(current);
121}
122
Shaunak Sahabd427802017-07-18 00:19:33 -0700123void acpi_fill_fadt(acpi_fadt_t *fadt)
124{
125 const uint16_t pmbase = ACPI_BASE_ADDRESS;
126
Marc Jonesf9ea7ed2018-08-22 18:59:26 -0600127 fadt->header.revision = get_acpi_table_revision(FADT);
Shaunak Sahabd427802017-07-18 00:19:33 -0700128
129 fadt->sci_int = acpi_sci_irq();
Kyösti Mälkkic328a682019-11-23 07:23:40 +0200130
Kyösti Mälkki0a9e72e2019-08-11 01:22:28 +0300131 if (permanent_smi_handler()) {
Kyösti Mälkkic328a682019-11-23 07:23:40 +0200132 fadt->smi_cmd = APM_CNT;
133 fadt->acpi_enable = APM_CNT_ACPI_ENABLE;
134 fadt->acpi_disable = APM_CNT_ACPI_DISABLE;
135 }
Shaunak Sahabd427802017-07-18 00:19:33 -0700136
137 fadt->pm1a_evt_blk = pmbase + PM1_STS;
Shaunak Sahabd427802017-07-18 00:19:33 -0700138 fadt->pm1a_cnt_blk = pmbase + PM1_CNT;
Shaunak Sahabd427802017-07-18 00:19:33 -0700139
140 fadt->gpe0_blk = pmbase + GPE0_STS(0);
141
142 fadt->pm1_evt_len = 4;
143 fadt->pm1_cnt_len = 2;
144
145 /* GPE0 STS/EN pairs each 32 bits wide. */
146 fadt->gpe0_blk_len = 2 * GPE0_REG_MAX * sizeof(uint32_t);
147
Shaunak Sahabd427802017-07-18 00:19:33 -0700148 fadt->day_alrm = 0xd;
149
Angel Ponsa208c6c2020-07-13 00:02:34 +0200150 fadt->flags |= ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED |
Michael Niewöhner2353cd92021-10-04 16:59:49 +0200151 ACPI_FADT_SLEEP_BUTTON |
Michael Niewöhner5c259642021-09-25 00:40:52 +0200152 ACPI_FADT_SEALED_CASE | ACPI_FADT_S4_RTC_WAKE;
153
154 if (CONFIG(USE_PM_ACPI_TIMER) || !CONFIG(PM_ACPI_TIMER_OPTIONAL))
155 fadt->flags |= ACPI_FADT_PLATFORM_CLOCK;
Shaunak Sahabd427802017-07-18 00:19:33 -0700156
Elyes HAOUAS04071f42020-07-20 17:05:24 +0200157 fadt->x_pm1a_evt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
Shaunak Sahabd427802017-07-18 00:19:33 -0700158 fadt->x_pm1a_evt_blk.bit_width = fadt->pm1_evt_len * 8;
159 fadt->x_pm1a_evt_blk.addrl = pmbase + PM1_STS;
Angel Pons12a4d052020-07-14 01:31:27 +0200160 fadt->x_pm1a_evt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100161
Elyes HAOUAS04071f42020-07-20 17:05:24 +0200162 fadt->x_pm1a_cnt_blk.space_id = ACPI_ADDRESS_SPACE_IO;
Shaunak Sahabd427802017-07-18 00:19:33 -0700163 fadt->x_pm1a_cnt_blk.bit_width = fadt->pm1_cnt_len * 8;
164 fadt->x_pm1a_cnt_blk.addrl = pmbase + PM1_CNT;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100165 fadt->x_pm1a_cnt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
Shaunak Sahabd427802017-07-18 00:19:33 -0700166
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100167 /*
168 * Windows 10 requires x_gpe0_blk to be set starting with FADT revision 5.
169 * The bit_width field intentionally overflows here.
170 * The OSPM can instead use the values in `fadt->gpe0_blk{,_len}`, which
171 * seems to work fine on Linux 5.0 and Windows 10.
172 */
173 fadt->x_gpe0_blk.space_id = ACPI_ADDRESS_SPACE_IO;
174 fadt->x_gpe0_blk.bit_width = fadt->gpe0_blk_len * 8;
175 fadt->x_gpe0_blk.bit_offset = 0;
Angel Ponsa23aff32020-06-21 20:47:54 +0200176 fadt->x_gpe0_blk.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
Patrick Rudolphc02bda02020-02-28 10:19:41 +0100177 fadt->x_gpe0_blk.addrl = fadt->gpe0_blk;
178 fadt->x_gpe0_blk.addrh = 0;
Shaunak Sahabd427802017-07-18 00:19:33 -0700179}
180
Furquan Shaikh0f007d82020-04-24 06:41:18 -0700181unsigned long southbridge_write_acpi_tables(const struct device *device,
Shaunak Sahabd427802017-07-18 00:19:33 -0700182 unsigned long current,
183 struct acpi_rsdp *rsdp)
184{
Marc Jones5258f4f2020-12-02 11:29:09 -0700185 if (CONFIG(SOC_INTEL_COMMON_BLOCK_UART)) {
186 current = acpi_write_dbg2_pci_uart(rsdp, current,
187 uart_get_device(),
188 ACPI_ACCESS_SIZE_DWORD_ACCESS);
189 }
190
Shaunak Sahabd427802017-07-18 00:19:33 -0700191 return acpi_write_hpet(device, current, rsdp);
192}
193
Aaron Durbin64031672018-04-21 14:45:32 -0600194__weak
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200195void acpi_fill_soc_wake(uint32_t *pm1_en, uint32_t *gpe0_en,
196 const struct chipset_power_state *ps)
Shaunak Sahabd427802017-07-18 00:19:33 -0700197{
Shaunak Sahabd427802017-07-18 00:19:33 -0700198}
199
200/*
201 * Save wake source information for calculating ACPI _SWS values
202 *
203 * @pm1: PM1_STS register with only enabled events set
204 * @gpe0: GPE0_STS registers with only enabled events set
205 *
Kyösti Mälkkif67e67512021-01-22 19:59:07 +0200206 * return the number of registers in the gpe0 array
Shaunak Sahabd427802017-07-18 00:19:33 -0700207 */
208
Kyösti Mälkkica71e132021-01-15 05:06:35 +0200209int soc_fill_acpi_wake(const struct chipset_power_state *ps, uint32_t *pm1, uint32_t **gpe0)
Shaunak Sahabd427802017-07-18 00:19:33 -0700210{
Shaunak Sahabd427802017-07-18 00:19:33 -0700211 static uint32_t gpe0_sts[GPE0_REG_MAX];
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200212 uint32_t gpe0_en[GPE0_REG_MAX];
Shaunak Sahabd427802017-07-18 00:19:33 -0700213 uint32_t pm1_en;
214 int i;
215
Shaunak Sahabd427802017-07-18 00:19:33 -0700216 /*
217 * PM1_EN to check the basic wake events which can happen through
218 * powerbtn or any other wake source like lidopen, key board press etc.
219 */
220 pm1_en = ps->pm1_en;
Michael Niewöhnerf855b8b2021-10-10 16:56:31 +0200221 pm1_en |= WAK_STS | PWRBTN_EN;
Shaunak Sahabd427802017-07-18 00:19:33 -0700222
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200223 memcpy(gpe0_en, ps->gpe0_en, sizeof(gpe0_en));
224
225 acpi_fill_soc_wake(&pm1_en, gpe0_en, ps);
Shaunak Sahabd427802017-07-18 00:19:33 -0700226
227 *pm1 = ps->pm1_sts & pm1_en;
228
229 /* Mask off GPE0 status bits that are not enabled */
230 *gpe0 = &gpe0_sts[0];
231 for (i = 0; i < GPE0_REG_MAX; i++)
Michael Niewöhner820b9c42021-09-30 21:03:07 +0200232 gpe0_sts[i] = ps->gpe0_sts[i] & gpe0_en[i];
Shaunak Sahabd427802017-07-18 00:19:33 -0700233
234 return GPE0_REG_MAX;
235}
236
Marc Jonesa81703c2020-12-18 10:44:47 -0700237int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio)
Shaunak Sahabd427802017-07-18 00:19:33 -0700238{
239 u32 m;
240 u32 power;
241
242 /*
243 * M = ((1.1 - ((p1_ratio - ratio) * 0.00625)) / 1.1) ^ 2
244 *
245 * Power = (ratio / p1_ratio) * m * tdp
246 */
247
248 m = (110000 - ((p1_ratio - ratio) * 625)) / 11;
249 m = (m * m) / 1000;
250
251 power = ((ratio * 100000 / p1_ratio) / 100);
252 power *= (m / 100) * (tdp / 1000);
253 power /= 1000;
254
255 return power;
256}
257
Shaunak Sahabd427802017-07-18 00:19:33 -0700258static void generate_c_state_entries(void)
259{
260 acpi_cstate_t *c_state_map;
261 size_t entries;
262
263 c_state_map = soc_get_cstate_map(&entries);
264
265 /* Generate C-state tables */
266 acpigen_write_CST_package(c_state_map, entries);
267}
268
269void generate_p_state_entries(int core, int cores_per_package)
270{
271 int ratio_min, ratio_max, ratio_turbo, ratio_step;
272 int coord_type, power_max, num_entries;
273 int ratio, power, clock, clock_max;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100274 bool turbo;
Shaunak Sahabd427802017-07-18 00:19:33 -0700275
276 coord_type = cpu_get_coord_type();
277 ratio_min = cpu_get_min_ratio();
278 ratio_max = cpu_get_max_ratio();
279 clock_max = (ratio_max * cpu_get_bus_clock()) / KHz;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100280 turbo = (get_turbo_state() == TURBO_ENABLED);
Shaunak Sahabd427802017-07-18 00:19:33 -0700281
282 /* Calculate CPU TDP in mW */
283 power_max = cpu_get_power_max();
284
285 /* Write _PCT indicating use of FFixedHW */
286 acpigen_write_empty_PCT();
287
288 /* Write _PPC with no limit on supported P-state */
289 acpigen_write_PPC_NVS();
290 /* Write PSD indicating configured coordination type */
291 acpigen_write_PSD_package(core, 1, coord_type);
292
293 /* Add P-state entries in _PSS table */
294 acpigen_write_name("_PSS");
295
296 /* Determine ratio points */
297 ratio_step = PSS_RATIO_STEP;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100298 do {
Shaunak Sahabd427802017-07-18 00:19:33 -0700299 num_entries = ((ratio_max - ratio_min) / ratio_step) + 1;
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100300 if (((ratio_max - ratio_min) % ratio_step) > 0)
301 num_entries += 1;
302 if (turbo)
303 num_entries += 1;
304 if (num_entries > PSS_MAX_ENTRIES)
305 ratio_step += 1;
306 } while (num_entries > PSS_MAX_ENTRIES);
307
308 /* _PSS package count depends on Turbo */
309 acpigen_write_package(num_entries);
Shaunak Sahabd427802017-07-18 00:19:33 -0700310
311 /* P[T] is Turbo state if enabled */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100312 if (turbo) {
Shaunak Sahabd427802017-07-18 00:19:33 -0700313 ratio_turbo = cpu_get_max_turbo_ratio();
314
315 /* Add entry for Turbo ratio */
316 acpigen_write_PSS_package(clock_max + 1, /* MHz */
317 power_max, /* mW */
318 PSS_LATENCY_TRANSITION,/* lat1 */
319 PSS_LATENCY_BUSMASTER,/* lat2 */
320 ratio_turbo << 8, /* control */
321 ratio_turbo << 8); /* status */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100322 num_entries -= 1;
Shaunak Sahabd427802017-07-18 00:19:33 -0700323 }
324
325 /* First regular entry is max non-turbo ratio */
326 acpigen_write_PSS_package(clock_max, /* MHz */
327 power_max, /* mW */
328 PSS_LATENCY_TRANSITION,/* lat1 */
329 PSS_LATENCY_BUSMASTER,/* lat2 */
330 ratio_max << 8, /* control */
331 ratio_max << 8); /* status */
Julien Viard de Galbertc2540a92018-11-06 09:28:03 +0100332 num_entries -= 1;
Shaunak Sahabd427802017-07-18 00:19:33 -0700333
334 /* Generate the remaining entries */
335 for (ratio = ratio_min + ((num_entries - 1) * ratio_step);
336 ratio >= ratio_min; ratio -= ratio_step) {
337
338 /* Calculate power at this ratio */
Marc Jonesa81703c2020-12-18 10:44:47 -0700339 power = common_calculate_power_ratio(power_max, ratio_max, ratio);
Shaunak Sahabd427802017-07-18 00:19:33 -0700340 clock = (ratio * cpu_get_bus_clock()) / KHz;
341
342 acpigen_write_PSS_package(clock, /* MHz */
343 power, /* mW */
344 PSS_LATENCY_TRANSITION,/* lat1 */
345 PSS_LATENCY_BUSMASTER,/* lat2 */
346 ratio << 8, /* control */
347 ratio << 8); /* status */
348 }
349 /* Fix package length */
350 acpigen_pop_len();
351}
352
Julien Viard de Galbert595202c2018-03-29 14:01:01 +0200353__attribute__ ((weak)) acpi_tstate_t *soc_get_tss_table(int *entries)
Shaunak Sahabd427802017-07-18 00:19:33 -0700354{
355 *entries = 0;
356 return NULL;
357}
358
359void generate_t_state_entries(int core, int cores_per_package)
360{
361 acpi_tstate_t *soc_tss_table;
362 int entries;
363
364 soc_tss_table = soc_get_tss_table(&entries);
365 if (entries == 0)
366 return;
367
368 /* Indicate SW_ALL coordination for T-states */
369 acpigen_write_TSD_package(core, cores_per_package, SW_ALL);
370
371 /* Indicate FixedHW so OS will use MSR */
372 acpigen_write_empty_PTC();
373
374 /* Set NVS controlled T-state limit */
375 acpigen_write_TPC("\\TLVL");
376
377 /* Write TSS table for MSR access */
378 acpigen_write_TSS_package(entries, soc_tss_table);
379}
380
Michael Niewöhnered21df62020-09-19 00:08:45 +0200381static void generate_cppc_entries(int core_id)
382{
383 if (!(CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPPC) &&
384 cpuid_eax(6) & CPUID_6_EAX_ISST))
385 return;
386
387 /* Generate GCPC package in first logical core */
388 if (core_id == 0) {
389 struct cppc_config cppc_config;
390 cpu_init_cppc_config(&cppc_config, CPPC_VERSION_2);
391 acpigen_write_CPPC_package(&cppc_config);
392 }
393
394 /* Write _CPC entry for each logical core */
395 acpigen_write_CPPC_method();
396}
397
Aaron Durbin64031672018-04-21 14:45:32 -0600398__weak void soc_power_states_generation(int core_id,
Shaunak Sahabd427802017-07-18 00:19:33 -0700399 int cores_per_package)
400{
401}
402
Furquan Shaikh7536a392020-04-24 21:59:21 -0700403void generate_cpu_entries(const struct device *device)
Shaunak Sahabd427802017-07-18 00:19:33 -0700404{
Michael Niewöhner2353cd92021-10-04 16:59:49 +0200405 int core_id, cpu_id;
Shaunak Sahabd427802017-07-18 00:19:33 -0700406 int totalcores = dev_count_cpu();
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100407 unsigned int num_virt;
408 unsigned int num_phys;
Shaunak Sahabd427802017-07-18 00:19:33 -0700409
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100410 cpu_read_topology(&num_phys, &num_virt);
411
412 int numcpus = totalcores / num_virt;
413
414 printk(BIOS_DEBUG, "Found %d CPU(s) with %d/%d physical/logical core(s) each.\n",
415 numcpus, num_phys, num_virt);
Shaunak Sahabd427802017-07-18 00:19:33 -0700416
417 for (cpu_id = 0; cpu_id < numcpus; cpu_id++) {
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100418 for (core_id = 0; core_id < num_virt; core_id++) {
Christian Walterbe3979c2019-12-18 15:07:59 +0100419 /* Generate processor \_SB.CPUx */
Michael Niewöhner2353cd92021-10-04 16:59:49 +0200420 acpigen_write_processor((cpu_id) * num_virt + core_id, 0, 0);
Shaunak Sahabd427802017-07-18 00:19:33 -0700421
422 /* Generate C-state tables */
423 generate_c_state_entries();
424
Michael Niewöhnered21df62020-09-19 00:08:45 +0200425 generate_cppc_entries(core_id);
426
Shaunak Sahabd427802017-07-18 00:19:33 -0700427 /* Soc specific power states generation */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100428 soc_power_states_generation(core_id, num_virt);
Shaunak Sahabd427802017-07-18 00:19:33 -0700429
430 acpigen_pop_len();
431 }
432 }
Arthur Heymans0ac555e2018-11-28 12:25:54 +0100433 /* PPKG is usually used for thermal management
434 of the first and only package. */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100435 acpigen_write_processor_package("PPKG", 0, num_virt);
Arthur Heymans0ac555e2018-11-28 12:25:54 +0100436
437 /* Add a method to notify processor nodes */
Patrick Rudolph7a66ffb2020-12-17 14:42:29 +0100438 acpigen_write_processor_cnot(num_virt);
Shaunak Sahabd427802017-07-18 00:19:33 -0700439}