Commit 652261a7 authored by Mark Salter's avatar Mark Salter Committed by Will Deacon

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: default avatarRobert Richter <rrichter@cavium.com>
Tested-by: default avatarTimur Tabi <timur@codeaurora.org>
Acked-by: default avatarRobert Richter <rrichter@cavium.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarGrant Likely <grant.likely@linaro.org>
Signed-off-by: default avatarMark Salter <msalter@redhat.com>
Signed-off-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 37655163
...@@ -12,8 +12,21 @@ ...@@ -12,8 +12,21 @@
#ifndef _ASM_ACPI_H #ifndef _ASM_ACPI_H
#define _ASM_ACPI_H #define _ASM_ACPI_H
#include <linux/mm.h>
/* Basic configuration for ACPI */ /* Basic configuration for ACPI */
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
/* ACPI table mapping after acpi_gbl_permanent_mmap is set */
static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
acpi_size size)
{
if (!page_is_ram(phys >> PAGE_SHIFT))
return ioremap(phys, size);
return ioremap_cache(phys, size);
}
#define acpi_os_ioremap acpi_os_ioremap
#define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */ #define acpi_strict 1 /* No out-of-spec workarounds on ARM64 */
extern int acpi_disabled; extern int acpi_disabled;
extern int acpi_noirq; extern int acpi_noirq;
......
...@@ -3,11 +3,15 @@ ...@@ -3,11 +3,15 @@
#include <linux/io.h> #include <linux/io.h>
#include <asm/acpi.h>
#ifndef acpi_os_ioremap
static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
acpi_size size) acpi_size size)
{ {
return ioremap_cache(phys, size); return ioremap_cache(phys, size);
} }
#endif
void __iomem *__init_refok void __iomem *__init_refok
acpi_os_map_iomem(acpi_physical_address phys, acpi_size size); acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
......
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