Commit 5f3b1a8b authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown

ACPICA: Remove duplicate table definitions (non-conflicting)

Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent ad363f80
This diff is collapsed.
This diff is collapsed.
...@@ -620,15 +620,16 @@ void __init acpi_early_init(void) ...@@ -620,15 +620,16 @@ void __init acpi_early_init(void)
#ifdef CONFIG_X86 #ifdef CONFIG_X86
if (!acpi_ioapic) { if (!acpi_ioapic) {
extern acpi_interrupt_flags acpi_sci_flags; extern u8 acpi_sci_flags;
/* compatible (0) means level (3) */ /* compatible (0) means level (3) */
if (acpi_sci_flags.trigger == 0) if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) {
acpi_sci_flags.trigger = 3; acpi_sci_flags &= ~ACPI_MADT_TRIGGER_MASK;
acpi_sci_flags |= ACPI_MADT_TRIGGER_LEVEL;
}
/* Set PIC-mode SCI trigger type */ /* Set PIC-mode SCI trigger type */
acpi_pic_sci_set_trigger(acpi_gbl_FADT.sci_interrupt, acpi_pic_sci_set_trigger(acpi_gbl_FADT.sci_interrupt,
acpi_sci_flags.trigger); (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2);
} else { } else {
extern int acpi_sci_override_gsi; extern int acpi_sci_override_gsi;
/* /*
......
...@@ -43,90 +43,92 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" }; ...@@ -43,90 +43,92 @@ static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" };
static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata; static struct acpi_table_desc initial_tables[ACPI_MAX_TABLES] __initdata;
void acpi_table_print_madt_entry(acpi_table_entry_header * header) void acpi_table_print_madt_entry(struct acpi_subtable_header * header)
{ {
if (!header) if (!header)
return; return;
switch (header->type) { switch (header->type) {
case ACPI_MADT_LAPIC: case ACPI_MADT_TYPE_LOCAL_APIC:
{ {
struct acpi_table_lapic *p = struct acpi_madt_local_apic *p =
(struct acpi_table_lapic *)header; (struct acpi_madt_local_apic *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n", "LAPIC (acpi_id[0x%02x] lapic_id[0x%02x] %s)\n",
p->acpi_id, p->id, p->processor_id, p->id,
p->flags.enabled ? "enabled" : "disabled"); (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
} }
break; break;
case ACPI_MADT_IOAPIC: case ACPI_MADT_TYPE_IO_APIC:
{ {
struct acpi_table_ioapic *p = struct acpi_madt_io_apic *p =
(struct acpi_table_ioapic *)header; (struct acpi_madt_io_apic *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n", "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n",
p->id, p->address, p->global_irq_base); p->id, p->address, p->global_irq_base);
} }
break; break;
case ACPI_MADT_INT_SRC_OVR: case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
{ {
struct acpi_table_int_src_ovr *p = struct acpi_madt_interrupt_override *p =
(struct acpi_table_int_src_ovr *)header; (struct acpi_madt_interrupt_override *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n",
p->bus, p->bus_irq, p->global_irq, p->bus, p->source_irq, p->global_irq,
mps_inti_flags_polarity[p->flags.polarity], mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_trigger[p->flags.trigger]); mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2]);
if (p->flags.reserved) if (p->inti_flags &
~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK))
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"INT_SRC_OVR unexpected reserved flags: 0x%x\n", "INT_SRC_OVR unexpected reserved flags: 0x%x\n",
p->flags.reserved); p->inti_flags &
~(ACPI_MADT_POLARITY_MASK | ACPI_MADT_TRIGGER_MASK));
} }
break; break;
case ACPI_MADT_NMI_SRC: case ACPI_MADT_TYPE_NMI_SOURCE:
{ {
struct acpi_table_nmi_src *p = struct acpi_madt_nmi_source *p =
(struct acpi_table_nmi_src *)header; (struct acpi_madt_nmi_source *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"NMI_SRC (%s %s global_irq %d)\n", "NMI_SRC (%s %s global_irq %d)\n",
mps_inti_flags_polarity[p->flags.polarity], mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_trigger[p->flags.trigger], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
p->global_irq); p->global_irq);
} }
break; break;
case ACPI_MADT_LAPIC_NMI: case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
{ {
struct acpi_table_lapic_nmi *p = struct acpi_madt_local_apic_nmi *p =
(struct acpi_table_lapic_nmi *)header; (struct acpi_madt_local_apic_nmi *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n",
p->acpi_id, p->processor_id,
mps_inti_flags_polarity[p->flags.polarity], mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK ],
mps_inti_flags_trigger[p->flags.trigger], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
p->lint); p->lint);
} }
break; break;
case ACPI_MADT_LAPIC_ADDR_OVR: case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
{ {
struct acpi_table_lapic_addr_ovr *p = struct acpi_madt_local_apic_override *p =
(struct acpi_table_lapic_addr_ovr *)header; (struct acpi_madt_local_apic_override *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"LAPIC_ADDR_OVR (address[%p])\n", "LAPIC_ADDR_OVR (address[%p])\n",
(void *)(unsigned long)p->address); (void *)(unsigned long)p->address);
} }
break; break;
case ACPI_MADT_IOSAPIC: case ACPI_MADT_TYPE_IO_SAPIC:
{ {
struct acpi_table_iosapic *p = struct acpi_madt_io_sapic *p =
(struct acpi_table_iosapic *)header; (struct acpi_madt_io_sapic *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n", "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
p->id, (void *)(unsigned long)p->address, p->id, (void *)(unsigned long)p->address,
...@@ -134,26 +136,26 @@ void acpi_table_print_madt_entry(acpi_table_entry_header * header) ...@@ -134,26 +136,26 @@ void acpi_table_print_madt_entry(acpi_table_entry_header * header)
} }
break; break;
case ACPI_MADT_LSAPIC: case ACPI_MADT_TYPE_LOCAL_SAPIC:
{ {
struct acpi_table_lsapic *p = struct acpi_madt_local_sapic *p =
(struct acpi_table_lsapic *)header; (struct acpi_madt_local_sapic *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n", "LSAPIC (acpi_id[0x%02x] lsapic_id[0x%02x] lsapic_eid[0x%02x] %s)\n",
p->acpi_id, p->id, p->eid, p->processor_id, p->id, p->eid,
p->flags.enabled ? "enabled" : "disabled"); (p->lapic_flags & ACPI_MADT_ENABLED) ? "enabled" : "disabled");
} }
break; break;
case ACPI_MADT_PLAT_INT_SRC: case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
{ {
struct acpi_table_plat_int_src *p = struct acpi_madt_interrupt_source *p =
(struct acpi_table_plat_int_src *)header; (struct acpi_madt_interrupt_source *)header;
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n",
mps_inti_flags_polarity[p->flags.polarity], mps_inti_flags_polarity[p->inti_flags & ACPI_MADT_POLARITY_MASK],
mps_inti_flags_trigger[p->flags.trigger], mps_inti_flags_trigger[(p->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2],
p->type, p->id, p->eid, p->iosapic_vector, p->type, p->id, p->eid, p->io_sapic_vector,
p->global_irq); p->global_irq);
} }
break; break;
...@@ -175,7 +177,7 @@ acpi_table_parse_madt_family(char *id, ...@@ -175,7 +177,7 @@ acpi_table_parse_madt_family(char *id,
unsigned int max_entries) unsigned int max_entries)
{ {
struct acpi_table_header *madt = NULL; struct acpi_table_header *madt = NULL;
acpi_table_entry_header *entry; struct acpi_subtable_header *entry;
unsigned int count = 0; unsigned int count = 0;
unsigned long madt_end; unsigned long madt_end;
...@@ -183,7 +185,6 @@ acpi_table_parse_madt_family(char *id, ...@@ -183,7 +185,6 @@ acpi_table_parse_madt_family(char *id,
return -EINVAL; return -EINVAL;
/* Locate the MADT (if exists). There should only be one. */ /* Locate the MADT (if exists). There should only be one. */
acpi_get_table(id, 0, &madt); acpi_get_table(id, 0, &madt);
if (!madt) { if (!madt) {
...@@ -195,17 +196,17 @@ acpi_table_parse_madt_family(char *id, ...@@ -195,17 +196,17 @@ acpi_table_parse_madt_family(char *id,
/* Parse all entries looking for a match. */ /* Parse all entries looking for a match. */
entry = (acpi_table_entry_header *) entry = (struct acpi_subtable_header *)
((unsigned long)madt + madt_size); ((unsigned long)madt + madt_size);
while (((unsigned long)entry) + sizeof(acpi_table_entry_header) < while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
madt_end) { madt_end) {
if (entry->type == entry_id if (entry->type == entry_id
&& (!max_entries || count++ < max_entries)) && (!max_entries || count++ < max_entries))
if (handler(entry, madt_end)) if (handler(entry, madt_end))
return -EINVAL; return -EINVAL;
entry = (acpi_table_entry_header *) entry = (struct acpi_subtable_header *)
((unsigned long)entry + entry->length); ((unsigned long)entry + entry->length);
} }
if (max_entries && count > max_entries) { if (max_entries && count > max_entries) {
...@@ -217,10 +218,10 @@ acpi_table_parse_madt_family(char *id, ...@@ -217,10 +218,10 @@ acpi_table_parse_madt_family(char *id,
} }
int __init int __init
acpi_table_parse_madt(enum acpi_madt_entry_id id, acpi_table_parse_madt(enum acpi_madt_type id,
acpi_madt_entry_handler handler, unsigned int max_entries) acpi_madt_entry_handler handler, unsigned int max_entries)
{ {
return acpi_table_parse_madt_family("APIC", return acpi_table_parse_madt_family(ACPI_SIG_MADT,
sizeof(struct acpi_table_madt), id, sizeof(struct acpi_table_madt), id,
handler, max_entries); handler, max_entries);
} }
...@@ -228,7 +229,6 @@ acpi_table_parse_madt(enum acpi_madt_entry_id id, ...@@ -228,7 +229,6 @@ acpi_table_parse_madt(enum acpi_madt_entry_id id,
int __init acpi_table_parse(char *id, acpi_table_handler handler) int __init acpi_table_parse(char *id, acpi_table_handler handler)
{ {
struct acpi_table_header *table = NULL; struct acpi_table_header *table = NULL;
if (!handler) if (!handler)
return -EINVAL; return -EINVAL;
...@@ -245,10 +245,11 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) ...@@ -245,10 +245,11 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
* *
* find RSDP, find and checksum SDT/XSDT. * find RSDP, find and checksum SDT/XSDT.
* checksum all tables, print SDT/XSDT * checksum all tables, print SDT/XSDT
* *
* result: sdt_entry[] is initialized * result: sdt_entry[] is initialized
*/ */
int __init acpi_table_init(void) int __init acpi_table_init(void)
{ {
acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
......
...@@ -58,106 +58,6 @@ typedef struct { ...@@ -58,106 +58,6 @@ typedef struct {
u8 length; u8 length;
} __attribute__ ((packed)) acpi_table_entry_header; } __attribute__ ((packed)) acpi_table_entry_header;
/* Multiple APIC Description Table (MADT) */
enum acpi_madt_entry_id {
ACPI_MADT_LAPIC = 0,
ACPI_MADT_IOAPIC,
ACPI_MADT_INT_SRC_OVR,
ACPI_MADT_NMI_SRC,
ACPI_MADT_LAPIC_NMI,
ACPI_MADT_LAPIC_ADDR_OVR,
ACPI_MADT_IOSAPIC,
ACPI_MADT_LSAPIC,
ACPI_MADT_PLAT_INT_SRC,
ACPI_MADT_ENTRY_COUNT
};
typedef struct {
u16 polarity:2;
u16 trigger:2;
u16 reserved:12;
} __attribute__ ((packed)) acpi_interrupt_flags;
struct acpi_table_lapic {
acpi_table_entry_header header;
u8 acpi_id;
u8 id;
struct {
u32 enabled:1;
u32 reserved:31;
} flags;
} __attribute__ ((packed));
struct acpi_table_ioapic {
acpi_table_entry_header header;
u8 id;
u8 reserved;
u32 address;
u32 global_irq_base;
} __attribute__ ((packed));
struct acpi_table_int_src_ovr {
acpi_table_entry_header header;
u8 bus;
u8 bus_irq;
u32 global_irq;
acpi_interrupt_flags flags;
} __attribute__ ((packed));
struct acpi_table_nmi_src {
acpi_table_entry_header header;
acpi_interrupt_flags flags;
u32 global_irq;
} __attribute__ ((packed));
struct acpi_table_lapic_nmi {
acpi_table_entry_header header;
u8 acpi_id;
acpi_interrupt_flags flags;
u8 lint;
} __attribute__ ((packed));
struct acpi_table_lapic_addr_ovr {
acpi_table_entry_header header;
u8 reserved[2];
u64 address;
} __attribute__ ((packed));
struct acpi_table_iosapic {
acpi_table_entry_header header;
u8 id;
u8 reserved;
u32 global_irq_base;
u64 address;
} __attribute__ ((packed));
struct acpi_table_lsapic {
acpi_table_entry_header header;
u8 acpi_id;
u8 id;
u8 eid;
u8 reserved[3];
struct {
u32 enabled:1;
u32 reserved:31;
} flags;
} __attribute__ ((packed));
struct acpi_table_plat_int_src {
acpi_table_entry_header header;
acpi_interrupt_flags flags;
u8 type; /* See acpi_interrupt_type */
u8 id;
u8 eid;
u8 iosapic_vector;
u32 global_irq;
struct {
u32 cpei_override_flag:1;
u32 reserved:31;
} plint_flags;
} __attribute__ ((packed));
enum acpi_interrupt_id { enum acpi_interrupt_id {
ACPI_INTERRUPT_PMI = 1, ACPI_INTERRUPT_PMI = 1,
ACPI_INTERRUPT_INIT, ACPI_INTERRUPT_INIT,
...@@ -285,7 +185,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *header); ...@@ -285,7 +185,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *header);
extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT]; extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end); typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
char * __acpi_map_table (unsigned long phys_addr, unsigned long size); char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
unsigned long acpi_find_rsdp (void); unsigned long acpi_find_rsdp (void);
...@@ -295,11 +195,11 @@ int acpi_numa_init (void); ...@@ -295,11 +195,11 @@ int acpi_numa_init (void);
int acpi_table_init (void); int acpi_table_init (void);
int acpi_table_parse (char *id, acpi_table_handler handler); int acpi_table_parse (char *id, acpi_table_handler handler);
int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
int acpi_parse_mcfg (struct acpi_table_header *header); int acpi_parse_mcfg (struct acpi_table_header *header);
void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
void acpi_table_print_madt_entry (acpi_table_entry_header *madt); void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
void acpi_table_print_srat_entry (acpi_table_entry_header *srat); void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
/* the following four functions are architecture-dependent */ /* the following four functions are architecture-dependent */
......
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