2019-05-28 17:10:25 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2004 James Cleverdon, IBM.
|
|
|
|
*
|
|
|
|
* Generic APIC sub-arch probe layer.
|
|
|
|
*
|
|
|
|
* Hacked for x86-64 by James Cleverdon from i386 architecture code by
|
|
|
|
* Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
|
|
|
|
* James Cleverdon.
|
|
|
|
*/
|
2020-08-06 12:35:11 +00:00
|
|
|
#include <linux/thread_info.h>
|
2009-02-17 12:58:15 +00:00
|
|
|
#include <asm/apic.h>
|
2019-07-22 18:47:12 +00:00
|
|
|
|
2019-07-22 18:47:14 +00:00
|
|
|
#include "local.h"
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
|
|
|
|
*/
|
2009-01-28 05:50:47 +00:00
|
|
|
void __init default_setup_apic_routing(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2011-05-21 00:51:18 +00:00
|
|
|
struct apic **drv;
|
2010-08-27 18:09:50 +00:00
|
|
|
|
|
|
|
enable_IR_x2apic();
|
|
|
|
|
2011-05-21 00:51:18 +00:00
|
|
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
|
|
|
if ((*drv)->probe && (*drv)->probe()) {
|
|
|
|
if (apic != *drv) {
|
|
|
|
apic = *drv;
|
|
|
|
pr_info("Switched APIC routing to %s.\n",
|
|
|
|
apic->name);
|
|
|
|
}
|
2011-05-19 23:45:46 +00:00
|
|
|
break;
|
|
|
|
}
|
2008-07-26 02:39:03 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2009-01-28 02:43:47 +00:00
|
|
|
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
2008-03-28 19:12:06 +00:00
|
|
|
{
|
2011-05-21 00:51:18 +00:00
|
|
|
struct apic **drv;
|
2008-07-22 05:08:21 +00:00
|
|
|
|
2011-05-21 00:51:18 +00:00
|
|
|
for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
|
|
|
|
if ((*drv)->acpi_madt_oem_check(oem_id, oem_table_id)) {
|
|
|
|
if (apic != *drv) {
|
|
|
|
apic = *drv;
|
|
|
|
pr_info("Setting APIC routing to %s.\n",
|
|
|
|
apic->name);
|
|
|
|
}
|
2008-07-22 05:08:21 +00:00
|
|
|
return 1;
|
|
|
|
}
|
2008-03-28 19:12:06 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|