1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <console/console.h>
7 struct device
*add_cpu_device(struct bus
*cpu_bus
, unsigned int apic_id
,
10 struct device_path cpu_path
= {};
13 /* Build the CPU device path */
14 cpu_path
.type
= DEVICE_PATH_APIC
;
15 cpu_path
.apic
.apic_id
= apic_id
;
16 cpu_path
.apic
.initial_lapicid
= apic_id
;
18 /* Update CPU in devicetree. */
20 cpu
= alloc_find_dev(cpu_bus
, &cpu_path
);
22 cpu
= find_dev_path(cpu_bus
, &cpu_path
);
26 cpu
->enabled
= enabled
;
27 printk(BIOS_DEBUG
, "CPU: %s %s\n",
28 dev_path(cpu
), cpu
->enabled
?"enabled":"disabled");