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"); ...@@ -55,6 +55,7 @@ asm (".weak iosapic_register_intr");
asm (".weak iosapic_override_isa_irq"); asm (".weak iosapic_override_isa_irq");
asm (".weak iosapic_register_platform_intr"); asm (".weak iosapic_register_platform_intr");
asm (".weak iosapic_init"); asm (".weak iosapic_init");
asm (".weak iosapic_system_init");
asm (".weak iosapic_version"); asm (".weak iosapic_version");
void (*pm_idle) (void); void (*pm_idle) (void);
...@@ -335,16 +336,9 @@ acpi_parse_iosapic (acpi_table_entry_header *header) ...@@ -335,16 +336,9 @@ acpi_parse_iosapic (acpi_table_entry_header *header)
acpi_table_print_madt_entry(header); acpi_table_print_madt_entry(header);
if (iosapic_init) { if (iosapic_init)
#ifndef CONFIG_ITANIUM iosapic_init(iosapic->address, iosapic->global_irq_base);
/* 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
}
return 0; return 0;
} }
...@@ -439,7 +433,13 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size) ...@@ -439,7 +433,13 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
acpi_madt = (struct acpi_table_madt *) __va(phys_addr); acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
/* remember the value for reference after free_initmem() */ /* 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; has_8259 = acpi_madt->flags.pcat_compat;
#endif
if (iosapic_system_init)
iosapic_system_init(has_8259);
/* Get base address of IPI Message Block */ /* Get base address of IPI Message Block */
......
...@@ -111,11 +111,12 @@ static struct iosapic { ...@@ -111,11 +111,12 @@ static struct iosapic {
char *addr; /* base address of IOSAPIC */ char *addr; /* base address of IOSAPIC */
unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
unsigned short num_rte; /* number of RTE in this IOSAPIC */ unsigned short num_rte; /* number of RTE in this IOSAPIC */
unsigned char pcat_compat; /* 8259 compatibility flag */
} iosapic_lists[256] __devinitdata; } iosapic_lists[256] __devinitdata;
static int num_iosapic = 0; static int num_iosapic = 0;
static unsigned char pcat_compat; /* 8259 compatibility flag */
/* /*
* Find an IOSAPIC associated with a GSI * Find an IOSAPIC associated with a GSI
...@@ -615,19 +616,14 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, ...@@ -615,19 +616,14 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
} }
void __devinit 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; int vector;
unsigned int isa_irq, ver;
char *addr;
static int first_time = 1;
if (first_time) { for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
first_time = 0; 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) { if (pcat_compat) {
/* /*
* Disable the compatibility mode interrupts (8259 style), needs IN/OUT support * 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) ...@@ -637,6 +633,14 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
outb(0xff, 0xA1); outb(0xff, 0xA1);
outb(0xff, 0x21); 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); addr = ioremap(phys_addr, 0);
ver = iosapic_version(addr); ver = iosapic_version(addr);
...@@ -649,7 +653,6 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat) ...@@ -649,7 +653,6 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
num_rte = ((ver >> 16) & 0xff) + 1; num_rte = ((ver >> 16) & 0xff) + 1;
iosapic_lists[num_iosapic].addr = addr; 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].gsi_base = gsi_base;
iosapic_lists[num_iosapic].num_rte = num_rte; iosapic_lists[num_iosapic].num_rte = num_rte;
num_iosapic++; num_iosapic++;
...@@ -732,7 +735,7 @@ iosapic_parse_prt (void) ...@@ -732,7 +735,7 @@ iosapic_parse_prt (void)
struct acpi_prt_entry *entry; struct acpi_prt_entry *entry;
struct list_head *node; struct list_head *node;
unsigned int gsi, gsi_base; unsigned int gsi, gsi_base;
int index, vector, pcat_compat; int index, vector;
char pci_id[16]; char pci_id[16];
char *addr; char *addr;
...@@ -756,7 +759,6 @@ iosapic_parse_prt (void) ...@@ -756,7 +759,6 @@ iosapic_parse_prt (void)
} }
addr = iosapic_lists[index].addr; addr = iosapic_lists[index].addr;
gsi_base = iosapic_lists[index].gsi_base; gsi_base = iosapic_lists[index].gsi_base;
pcat_compat = iosapic_lists[index].pcat_compat;
if (pcat_compat && (gsi < 16)) if (pcat_compat && (gsi < 16))
vector = isa_irq_to_vector(gsi); vector = isa_irq_to_vector(gsi);
......
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern void __devinit iosapic_system_init (int pcat_compat);
extern void __devinit iosapic_init (unsigned long address, extern void __devinit iosapic_init (unsigned long address,
unsigned int gsi_base, unsigned int gsi_base);
int pcat_compat);
extern int gsi_to_vector (unsigned int gsi); extern int gsi_to_vector (unsigned int gsi);
extern int gsi_to_irq (unsigned int gsi); extern int gsi_to_irq (unsigned int gsi);
extern void iosapic_parse_prt (void); 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