diff options
author | Mark Salter <msalter@redhat.com> | 2015-03-24 10:02:38 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-03-25 07:49:30 -0400 |
commit | 652261a7a86c884147930fa1e5ddd82a8a5748da (patch) | |
tree | 835b7489753d4a472301ccc104d5c295994ab0f6 | |
parent | 37655163ce1a3ef2635a9bba0ad614f25e01484e (diff) |
ACPI: fix acpi_os_ioremap for arm64
The acpi_os_ioremap() function may be used to map normal RAM or IO
regions. The current implementation simply uses ioremap_cache(). This
will work for some architectures, but arm64 ioremap_cache() cannot be
used to map IO regions which don't support caching. So for arm64, use
ioremap() for non-RAM regions.
CC: Rafael J Wysocki <rjw@rjwysocki.net>
CC: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Robert Richter <rrichter@cavium.com>
Tested-by: Timur Tabi <timur@codeaurora.org>
Acked-by: Robert Richter <rrichter@cavium.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/include/asm/acpi.h | 13 | ||||
-rw-r--r-- | include/acpi/acpi_io.h | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 8b837ab59988..40e092483e96 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h | |||
@@ -12,8 +12,21 @@ | |||
12 | #ifndef _ASM_ACPI_H | 12 | #ifndef _ASM_ACPI_H |
13 | #define _ASM_ACPI_H | 13 | #define _ASM_ACPI_H |
14 | 14 | ||
15 | #include <linux/mm.h> | ||
16 | |||
15 | /* Basic configuration for ACPI */ | 17 | /* Basic configuration for ACPI */ |
16 | #ifdef CONFIG_ACPI | 18 | #ifdef CONFIG_ACPI |
19 | /* ACPI table mapping after acpi_gbl_permanent_mmap is set */ | ||
20 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | ||
21 | acpi_size size) | ||
22 | { | ||
23 | if (!page_is_ram(phys >> PAGE_SHIFT)) | ||
24 | return ioremap(phys, size); | ||
25 | |||
26 | return ioremap_cache(phys, size); | ||
27 | } | ||
28 | #define acpi_os_ioremap acpi_os_ioremap | ||
29 | |||
17 | #define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */ | 30 | #define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */ |
18 | extern int acpi_disabled; | 31 | extern int acpi_disabled; |
19 | extern int acpi_noirq; | 32 | extern int acpi_noirq; |
diff --git a/include/acpi/acpi_io.h b/include/acpi/acpi_io.h index 444671e9c65d..dd86c5fc102d 100644 --- a/include/acpi/acpi_io.h +++ b/include/acpi/acpi_io.h | |||
@@ -3,11 +3,15 @@ | |||
3 | 3 | ||
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | 5 | ||
6 | #include <asm/acpi.h> | ||
7 | |||
8 | #ifndef acpi_os_ioremap | ||
6 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, | 9 | static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, |
7 | acpi_size size) | 10 | acpi_size size) |
8 | { | 11 | { |
9 | return ioremap_cache(phys, size); | 12 | return ioremap_cache(phys, size); |
10 | } | 13 | } |
14 | #endif | ||
11 | 15 | ||
12 | void __iomem *__init_refok | 16 | void __iomem *__init_refok |
13 | acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); | 17 | acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); |