aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/pmb.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-03-02 16:49:50 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-03-02 16:49:50 +0900
commit4cfa8e75d6854699597e21fd570721d63f899934 (patch)
treecb9199101ee22020524b6e96bfed4caa4ba12e7e /arch/sh/mm/pmb.c
parentsh: reworked dynamic PMB mapping. (diff)
downloadlinux-dev-4cfa8e75d6854699597e21fd570721d63f899934.tar.xz
linux-dev-4cfa8e75d6854699597e21fd570721d63f899934.zip
sh: make pmb iomapping configurable.
This plugs in an early_param for permitting transparent PMB-backed ioremapping to be enabled/disabled. For the time being, we use a default-disabled policy. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/pmb.c')
-rw-r--r--arch/sh/mm/pmb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 9a516b89839a..9429355c18ca 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -68,6 +68,8 @@ static DEFINE_RWLOCK(pmb_rwlock);
static struct pmb_entry pmb_entry_list[NR_PMB_ENTRIES];
static DECLARE_BITMAP(pmb_map, NR_PMB_ENTRIES);
+static unsigned int pmb_iomapping_enabled;
+
static __always_inline unsigned long mk_pmb_entry(unsigned int entry)
{
return (entry & PMB_E_MASK) << PMB_E_SHIFT;
@@ -284,6 +286,9 @@ void __iomem *pmb_remap_caller(phys_addr_t phys, unsigned long size,
unsigned long aligned;
struct vm_struct *area;
+ if (!pmb_iomapping_enabled)
+ return NULL;
+
/*
* Small mappings need to go through the TLB.
*/
@@ -684,6 +689,18 @@ static void __init pmb_resize(void)
}
#endif
+static int __init early_pmb(char *p)
+{
+ if (!p)
+ return 0;
+
+ if (strstr(p, "iomap"))
+ pmb_iomapping_enabled = 1;
+
+ return 0;
+}
+early_param("pmb", early_pmb);
+
void __init pmb_init(void)
{
/* Synchronize software state */