Fernando Guzman Lugo | 1 Jul 2010 01:59
Picon
Favicon

[PATCHv3 0/9] dspbridge: iommu migration

This set of patches remove the dspbridge custom mmu implementation
and use iommu module instead.

NOTE: in order to dspbridge can work properly the patch
"0001-iovmm-add-superpages-support-to-fixed-da-address.patch"
is needed (specifically iommu_kmap calls need this patch).

Fernando Guzman Lugo (9):
  dspbridge: replace iommu custom for opensource implementation
  dspbridge: move shared memory iommu maps to tiomap3430.c
  dspbridge: rename bridge_brd_mem_map/unmap to a proper name
  dspbridge: remove custom mmu code from tiomap3430.c
  dspbridge: add mmufault support
  dspbridge: remove hw directory
  dspbridge: move all iommu related code to a new file
  dspbridge: add map support for big buffers
  dspbridge: cleanup bridge_dev_context and cfg_hostres structures

 arch/arm/plat-omap/include/dspbridge/cfgdefs.h  |    1 -
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h  |   90 ++
 arch/arm/plat-omap/include/dspbridge/dspdefs.h  |   44 -
 arch/arm/plat-omap/include/dspbridge/dspdeh.h   |    1 -
 arch/arm/plat-omap/include/dspbridge/dspioctl.h |    7 -
 drivers/dsp/bridge/Makefile                     |    5 +-
 drivers/dsp/bridge/core/_deh.h                  |    3 -
 drivers/dsp/bridge/core/_tiomap.h               |   15 +-
 drivers/dsp/bridge/core/dsp-mmu.c               |  229 ++++
 drivers/dsp/bridge/core/io_sm.c                 |  185 +---
 drivers/dsp/bridge/core/mmu_fault.c             |  139 ---
 drivers/dsp/bridge/core/mmu_fault.h             |   36 -
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:00
Picon
Favicon

[PATCH] iovmm: add superpages support to fixed da address

This patch adds superpages support to fixed ad address
inside iommu_kmap function.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/iovmm.c |   52 +++++++++++++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 936aef1..7cde09f 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
 <at>  <at>  -86,35 +86,45  <at>  <at>  static size_t sgtable_len(const struct sg_table *sgt)
 }
 #define sgtable_ok(x)	(!!sgtable_len(x))

+
+static inline unsigned max_alignment(u32 addr)
+{
+	int i;
+	unsigned pagesize[] = { SZ_16M, SZ_1M, SZ_64K, SZ_4K, };
+	for (i = 0; i < ARRAY_SIZE(pagesize) && addr & (pagesize[i] - 1); i++)
+		;
+	return (i < ARRAY_SIZE(pagesize)) ? pagesize[i] : 0;
+}
+
+
 /*
  * calculate the optimal number sg elements from total bytes based on
  * iommu superpages
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:00
Picon
Favicon

[PATCHv3 9/9] dspbridge: cleanup bridge_dev_context and cfg_hostres structures

this patch cleans up cfg_hostres and bridge_dev_context
structures of custom mmu code not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |    1 -
 drivers/dsp/bridge/core/_tiomap.h              |    5 -----
 drivers/dsp/bridge/core/tiomap3430.c           |    8 --------
 drivers/dsp/bridge/core/tiomap_io.c            |    2 +-
 drivers/dsp/bridge/rmgr/drv.c                  |    4 ----
 5 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index 38122db..dfb55cc 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
 <at>  <at>  -68,7 +68,6  <at>  <at>  struct cfg_hostres {
 	void __iomem *dw_per_base;
 	u32 dw_per_pm_base;
 	u32 dw_core_pm_base;
-	void __iomem *dw_dmmu_base;
 	void __iomem *dw_sys_ctrl_base;
 };

diff --git a/drivers/dsp/bridge/core/_tiomap.h b/drivers/dsp/bridge/core/_tiomap.h
index 8a9a822..82bce7d 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
 <at>  <at>  -323,7 +323,6  <at>  <at>  struct bridge_dev_context {
 	 */
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 01:59
Picon
Favicon

[PATCHv3 6/9] dspbridge: remove hw directory

hw directory only was being used for custom iommu implementation
api's, so after the iommu module migration this directory is not
needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/include/dspbridge/dspioctl.h |    7 -
 drivers/dsp/bridge/Makefile                     |    3 +-
 drivers/dsp/bridge/core/_tiomap.h               |    1 -
 drivers/dsp/bridge/core/io_sm.c                 |    4 -
 drivers/dsp/bridge/core/mmu_fault.c             |    4 -
 drivers/dsp/bridge/core/tiomap3430.c            |   22 +-
 drivers/dsp/bridge/core/tiomap3430_pwr.c        |  183 +------
 drivers/dsp/bridge/core/tiomap_io.c             |    5 +-
 drivers/dsp/bridge/core/ue_deh.c                |    4 -
 drivers/dsp/bridge/hw/EasiGlobal.h              |   41 --
 drivers/dsp/bridge/hw/GlobalTypes.h             |  308 ------------
 drivers/dsp/bridge/hw/MMUAccInt.h               |   76 ---
 drivers/dsp/bridge/hw/MMURegAcM.h               |  226 ---------
 drivers/dsp/bridge/hw/hw_defs.h                 |   60 ---
 drivers/dsp/bridge/hw/hw_mmu.c                  |  587 -----------------------
 drivers/dsp/bridge/hw/hw_mmu.h                  |  161 -------
 drivers/dsp/bridge/rmgr/node.c                  |    4 +-
 17 files changed, 35 insertions(+), 1661 deletions(-)
 delete mode 100644 drivers/dsp/bridge/hw/EasiGlobal.h
 delete mode 100644 drivers/dsp/bridge/hw/GlobalTypes.h
 delete mode 100644 drivers/dsp/bridge/hw/MMUAccInt.h
 delete mode 100644 drivers/dsp/bridge/hw/MMURegAcM.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_defs.h
 delete mode 100644 drivers/dsp/bridge/hw/hw_mmu.c
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 01:59
Picon
Favicon

[PATCHv3 4/9] dspbridge: remove custom mmu code from tiomap3430.c

This patch removes all the custom mmu code remaining in
tiomap3430.c which is not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 drivers/dsp/bridge/core/_tiomap.h    |    1 -
 drivers/dsp/bridge/core/tiomap3430.c |  470 ----------------------------------
 2 files changed, 0 insertions(+), 471 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h b/drivers/dsp/bridge/core/_tiomap.h
index 4aa2358..c41fd8e 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
 <at>  <at>  -356,7 +356,6  <at>  <at>  struct bridge_dev_context {

 	/* TC Settings */
 	bool tc_word_swap_on;	/* Traffic Controller Word Swap */
-	struct pg_table_attrs *pt_attrs;
 	u32 dsp_per_clks;
 };

diff --git a/drivers/dsp/bridge/core/tiomap3430.c b/drivers/dsp/bridge/core/tiomap3430.c
index 88f5167..96cceea 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
 <at>  <at>  -105,56 +105,9  <at>  <at>  static int bridge_dev_create(OUT struct bridge_dev_context
 static int bridge_dev_ctrl(struct bridge_dev_context *dev_context,
 				  u32 dw_cmd, IN OUT void *pargs);
 static int bridge_dev_destroy(struct bridge_dev_context *dev_context);
-static u32 user_va2_pa(struct mm_struct *mm, u32 address);
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:00
Picon
Favicon

[PATCHv3 8/9] dspbridge: add map support for big buffers

due to a restriction in scatter gather lists, it can
not be created a list for a buffer bigger than 1MB.
This patch is spliting big mappings into 1MB mappings.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |    2 +-
 drivers/dsp/bridge/core/dsp-mmu.c              |   55 ++++++++++++++---------
 drivers/dsp/bridge/rmgr/proc.c                 |    3 +-
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
index 266f38b..2e4bf6a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 <at>  <at>  -85,6 +85,6  <at>  <at>  int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size);

 #endif
diff --git a/drivers/dsp/bridge/core/dsp-mmu.c b/drivers/dsp/bridge/core/dsp-mmu.c
index e8da327..9a46206 100644
--- a/drivers/dsp/bridge/core/dsp-mmu.c
+++ b/drivers/dsp/bridge/core/dsp-mmu.c
 <at>  <at>  -133,7 +133,7  <at>  <at>  int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
 						struct page **usr_pgs)
 {
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 01:59
Picon
Favicon

[PATCHv3 2/9] dspbridge: move shared memory iommu maps to tiomap3430.c

Now the iommu map of shared memory segments are done in
bridge_brd_start and unmaped in bridge_brd_stop.

NOTE: video sequencer reset is not done in dspbridge anymore,
due to dspbridge does not manage it.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 drivers/dsp/bridge/core/_tiomap.h    |    6 +
 drivers/dsp/bridge/core/io_sm.c      |  117 ++----------
 drivers/dsp/bridge/core/tiomap3430.c |  353 ++++++++++++++++++++--------------
 drivers/dsp/bridge/core/tiomap_io.c  |   11 +-
 4 files changed, 237 insertions(+), 250 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h b/drivers/dsp/bridge/core/_tiomap.h
index d13677a..6a822c6 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
 <at>  <at>  -310,6 +310,11  <at>  <at>  static const struct bpwr_clk_t bpwr_clks[] = {

 #define CLEAR_BIT_INDEX(reg, index)   (reg &= ~(1 << (index)))

+struct shm_segs {
+	u32 seg0_da, seg0_pa, seg0_va, seg0_size;
+	u32 seg1_da, seg1_pa, seg1_va, seg1_size;
+};
+
 /* This Bridge driver's device context: */
 struct bridge_dev_context {
 	struct dev_object *hdev_obj;	/* Handle to Bridge device object. */
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:20
Picon
Favicon

[PATCH 8/9] dspbridge: add map support for big buffers

due to a restriction in scatter gather lists, it can
not be created a list for a buffer bigger than 1MB.
This patch is spliting big mappings into 1MB mappings.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |    2 +-
 drivers/dsp/bridge/core/dsp-mmu.c              |   55 ++++++++++++++---------
 drivers/dsp/bridge/rmgr/proc.c                 |    3 +-
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
index 266f38b..2e4bf6a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 <at>  <at>  -85,6 +85,6  <at>  <at>  int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
  * This function unmaps a user space buffer into DSP virtual address.
  *
  */
-int user_to_dsp_unmap(struct iommu *mmu, u32 da);
+int user_to_dsp_unmap(struct iommu *mmu, u32 da, unsigned size);

 #endif
diff --git a/drivers/dsp/bridge/core/dsp-mmu.c b/drivers/dsp/bridge/core/dsp-mmu.c
index e8da327..9a46206 100644
--- a/drivers/dsp/bridge/core/dsp-mmu.c
+++ b/drivers/dsp/bridge/core/dsp-mmu.c
 <at>  <at>  -133,7 +133,7  <at>  <at>  int user_to_dsp_map(struct iommu *mmu, u32 uva, u32 da, u32 size,
 						struct page **usr_pgs)
 {
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:20
Picon
Favicon

[PATCH 7/9] dspbridge: move all iommu related code to a new file

This patch moves all the code related to iommu in the
dsp-mmu.c file

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h |   90 ++++++++++
 arch/arm/plat-omap/include/dspbridge/dspdeh.h  |    1 -
 drivers/dsp/bridge/Makefile                    |    2 +-
 drivers/dsp/bridge/core/_deh.h                 |    3 -
 drivers/dsp/bridge/core/_tiomap.h              |   41 +-----
 drivers/dsp/bridge/core/dsp-mmu.c              |  218 ++++++++++++++++++++++++
 drivers/dsp/bridge/core/mmu_fault.c            |   76 --------
 drivers/dsp/bridge/core/mmu_fault.h            |   35 ----
 drivers/dsp/bridge/core/tiomap3430.c           |  111 +------------
 drivers/dsp/bridge/core/ue_deh.c               |   68 +-------
 drivers/dsp/bridge/rmgr/proc.c                 |    6 +-
 11 files changed, 318 insertions(+), 333 deletions(-)
 create mode 100644 arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 create mode 100644 drivers/dsp/bridge/core/dsp-mmu.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.c
 delete mode 100644 drivers/dsp/bridge/core/mmu_fault.h

diff --git a/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
new file mode 100644
index 0000000..266f38b
--- /dev/null
+++ b/arch/arm/plat-omap/include/dspbridge/dsp-mmu.h
 <at>  <at>  -0,0 +1,90  <at>  <at> 
+/*
+ * dsp-mmu.h
(Continue reading)

Fernando Guzman Lugo | 1 Jul 2010 02:20
Picon
Favicon

[PATCH 4/9] dspbridge: remove custom mmu code from tiomap3430.c

This patch removes all the custom mmu code remaining in
tiomap3430.c which is not needed anymore.

Signed-off-by: Fernando Guzman Lugo <x0095840 <at> ti.com>
---
 drivers/dsp/bridge/core/_tiomap.h    |    1 -
 drivers/dsp/bridge/core/tiomap3430.c |  470 ----------------------------------
 2 files changed, 0 insertions(+), 471 deletions(-)

diff --git a/drivers/dsp/bridge/core/_tiomap.h b/drivers/dsp/bridge/core/_tiomap.h
index 4aa2358..c41fd8e 100644
--- a/drivers/dsp/bridge/core/_tiomap.h
+++ b/drivers/dsp/bridge/core/_tiomap.h
 <at>  <at>  -356,7 +356,6  <at>  <at>  struct bridge_dev_context {

 	/* TC Settings */
 	bool tc_word_swap_on;	/* Traffic Controller Word Swap */
-	struct pg_table_attrs *pt_attrs;
 	u32 dsp_per_clks;
 };

diff --git a/drivers/dsp/bridge/core/tiomap3430.c b/drivers/dsp/bridge/core/tiomap3430.c
index 88f5167..96cceea 100644
--- a/drivers/dsp/bridge/core/tiomap3430.c
+++ b/drivers/dsp/bridge/core/tiomap3430.c
 <at>  <at>  -105,56 +105,9  <at>  <at>  static int bridge_dev_create(OUT struct bridge_dev_context
 static int bridge_dev_ctrl(struct bridge_dev_context *dev_context,
 				  u32 dw_cmd, IN OUT void *pargs);
 static int bridge_dev_destroy(struct bridge_dev_context *dev_context);
-static u32 user_va2_pa(struct mm_struct *mm, u32 address);
(Continue reading)


Gmane