2019-05-28 10:10:25 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2005-04-16 15:20:36 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2004 James Cleverdon, IBM.
|
|
|
|
*
|
2005-07-28 21:15:42 -07:00
|
|
|
* Flat APIC subarch code.
|
2005-04-16 15:20:36 -07:00
|
|
|
*
|
|
|
|
* Hacked for x86-64 by James Cleverdon from i386 architecture code by
|
|
|
|
* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
|
|
|
|
* James Cleverdon.
|
|
|
|
*/
|
2016-07-13 20:18:56 -04:00
|
|
|
#include <linux/export.h>
|
2018-12-05 00:34:56 +01:00
|
|
|
|
2019-07-22 20:47:11 +02:00
|
|
|
#include <asm/apic.h>
|
2019-07-22 20:47:12 +02:00
|
|
|
|
2019-07-22 20:47:14 +02:00
|
|
|
#include "local.h"
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-07-28 13:06:10 +02:00
|
|
|
static u32 physflat_get_apic_id(u32 x)
|
2008-07-12 01:01:20 -07:00
|
|
|
{
|
2016-09-11 14:58:21 +09:00
|
|
|
return (x >> 24) & 0xFF;
|
2008-07-12 01:01:20 -07:00
|
|
|
}
|
|
|
|
|
2024-07-28 13:06:10 +02:00
|
|
|
static int physflat_probe(void)
|
2011-12-21 17:45:15 -08:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2008-10-12 11:44:09 +02:00
|
|
|
static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
2008-07-21 22:08:21 -07:00
|
|
|
{
|
2024-07-28 13:06:10 +02:00
|
|
|
return 1;
|
2011-05-19 16:45:46 -07:00
|
|
|
}
|
|
|
|
|
2016-08-08 16:29:06 -07:00
|
|
|
static struct apic apic_physflat __ro_after_init = {
|
2009-01-28 02:37:01 +01:00
|
|
|
|
|
|
|
.name = "physical flat",
|
2011-05-19 16:45:46 -07:00
|
|
|
.probe = physflat_probe,
|
2009-01-28 02:37:01 +01:00
|
|
|
.acpi_madt_oem_check = physflat_acpi_madt_oem_check,
|
|
|
|
|
2020-10-24 22:35:08 +01:00
|
|
|
.dest_mode_logical = false,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2009-01-28 05:08:44 +01:00
|
|
|
.disable_esr = 0,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2009-01-28 06:50:47 +01:00
|
|
|
.cpu_present_to_apicid = default_cpu_present_to_apicid,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2023-08-08 15:04:10 -07:00
|
|
|
.max_apic_id = 0xFE,
|
2024-07-28 13:06:10 +02:00
|
|
|
.get_apic_id = physflat_get_apic_id,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2017-09-13 23:29:37 +02:00
|
|
|
.calc_dest_apicid = apic_default_calc_apicid,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2015-11-04 22:57:02 +00:00
|
|
|
.send_IPI = default_send_IPI_single_phys,
|
2015-11-04 22:57:02 +00:00
|
|
|
.send_IPI_mask = default_send_IPI_mask_sequence_phys,
|
|
|
|
.send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_phys,
|
2019-07-22 20:47:29 +02:00
|
|
|
.send_IPI_allbutself = default_send_IPI_allbutself,
|
|
|
|
.send_IPI_all = default_send_IPI_all,
|
|
|
|
.send_IPI_self = default_send_IPI_self,
|
2023-10-02 14:00:07 +02:00
|
|
|
.nmi_to_offline_cpu = true,
|
2009-01-28 02:37:01 +01:00
|
|
|
|
2009-02-16 23:02:14 -08:00
|
|
|
.read = native_apic_mem_read,
|
|
|
|
.write = native_apic_mem_write,
|
2023-08-08 15:04:15 -07:00
|
|
|
.eoi = native_apic_mem_eoi,
|
2009-02-16 23:02:14 -08:00
|
|
|
.icr_read = native_apic_icr_read,
|
|
|
|
.icr_write = native_apic_icr_write,
|
2023-08-08 15:04:04 -07:00
|
|
|
.wait_icr_idle = apic_mem_wait_icr_idle,
|
2023-08-08 15:04:06 -07:00
|
|
|
.safe_wait_icr_idle = apic_mem_wait_icr_idle_timeout,
|
2005-07-28 21:15:42 -07:00
|
|
|
};
|
2024-07-28 13:06:10 +02:00
|
|
|
apic_driver(apic_physflat);
|
2011-05-20 17:51:17 -07:00
|
|
|
|
2024-07-28 13:06:10 +02:00
|
|
|
struct apic *apic __ro_after_init = &apic_physflat;
|
|
|
|
EXPORT_SYMBOL_GPL(apic);
|