2008-06-08 21:31:54 -04:00
|
|
|
/*
|
|
|
|
* APIC driver for the IBM NUMAQ chipset.
|
|
|
|
*/
|
|
|
|
#define APIC_DEFINITION 1
|
|
|
|
#include <linux/threads.h>
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
#include <asm/mpspec.h>
|
|
|
|
#include <asm/genapic.h>
|
|
|
|
#include <asm/fixmap.h>
|
|
|
|
#include <asm/apicdef.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/init.h>
|
2008-07-25 05:17:55 -04:00
|
|
|
#include <asm/numaq/apicdef.h>
|
2008-07-11 21:43:10 -04:00
|
|
|
#include <linux/smp.h>
|
2008-07-25 05:17:55 -04:00
|
|
|
#include <asm/numaq/apic.h>
|
|
|
|
#include <asm/numaq/ipi.h>
|
|
|
|
#include <asm/numaq/mpparse.h>
|
|
|
|
#include <asm/numaq/wakecpu.h>
|
2008-06-08 21:31:54 -04:00
|
|
|
#include <asm/numaq.h>
|
|
|
|
|
2009-01-28 07:44:32 -05:00
|
|
|
static int __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
|
2008-06-08 21:31:54 -04:00
|
|
|
{
|
|
|
|
numaq_mps_oem_check(mpc, oem, productid);
|
|
|
|
return found_numaq;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int probe_numaq(void)
|
|
|
|
{
|
|
|
|
/* already know from get_memcfg_numaq() */
|
|
|
|
return found_numaq;
|
|
|
|
}
|
|
|
|
|
2009-01-28 00:50:47 -05:00
|
|
|
static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
|
2008-08-19 23:50:28 -04:00
|
|
|
{
|
|
|
|
/* Careful. Some cpus do not strictly honor the set of cpus
|
|
|
|
* specified in the interrupt destination when using lowest
|
|
|
|
* priority interrupt delivery mode.
|
|
|
|
*
|
|
|
|
* In particular there was a hyperthreading cpu observed to
|
|
|
|
* deliver interrupts to the wrong hyperthread when only one
|
|
|
|
* hyperthread was specified in the interrupt desitination.
|
|
|
|
*/
|
2008-12-16 20:33:52 -05:00
|
|
|
*retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
|
2008-08-19 23:50:28 -04:00
|
|
|
}
|
|
|
|
|
2009-01-28 06:43:18 -05:00
|
|
|
static void numaq_setup_portio_remap(void)
|
|
|
|
{
|
|
|
|
int num_quads = num_online_nodes();
|
|
|
|
|
|
|
|
if (num_quads <= 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
|
|
|
|
xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
|
|
|
|
printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
|
|
|
|
(u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
|
|
|
|
}
|
|
|
|
|
2009-01-27 21:32:03 -05:00
|
|
|
struct genapic apic_numaq = {
|
|
|
|
|
|
|
|
.name = "NUMAQ",
|
|
|
|
.probe = probe_numaq,
|
2009-01-27 21:43:47 -05:00
|
|
|
.acpi_madt_oem_check = NULL,
|
2009-01-27 21:43:47 -05:00
|
|
|
.apic_id_registered = numaq_apic_id_registered,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-27 22:16:01 -05:00
|
|
|
.irq_delivery_mode = dest_LowestPrio,
|
|
|
|
/* physical delivery on LOCAL quad: */
|
|
|
|
.irq_dest_mode = 0,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-27 22:30:40 -05:00
|
|
|
.target_cpus = numaq_target_cpus,
|
2009-01-27 23:08:44 -05:00
|
|
|
.disable_esr = 1,
|
2009-01-27 23:29:25 -05:00
|
|
|
.dest_logical = APIC_DEST_LOGICAL,
|
2009-01-27 23:41:42 -05:00
|
|
|
.check_apicid_used = numaq_check_apicid_used,
|
|
|
|
.check_apicid_present = numaq_check_apicid_present,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-28 00:50:47 -05:00
|
|
|
.vector_allocation_domain = numaq_vector_allocation_domain,
|
2009-01-28 00:50:47 -05:00
|
|
|
.init_apic_ldr = numaq_init_apic_ldr,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-28 00:50:47 -05:00
|
|
|
.ioapic_phys_id_map = numaq_ioapic_phys_id_map,
|
2009-01-28 00:50:47 -05:00
|
|
|
.setup_apic_routing = numaq_setup_apic_routing,
|
2009-01-28 01:17:26 -05:00
|
|
|
.multi_timer_check = numaq_multi_timer_check,
|
2009-01-28 00:50:47 -05:00
|
|
|
.apicid_to_node = numaq_apicid_to_node,
|
2009-01-28 00:50:47 -05:00
|
|
|
.cpu_to_logical_apicid = numaq_cpu_to_logical_apicid,
|
2009-01-28 00:50:47 -05:00
|
|
|
.cpu_present_to_apicid = numaq_cpu_present_to_apicid,
|
2009-01-28 00:50:47 -05:00
|
|
|
.apicid_to_cpu_present = numaq_apicid_to_cpu_present,
|
2009-01-28 06:43:18 -05:00
|
|
|
.setup_portio_remap = numaq_setup_portio_remap,
|
2009-01-28 06:43:18 -05:00
|
|
|
.check_phys_apicid_present = numaq_check_phys_apicid_present,
|
2009-01-28 06:43:18 -05:00
|
|
|
.enable_apic_mode = NULL,
|
2009-01-28 07:24:54 -05:00
|
|
|
.phys_pkg_id = numaq_phys_pkg_id,
|
2009-01-28 07:44:32 -05:00
|
|
|
.mps_oem_check = __numaq_mps_oem_check,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-28 08:08:38 -05:00
|
|
|
.get_apic_id = numaq_get_apic_id,
|
2009-01-27 21:32:03 -05:00
|
|
|
.set_apic_id = NULL,
|
2009-01-28 09:08:53 -05:00
|
|
|
.apic_id_mask = 0x0F << 24,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-28 09:20:18 -05:00
|
|
|
.cpu_mask_to_apicid = numaq_cpu_mask_to_apicid,
|
|
|
|
.cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
|
2009-01-27 21:32:03 -05:00
|
|
|
|
2009-01-28 09:42:24 -05:00
|
|
|
.send_IPI_mask = numaq_send_IPI_mask,
|
2009-01-27 21:32:03 -05:00
|
|
|
.send_IPI_mask_allbutself = NULL,
|
2009-01-28 09:42:24 -05:00
|
|
|
.send_IPI_allbutself = numaq_send_IPI_allbutself,
|
|
|
|
.send_IPI_all = numaq_send_IPI_all,
|
2009-01-27 21:32:03 -05:00
|
|
|
.send_IPI_self = NULL,
|
|
|
|
|
|
|
|
.wakeup_cpu = NULL,
|
2009-01-28 10:09:23 -05:00
|
|
|
.trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW,
|
|
|
|
.trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH,
|
2009-01-27 21:32:03 -05:00
|
|
|
.wait_for_init_deassert = wait_for_init_deassert,
|
|
|
|
.smp_callin_clear_local_apic = smp_callin_clear_local_apic,
|
|
|
|
.store_NMI_vector = store_NMI_vector,
|
|
|
|
.restore_NMI_vector = restore_NMI_vector,
|
|
|
|
.inquire_remote_apic = inquire_remote_apic,
|
|
|
|
};
|