diff mbox

[3/4] dspbridge: remove _tiomap_mmu.h

Message ID 1274024702-20961-4-git-send-email-felipe.contreras@gmail.com (mailing list archive)
State Accepted
Delegated to:
Headers show

Commit Message

Felipe Contreras May 16, 2010, 3:45 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/dsp/bridge/core/_tiomap_mmu.h b/drivers/dsp/bridge/core/_tiomap_mmu.h
deleted file mode 100644
index 66c1249..0000000
--- a/drivers/dsp/bridge/core/_tiomap_mmu.h
+++ /dev/null
@@ -1,41 +0,0 @@ 
-/*
- * _tiomap_mmu.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Definitions and types for the DSP MMU modules.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef _TIOMAP_MMU_
-#define _TIOMAP_MMU_
-
-#include "_tiomap.h"
-
-/*
- *  ======== configure_dsp_mmu ========
- *
- *  Make DSP MMu page table entries.
- *  Note: Not utilizing Coarse / Fine page tables.
- *  SECTION = 1MB, LARGE_PAGE = 64KB, SMALL_PAGE = 4KB, TINY_PAGE = 1KB.
- *  DSP Byte address 0x40_0000 is word addr 0x20_0000.
- */
-extern void configure_dsp_mmu(struct bridge_dev_context *dev_context,
-			      u32 dataBasePhys,
-			      u32 dspBaseVirt,
-			      u32 sizeInBytes,
-			      s32 nEntryStart,
-			      enum hw_endianism_t endianism,
-			      enum hw_element_size_t elem_size,
-			      enum hw_mmu_mixed_size_t mixed_size);
-
-#endif /* _TIOMAP_MMU_ */
diff --git a/drivers/dsp/bridge/core/mmu_fault.c b/drivers/dsp/bridge/core/mmu_fault.c
index 883f45d..7cd78c6 100644
--- a/drivers/dsp/bridge/core/mmu_fault.c
+++ b/drivers/dsp/bridge/core/mmu_fault.c
@@ -38,7 +38,6 @@ 
 /*  ----------------------------------- This */
 #include "_deh.h"
 #include <dspbridge/cfg.h>
-#include "_tiomap_mmu.h"
 #include "_tiomap.h"
 #include "mmu_fault.h"
 
diff --git a/drivers/dsp/bridge/core/tiomap3430.c b/drivers/dsp/bridge/core/tiomap3430.c
index c7b0d83..3b571aa 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
@@ -57,7 +57,6 @@ 
 /*  ----------------------------------- Local */
 #include "_tiomap.h"
 #include "_tiomap_pwr.h"
-#include "_tiomap_mmu.h"
 #include "_tiomap_util.h"
 #include "tiomap_io.h"
 
@@ -457,41 +456,32 @@  static dsp_status bridge_brd_start(struct bridge_dev_context *hDevContext,
 		/* Only make TLB entry if both addresses are non-zero */
 		for (entry_ndx = 0; entry_ndx < BRDIOCTL_NUMOFMMUTLB;
 		     entry_ndx++) {
-			if ((dev_context->atlb_entry[entry_ndx].ul_gpp_pa != 0)
-			    && (dev_context->atlb_entry[entry_ndx].ul_dsp_va !=
-				0)) {
-				dev_dbg(bridge,
-					"(proc) MMU %d GppPa:"
-					" 0x%x DspVa 0x%x Size 0x%x\n",
+			struct bridge_ioctl_extproc *e = &dev_context->atlb_entry[entry_ndx];
+			struct hw_mmu_map_attrs_t map_attrs = {
+				.endianism = e->endianism,
+				.element_size = e->elem_size,
+				.mixed_size = e->mixed_mode,
+			};
+
+			if (!e->ul_gpp_pa || !e->ul_dsp_va)
+				continue;
+
+			dev_dbg(bridge,
+					"MMU %d, pa: 0x%x, va: 0x%x, size: 0x%x",
 					itmp_entry_ndx,
-					dev_context->atlb_entry[entry_ndx].
-					ul_gpp_pa,
-					dev_context->atlb_entry[entry_ndx].
-					ul_dsp_va,
-					dev_context->atlb_entry[entry_ndx].
-					ul_size);
-				configure_dsp_mmu(dev_context,
-						  dev_context->
-						  atlb_entry[entry_ndx].
-						  ul_gpp_pa,
-						  dev_context->
-						  atlb_entry[entry_ndx].
-						  ul_dsp_va * DSPWORDSIZE,
-						  dev_context->
-						  atlb_entry[entry_ndx].ul_size,
-						  itmp_entry_ndx,
-						  dev_context->
-						  atlb_entry[entry_ndx].
-						  endianism,
-						  dev_context->
-						  atlb_entry[entry_ndx].
-						  elem_size,
-						  dev_context->
-						  atlb_entry[entry_ndx].
-						  mixed_mode);
-				itmp_entry_ndx++;
-			}
-		}		/* end for */
+					e->ul_gpp_pa,
+					e->ul_dsp_va,
+					e->ul_size);
+
+			hw_mmu_tlb_add(dev_context->dw_dsp_mmu_base,
+					e->ul_gpp_pa,
+					e->ul_dsp_va,
+					e->ul_size,
+					itmp_entry_ndx,
+					&map_attrs, 1, 1);
+
+			itmp_entry_ndx++;
+		}
 	}
 
 	/* Lock the above TLB entries and get the BIOS and load monitor timer
@@ -1870,30 +1860,6 @@  static dsp_status mem_map_vmalloc(struct bridge_dev_context *dev_context,
 }
 
 /*
- *  ======== configure_dsp_mmu ========
- *      Make DSP MMU page table entries.
- */
-void configure_dsp_mmu(struct bridge_dev_context *dev_context, u32 dataBasePhys,
-		       u32 dspBaseVirt, u32 sizeInBytes, s32 nEntryStart,
-		       enum hw_endianism_t endianism,
-		       enum hw_element_size_t elem_size,
-		       enum hw_mmu_mixed_size_t mixed_size)
-{
-	struct hw_mmu_map_attrs_t map_attrs = { endianism, elem_size,
-						mixed_size };
-
-	DBC_REQUIRE(sizeInBytes > 0);
-	dev_dbg(bridge, "%s: entry %x pa %x, va %x, bytes %x endianism %x, "
-		"elem_size %x, mixed_size %x", __func__, nEntryStart,
-		dataBasePhys, dspBaseVirt, sizeInBytes, endianism,
-		elem_size, mixed_size);
-
-	hw_mmu_tlb_add(dev_context->dw_dsp_mmu_base, dataBasePhys,
-		       dspBaseVirt, sizeInBytes, nEntryStart,
-		       &map_attrs, HW_SET, HW_SET);
-}
-
-/*
  *  ======== wait_for_start ========
  *      Wait for the singal from DSP that it has started, or time out.
  */
diff --git a/drivers/dsp/bridge/core/ue_deh.c b/drivers/dsp/bridge/core/ue_deh.c
index 605f312..10486b4 100644
--- a/drivers/dsp/bridge/core/ue_deh.c
+++ b/drivers/dsp/bridge/core/ue_deh.c
@@ -49,7 +49,6 @@ 
 #include "mmu_fault.h"
 #include "_tiomap.h"
 #include "_deh.h"
-#include "_tiomap_mmu.h"
 #include "_tiomap_pwr.h"
 #include <dspbridge/io_sm.h>