2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* APIC driver for the Unisys ES7000 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 09:17:33 +00:00
|
|
|
#include <asm/es7000/apicdef.h>
|
2008-07-12 01:43:10 +00:00
|
|
|
#include <linux/smp.h>
|
2008-07-25 09:17:33 +00:00
|
|
|
#include <asm/es7000/apic.h>
|
|
|
|
#include <asm/es7000/ipi.h>
|
|
|
|
#include <asm/es7000/mpparse.h>
|
2008-11-18 16:14:14 +00:00
|
|
|
#include <asm/mach-default/mach_wakecpu.h>
|
|
|
|
|
|
|
|
void __init es7000_update_genapic_to_cluster(void)
|
|
|
|
{
|
2009-01-27 23:14:11 +00:00
|
|
|
apic->target_cpus = target_cpus_cluster;
|
2009-01-28 03:02:31 +00:00
|
|
|
apic->irq_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
|
|
|
|
apic->irq_dest_mode = INT_DEST_MODE_CLUSTER;
|
2008-11-18 16:14:14 +00:00
|
|
|
|
2009-01-28 05:50:47 +00:00
|
|
|
apic->init_apic_ldr = es7000_init_apic_ldr_cluster;
|
2008-11-18 16:14:14 +00:00
|
|
|
|
2009-01-27 23:14:11 +00:00
|
|
|
apic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster;
|
2008-11-18 16:14:14 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-01-11 00:52:44 +00:00
|
|
|
static int probe_es7000(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
/* probed later in mptable/ACPI hooks */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-01-03 10:16:57 +00:00
|
|
|
static __init int
|
|
|
|
mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
|
2007-05-02 17:27:08 +00:00
|
|
|
{
|
2009-01-04 16:52:56 +00:00
|
|
|
if (mpc->oemptr) {
|
2009-01-03 10:22:54 +00:00
|
|
|
struct mpc_oemtable *oem_table =
|
2009-01-04 16:52:56 +00:00
|
|
|
(struct mpc_oemtable *)mpc->oemptr;
|
2007-05-02 17:27:08 +00:00
|
|
|
if (!strncmp(oem, "UNISYS", 6))
|
|
|
|
return parse_unisys_oem((char *)oem_table);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_ACPI
|
|
|
|
/* Hook from generic ACPI tables.c */
|
2009-01-28 02:43:47 +00:00
|
|
|
static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
2007-05-02 17:27:08 +00:00
|
|
|
{
|
2008-09-14 09:33:14 +00:00
|
|
|
unsigned long oem_addr = 0;
|
|
|
|
int check_dsdt;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
/* check dsdt at first to avoid clear fix_map for oem_addr */
|
|
|
|
check_dsdt = es7000_check_dsdt();
|
|
|
|
|
2007-05-02 17:27:08 +00:00
|
|
|
if (!find_unisys_acpi_oem_table(&oem_addr)) {
|
2008-09-14 09:33:14 +00:00
|
|
|
if (check_dsdt)
|
|
|
|
ret = parse_unisys_oem((char *)oem_addr);
|
2007-05-02 17:27:08 +00:00
|
|
|
else {
|
|
|
|
setup_unisys();
|
2008-09-14 09:33:14 +00:00
|
|
|
ret = 1;
|
2007-05-02 17:27:08 +00:00
|
|
|
}
|
2008-09-14 09:33:14 +00:00
|
|
|
/*
|
|
|
|
* we need to unmap it
|
|
|
|
*/
|
|
|
|
unmap_unisys_acpi_oem_table(oem_addr);
|
2007-05-02 17:27:08 +00:00
|
|
|
}
|
2008-09-14 09:33:14 +00:00
|
|
|
return ret;
|
2007-05-02 17:27:08 +00:00
|
|
|
}
|
|
|
|
#else
|
2009-01-28 02:43:47 +00:00
|
|
|
static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
|
2007-05-02 17:27:08 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-01-28 05:50:47 +00:00
|
|
|
static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
|
2008-08-20 03:50:28 +00: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-17 01:33:52 +00:00
|
|
|
*retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
|
2008-08-20 03:50:28 +00:00
|
|
|
}
|
|
|
|
|
2009-01-28 02:32:03 +00:00
|
|
|
struct genapic apic_es7000 = {
|
|
|
|
|
|
|
|
.name = "es7000",
|
|
|
|
.probe = probe_es7000,
|
2009-01-28 02:43:47 +00:00
|
|
|
.acpi_madt_oem_check = es7000_acpi_madt_oem_check,
|
2009-01-28 02:43:47 +00:00
|
|
|
.apic_id_registered = es7000_apic_id_registered,
|
2009-01-28 02:32:03 +00:00
|
|
|
|
2009-01-28 03:16:01 +00:00
|
|
|
.irq_delivery_mode = dest_Fixed,
|
|
|
|
/* phys delivery to target CPUs: */
|
|
|
|
.irq_dest_mode = 0,
|
2009-01-28 02:32:03 +00:00
|
|
|
|
2009-01-28 03:30:40 +00:00
|
|
|
.target_cpus = es7000_target_cpus,
|
2009-01-28 04:08:44 +00:00
|
|
|
.disable_esr = 1,
|
2009-01-28 04:29:25 +00:00
|
|
|
.dest_logical = 0,
|
2009-01-28 04:41:42 +00:00
|
|
|
.check_apicid_used = es7000_check_apicid_used,
|
|
|
|
.check_apicid_present = es7000_check_apicid_present,
|
2009-01-28 02:32:03 +00:00
|
|
|
|
2009-01-28 05:50:47 +00:00
|
|
|
.vector_allocation_domain = es7000_vector_allocation_domain,
|
2009-01-28 05:50:47 +00:00
|
|
|
.init_apic_ldr = es7000_init_apic_ldr,
|
2009-01-28 02:32:03 +00:00
|
|
|
|
2009-01-28 05:50:47 +00:00
|
|
|
.ioapic_phys_id_map = es7000_ioapic_phys_id_map,
|
2009-01-28 05:50:47 +00:00
|
|
|
.setup_apic_routing = es7000_setup_apic_routing,
|
2009-01-28 06:17:26 +00:00
|
|
|
.multi_timer_check = NULL,
|
2009-01-28 05:50:47 +00:00
|
|
|
.apicid_to_node = es7000_apicid_to_node,
|
2009-01-28 05:50:47 +00:00
|
|
|
.cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
|
2009-01-28 05:50:47 +00:00
|
|
|
.cpu_present_to_apicid = es7000_cpu_present_to_apicid,
|
2009-01-28 05:50:47 +00:00
|
|
|
.apicid_to_cpu_present = es7000_apicid_to_cpu_present,
|
2009-01-28 11:43:18 +00:00
|
|
|
.setup_portio_remap = NULL,
|
2009-01-28 11:43:18 +00:00
|
|
|
.check_phys_apicid_present = es7000_check_phys_apicid_present,
|
2009-01-28 11:43:18 +00:00
|
|
|
.enable_apic_mode = es7000_enable_apic_mode,
|
2009-01-28 02:32:03 +00:00
|
|
|
.phys_pkg_id = phys_pkg_id,
|
|
|
|
.mps_oem_check = mps_oem_check,
|
|
|
|
|
|
|
|
.get_apic_id = get_apic_id,
|
|
|
|
.set_apic_id = NULL,
|
|
|
|
.apic_id_mask = APIC_ID_MASK,
|
|
|
|
|
|
|
|
.cpu_mask_to_apicid = cpu_mask_to_apicid,
|
|
|
|
.cpu_mask_to_apicid_and = cpu_mask_to_apicid_and,
|
|
|
|
|
|
|
|
.send_IPI_mask = send_IPI_mask,
|
|
|
|
.send_IPI_mask_allbutself = NULL,
|
|
|
|
.send_IPI_allbutself = send_IPI_allbutself,
|
|
|
|
.send_IPI_all = send_IPI_all,
|
|
|
|
.send_IPI_self = NULL,
|
|
|
|
|
|
|
|
.wakeup_cpu = NULL,
|
|
|
|
.trampoline_phys_low = TRAMPOLINE_PHYS_LOW,
|
|
|
|
.trampoline_phys_high = TRAMPOLINE_PHYS_HIGH,
|
|
|
|
.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,
|
|
|
|
};
|