2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* Copyright 2004 James Cleverdon, IBM.
|
|
|
|
* Subject to the GNU Public License, v.2
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
#include <linux/threads.h>
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
#include <linux/string.h>
|
2016-07-14 07:18:56 +07:00
|
|
|
#include <linux/init.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/ctype.h>
|
2008-03-29 02:12:16 +07:00
|
|
|
#include <linux/hardirq.h>
|
2008-07-26 09:39:03 +07:00
|
|
|
#include <linux/dmar.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#include <asm/smp.h>
|
2009-02-17 19:58:15 +07:00
|
|
|
#include <asm/apic.h>
|
2009-02-17 14:02:14 +07:00
|
|
|
#include <asm/ipi.h>
|
2008-11-18 06:19:53 +07:00
|
|
|
#include <asm/setup.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
|
|
|
|
*/
|
2009-01-28 12:50:47 +07:00
|
|
|
void __init default_setup_apic_routing(void)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2011-05-21 07:51:18 +07:00
|
|
|
struct apic **drv;
|
2010-08-28 01:09:50 +07:00
|
|
|
|
|
|
|
enable_IR_x2apic();
|
|
|
|
|
2011-05-21 07:51:18 +07: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-20 06:45:46 +07:00
|
|
|
break;
|
|
|
|
}
|
2008-07-26 09:39:03 +07:00
|
|
|
}
|
2010-01-19 03:10:49 +07:00
|
|
|
|
2012-06-03 05:11:34 +07:00
|
|
|
if (x86_platform.apic_post_init)
|
|
|
|
x86_platform.apic_post_init();
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2007-05-03 00:27:04 +07:00
|
|
|
/* Same for both flat and physical. */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2008-07-11 01:16:53 +07:00
|
|
|
void apic_send_IPI_self(int vector)
|
2005-04-17 05:20:36 +07:00
|
|
|
{
|
2009-01-28 21:42:24 +07:00
|
|
|
__default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
2008-03-29 02:12:06 +07:00
|
|
|
|
2009-01-28 09:43:47 +07:00
|
|
|
int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
2008-03-29 02:12:06 +07:00
|
|
|
{
|
2011-05-21 07:51:18 +07:00
|
|
|
struct apic **drv;
|
2008-07-22 12:08:21 +07:00
|
|
|
|
2011-05-21 07:51:18 +07: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 12:08:21 +07:00
|
|
|
return 1;
|
|
|
|
}
|
2008-03-29 02:12:06 +07:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|