Commit 0e568335 authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown

ACPI: build fix for IBM x440 - CONFIG_X86_SUMMIT

i386 srat.c broke due to re-names from ACPICA table-manager re-write.
Signed-off-by: default avatarAlexey Starikovskiy <alexey.y.starikovskiy@linux.intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 5763d3c7
...@@ -62,19 +62,19 @@ extern void * boot_ioremap(unsigned long, unsigned long); ...@@ -62,19 +62,19 @@ extern void * boot_ioremap(unsigned long, unsigned long);
/* Identify CPU proximity domains */ /* Identify CPU proximity domains */
static void __init parse_cpu_affinity_structure(char *p) static void __init parse_cpu_affinity_structure(char *p)
{ {
struct acpi_table_processor_affinity *cpu_affinity = struct acpi_srat_cpu_affinity *cpu_affinity =
(struct acpi_table_processor_affinity *) p; (struct acpi_srat_cpu_affinity *) p;
if (!cpu_affinity->flags.enabled) if ((cpu_affinity->flags & ACPI_SRAT_CPU_ENABLED) == 0)
return; /* empty entry */ return; /* empty entry */
/* mark this node as "seen" in node bitmap */ /* mark this node as "seen" in node bitmap */
BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain); BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain_lo);
apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain; apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain_lo;
printk("CPU 0x%02X in proximity domain 0x%02X\n", printk("CPU 0x%02X in proximity domain 0x%02X\n",
cpu_affinity->apic_id, cpu_affinity->proximity_domain); cpu_affinity->apic_id, cpu_affinity->proximity_domain_lo);
} }
/* /*
...@@ -87,25 +87,24 @@ static void __init parse_memory_affinity_structure (char *sratp) ...@@ -87,25 +87,24 @@ static void __init parse_memory_affinity_structure (char *sratp)
unsigned long start_pfn, end_pfn; unsigned long start_pfn, end_pfn;
u8 pxm; u8 pxm;
struct node_memory_chunk_s *p, *q, *pend; struct node_memory_chunk_s *p, *q, *pend;
struct acpi_table_memory_affinity *memory_affinity = struct acpi_srat_mem_affinity *memory_affinity =
(struct acpi_table_memory_affinity *) sratp; (struct acpi_srat_mem_affinity *) sratp;
if (!memory_affinity->flags.enabled) if ((memory_affinity->flags & ACPI_SRAT_MEM_ENABLED) == 0)
return; /* empty entry */ return; /* empty entry */
pxm = memory_affinity->proximity_domain & 0xff;
/* mark this node as "seen" in node bitmap */ /* mark this node as "seen" in node bitmap */
BMAP_SET(pxm_bitmap, memory_affinity->proximity_domain); BMAP_SET(pxm_bitmap, pxm);
/* calculate info for memory chunk structure */ /* calculate info for memory chunk structure */
paddr = memory_affinity->base_addr_hi; paddr = memory_affinity->base_address;
paddr = (paddr << 32) | memory_affinity->base_addr_lo; size = memory_affinity->length;
size = memory_affinity->length_hi;
size = (size << 32) | memory_affinity->length_lo;
start_pfn = paddr >> PAGE_SHIFT; start_pfn = paddr >> PAGE_SHIFT;
end_pfn = (paddr + size) >> PAGE_SHIFT; end_pfn = (paddr + size) >> PAGE_SHIFT;
pxm = memory_affinity->proximity_domain;
if (num_memory_chunks >= MAXCHUNKS) { if (num_memory_chunks >= MAXCHUNKS) {
printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n", printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n",
...@@ -132,8 +131,8 @@ static void __init parse_memory_affinity_structure (char *sratp) ...@@ -132,8 +131,8 @@ static void __init parse_memory_affinity_structure (char *sratp)
printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n", printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n",
start_pfn, end_pfn, start_pfn, end_pfn,
memory_affinity->memory_type, memory_affinity->memory_type,
memory_affinity->proximity_domain, pxm,
(memory_affinity->flags.hot_pluggable ? ((memory_affinity->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) ?
"enabled and removable" : "enabled" ) ); "enabled and removable" : "enabled" ) );
} }
...@@ -185,10 +184,10 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) ...@@ -185,10 +184,10 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
num_memory_chunks = 0; num_memory_chunks = 0;
while (p < end) { while (p < end) {
switch (*p) { switch (*p) {
case ACPI_SRAT_PROCESSOR_AFFINITY: case ACPI_SRAT_TYPE_CPU_AFFINITY:
parse_cpu_affinity_structure(p); parse_cpu_affinity_structure(p);
break; break;
case ACPI_SRAT_MEMORY_AFFINITY: case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
parse_memory_affinity_structure(p); parse_memory_affinity_structure(p);
break; break;
default: default:
...@@ -262,31 +261,30 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) ...@@ -262,31 +261,30 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
return 0; return 0;
} }
struct acpi_static_rsdt {
struct acpi_table_rsdt table;
u32 padding[7]; /* Allow for 7 more table entries */
};
int __init get_memcfg_from_srat(void) int __init get_memcfg_from_srat(void)
{ {
struct acpi_table_header *header = NULL; struct acpi_table_header *header = NULL;
struct acpi_table_rsdp *rsdp = NULL; struct acpi_table_rsdp *rsdp = NULL;
struct acpi_table_rsdt *rsdt = NULL; struct acpi_table_rsdt *rsdt = NULL;
struct acpi_pointer *rsdp_address = NULL; acpi_native_uint rsdp_address = 0;
struct acpi_table_rsdt saved_rsdt; struct acpi_static_rsdt saved_rsdt;
int tables = 0; int tables = 0;
int i = 0; int i = 0;
if (ACPI_FAILURE(acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING, rsdp_address = acpi_find_rsdp();
rsdp_address))) { if (!rsdp_address) {
printk("%s: System description tables not found\n", printk("%s: System description tables not found\n",
__FUNCTION__); __FUNCTION__);
goto out_err; goto out_err;
} }
if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) {
printk("%s: assigning address to rsdp\n", __FUNCTION__); printk("%s: assigning address to rsdp\n", __FUNCTION__);
rsdp = (struct acpi_table_rsdp *) rsdp = (struct acpi_table_rsdp *)(u32)rsdp_address;
(u32)rsdp_address->pointer.physical;
} else {
printk("%s: rsdp_address is not a physical pointer\n", __FUNCTION__);
goto out_err;
}
if (!rsdp) { if (!rsdp) {
printk("%s: Didn't find ACPI root!\n", __FUNCTION__); printk("%s: Didn't find ACPI root!\n", __FUNCTION__);
goto out_err; goto out_err;
...@@ -295,13 +293,13 @@ int __init get_memcfg_from_srat(void) ...@@ -295,13 +293,13 @@ int __init get_memcfg_from_srat(void)
printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
rsdp->oem_id); rsdp->oem_id);
if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) { if (strncmp(rsdp->signature, ACPI_SIG_RSDP,strlen(ACPI_SIG_RSDP))) {
printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__); printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__);
goto out_err; goto out_err;
} }
rsdt = (struct acpi_table_rsdt *) rsdt = (struct acpi_table_rsdt *)
boot_ioremap(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt)); boot_ioremap(rsdp->rsdt_physical_address, sizeof(struct acpi_table_rsdt));
if (!rsdt) { if (!rsdt) {
printk(KERN_WARNING printk(KERN_WARNING
...@@ -310,9 +308,9 @@ int __init get_memcfg_from_srat(void) ...@@ -310,9 +308,9 @@ int __init get_memcfg_from_srat(void)
goto out_err; goto out_err;
} }
header = & rsdt->header; header = &rsdt->header;
if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) { if (strncmp(header->signature, ACPI_SIG_RSDT, strlen(ACPI_SIG_RSDT))) {
printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
goto out_err; goto out_err;
} }
...@@ -330,9 +328,9 @@ int __init get_memcfg_from_srat(void) ...@@ -330,9 +328,9 @@ int __init get_memcfg_from_srat(void)
memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
if (saved_rsdt.header.length > sizeof(saved_rsdt)) { if (saved_rsdt.table.header.length > sizeof(saved_rsdt)) {
printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n",
saved_rsdt.header.length); saved_rsdt.table.header.length);
goto out_err; goto out_err;
} }
...@@ -341,15 +339,15 @@ int __init get_memcfg_from_srat(void) ...@@ -341,15 +339,15 @@ int __init get_memcfg_from_srat(void)
for (i = 0; i < tables; i++) { for (i = 0; i < tables; i++) {
/* Map in header, then map in full table length. */ /* Map in header, then map in full table length. */
header = (struct acpi_table_header *) header = (struct acpi_table_header *)
boot_ioremap(saved_rsdt.entry[i], sizeof(struct acpi_table_header)); boot_ioremap(saved_rsdt.table.table_offset_entry[i], sizeof(struct acpi_table_header));
if (!header) if (!header)
break; break;
header = (struct acpi_table_header *) header = (struct acpi_table_header *)
boot_ioremap(saved_rsdt.entry[i], header->length); boot_ioremap(saved_rsdt.table.table_offset_entry[i], header->length);
if (!header) if (!header)
break; break;
if (strncmp((char *) &header->signature, "SRAT", 4)) if (strncmp((char *) &header->signature, ACPI_SIG_SRAT, 4))
continue; continue;
/* we've found the srat table. don't need to look at any more tables */ /* we've found the srat table. don't need to look at any more tables */
......
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