aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-03-02 02:49:50 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-03-02 02:49:50 -0500
commit4cfa8e75d6854699597e21fd570721d63f899934 (patch)
treecb9199101ee22020524b6e96bfed4caa4ba12e7e
parent90e7d649d86f21d478dc134f74c88e19dd472393 (diff)
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>
-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);
68static struct pmb_entry pmb_entry_list[NR_PMB_ENTRIES]; 68static struct pmb_entry pmb_entry_list[NR_PMB_ENTRIES];
69static DECLARE_BITMAP(pmb_map, NR_PMB_ENTRIES); 69static DECLARE_BITMAP(pmb_map, NR_PMB_ENTRIES);
70 70
71static unsigned int pmb_iomapping_enabled;
72
71static __always_inline unsigned long mk_pmb_entry(unsigned int entry) 73static __always_inline unsigned long mk_pmb_entry(unsigned int entry)
72{ 74{
73 return (entry & PMB_E_MASK) << PMB_E_SHIFT; 75 return (entry & PMB_E_MASK) << PMB_E_SHIFT;
@@ -284,6 +286,9 @@ void __iomem *pmb_remap_caller(phys_addr_t phys, unsigned long size,
284 unsigned long aligned; 286 unsigned long aligned;
285 struct vm_struct *area; 287 struct vm_struct *area;
286 288
289 if (!pmb_iomapping_enabled)
290 return NULL;
291
287 /* 292 /*
288 * Small mappings need to go through the TLB. 293 * Small mappings need to go through the TLB.
289 */ 294 */
@@ -684,6 +689,18 @@ static void __init pmb_resize(void)
684} 689}
685#endif 690#endif
686 691
692static int __init early_pmb(char *p)
693{
694 if (!p)
695 return 0;
696
697 if (strstr(p, "iomap"))
698 pmb_iomapping_enabled = 1;
699
700 return 0;
701}
702early_param("pmb", early_pmb);
703
687void __init pmb_init(void) 704void __init pmb_init(void)
688{ 705{
689 /* Synchronize software state */ 706 /* Synchronize software state */