]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/acpi: Add functions to setup and access the wakeup mailbox
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Wed, 4 Mar 2026 23:41:13 +0000 (15:41 -0800)
committerDexuan Cui <decui@microsoft.com>
Thu, 28 May 2026 20:01:25 +0000 (20:01 +0000)
Systems that describe hardware using DeviceTree graphs may enumerate and
implement the wakeup mailbox as defined in the ACPI specification but do
not otherwise depend on ACPI. Expose functions to setup and access the
location of the wakeup mailbox from outside ACPI code.

The function acpi_setup_mp_wakeup_mailbox() stores the physical address of
the mailbox and updates the wakeup_secondary_cpu_64() APIC callback.

The function acpi_madt_multiproc_wakeup_mailbox() returns a pointer to the
mailbox.

Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Dexuan Cui <dexuan@kernel.org>
arch/x86/include/asm/acpi.h
arch/x86/kernel/acpi/madt_wakeup.c

index a03aa6f999d1587a15273e871e5f9e72c2d7d8d4..820df375df7944279186777c57966c03f316e8ed 100644 (file)
@@ -182,6 +182,9 @@ void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
 #define acpi_os_ioremap acpi_os_ioremap
 #endif
 
+void acpi_setup_mp_wakeup_mailbox(u64 addr);
+struct acpi_madt_multiproc_wakeup_mailbox *acpi_get_mp_wakeup_mailbox(void);
+
 #else /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
@@ -200,6 +203,13 @@ static inline u64 x86_default_get_root_pointer(void)
        return 0;
 }
 
+static inline void acpi_setup_mp_wakeup_mailbox(u64 addr) { }
+
+static inline struct acpi_madt_multiproc_wakeup_mailbox *acpi_get_mp_wakeup_mailbox(void)
+{
+       return NULL;
+}
+
 #endif /* !CONFIG_ACPI */
 
 #define ARCH_HAS_POWER_INIT    1
index 6d7603511f52c38b0290f600a94df046defb7a3a..82caf44b45e391ba63f29fa0b1a7f414ca2fa5b9 100644 (file)
@@ -247,3 +247,14 @@ int __init acpi_parse_mp_wake(union acpi_subtable_headers *header,
 
        return 0;
 }
+
+void __init acpi_setup_mp_wakeup_mailbox(u64 mailbox_paddr)
+{
+       acpi_mp_wake_mailbox_paddr = mailbox_paddr;
+       apic_update_callback(wakeup_secondary_cpu_64, acpi_wakeup_cpu);
+}
+
+struct acpi_madt_multiproc_wakeup_mailbox *acpi_get_mp_wakeup_mailbox(void)
+{
+       return acpi_mp_wake_mailbox;
+}