aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/mm/ioremap_fixed.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-02-23 16:20:53 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-03-02 16:40:06 +0900
commit90e7d649d86f21d478dc134f74c88e19dd472393 (patch)
tree7526b5320c01da9efd2ce581369b000baa91e0da /arch/sh/mm/ioremap_fixed.c
parent94316cdadb0067ba6d1f08b9a6f84fe755bdaa38 (diff)
sh: reworked dynamic PMB mapping.
This implements a fairly significant overhaul of the dynamic PMB mapping code. The primary change here is that the PMB gets its own VMA that follows the uncached mapping and we attempt to be a bit more intelligent with dynamic sizing, multi-entry mapping, and so forth. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/ioremap_fixed.c')
-rw-r--r--arch/sh/mm/ioremap_fixed.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/sh/mm/ioremap_fixed.c b/arch/sh/mm/ioremap_fixed.c
index 0b78b1e20ef..7f682e5dafc 100644
--- a/arch/sh/mm/ioremap_fixed.c
+++ b/arch/sh/mm/ioremap_fixed.c
@@ -45,14 +45,21 @@ void __init ioremap_fixed_init(void)
}
void __init __iomem *
-ioremap_fixed(resource_size_t phys_addr, unsigned long offset,
- unsigned long size, pgprot_t prot)
+ioremap_fixed(phys_addr_t phys_addr, unsigned long size, pgprot_t prot)
{
enum fixed_addresses idx0, idx;
struct ioremap_map *map;
unsigned int nrpages;
+ unsigned long offset;
int i, slot;
+ /*
+ * Mappings have to be page-aligned
+ */
+ offset = phys_addr & ~PAGE_MASK;
+ phys_addr &= PAGE_MASK;
+ size = PAGE_ALIGN(phys_addr + size) - phys_addr;
+
slot = -1;
for (i = 0; i < FIX_N_IOREMAPS; i++) {
map = &ioremap_maps[i];