]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/mmu.c
REMOVE OMAP LEGACY CODE: Reset mach-omap1/board-*.c files to mainline
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / mmu.c
index 66aa0d49b980f221b94fc58b790911a4ce1c9936..75dd310a9073921264659e6e8f34cac93718d661 100644 (file)
@@ -9,18 +9,8 @@
  *        and Paul Mundt <paul.mundt@nokia.com>
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <linux/types.h>
 #include <linux/init.h>
@@ -32,6 +22,7 @@
 #include <linux/err.h>
 #include "mmu.h"
 #include <asm/tlbflush.h>
+#include <mach/dsp_common.h>
 
 static void *dspvect_page;
 #define DSP_INIT_PAGE  0xfff000
@@ -79,6 +70,12 @@ void dsp_mem_usecount_clear(void)
 }
 EXPORT_SYMBOL_GPL(dsp_mem_usecount_clear);
 
+void omap_mmu_itack(struct omap_mmu *mmu)
+{
+       omap_mmu_write_reg(mmu, OMAP_MMU_IT_ACK_IT_ACK, OMAP_MMU_IT_ACK);
+}
+EXPORT_SYMBOL(omap_mmu_itack);
+
 static int omap1_mmu_mem_enable(struct omap_mmu *mmu, void *addr)
 {
        int ret = 0;
@@ -201,8 +198,8 @@ static int omap1_mmu_startup(struct omap_mmu *mmu)
 {
        dspvect_page = (void *)__get_dma_pages(GFP_KERNEL, 0);
        if (dspvect_page == NULL) {
-               printk(KERN_ERR "MMU: failed to allocate memory "
-                               "for dsp vector table\n");
+               dev_err(mmu->dev, "MMU %s: failed to allocate memory "
+                       "for vector table\n", mmu->name);
                return -ENOMEM;
        }
 
@@ -238,13 +235,13 @@ static inline unsigned long omap1_mmu_cam_va(struct cam_ram_regset *cr)
 }
 
 static struct cam_ram_regset *
-omap1_mmu_cam_ram_alloc(struct omap_mmu_tlb_entry *entry)
+omap1_mmu_cam_ram_alloc(struct omap_mmu *mmu, struct omap_mmu_tlb_entry *entry)
 {
        struct cam_ram_regset *cr;
 
        if (entry->va & ~(get_cam_va_mask(entry->pgsz))) {
-               printk(KERN_ERR "MMU: mapping vadr (0x%06lx) is not on an "
-                      "aligned boundary\n", entry->va);
+               dev_err(mmu->dev, "MMU %s: mapping vadr (0x%06lx) is not on"
+                       " an aligned boundary\n", mmu->name, entry->va);
                return ERR_PTR(-EINVAL);
        }
 
@@ -279,7 +276,7 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu)
 
        /* if the fault is masked, nothing to do */
        if ((status & MMUFAULT_MASK) == 0) {
-               pr_debug( "MMU interrupt, but ignoring.\n");
+               pr_debug("MMU interrupt, but ignoring.\n");
                /*
                 * note: in OMAP1710,
                 * when CACHE + DMA domain gets out of idle in DSP,
@@ -287,16 +284,16 @@ static void omap1_mmu_interrupt(struct omap_mmu *mmu)
                 * in this case, we just ignore the interrupt.
                 */
                if (status) {
-                       pr_debug( "%s%s%s%s\n",
-                                 (status & OMAP_MMU_FAULT_ST_PREF)?
-                                 "  (prefetch err)" : "",
-                                 (status & OMAP_MMU_FAULT_ST_PERM)?
-                                 "  (permission fault)" : "",
-                                 (status & OMAP_MMU_FAULT_ST_TLB_MISS)?
-                                 "  (TLB miss)" : "",
-                                 (status & OMAP_MMU_FAULT_ST_TRANS) ?
-                                 "  (translation fault)": "");
-                       pr_debug( "fault address = %#08lx\n", va);
+                       pr_debug("%s%s%s%s\n",
+                                (status & OMAP_MMU_FAULT_ST_PREF)?
+                                "  (prefetch err)" : "",
+                                (status & OMAP_MMU_FAULT_ST_PERM)?
+                                "  (permission fault)" : "",
+                                (status & OMAP_MMU_FAULT_ST_TLB_MISS)?
+                                "  (TLB miss)" : "",
+                                (status & OMAP_MMU_FAULT_ST_TRANS) ?
+                                "  (translation fault)": "");
+                       pr_debug("fault address = %#08lx\n", va);
                }
                enable_irq(mmu->irq);
                return;