summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2018-07-10 13:06:55 +0000
committerkettenis <kettenis@openbsd.org>2018-07-10 13:06:55 +0000
commitc71246930d9cc14c69dc914304e0225e0ecce65a (patch)
tree044218a737369aba8ff819b45b56d639b1b553e6
parent__func__ log statements and some whitespace knf (diff)
downloadwireguard-openbsd-c71246930d9cc14c69dc914304e0225e0ecce65a.tar.xz
wireguard-openbsd-c71246930d9cc14c69dc914304e0225e0ecce65a.zip
Always use PSCI to enable secondary CPUs if it is detected.
-rw-r--r--sys/arch/arm64/stand/efiboot/efiacpi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/arm64/stand/efiboot/efiacpi.c b/sys/arch/arm64/stand/efiboot/efiacpi.c
index 2c93e2c2053..1c5155ac7ca 100644
--- a/sys/arch/arm64/stand/efiboot/efiacpi.c
+++ b/sys/arch/arm64/stand/efiboot/efiacpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efiacpi.c,v 1.3 2018/07/09 14:01:13 kettenis Exp $ */
+/* $OpenBSD: efiacpi.c,v 1.4 2018/07/10 13:06:55 kettenis Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
@@ -324,6 +324,8 @@ struct acpi_spcr {
/* We'll never see ACPI 1.0 tables on ARM. */
static EFI_GUID acpi_guid = ACPI_20_TABLE_GUID;
+static int psci = 0;
+
void
efi_acpi_fadt(struct acpi_table_header *hdr)
{
@@ -337,6 +339,8 @@ efi_acpi_fadt(struct acpi_table_header *hdr)
if (fadt->hdr_revision < 5)
return;
+ psci = fadt->arm_boot_arch & FADT_PSCI_COMPLIANT;
+
node = fdt_find_node("/psci");
if (fadt->arm_boot_arch & FADT_PSCI_COMPLIANT)
fdt_node_set_string_property(node, "status", "okay");
@@ -402,7 +406,7 @@ efi_acpi_madt_gic(struct acpi_madt_gic *gic)
fdt_node_add_string_property(child, "device_type", "cpu");
fdt_node_add_string_property(child, "compatible", "arm,armv8");
fdt_node_add_property(child, "reg", &reg, sizeof(reg));
- if (gic->parking_protocol_version == 0)
+ if (gic->parking_protocol_version == 0 || psci)
fdt_node_add_string_property(child, "enable-method", "psci");
if ((gic->flags & ACPI_PROC_ENABLE) == 0)
fdt_node_add_string_property(child, "status", "disabled");