• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <acpi/acpi.h>
5 #include <acpi/acpigen.h>
6 #include <device/device.h>
7 #include "i82371eb.h"
8 
generate_cpu_entry(int cpu)9 static void generate_cpu_entry(int cpu)
10 {
11 	acpigen_write_processor_device(cpu);
12 
13 	/* bit 1:3 in PCNTRL reg (pmbase+0x10) */
14 	acpigen_write_PTC(3, 1, DEFAULT_PMBASE + PCNTRL);
15 
16 	acpigen_write_processor_device_end();
17 }
18 
generate_cpu_entries(const struct device * device)19 void generate_cpu_entries(const struct device *device)
20 {
21 	int cpu;
22 	int numcpus = dev_count_cpu();
23 
24 	printk(BIOS_DEBUG, "Found %d CPU(s).\n", numcpus);
25 
26 	/* without the outer scope, further ssdt addition will end up
27 	 * within the processor statement */
28 	acpigen_write_scope("\\_SB");
29 
30 	for (cpu = 0; cpu < numcpus; cpu++)
31 		generate_cpu_entry(cpu);
32 
33 	acpigen_pop_len();
34 }
35