acpi: Add processor device

Add a new method to write the processor device identified by _HID
ACPI0007, that is preferred over the Processor OpCode since ACPI 6.0.

Fixes booting arm using ACPI only since the Processor OpCode isn't
found valid by the Linux kernel.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
This commit is contained in:
Patrick Rudolph
2024-10-23 15:19:58 +02:00
committed by Tom Rini
parent f570ab6361
commit 4ac655cd1a
2 changed files with 23 additions and 0 deletions

View File

@@ -361,6 +361,17 @@ void acpigen_write_processor(struct acpi_ctx *ctx, uint cpuindex,
acpigen_emit_byte(ctx, pblock_len);
}
void acpigen_write_processor_device(struct acpi_ctx *ctx, uint cpuindex)
{
char pscope[16];
snprintf(pscope, sizeof(pscope), ACPI_CPU_STRING, cpuindex);
acpigen_write_device(ctx, pscope);
acpigen_write_name_string(ctx, "_HID", "ACPI0007");
acpigen_write_name_integer(ctx, "_UID", cpuindex);
acpigen_pop_len(ctx); /* Device */
}
void acpigen_write_processor_package(struct acpi_ctx *ctx,
const char *const name,
const uint first_core,