aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/ioremap_32.c
diff options
context:
space:
mode:
authorYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>2009-03-10 02:49:54 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-03-10 02:49:54 -0400
commit2f47f44790a9c8fc43e515df3c6be19a35ee5de5 (patch)
tree6a13f7abebcb04cc396a1d6de307265e36ccc89d /arch/sh/mm/ioremap_32.c
parenta29b99eccecefe5026713b226f66f117c8837ad5 (diff)
sh: Support fixed 32-bit PMB mappings from bootloader.
This provides a method for supporting fixed PMB mappings inherited from the bootloader, as an alternative to the dynamic PMB mapping currently used by the kernel. In the future these methods will be combined. P1/P2 area is handled like a regular 29-bit physical address, and local bus device are assigned P3 area addresses. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/ioremap_32.c')
-rw-r--r--arch/sh/mm/ioremap_32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c
index 8dc77026a0b..60cc486d2c2 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap_32.c
@@ -59,11 +59,13 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
59 if (is_pci_memaddr(phys_addr) && is_pci_memaddr(last_addr)) 59 if (is_pci_memaddr(phys_addr) && is_pci_memaddr(last_addr))
60 return (void __iomem *)phys_addr; 60 return (void __iomem *)phys_addr;
61 61
62#if !defined(CONFIG_PMB_FIXED)
62 /* 63 /*
63 * Don't allow anybody to remap normal RAM that we're using.. 64 * Don't allow anybody to remap normal RAM that we're using..
64 */ 65 */
65 if (phys_addr < virt_to_phys(high_memory)) 66 if (phys_addr < virt_to_phys(high_memory))
66 return NULL; 67 return NULL;
68#endif
67 69
68 /* 70 /*
69 * Mappings have to be page-aligned 71 * Mappings have to be page-aligned
@@ -81,7 +83,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
81 area->phys_addr = phys_addr; 83 area->phys_addr = phys_addr;
82 orig_addr = addr = (unsigned long)area->addr; 84 orig_addr = addr = (unsigned long)area->addr;
83 85
84#ifdef CONFIG_32BIT 86#ifdef CONFIG_PMB
85 /* 87 /*
86 * First try to remap through the PMB once a valid VMA has been 88 * First try to remap through the PMB once a valid VMA has been
87 * established. Smaller allocations (or the rest of the size 89 * established. Smaller allocations (or the rest of the size
@@ -122,7 +124,7 @@ void __iounmap(void __iomem *addr)
122 if (seg < P3SEG || vaddr >= P3_ADDR_MAX || is_pci_memaddr(vaddr)) 124 if (seg < P3SEG || vaddr >= P3_ADDR_MAX || is_pci_memaddr(vaddr))
123 return; 125 return;
124 126
125#ifdef CONFIG_32BIT 127#ifdef CONFIG_PMB
126 /* 128 /*
127 * Purge any PMB entries that may have been established for this 129 * Purge any PMB entries that may have been established for this
128 * mapping, then proceed with conventional VMA teardown. 130 * mapping, then proceed with conventional VMA teardown.