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