The early_init_dt_scan_acpi() function currently uses be32_to_cpu()
helpers to read the "linux,acpi-start" and "linux,acpi-len" properties.
This may not be safe for arm64. This patch uses of_read_ulong to read
the property values which should be safe for both arm and arm64.
Signed-off-by: Mark Salter <msalter(a)redhat.com>
---
drivers/of/fdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 875a4c1..d48ab6a 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -720,13 +720,13 @@ int __init early_init_dt_scan_acpi(unsigned long node, const char *uname,
/* Retrieve acpi,address line */
pinfo = (struct acpi_arm_root *)data;
p = of_get_flat_dt_prop(node, "linux,acpi-start", &l);
- if (p != NULL && l > 0)
- pinfo->phys_address = be32_to_cpu(*p);
+ if (p)
+ pinfo->phys_address = of_read_ulong(p, l/4);
/* Retrieve acpi,size line */
p = of_get_flat_dt_prop(node, "linux,acpi-len", &l);
- if (p != NULL && l > 0)
- pinfo->size = be32_to_cpu(*p);
+ if (p)
+ pinfo->size = of_read_ulong(p, l/4);
return 1;
}
--
1.8.3.1
From: Al Stone <ahs3(a)redhat.com>
I should have sent these out for comment much sooner. Once these are
in good shape, the next steps are to send patches for verifying that
the pinconf code is working properly, connecting up the GPIO interrupts
using ACPI, and then conversion of all of the pin controllers for
Arndale (this patch converts one of four).
This patch puts most of the infrastructure in place so that in the
3.11 kernel the Arndale pin controllers can be converted from FDT to
ACPI. The changes in ASL are included in a separate patch. What this
allows is for the pin controllers to be described in either FDT or ACPI
for Arndale and -- in conjunction with the ASL changes -- shows how to
describe a Samsung controller in ACPI.
Al Stone (5):
ACPI: ARM: arndale: remove GPZ GPIO definition from DT so it can be in
ACPI
ACPI: ARM: arndale: whitelist the samsung-pinctrl driver for ACPI
ACPI: make an error message a little clearer
ACPI: improve acpi_extract_package() utility
ACPI: ARM: arndale: enable ACPI in the Samsung pinctrl driver
arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 2 +
arch/arm/boot/dts/exynos5250.dtsi | 6 +-
drivers/acpi/acpi_platform.c | 3 +
drivers/acpi/osl.c | 2 +-
drivers/acpi/utils.c | 17 +-
drivers/pinctrl/pinctrl-samsung.c | 507 +++++++++++++++++++++++++++++-
drivers/pinctrl/pinctrl-samsung.h | 3 +
7 files changed, 526 insertions(+), 14 deletions(-)
--
1.8.3.1
ACPI spec is x86 oriented thus it use NMI for error reporting as low latency
error signalling way. Fast response to error occurrence is what ARM trying to
satisfy using interrupt prioritization since there is no NMI direct equivalent
for ARM architecture.
Patch set are divided into three step:
1. Create generic code responsible for setting interrupt priority.
2. Use it in interrupt setup.
3. Example of interrupt controller priority mapping for GIC platform dependent
code.
Patch set tries to meet requirements like:
- not breaking existing code
- easy to expand to new priority levels
- easy to map generic priority levels to platform dependent priority values
See commit logs for more detailed explanation.