Commit 505ed472 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by David Mosberger

[PATCH] ia64: iosapic: make pcat_compat system property

Make pcat_compat a system property, not a per-IOSAPIC property.
parent 6d395fb7
......@@ -55,6 +55,7 @@ asm (".weak iosapic_register_intr");
asm (".weak iosapic_override_isa_irq");
asm (".weak iosapic_register_platform_intr");
asm (".weak iosapic_init");
asm (".weak iosapic_system_init");
asm (".weak iosapic_version");
void (*pm_idle) (void);
......@@ -335,16 +336,9 @@ acpi_parse_iosapic (acpi_table_entry_header *header)
acpi_table_print_madt_entry(header);
if (iosapic_init) {
#ifndef CONFIG_ITANIUM
/* PCAT_COMPAT flag indicates dual-8259 setup */
iosapic_init(iosapic->address, iosapic->global_irq_base,
acpi_madt->flags.pcat_compat);
#else
/* Firmware on old Itanium systems is broken */
iosapic_init(iosapic->address, iosapic->global_irq_base, 1);
#endif
}
if (iosapic_init)
iosapic_init(iosapic->address, iosapic->global_irq_base);
return 0;
}
......@@ -439,7 +433,13 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
/* remember the value for reference after free_initmem() */
#ifdef CONFIG_ITANIUM
has_8259 = 1; /* Firmware on old Itanium systems is broken */
#else
has_8259 = acpi_madt->flags.pcat_compat;
#endif
if (iosapic_system_init)
iosapic_system_init(has_8259);
/* Get base address of IPI Message Block */
......
......@@ -111,11 +111,12 @@ static struct iosapic {
char *addr; /* base address of IOSAPIC */
unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
unsigned short num_rte; /* number of RTE in this IOSAPIC */
unsigned char pcat_compat; /* 8259 compatibility flag */
} iosapic_lists[256] __devinitdata;
static int num_iosapic = 0;
static unsigned char pcat_compat; /* 8259 compatibility flag */
/*
* Find an IOSAPIC associated with a GSI
......@@ -615,19 +616,14 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
}
void __devinit
iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
iosapic_system_init (int system_pcat_compat)
{
int num_rte, vector;
unsigned int isa_irq, ver;
char *addr;
static int first_time = 1;
int vector;
if (first_time) {
first_time = 0;
for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
iosapic_intr_info[vector].rte_index = -1; /* mark as unused */
}
for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
iosapic_intr_info[vector].rte_index = -1; /* mark as unused */
pcat_compat = system_pcat_compat;
if (pcat_compat) {
/*
* Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
......@@ -637,6 +633,14 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
outb(0xff, 0xA1);
outb(0xff, 0x21);
}
}
void __devinit
iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
{
int num_rte, vector;
unsigned int isa_irq, ver;
char *addr;
addr = ioremap(phys_addr, 0);
ver = iosapic_version(addr);
......@@ -649,7 +653,6 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
num_rte = ((ver >> 16) & 0xff) + 1;
iosapic_lists[num_iosapic].addr = addr;
iosapic_lists[num_iosapic].pcat_compat = pcat_compat;
iosapic_lists[num_iosapic].gsi_base = gsi_base;
iosapic_lists[num_iosapic].num_rte = num_rte;
num_iosapic++;
......@@ -732,7 +735,7 @@ iosapic_parse_prt (void)
struct acpi_prt_entry *entry;
struct list_head *node;
unsigned int gsi, gsi_base;
int index, vector, pcat_compat;
int index, vector;
char pci_id[16];
char *addr;
......@@ -756,7 +759,6 @@ iosapic_parse_prt (void)
}
addr = iosapic_lists[index].addr;
gsi_base = iosapic_lists[index].gsi_base;
pcat_compat = iosapic_lists[index].pcat_compat;
if (pcat_compat && (gsi < 16))
vector = isa_irq_to_vector(gsi);
......
......@@ -51,9 +51,9 @@
#ifndef __ASSEMBLY__
extern void __devinit iosapic_system_init (int pcat_compat);
extern void __devinit iosapic_init (unsigned long address,
unsigned int gsi_base,
int pcat_compat);
unsigned int gsi_base);
extern int gsi_to_vector (unsigned int gsi);
extern int gsi_to_irq (unsigned int gsi);
extern void iosapic_parse_prt (void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment