These patches implement getting ACPI tables from EFI and remove some unneeded debugging which will crash kernel in this case.
Changes since v1 Handled the case where CONFIG_EFI=n in patch 1/2
From: Graeme Gregory graeme.gregory@linaro.org
Add handling for tables from EFI in addition to the handling already present for tables passed via FDT.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/acpi/plat/arm/boot.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/plat/arm/boot.c b/drivers/acpi/plat/arm/boot.c index 82b7bd6..67f983f2 100644 --- a/drivers/acpi/plat/arm/boot.c +++ b/drivers/acpi/plat/arm/boot.c @@ -740,19 +740,29 @@ void __init acpi_arm_blob_relocate(void) struct acpi_table_rsdp *rp; struct acpi_table_xsdt *xp; struct acpi_table_fadt *fp; - phys_addr_t paddress; + phys_addr_t paddress = 0; void *vaddress; u32 entries; u32 ii; u64 *tmp;
- if (!acpi_arm_rsdp_info.phys_address && !acpi_arm_rsdp_info.size) { - printk(KERN_ERR "(E) ACPI: failed to find rsdp info\n"); - return; + if (efi_enabled(EFI_CONFIG_TABLES)) { + if (efi.acpi20) + paddress = efi.acpi20; + else if (efi.acpi) + paddress = efi.acpi; + } + + if (!paddress) { + if (acpi_arm_rsdp_info.phys_address) { + paddress = acpi_arm_rsdp_info.phys_address + + ACPI_BLOB_HEADER_SIZE; + } else { + pr_err("ACPI: failed to find rsdp info\n"); + return; + } }
- paddress = acpi_arm_rsdp_info.phys_address; - paddress += ACPI_BLOB_HEADER_SIZE; vaddress = phys_to_virt(paddress);
/* fixups for the rsdp */
From: Graeme Gregory graeme.gregory@linaro.org
Remove the debugging code from acpi initialisation as it is no longer needed and causes issues becuase it is called before paging_init() which depending on memory layout crashes.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/of/fdt.c | 14 -------------- 1 file changed, 14 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 0535169..3b8b38e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -728,20 +728,6 @@ int __init early_init_dt_scan_acpi(unsigned long node, const char *uname, if (p != NULL && l > 0) pinfo->size = be32_to_cpu(*p);
- printk("acpi: start info is 0x%016llX, %lu bytes\n", - pinfo->phys_address, pinfo->size); - - memblock_reserve(pinfo->phys_address, pinfo->size); - - sig = phys_to_virt(pinfo->phys_address); - - printk("acpi: sig is "%c%c%c%c"\n", - sig[0], sig[1], sig[2], sig[3]); - printk("acpi: info is %02x %02x %02x %02x\n", - sig[4], sig[5], sig[6], sig[7]); - printk("acpi: first table is "%c%c%c%c"\n", - sig[8], sig[9], sig[10], sig[11]); - return 1; } #endif
On 07/17/2013 10:05 AM, Graeme Gregory wrote:
These patches implement getting ACPI tables from EFI and remove some unneeded debugging which will crash kernel in this case.
Changes since v1 Handled the case where CONFIG_EFI=n in patch 1/2
Patch 2/2 to remove the debugging looks good.
Patch 1/2 puzzles me a little now that I've thought about it a little bit -- do we really _need_ to handle the acpi20 pointer from EFI, or is that solely being paranoid and enabling handling of wicked old ACPI code?
Thanks.
On 22/07/13 20:41, Al Stone wrote:
On 07/17/2013 10:05 AM, Graeme Gregory wrote:
These patches implement getting ACPI tables from EFI and remove some unneeded debugging which will crash kernel in this case.
Changes since v1 Handled the case where CONFIG_EFI=n in patch 1/2
Patch 2/2 to remove the debugging looks good.
Patch 1/2 puzzles me a little now that I've thought about it a little bit -- do we really _need_ to handle the acpi20 pointer from EFI, or is that solely being paranoid and enabling handling of wicked old ACPI code?
Thanks.
Actually thinking about it function should just call acpi_get_root_pointer rather than re-doing the same logic again here.
Graeme