[PATCH v2] DSPBRIDGE: remove wdt3 from dsp control

2010-04-27 Thread Omar Ramirez Luna
WDT3 is used as a way to detect dsp hangs, as of now its
control is left to arm side driver, so, no requests should
be received by the dsp to enable/disable this clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 2e3c64d..ee85905 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -64,8 +64,6 @@ struct dsp_clk_t {
 static struct omap_dm_timer *timer[4];
 
 static struct dsp_clk_t dsp_clks[] = {
-   {NULL, wdt_fck, 3},
-   {NULL, wdt_ick, 3},
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
 };
@@ -141,6 +139,8 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
omap_mcbsp_request(MCBSP_ID(clk_id));
break;
case WDT_CLK:
+   dev_err(bridge, ERROR: DSP requested to enable WDT3 clk\n);
+   break;
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
if (clk_enable(clk_handle)) {
@@ -191,6 +191,8 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
omap_mcbsp_free(MCBSP_ID(clk_id));
break;
case WDT_CLK:
+   dev_err(bridge, ERROR: DSP requested to disable WDT3 clk\n);
+   break;
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
 
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] DSPBRIDGE: function to get the type of clock requested by dsp

2010-04-27 Thread Omar Ramirez Luna
DSP can request between 5 types of clocks: IVA2, GPT (5-8), WDT (3),
MCBSP (1-5) or SSI clock. This function will be useful in case
a specific clock framework is associated with the clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   89 -
 1 files changed, 68 insertions(+), 21 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index e35b929..d5c3d4e 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -40,6 +40,13 @@
 #define SSI_SIDLE_SMARTIDLE(2  3)
 #define SSI_MIDLE_NOIDLE   (1  12)
 
+/* Clk types requested by the dsp */
+#define IVA2_CLK   0
+#define GPT_CLK1
+#define WDT_CLK2
+#define MCBSP_CLK  3
+#define SSI_CLK4
+
 struct dsp_clk_t {
struct clk *clk_handle;
const char *clk_name;
@@ -76,6 +83,26 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, }
 };
 
+static s8 get_clk_type(u8 id)
+{
+   s8 type;
+
+   if (id == DSP_CLK_IVA2_CK)
+   type = IVA2_CLK;
+   else if (id = DSP_CLK_GPT8_ICK)
+   type = GPT_CLK;
+   else if (id = DSP_CLK_WDT3_ICK)
+   type = WDT_CLK;
+   else if (id = DSP_CLK_MCBSP5_ICK)
+   type = MCBSP_CLK;
+   else if (id  DSP_CLK_SSI_ICK)
+   type = SSI_CLK;
+   else
+   type = -1;
+
+   return type;
+}
+
 /*
  *   dsp_clk_exit 
  *  Purpose:
@@ -141,23 +168,33 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
dsp_status status = DSP_SOK;
struct clk *clk_handle;
 
-   DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
+   switch (get_clk_type(clk_id)) {
+   case IVA2_CLK:
+   case GPT_CLK:
+   case MCBSP_CLK:
+   case WDT_CLK:
+   case SSI_CLK:
+   clk_handle = dsp_clks[clk_id].clk_handle;
+   if (clk_enable(clk_handle)) {
+   pr_err(dsp_clk_enable: failed to Enable CLK %s, 
+   CLK dev id = %d\n, dsp_clks[clk_id].clk_name,
+   dsp_clks[clk_id].id);
+   status = -EPERM;
+   }
 
-   clk_handle = dsp_clks[clk_id].clk_handle;
-   if (clk_enable(clk_handle)) {
-   pr_err(dsp_clk_enable: failed to Enable CLK %s, 
-  CLK dev id = %d\n,
-  dsp_clks[clk_id].clk_name,
-  dsp_clks[clk_id].id);
-   status = -EPERM;
+   /*
+* The SSI module need to configured not to have the Forced
+* idle for master interface. If it is set to forced idle,
+* the SSI module is transitioning to standby thereby causing
+* the client in the DSP hang waiting for the SSI module to
+* be active after enabling the clocks
+*/
+   if (clk_id == DSP_CLK_SSI_ICK)
+   ssi_clk_prepare(true);
+   break;
+   default:
+   dev_err(bridge, Invalid clock id for enable\n);
}
-   /* The SSI module need to configured not to have the Forced idle for
-* master interface. If it is set to forced idle, the SSI module is
-* transitioning to standby thereby causing the client in the DSP hang
-* waiting for the SSI module to be active after enabling the clocks
-*/
-   if (clk_id == DSP_CLK_SSI_FCK)
-   ssi_clk_prepare(true);
 
return status;
 }
@@ -175,12 +212,22 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 
DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
 
-   clk_handle = dsp_clks[clk_id].clk_handle;
-
-   if (clk_id == DSP_CLK_SSI_ICK)
-   ssi_clk_prepare(false);
-
-   clk_disable(clk_handle);
+   switch (get_clk_type(clk_id)) {
+   case IVA2_CLK:
+   case GPT_CLK:
+   case MCBSP_CLK:
+   case WDT_CLK:
+   case SSI_CLK:
+   clk_handle = dsp_clks[clk_id].clk_handle;
+
+   if (clk_id == DSP_CLK_SSI_ICK)
+   ssi_clk_prepare(false);
+
+   clk_disable(clk_handle);
+   break;
+   default:
+   dev_err(bridge, Invalid clock id for disable\n);
+   }
 
return status;
 }
-- 
1.6.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] DSPBRIDGE: reorganize the code to handle peripheral clocks

2010-04-27 Thread Omar Ramirez Luna
This patch moves and simplifies the code used to enable/disable
all the requested peripheral clocks.

Signed-off-by: Omar Ramirez Luna omar.rami...@hotmail.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |4 ++
 drivers/dsp/bridge/rmgr/drv_interface.c|1 +
 drivers/dsp/bridge/wmd/_tiomap_pwr.h   |   17 --
 drivers/dsp/bridge/wmd/dsp-clock.c |   43 +
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   47 +++-
 drivers/dsp/bridge/wmd/tiomap_io.c |4 +-
 drivers/dsp/bridge/wmd/ue_deh.c|2 +-
 7 files changed, 56 insertions(+), 62 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index e6b09c7..439fc2d 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -75,6 +75,8 @@ extern void dsp_clk_init(void);
  */
 extern dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id);
 
+u32 dsp_clock_enable_all(u32 dsp_per_clocks);
+
 /*
  *   dsp_clk_disable 
  *  Purpose:
@@ -90,6 +92,8 @@ extern dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id);
 
 extern u32 dsp_clk_get_iva2_rate(void);
 
+u32 dsp_clock_disable_all(u32 dsp_per_clocks);
+
 extern void ssi_clk_prepare(bool FLAG);
 
 #endif /* _SYNC_H */
diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index db1c746..04b17be 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -41,6 +41,7 @@
 
 /*  --- OS Adaptation Layer */
 #include dspbridge/services.h
+#include dspbridge/clk.h
 #include dspbridge/sync.h
 
 /*  --- Platform Manager */
diff --git a/drivers/dsp/bridge/wmd/_tiomap_pwr.h 
b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
index a7a4fc2..1948e83 100644
--- a/drivers/dsp/bridge/wmd/_tiomap_pwr.h
+++ b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
@@ -64,23 +64,6 @@ dsp_status pre_scale_dsp(struct wmd_dev_context 
*dev_context, IN void *pargs);
  */
 dsp_status handle_constraints_set(struct wmd_dev_context *dev_context,
  IN void *pargs);
-/*
- *   dsp_peripheral_clocks_disable 
- * This function disables all the peripheral clocks that
- * were enabled by DSP. Call this function only when
- * DSP is entering Hibernation or when DSP is in
- * Error state
- */
-dsp_status dsp_peripheral_clocks_disable(struct wmd_dev_context *dev_context,
-IN void *pargs);
-
-/*
- *   dsp_peripheral_clocks_enable 
- * This function enables all the peripheral clocks that
- * were requested by DSP.
- */
-dsp_status dsp_peripheral_clocks_enable(struct wmd_dev_context *dev_context,
-   IN void *pargs);
 
 /*
  *   dsp_clk_wakeup_event_ctrl 
diff --git a/drivers/dsp/bridge/wmd/dsp-clock.c 
b/drivers/dsp/bridge/wmd/dsp-clock.c
index c4f0874..608ff03 100644
--- a/drivers/dsp/bridge/wmd/dsp-clock.c
+++ b/drivers/dsp/bridge/wmd/dsp-clock.c
@@ -115,6 +115,8 @@ static s8 get_clk_type(u8 id)
  */
 void dsp_clk_exit(void)
 {
+   dsp_clock_disable_all(dsp_clocks);
+
clk_put(iva2_clk);
clk_put(ssi.sst_fck);
clk_put(ssi.ssr_fck);
@@ -247,6 +249,25 @@ out:
return status;
 }
 
+/**
+ * dsp_clock_enable_all - Enable clocks used by the DSP
+ * @dev_contextDriver's device context strucure
+ *
+ * This function enables all the peripheral clocks that were requested by DSP.
+ */
+u32 dsp_clock_enable_all(u32 dsp_per_clocks)
+{
+   u32 clk_id;
+   u32 status = -EPERM;
+
+   for (clk_id = 0; clk_id  DSP_CLK_NOT_DEFINED; clk_id++) {
+   if (is_dsp_clk_active(dsp_per_clocks, clk_id))
+   status = dsp_clk_enable(clk_id);
+   }
+
+   return status;
+}
+
 /*
  *   dsp_clk_disable 
  *  Purpose:
@@ -295,6 +316,27 @@ out:
return status;
 }
 
+/**
+ * dsp_clock_disable_all - Disable all active clocks
+ * @dev_contextDriver's device context structure
+ *
+ * This function disables all the peripheral clocks that were enabled by DSP.
+ * It is meant to be called only when DSP is entering hibernation or when DSP
+ * is in error state.
+ */
+u32 dsp_clock_disable_all(u32 dsp_per_clocks)
+{
+   u32 clk_id;
+   u32 status = -EPERM;
+
+   for (clk_id = 0; clk_id  DSP_CLK_NOT_DEFINED; clk_id++) {
+   if (is_dsp_clk_active(dsp_per_clocks, clk_id))
+   status = dsp_clk_disable(clk_id);
+   }
+
+   return status;
+}
+
 u32 dsp_clk_get_iva2_rate(void)
 {
u32 clk_speed_khz;
@@ -332,3 +374,4 @@ void ssi_clk_prepare(bool FLAG)
__raw_writel(value, ssi_base + OMAP_SSI_SYSCONFIG_OFFSET);
iounmap(ssi_base);
 }
+
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c 
b

Re: [PATCH v2] generic clk module removal

2010-04-28 Thread Omar Ramirez Luna

On 4/27/2010 8:34 PM, Nishanth Menon wrote:

On 04/27/2010 08:29 PM, Omar Ramirez Luna wrote:

This set of patches remove clk module from the services layer.

Now:
- GPT 5-8 are controlled through DM Timer framework.
- MCBSP clocks are enabled by requesting the proper mcbsp device.
- WDT is left for bridge driver to control rather than on request from dsp.
- SSI is controlled by enabling/disabling its sst, ssr and ick clocks.

v2:
- rebased
- keep iva2 handling as it is advised to turn off the clocks for iva reset
sources.
- release all the clocks (disable   free) if driver is uninstalled.



[...]

is there a series numbering for this patchset?


wrong sed substitution command to place v2 :/

I will resend.

- omar

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] DSPBRIDGE: use dm timer framework for gpt timers

2010-04-28 Thread Omar Ramirez Luna

On 4/28/2010 2:46 AM, Felipe Contreras wrote:

On Wed, Apr 28, 2010 at 4:29 AM, Omar Ramirez Lunaomar.rami...@ti.com  wrote:

This patch switches to use DM timer framework instead of
a custom one for GPT timers, currently dsp can make use of
gpt 5, 6, 7 or 8.


I heard someone that was using gpt 8 for something else. Is it
possible to configure dsp-bridge to not use it?



There are two scenarios:

1. The request comes from the DSP side (afaik for video use case), the 
change should be in the DSP side binaries to request some other gpt 
instead. I don't know how possible is to get this changed.


2. bridge driver also requests gpt8 whenever a mmu fault is triggered, 
this to set a timer to interrupt the dsp after the mmu fault dump has 
been finished, I think this can be easily replaced in bridge to use some 
other gpt, but 1 is still there. (besides a new patch is needed to 
remove direct access to dm timer inside ue_deh and make it to go through 
dsp-clock)


Regards,
omar
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 06/19] DSPBRIDGE: remove function clk_set32k_hz

2010-04-28 Thread Omar Ramirez Luna
This is only used for GPTs and should be addressed once
those clocks are requested using DM timer framework.

This patch might break functionality.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |   14 +-
 drivers/dsp/bridge/services/clk.c  |   26 --
 drivers/dsp/bridge/wmd/tiomap3430.c|   15 ---
 3 files changed, 1 insertions(+), 54 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 2a43aab..5f7a925 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -45,7 +45,6 @@ enum dsp_clk_id {
DSP_CLK_MCBSP5_ICK,
DSP_CLK_SSI_FCK,
DSP_CLK_SSI_ICK,
-   DSP_CLK_SYS32K_CK,
DSP_CLK_NOT_DEFINED
 };
 
@@ -115,18 +114,7 @@ extern dsp_status dsp_clk_disable(IN enum dsp_clk_id 
clk_id);
  */
 extern dsp_status dsp_clk_get_rate(IN enum dsp_clk_id clk_id,
u32 *speedMhz);
-/*
- *   clk_set32k_hz 
- *  Purpose:
- *  Set the requested clock to 32KHz.
- *  Parameters:
- *  Returns:
- *  DSP_SOK:Success.
- *  -EPERM:  Error occured while setting the clock parent to 32KHz.
- *  Requires:
- *  Ensures:
- */
-extern dsp_status clk_set32k_hz(IN enum dsp_clk_id clk_id);
+
 extern void ssi_clk_prepare(bool FLAG);
 
 /*
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 23d4346..b4f5709 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -75,7 +75,6 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, mcbsp_ick, 5},
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
-   {NULL, omap_32k_fck, -1},
{NULL, }
 };
 
@@ -171,31 +170,6 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 }
 
 /*
- *   clk_set32k_hz 
- *  Purpose:
- *  To Set parent of a clock to 32KHz.
- */
-
-dsp_status clk_set32k_hz(IN enum dsp_clk_id clk_id)
-{
-   dsp_status status = DSP_SOK;
-   struct clk *clk_handle;
-   struct clk *clk_parent;
-   clk_parent = dsp_clks[DSP_CLK_SYS32K_CK].clk_handle;
-
-   DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
-
-   clk_handle = dsp_clks[clk_id].clk_handle;
-   if (!(clk_set_parent(clk_handle, clk_parent) == 0x0)) {
-   pr_err(%s: failed for %s, dev id = %d\n, __func__,
-  dsp_clks[clk_id].clk_name,
-  dsp_clks[clk_id].id);
-   status = -EPERM;
-   }
-   return status;
-}
-
-/*
  *   dsp_clk_disable 
  *  Purpose:
  *  Disable the clock.
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index 896941c..52ec3bc 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -543,13 +543,6 @@ static dsp_status bridge_brd_start(struct wmd_dev_context 
*hDevContext,
}
}
 
-   if (clk_id_index  MBX_PM_MAX_RESOURCES) {
-   status =
-   clk_set32k_hz(bpwr_clks
- [clk_id_index].fun_clk);
-   } else {
-   status = -EPERM;
-   }
clk_cmd = (BPWR_ENABLE_CLOCK  MBX_PM_CLK_CMDSHIFT) |
ul_load_monitor_timer;
 
@@ -578,14 +571,6 @@ static dsp_status bridge_brd_start(struct wmd_dev_context 
*hDevContext,
}
}
 
-   if (clk_id_index  MBX_PM_MAX_RESOURCES) {
-   status =
-   clk_set32k_hz(bpwr_clks
- [clk_id_index].fun_clk);
-   } else {
-   status = -EPERM;
-   }
-
clk_cmd = (BPWR_ENABLE_CLOCK  MBX_PM_CLK_CMDSHIFT) |
ul_bios_gp_timer;
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 02/19] DSPBRIDGE: fail if clk handle is NULL

2010-04-28 Thread Omar Ramirez Luna
If we fail if a clk handle is NULL during initialization
then there is no need to keep checking every time if the
handle is NULL for enable/disable/set_32k/get_use_cnt.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   68 +++--
 1 files changed, 20 insertions(+), 48 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index fb2ca81..1089e72 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -130,7 +130,7 @@ bool services_clk_init(void)
pr_err(%s: failed to get clk handle %s, dev id = %d\n,
   __func__, services_clks[i].clk_name,
   services_clks[i].id);
-   /* should we fail here?? */
+   return false;
}
services_clks[i].clk_handle = clk_handle;
i++;
@@ -153,17 +153,11 @@ dsp_status services_clk_enable(IN enum services_clk_id 
clk_id)
DBC_REQUIRE(clk_id  SERVICESCLK_NOT_DEFINED);
 
clk_handle = services_clks[clk_id].clk_handle;
-   if (clk_handle) {
-   if (clk_enable(clk_handle)) {
-   pr_err(services_clk_enable: failed to Enable CLK %s, 
-  CLK dev id = %d\n,
-  services_clks[clk_id].clk_name,
-  services_clks[clk_id].id);
-   status = -EPERM;
-   }
-   } else {
-   pr_err(%s: failed to get CLK %s, CLK dev id = %d\n, __func__,
-services_clks[clk_id].clk_name, services_clks[clk_id].id);
+   if (clk_enable(clk_handle)) {
+   pr_err(services_clk_enable: failed to Enable CLK %s, 
+  CLK dev id = %d\n,
+  services_clks[clk_id].clk_name,
+  services_clks[clk_id].id);
status = -EPERM;
}
/* The SSI module need to configured not to have the Forced idle for
@@ -193,13 +187,11 @@ dsp_status clk_set32k_hz(IN enum services_clk_id clk_id)
DBC_REQUIRE(clk_id  SERVICESCLK_NOT_DEFINED);
 
clk_handle = services_clks[clk_id].clk_handle;
-   if (clk_handle) {
-   if (!(clk_set_parent(clk_handle, clk_parent) == 0x0)) {
-   pr_err(%s: failed for %s, dev id = %d\n, __func__,
-  services_clks[clk_id].clk_name,
-  services_clks[clk_id].id);
-   status = -EPERM;
-   }
+   if (!(clk_set_parent(clk_handle, clk_parent) == 0x0)) {
+   pr_err(%s: failed for %s, dev id = %d\n, __func__,
+  services_clks[clk_id].clk_name,
+  services_clks[clk_id].id);
+   status = -EPERM;
}
return status;
 }
@@ -231,15 +223,8 @@ dsp_status services_clk_disable(IN enum services_clk_id 
clk_id)
if (clk_id == SERVICESCLK_SSI_ICK)
ssi_clk_prepare(false);
 
-   if (clk_handle) {
-   clk_disable(clk_handle);
-   } else {
-   pr_err(services_clk_disable: failed to get CLK %s,
-  CLK dev id = %d\n,
-  services_clks[clk_id].clk_name,
-  services_clks[clk_id].id);
-   status = -EPERM;
-   }
+   clk_disable(clk_handle);
+
return status;
 }
 
@@ -260,38 +245,25 @@ dsp_status services_clk_get_rate(IN enum services_clk_id 
clk_id, u32 *speedKhz)
*speedKhz = 0x0;
 
clk_handle = services_clks[clk_id].clk_handle;
-   if (clk_handle) {
-   clk_speed_hz = clk_get_rate(clk_handle);
-   *speedKhz = clk_speed_hz / 1000;
-   dev_dbg(bridge, %s: clk_speed_hz = %d, speedinKhz = %d\n,
+   clk_speed_hz = clk_get_rate(clk_handle);
+   *speedKhz = clk_speed_hz / 1000;
+   dev_dbg(bridge, %s: clk_speed_hz = %d, speedinKhz = %d\n,
__func__, clk_speed_hz, *speedKhz);
-   } else {
-   pr_err(%s: failed to get %s, dev Id = %d\n, __func__,
-  services_clks[clk_id].clk_name,
-  services_clks[clk_id].id);
-   status = -EPERM;
-   }
+
return status;
 }
 
 s32 clk_get_use_cnt(IN enum services_clk_id clk_id)
 {
-   dsp_status status = DSP_SOK;
struct clk *clk_handle;
s32 use_count = -1;
DBC_REQUIRE(clk_id  SERVICESCLK_NOT_DEFINED);
 
clk_handle = services_clks[clk_id].clk_handle;
 
-   if (clk_handle) {
-   /* FIXME: usecount shouldn't be used */
-   use_count = clk_handle-usecount;
-   } else {
-   pr_err(%s: failed to get %s, dev Id = %d\n, __func__,
-  services_clks[clk_id].clk_name,
-  services_clks[clk_id].id

[PATCH v2 01/19] DSPBRIDGE: remove clk_handle from drv interface

2010-04-28 Thread Omar Ramirez Luna
Since it is not used, remove.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index 2f92278..ea2a5f3 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -149,7 +149,6 @@ static struct file_operations bridge_fops = {
 #ifdef CONFIG_PM
 static u32 time_out = 1000;
 #ifdef CONFIG_BRIDGE_DVFS
-static struct clk *clk_handle;
 s32 dsp_max_opps = VDD1_OPP5;
 #endif
 
@@ -324,10 +323,6 @@ static int __devinit omap34_xx_bridge_probe(struct 
platform_device *pdev)
for (i = 0; i  6; i++)
pdata-mpu_speed[i] = vdd1_rate_table_bridge[i].rate;
 
-   clk_handle = clk_get(NULL, iva2_ck);
-   if (!clk_handle)
-   pr_err(%s: clk_get failed to get iva2_ck\n, __func__);
-
if (!cpufreq_register_notifier(iva_clk_notifier,
CPUFREQ_TRANSITION_NOTIFIER))
pr_err(%s: clk_notifier_register failed for iva2_ck\n,
@@ -383,10 +378,6 @@ static int __devexit omap34_xx_bridge_remove(struct 
platform_device *pdev)
driver_context = 0;
DBC_ASSERT(ret == true);
}
-#ifdef CONFIG_BRIDGE_DVFS
-   clk_put(clk_handle);
-   clk_handle = NULL;
-#endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
 func_cont:
mem_ext_phys_pool_release();
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 07/19] DSPBRIDGE: remove clk_get_use_cnt

2010-04-28 Thread Omar Ramirez Luna
Instead of querying the use count, balanced number of
enable/disable should be enforced across the system.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |   13 -
 drivers/dsp/bridge/services/clk.c  |   23 ---
 2 files changed, 0 insertions(+), 36 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 5f7a925..621d08f 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -117,17 +117,4 @@ extern dsp_status dsp_clk_get_rate(IN enum dsp_clk_id 
clk_id,
 
 extern void ssi_clk_prepare(bool FLAG);
 
-/*
- *   CLK_Get_RefCnt 
- *  Purpose:
- *  get the reference count for the clock.
- *  Parameters:
- *  Returns:
- *  s32:Reference Count for the clock.
- *  -EPERM:  Error occured while getting the reference count of a clock.
- *  Requires:
- *  Ensures:
- */
-extern s32 clk_get_use_cnt(IN enum dsp_clk_id clk_id);
-
 #endif /* _SYNC_H */
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index b4f5709..e447d54 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -179,20 +179,11 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 {
dsp_status status = DSP_SOK;
struct clk *clk_handle;
-   s32 clk_use_cnt;
 
DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
 
clk_handle = dsp_clks[clk_id].clk_handle;
 
-   clk_use_cnt = clk_get_use_cnt(clk_id);
-   if (clk_use_cnt == -1) {
-   pr_err(%s: failed to get CLK Use count for CLK %s, CLK dev id
-   = %d\n, __func__, dsp_clks[clk_id].clk_name,
-  dsp_clks[clk_id].id);
-   } else if (clk_use_cnt == 0) {
-   return status;
-   }
if (clk_id == DSP_CLK_SSI_ICK)
ssi_clk_prepare(false);
 
@@ -226,20 +217,6 @@ dsp_status dsp_clk_get_rate(IN enum dsp_clk_id clk_id, u32 
*speedKhz)
return status;
 }
 
-s32 clk_get_use_cnt(IN enum dsp_clk_id clk_id)
-{
-   struct clk *clk_handle;
-   s32 use_count = -1;
-   DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
-
-   clk_handle = dsp_clks[clk_id].clk_handle;
-
-   /* FIXME: usecount shouldn't be used */
-   use_count = clk_handle-usecount;
-
-   return use_count;
-}
-
 void ssi_clk_prepare(bool FLAG)
 {
void __iomem *ssi_base;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 08/19] DSPBRIDGE: trivial clock cleanup for unused code

2010-04-28 Thread Omar Ramirez Luna
Remove unusued struct and typedef.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |2 --
 drivers/dsp/bridge/services/clk.c  |7 ---
 2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 621d08f..f19d024 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -19,8 +19,6 @@
 #ifndef _CLK_H
 #define _CLK_H
 
-   /* Generic TIMER object: */
-struct timer_object;
 enum dsp_clk_id {
DSP_CLK_IVA2_CK = 0,
DSP_CLK_GPT5_FCK,
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index e447d54..e35b929 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -32,8 +32,6 @@
 
 /*  --- Defines, Data Structures, Typedefs */
 
-typedef volatile unsigned long reg_uword32;
-
 #define OMAP_SSI_OFFSET0x58000
 #define OMAP_SSI_SIZE  0x1000
 #define OMAP_SSI_SYSCONFIG_OFFSET  0x10
@@ -78,11 +76,6 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, }
 };
 
-/* Generic TIMER object: */
-struct timer_object {
-   struct timer_list timer;
-};
-
 /*
  *   dsp_clk_exit 
  *  Purpose:
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 18/19] DSPBRIDGE: move clk to dsp-clock

2010-04-28 Thread Omar Ramirez Luna
Rename file and move it outside services layer.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/Makefile |4 +-
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +
 drivers/dsp/bridge/services/clk.c   |  334 ---
 drivers/dsp/bridge/services/services.c  |3 -
 drivers/dsp/bridge/wmd/dsp-clock.c  |  334 +++
 5 files changed, 338 insertions(+), 339 deletions(-)
 delete mode 100644 drivers/dsp/bridge/services/clk.c
 create mode 100644 drivers/dsp/bridge/wmd/dsp-clock.c

diff --git a/drivers/dsp/bridge/Makefile b/drivers/dsp/bridge/Makefile
index e243670..8b9a681 100644
--- a/drivers/dsp/bridge/Makefile
+++ b/drivers/dsp/bridge/Makefile
@@ -1,11 +1,11 @@
 obj-$(CONFIG_MPU_BRIDGE)   += bridgedriver.o
 
 libgen = gen/gb.o gen/gs.o gen/gh.o gen/uuidutil.o
-libservices = services/sync.o services/clk.o services/cfg.o \
+libservices = services/sync.o services/cfg.o \
services/ntfy.o services/services.o
 libwmd = wmd/chnl_sm.o wmd/msg_sm.o wmd/io_sm.o wmd/tiomap3430.o \
wmd/tiomap3430_pwr.o wmd/tiomap_io.o \
-   wmd/mmu_fault.o wmd/ue_deh.o wmd/wdt.o
+   wmd/mmu_fault.o wmd/ue_deh.o wmd/wdt.o wmd/dsp-clock.o
 libpmgr = pmgr/chnl.o pmgr/io.o pmgr/msg.o pmgr/cod.o pmgr/dev.o pmgr/wcd.o \
pmgr/dmm.o pmgr/cmm.o pmgr/dbll.o
 librmgr = rmgr/dbdcd.o rmgr/disp.o rmgr/drv.o rmgr/mgr.o rmgr/node.o \
diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index ea2a5f3..db1c746 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -285,6 +285,7 @@ static int __devinit omap34_xx_bridge_probe(struct 
platform_device *pdev)
}
 #endif
 
+   dsp_clk_init();
services_init();
 
/*  Autostart flag.  This should be set to true if the DSP image should
@@ -382,6 +383,7 @@ static int __devexit omap34_xx_bridge_remove(struct 
platform_device *pdev)
 func_cont:
mem_ext_phys_pool_release();
 
+   dsp_clk_exit();
services_exit();
 
devno = MKDEV(driver_major, 0);
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
deleted file mode 100644
index c4f0874..000
--- a/drivers/dsp/bridge/services/clk.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * clk.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Clock and Timer services.
- *
- * 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.
- */
-
-/*  --- Host OS */
-#include dspbridge/host_os.h
-#include plat/dmtimer.h
-#include plat/mcbsp.h
-
-/*  --- DSP/BIOS Bridge */
-#include dspbridge/std.h
-#include dspbridge/dbdefs.h
-#include dspbridge/errbase.h
-#include dspbridge/cfg.h
-#include dspbridge/drv.h
-#include dspbridge/dev.h
-#include _tiomap.h
-
-/*  --- Trace  Debug */
-#include dspbridge/dbc.h
-
-/*  --- This */
-#include dspbridge/clk.h
-
-/*  --- Defines, Data Structures, Typedefs */
-
-#define OMAP_SSI_OFFSET0x58000
-#define OMAP_SSI_SIZE  0x1000
-#define OMAP_SSI_SYSCONFIG_OFFSET  0x10
-
-#define SSI_AUTOIDLE   (1  0)
-#define SSI_SIDLE_SMARTIDLE(2  3)
-#define SSI_MIDLE_NOIDLE   (1  12)
-
-/* Clk types requested by the dsp */
-#define IVA2_CLK   0
-#define GPT_CLK1
-#define WDT_CLK2
-#define MCBSP_CLK  3
-#define SSI_CLK4
-
-/* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */
-#define DMT_ID(id) ((id) + 4)
-
-/* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (0 - 4) */
-#define MCBSP_ID(id) ((id) - 6)
-
-static struct omap_dm_timer *timer[4];
-
-struct clk *iva2_clk;
-
-struct dsp_ssi {
-   struct clk *sst_fck;
-   struct clk *ssr_fck;
-   struct clk *ick;
-};
-
-static struct dsp_ssi ssi;
-
-static u32 dsp_clocks;
-
-static inline u32 is_dsp_clk_active(u32 clk, u8 id)
-{
-   return clk  (1  id);
-}
-
-static inline void set_dsp_clk_active(u32 *clk, u8 id)
-{
-   *clk |= (1  id);
-}
-
-static inline void set_dsp_clk_inactive(u32 *clk, u8 id)
-{
-   *clk = ~(1  id);
-}
-
-static s8 get_clk_type(u8 id)
-{
-   s8 type;
-
-   if (id == DSP_CLK_IVA2)
-   type = IVA2_CLK;
-   else if (id = DSP_CLK_GPT8)
-   type = GPT_CLK;
-   else if (id == DSP_CLK_WDT3

[PATCH v2 16/19] DSPBRIDGE: Move MCBSP_CLOCKS code to a common place

2010-04-28 Thread Omar Ramirez Luna
Given that:
Bridge should enable McBSP_CLKS (using T2 clock) so that DPLL4
 can be gated. Once McBSP2 clock is released, it should disable
 McBSP_CLKS as it prevents PER and CORE domain transitions when
 OFF is set to target power state.

It seems this code was duplicated, now it has been moved to be
called only when dsp is requesting a MCBSP clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c   |   52 +
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |   77 ---
 2 files changed, 52 insertions(+), 77 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 9a439c7..763a599 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -25,6 +25,10 @@
 #include dspbridge/std.h
 #include dspbridge/dbdefs.h
 #include dspbridge/errbase.h
+#include dspbridge/cfg.h
+#include dspbridge/drv.h
+#include dspbridge/dev.h
+#include _tiomap.h
 
 /*  --- Trace  Debug */
 #include dspbridge/dbc.h
@@ -124,6 +128,52 @@ void dsp_clk_init(void)
ssi.sst_fck, ssi.ssr_fck, ssi.ick);
 }
 
+static void mcbsp_clk_prepare(bool flag, u8 id)
+{
+   struct cfg_hostres *resources;
+   struct dev_object *hdev_object = NULL;
+   struct wmd_dev_context *wmd_context = NULL;
+   u32 val;
+
+   hdev_object = (struct dev_object *)drv_get_first_dev_object();
+   if (!hdev_object)
+   return;
+
+   dev_get_wmd_context(hdev_object, wmd_context);
+   if (!wmd_context)
+   return;
+
+   resources = wmd_context-resources;
+   if (!resources)
+   return;
+
+   if (flag) {
+   if (id == DSP_CLK_MCBSP1) {
+   /* set MCBSP1_CLKS, on McBSP1 ON */
+   val = __raw_readl(resources-dw_sys_ctrl_base + 0x274);
+   val |= 1  2;
+   __raw_writel(val, resources-dw_sys_ctrl_base + 0x274);
+   } else if (id == DSP_CLK_MCBSP2) {
+   /* set MCBSP2_CLKS, on McBSP2 ON */
+   val = __raw_readl(resources-dw_sys_ctrl_base + 0x274);
+   val |= 1  6;
+   __raw_writel(val, resources-dw_sys_ctrl_base + 0x274);
+   }
+   } else {
+   if (id == DSP_CLK_MCBSP1) {
+   /* clear MCBSP1_CLKS, on McBSP1 OFF */
+   val = __raw_readl(resources-dw_sys_ctrl_base + 0x274);
+   val = ~(1  2);
+   __raw_writel(val, resources-dw_sys_ctrl_base + 0x274);
+   } else if (id == DSP_CLK_MCBSP2) {
+   /* clear MCBSP2_CLKS, on McBSP2 OFF */
+   val = __raw_readl(resources-dw_sys_ctrl_base + 0x274);
+   val = ~(1  6);
+   __raw_writel(val, resources-dw_sys_ctrl_base + 0x274);
+   }
+   }
+}
+
 /*
  *   dsp_clk_enable 
  *  Purpose:
@@ -142,6 +192,7 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
timer[clk_id] = omap_dm_timer_request_specific(DMT_ID(clk_id));
break;
case MCBSP_CLK:
+   mcbsp_clk_prepare(true, clk_id);
omap_mcbsp_set_io_type(MCBSP_ID(clk_id), OMAP_MCBSP_POLL_IO);
omap_mcbsp_request(MCBSP_ID(clk_id));
break;
@@ -187,6 +238,7 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
omap_dm_timer_free(timer[clk_id]);
break;
case MCBSP_CLK:
+   mcbsp_clk_prepare(false, clk_id);
omap_mcbsp_free(MCBSP_ID(clk_id));
break;
case WDT_CLK:
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c 
b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
index 879f99e..6d1d557 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
@@ -288,16 +288,10 @@ dsp_status dsp_peripheral_clk_ctrl(struct wmd_dev_context 
*dev_context,
u32 tmp_index;
u32 dsp_per_clks_before;
dsp_status status = DSP_SOK;
-   struct cfg_hostres *resources = dev_context-resources;
-   u32 value;
 
dsp_per_clks_before = dev_context-dsp_per_clks;
 
ext_clk = (u32) *((u32 *) pargs);
-
-   if (!resources)
-   return -EPERM;
-
ext_clk_id = ext_clk  MBX_PM_CLK_IDMASK;
 
/* process the power message -- TODO, keep it in a separate function */
@@ -317,21 +311,6 @@ dsp_status dsp_peripheral_clk_ctrl(struct wmd_dev_context 
*dev_context,
ext_clk_cmd = (ext_clk  MBX_PM_CLK_CMDSHIFT)  MBX_PM_CLK_CMDMASK;
switch (ext_clk_cmd) {
case BPWR_DISABLE_CLOCK:
-   if (bpwr_clkid[clk_id_index] == BPWR_MCBSP1) {
-   /* clear MCBSP1_CLKS, on McBSP1 OFF

[PATCH v2 14/19] DSPBRIDGE: dsp interface to enable ssi clocks

2010-04-28 Thread Omar Ramirez Luna
This patch fixes the wrong name for ssi clock,
now it has been split into ssr and sst for fck. It
handle ick/ssr_fck/sst_fck clocks with one call to
disable/enable.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   56 ++---
 1 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index ee85905..c72f574 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -55,20 +55,17 @@
 /* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (1 - 5) */
 #define MCBSP_ID(id) ((id) - 13)
 
-struct dsp_clk_t {
-   struct clk *clk_handle;
-   const char *clk_name;
-   int id;
-};
-
 static struct omap_dm_timer *timer[4];
 
-static struct dsp_clk_t dsp_clks[] = {
-   {NULL, ssi_ssr_sst_fck, -1},
-   {NULL, ssi_ick, -1},
+struct clk *iva2_clk;
+
+struct dsp_ssi {
+   struct clk *sst_fck;
+   struct clk *ssr_fck;
+   struct clk *ick;
 };
 
-struct clk *iva2_clk;
+static struct dsp_ssi ssi;
 
 static s8 get_clk_type(u8 id)
 {
@@ -98,6 +95,9 @@ static s8 get_clk_type(u8 id)
 void dsp_clk_exit(void)
 {
clk_put(iva2_clk);
+   clk_put(ssi.sst_fck);
+   clk_put(ssi.ssr_fck);
+   clk_put(ssi.ick);
 }
 
 /*
@@ -114,6 +114,14 @@ void dsp_clk_init(void)
iva2_clk = clk_get(dspbridge_device.dev, iva2_ck);
if (IS_ERR(iva2_clk))
dev_err(bridge, failed to get iva2 clock %p\n, iva2_clk);
+
+   ssi.sst_fck = clk_get(dspbridge_device.dev, ssi_sst_fck);
+   ssi.ssr_fck = clk_get(dspbridge_device.dev, ssi_ssr_fck);
+   ssi.ick = clk_get(dspbridge_device.dev, ssi_ick);
+
+   if (IS_ERR(ssi.sst_fck) || IS_ERR(ssi.ssr_fck) || IS_ERR(ssi.ick))
+   dev_err(bridge, failed to get ssi: sst %p, ssr %p, ick %p\n,
+   ssi.sst_fck, ssi.ssr_fck, ssi.ick);
 }
 
 /*
@@ -125,7 +133,6 @@ void dsp_clk_init(void)
 dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 {
dsp_status status = DSP_SOK;
-   struct clk *clk_handle;
 
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
@@ -142,13 +149,9 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
dev_err(bridge, ERROR: DSP requested to enable WDT3 clk\n);
break;
case SSI_CLK:
-   clk_handle = dsp_clks[clk_id].clk_handle;
-   if (clk_enable(clk_handle)) {
-   pr_err(dsp_clk_enable: failed to Enable CLK %s, 
-   CLK dev id = %d\n, dsp_clks[clk_id].clk_name,
-   dsp_clks[clk_id].id);
-   status = -EPERM;
-   }
+   clk_enable(ssi.sst_fck);
+   clk_enable(ssi.ssr_fck);
+   clk_enable(ssi.ick);
 
/*
 * The SSI module need to configured not to have the Forced
@@ -157,8 +160,7 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 * the client in the DSP hang waiting for the SSI module to
 * be active after enabling the clocks
 */
-   if (clk_id == DSP_CLK_SSI_ICK)
-   ssi_clk_prepare(true);
+   ssi_clk_prepare(true);
break;
default:
dev_err(bridge, Invalid clock id for enable\n);
@@ -176,9 +178,6 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 {
dsp_status status = DSP_SOK;
-   struct clk *clk_handle;
-
-   DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
 
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
@@ -194,12 +193,11 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
dev_err(bridge, ERROR: DSP requested to disable WDT3 clk\n);
break;
case SSI_CLK:
-   clk_handle = dsp_clks[clk_id].clk_handle;
-
-   if (clk_id == DSP_CLK_SSI_ICK)
-   ssi_clk_prepare(false);
-
-   clk_disable(clk_handle);
+   ssi_clk_prepare(false);
+   ssi_clk_prepare(false);
+   clk_disable(ssi.sst_fck);
+   clk_disable(ssi.ssr_fck);
+   clk_disable(ssi.ick);
break;
default:
dev_err(bridge, Invalid clock id for disable\n);
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 19/19] DSPBRIDGE: reorganize the code to handle peripheral clocks

2010-04-28 Thread Omar Ramirez Luna
This patch moves and simplifies the code used to enable/disable
all the requested peripheral clocks.

Signed-off-by: Omar Ramirez Luna omar.rami...@hotmail.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |4 ++
 drivers/dsp/bridge/rmgr/drv_interface.c|1 +
 drivers/dsp/bridge/wmd/_tiomap_pwr.h   |   17 --
 drivers/dsp/bridge/wmd/dsp-clock.c |   43 +
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   47 +++-
 drivers/dsp/bridge/wmd/tiomap_io.c |4 +-
 drivers/dsp/bridge/wmd/ue_deh.c|2 +-
 7 files changed, 56 insertions(+), 62 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index e6b09c7..439fc2d 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -75,6 +75,8 @@ extern void dsp_clk_init(void);
  */
 extern dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id);
 
+u32 dsp_clock_enable_all(u32 dsp_per_clocks);
+
 /*
  *   dsp_clk_disable 
  *  Purpose:
@@ -90,6 +92,8 @@ extern dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id);
 
 extern u32 dsp_clk_get_iva2_rate(void);
 
+u32 dsp_clock_disable_all(u32 dsp_per_clocks);
+
 extern void ssi_clk_prepare(bool FLAG);
 
 #endif /* _SYNC_H */
diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index db1c746..04b17be 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -41,6 +41,7 @@
 
 /*  --- OS Adaptation Layer */
 #include dspbridge/services.h
+#include dspbridge/clk.h
 #include dspbridge/sync.h
 
 /*  --- Platform Manager */
diff --git a/drivers/dsp/bridge/wmd/_tiomap_pwr.h 
b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
index a7a4fc2..1948e83 100644
--- a/drivers/dsp/bridge/wmd/_tiomap_pwr.h
+++ b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
@@ -64,23 +64,6 @@ dsp_status pre_scale_dsp(struct wmd_dev_context 
*dev_context, IN void *pargs);
  */
 dsp_status handle_constraints_set(struct wmd_dev_context *dev_context,
  IN void *pargs);
-/*
- *   dsp_peripheral_clocks_disable 
- * This function disables all the peripheral clocks that
- * were enabled by DSP. Call this function only when
- * DSP is entering Hibernation or when DSP is in
- * Error state
- */
-dsp_status dsp_peripheral_clocks_disable(struct wmd_dev_context *dev_context,
-IN void *pargs);
-
-/*
- *   dsp_peripheral_clocks_enable 
- * This function enables all the peripheral clocks that
- * were requested by DSP.
- */
-dsp_status dsp_peripheral_clocks_enable(struct wmd_dev_context *dev_context,
-   IN void *pargs);
 
 /*
  *   dsp_clk_wakeup_event_ctrl 
diff --git a/drivers/dsp/bridge/wmd/dsp-clock.c 
b/drivers/dsp/bridge/wmd/dsp-clock.c
index c4f0874..608ff03 100644
--- a/drivers/dsp/bridge/wmd/dsp-clock.c
+++ b/drivers/dsp/bridge/wmd/dsp-clock.c
@@ -115,6 +115,8 @@ static s8 get_clk_type(u8 id)
  */
 void dsp_clk_exit(void)
 {
+   dsp_clock_disable_all(dsp_clocks);
+
clk_put(iva2_clk);
clk_put(ssi.sst_fck);
clk_put(ssi.ssr_fck);
@@ -247,6 +249,25 @@ out:
return status;
 }
 
+/**
+ * dsp_clock_enable_all - Enable clocks used by the DSP
+ * @dev_contextDriver's device context strucure
+ *
+ * This function enables all the peripheral clocks that were requested by DSP.
+ */
+u32 dsp_clock_enable_all(u32 dsp_per_clocks)
+{
+   u32 clk_id;
+   u32 status = -EPERM;
+
+   for (clk_id = 0; clk_id  DSP_CLK_NOT_DEFINED; clk_id++) {
+   if (is_dsp_clk_active(dsp_per_clocks, clk_id))
+   status = dsp_clk_enable(clk_id);
+   }
+
+   return status;
+}
+
 /*
  *   dsp_clk_disable 
  *  Purpose:
@@ -295,6 +316,27 @@ out:
return status;
 }
 
+/**
+ * dsp_clock_disable_all - Disable all active clocks
+ * @dev_contextDriver's device context structure
+ *
+ * This function disables all the peripheral clocks that were enabled by DSP.
+ * It is meant to be called only when DSP is entering hibernation or when DSP
+ * is in error state.
+ */
+u32 dsp_clock_disable_all(u32 dsp_per_clocks)
+{
+   u32 clk_id;
+   u32 status = -EPERM;
+
+   for (clk_id = 0; clk_id  DSP_CLK_NOT_DEFINED; clk_id++) {
+   if (is_dsp_clk_active(dsp_per_clocks, clk_id))
+   status = dsp_clk_disable(clk_id);
+   }
+
+   return status;
+}
+
 u32 dsp_clk_get_iva2_rate(void)
 {
u32 clk_speed_khz;
@@ -332,3 +374,4 @@ void ssi_clk_prepare(bool FLAG)
__raw_writel(value, ssi_base + OMAP_SSI_SYSCONFIG_OFFSET);
iounmap(ssi_base);
 }
+
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c 
b

[PATCH v2 10/19] DSPBRIDGE: iva2 clock handling

2010-04-28 Thread Omar Ramirez Luna
Change the way iva2 clock is handled and since the rate is needed
for this clock only, make the function get_rate to be specific for
iva clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |   16 +--
 drivers/dsp/bridge/services/clk.c  |   71 +++-
 drivers/dsp/bridge/services/services.c |9 +---
 drivers/dsp/bridge/wmd/tiomap3430.c|3 +-
 4 files changed, 22 insertions(+), 77 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index f19d024..2602d9f 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -71,7 +71,7 @@ extern void dsp_clk_exit(void);
  *  Ensures:
  *  CLK initialized.
  */
-extern bool dsp_clk_init(void);
+extern void dsp_clk_init(void);
 
 /*
  *   dsp_clk_enable 
@@ -99,19 +99,7 @@ extern dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id);
  */
 extern dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id);
 
-/*
- *   dsp_clk_get_rate 
- *  Purpose:
- *  Get the clock rate of requested clock.
- *  Parameters:
- *  Returns:
- *  DSP_SOK:Success.
- *  -EPERM:  Error occured while Getting the clock rate.
- *  Requires:
- *  Ensures:
- */
-extern dsp_status dsp_clk_get_rate(IN enum dsp_clk_id clk_id,
-   u32 *speedMhz);
+extern u32 dsp_clk_get_iva2_rate(void);
 
 extern void ssi_clk_prepare(bool FLAG);
 
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index d5c3d4e..9c994d3 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -57,7 +57,6 @@ struct dsp_clk_t {
  * 'dsp_clk_id' provided in the header file.. any changes in the
  * enumerations needs to be fixed in the array as well */
 static struct dsp_clk_t dsp_clks[] = {
-   {NULL, iva2_ck, -1},
{NULL, gpt5_fck, -1},
{NULL, gpt5_ick, -1},
{NULL, gpt6_fck, -1},
@@ -83,6 +82,8 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, }
 };
 
+struct clk *iva2_clk;
+
 static s8 get_clk_type(u8 id)
 {
s8 type;
@@ -110,17 +111,7 @@ static s8 get_clk_type(u8 id)
  */
 void dsp_clk_exit(void)
 {
-   int i = 0;
-
-   /* Relinquish the clock handles */
-   while (i  DSP_CLK_NOT_DEFINED) {
-   if (dsp_clks[i].clk_handle)
-   clk_put(dsp_clks[i].clk_handle);
-
-   dsp_clks[i].clk_handle = NULL;
-   i++;
-   }
-
+   clk_put(iva2_clk);
 }
 
 /*
@@ -128,33 +119,15 @@ void dsp_clk_exit(void)
  *  Purpose:
  *  Initialize CLK module.
  */
-bool dsp_clk_init(void)
+void dsp_clk_init(void)
 {
static struct platform_device dspbridge_device;
-   struct clk *clk_handle;
-   int i = 0;
 
dspbridge_device.dev.bus = platform_bus_type;
 
-   /* Get the clock handles from base port and store locally */
-   while (i  DSP_CLK_NOT_DEFINED) {
-   /* get the handle from BP */
-   dspbridge_device.id = dsp_clks[i].id;
-
-   clk_handle = clk_get(dspbridge_device.dev,
-dsp_clks[i].clk_name);
-
-   if (IS_ERR(clk_handle)) {
-   pr_err(%s: failed to get clk handle %s, dev id = %d\n,
-  __func__, dsp_clks[i].clk_name,
-  dsp_clks[i].id);
-   return false;
-   }
-   dsp_clks[i].clk_handle = clk_handle;
-   i++;
-   }
-
-   return true;
+   iva2_clk = clk_get(dspbridge_device.dev, iva2_ck);
+   if (IS_ERR(iva2_clk))
+   dev_err(bridge, failed to get iva2 clock %p\n, iva2_clk);
 }
 
 /*
@@ -170,6 +143,8 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
+   clk_enable(iva2_clk);
+   break;
case GPT_CLK:
case MCBSP_CLK:
case WDT_CLK:
@@ -214,6 +189,8 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
+   clk_disable(iva2_clk);
+   break;
case GPT_CLK:
case MCBSP_CLK:
case WDT_CLK:
@@ -232,29 +209,15 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
return status;
 }
 
-/*
- *   dsp_clk_get_rate 
- *  Purpose:
- *  GetClock Speed.
- *
- */
-
-dsp_status dsp_clk_get_rate(IN enum dsp_clk_id clk_id, u32 *speedKhz)
+u32 dsp_clk_get_iva2_rate(void)
 {
-   dsp_status status = DSP_SOK;
-   struct clk *clk_handle;
-   u32 clk_speed_hz;
+   u32 clk_speed_khz;
 
-   DBC_REQUIRE(clk_id  SERVICESCLK_NOT_DEFINED);
-   *speedKhz = 0x0;
+   clk_speed_khz = clk_get_rate(iva2_clk);
+   clk_speed_khz /= 1000;
+   dev_dbg

[PATCH v2 17/19] DSPBRIDGE: Balance the number of enable/disable

2010-04-28 Thread Omar Ramirez Luna
This patch ensure a balanced number of enable/disable
calls is made.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   37 +
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 763a599..c4f0874 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -71,6 +71,23 @@ struct dsp_ssi {
 
 static struct dsp_ssi ssi;
 
+static u32 dsp_clocks;
+
+static inline u32 is_dsp_clk_active(u32 clk, u8 id)
+{
+   return clk  (1  id);
+}
+
+static inline void set_dsp_clk_active(u32 *clk, u8 id)
+{
+   *clk |= (1  id);
+}
+
+static inline void set_dsp_clk_inactive(u32 *clk, u8 id)
+{
+   *clk = ~(1  id);
+}
+
 static s8 get_clk_type(u8 id)
 {
s8 type;
@@ -184,6 +201,11 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
 {
dsp_status status = DSP_SOK;
 
+   if (is_dsp_clk_active(dsp_clocks, clk_id)) {
+   dev_err(bridge, WARN: clock id %d already enabled\n, clk_id);
+   goto out;
+   }
+
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
clk_enable(iva2_clk);
@@ -215,8 +237,13 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
break;
default:
dev_err(bridge, Invalid clock id for enable\n);
+   status = -EPERM;
}
 
+   if (DSP_SUCCEEDED(status))
+   set_dsp_clk_active(dsp_clocks, clk_id);
+
+out:
return status;
 }
 
@@ -230,6 +257,11 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 {
dsp_status status = DSP_SOK;
 
+   if (!is_dsp_clk_active(dsp_clocks, clk_id)) {
+   dev_err(bridge, ERR: clock id %d already disabled\n, clk_id);
+   goto out;
+   }
+
switch (get_clk_type(clk_id)) {
case IVA2_CLK:
clk_disable(iva2_clk);
@@ -253,8 +285,13 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
break;
default:
dev_err(bridge, Invalid clock id for disable\n);
+   status = -EPERM;
}
 
+   if (DSP_SUCCEEDED(status))
+   set_dsp_clk_inactive(dsp_clocks, clk_id);
+
+out:
return status;
 }
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 11/19] DSPBRIDGE: use dm timer framework for gpt timers

2010-04-28 Thread Omar Ramirez Luna
This patch switches to use DM timer framework instead of
a custom one for GPT timers, currently dsp can make use of
gpt 5, 6, 7 or 8.

Signed-off-by: Omar Ramirez Luna omar.rami...@hotmail.com
---
 drivers/dsp/bridge/services/clk.c   |   25 ---
 drivers/dsp/bridge/wmd/tiomap3430.c |   36 ---
 2 files changed, 13 insertions(+), 48 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 9c994d3..37739a9 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -18,6 +18,7 @@
 
 /*  --- Host OS */
 #include dspbridge/host_os.h
+#include plat/dmtimer.h
 
 /*  --- DSP/BIOS Bridge */
 #include dspbridge/std.h
@@ -47,24 +48,21 @@
 #define MCBSP_CLK  3
 #define SSI_CLK4
 
+/*
+ * Bridge specific DM Timer macro.
+ * Bridge GPT id (1 - 4), DM Timer id (5 - 8)
+ */
+#define DMT_ID(id) ((id) + 4)
+
 struct dsp_clk_t {
struct clk *clk_handle;
const char *clk_name;
int id;
 };
 
-/* The row order of the below array needs to match with the clock enumerations
- * 'dsp_clk_id' provided in the header file.. any changes in the
- * enumerations needs to be fixed in the array as well */
+static struct omap_dm_timer *timer[4];
+
 static struct dsp_clk_t dsp_clks[] = {
-   {NULL, gpt5_fck, -1},
-   {NULL, gpt5_ick, -1},
-   {NULL, gpt6_fck, -1},
-   {NULL, gpt6_ick, -1},
-   {NULL, gpt7_fck, -1},
-   {NULL, gpt7_ick, -1},
-   {NULL, gpt8_fck, -1},
-   {NULL, gpt8_ick, -1},
{NULL, wdt_fck, 3},
{NULL, wdt_ick, 3},
{NULL, mcbsp_fck, 1},
@@ -79,7 +77,6 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, mcbsp_ick, 5},
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
-   {NULL, }
 };
 
 struct clk *iva2_clk;
@@ -146,6 +143,8 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
clk_enable(iva2_clk);
break;
case GPT_CLK:
+   timer[clk_id] = omap_dm_timer_request_specific(DMT_ID(clk_id));
+   break;
case MCBSP_CLK:
case WDT_CLK:
case SSI_CLK:
@@ -192,6 +191,8 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
clk_disable(iva2_clk);
break;
case GPT_CLK:
+   omap_dm_timer_free(timer[clk_id]);
+   break;
case MCBSP_CLK:
case WDT_CLK:
case SSI_CLK:
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index bb78df2..38338d1 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -392,9 +392,6 @@ static dsp_status bridge_brd_start(struct wmd_dev_context 
*hDevContext,
u32 clk_cmd;
struct io_mgr *hio_mgr;
u32 ul_load_monitor_timer;
-   u32 ext_clk_id = 0;
-   u32 tmp_index;
-   u32 clk_id_index = MBX_PM_MAX_RESOURCES;
struct dspbridge_platform_data *pdata =
omap_dspbridge_dev-dev.platform_data;
 
@@ -529,25 +526,9 @@ static dsp_status bridge_brd_start(struct wmd_dev_context 
*hDevContext,
 
if (DSP_SUCCEEDED(status)) {
if (ul_load_monitor_timer != 0x) {
-   clk_cmd = (BPWR_DISABLE_CLOCK  MBX_PM_CLK_CMDSHIFT) |
-   ul_load_monitor_timer;
-
-   dsp_peripheral_clk_ctrl(dev_context, clk_cmd);
-
-   ext_clk_id = clk_cmd  MBX_PM_CLK_IDMASK;
-   for (tmp_index = 0; tmp_index  MBX_PM_MAX_RESOURCES;
-tmp_index++) {
-   if (ext_clk_id == bpwr_clkid[tmp_index]) {
-   clk_id_index = tmp_index;
-   break;
-   }
-   }
-
clk_cmd = (BPWR_ENABLE_CLOCK  MBX_PM_CLK_CMDSHIFT) |
ul_load_monitor_timer;
-
dsp_peripheral_clk_ctrl(dev_context, clk_cmd);
-
} else {
dev_dbg(bridge, Not able to get the symbol for Load 
Monitor Timer\n);
@@ -556,26 +537,9 @@ static dsp_status bridge_brd_start(struct wmd_dev_context 
*hDevContext,
 
if (DSP_SUCCEEDED(status)) {
if (ul_bios_gp_timer != 0x) {
-   clk_cmd = (BPWR_DISABLE_CLOCK  MBX_PM_CLK_CMDSHIFT) |
-   ul_bios_gp_timer;
-
-   dsp_peripheral_clk_ctrl(dev_context, clk_cmd);
-
-   ext_clk_id = clk_cmd  MBX_PM_CLK_IDMASK;
-
-   for (tmp_index = 0; tmp_index  MBX_PM_MAX_RESOURCES;
-tmp_index++) {
-   if (ext_clk_id == bpwr_clkid[tmp_index

[PATCH v2 09/19] DSPBRIDGE: function to get the type of clock requested by dsp

2010-04-28 Thread Omar Ramirez Luna
DSP can request between 5 types of clocks: IVA2, GPT (5-8), WDT (3),
MCBSP (1-5) or SSI clock. This function will be useful in case
a specific clock framework is associated with the clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   89 -
 1 files changed, 68 insertions(+), 21 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index e35b929..d5c3d4e 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -40,6 +40,13 @@
 #define SSI_SIDLE_SMARTIDLE(2  3)
 #define SSI_MIDLE_NOIDLE   (1  12)
 
+/* Clk types requested by the dsp */
+#define IVA2_CLK   0
+#define GPT_CLK1
+#define WDT_CLK2
+#define MCBSP_CLK  3
+#define SSI_CLK4
+
 struct dsp_clk_t {
struct clk *clk_handle;
const char *clk_name;
@@ -76,6 +83,26 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, }
 };
 
+static s8 get_clk_type(u8 id)
+{
+   s8 type;
+
+   if (id == DSP_CLK_IVA2_CK)
+   type = IVA2_CLK;
+   else if (id = DSP_CLK_GPT8_ICK)
+   type = GPT_CLK;
+   else if (id = DSP_CLK_WDT3_ICK)
+   type = WDT_CLK;
+   else if (id = DSP_CLK_MCBSP5_ICK)
+   type = MCBSP_CLK;
+   else if (id  DSP_CLK_SSI_ICK)
+   type = SSI_CLK;
+   else
+   type = -1;
+
+   return type;
+}
+
 /*
  *   dsp_clk_exit 
  *  Purpose:
@@ -141,23 +168,33 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
dsp_status status = DSP_SOK;
struct clk *clk_handle;
 
-   DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
+   switch (get_clk_type(clk_id)) {
+   case IVA2_CLK:
+   case GPT_CLK:
+   case MCBSP_CLK:
+   case WDT_CLK:
+   case SSI_CLK:
+   clk_handle = dsp_clks[clk_id].clk_handle;
+   if (clk_enable(clk_handle)) {
+   pr_err(dsp_clk_enable: failed to Enable CLK %s, 
+   CLK dev id = %d\n, dsp_clks[clk_id].clk_name,
+   dsp_clks[clk_id].id);
+   status = -EPERM;
+   }
 
-   clk_handle = dsp_clks[clk_id].clk_handle;
-   if (clk_enable(clk_handle)) {
-   pr_err(dsp_clk_enable: failed to Enable CLK %s, 
-  CLK dev id = %d\n,
-  dsp_clks[clk_id].clk_name,
-  dsp_clks[clk_id].id);
-   status = -EPERM;
+   /*
+* The SSI module need to configured not to have the Forced
+* idle for master interface. If it is set to forced idle,
+* the SSI module is transitioning to standby thereby causing
+* the client in the DSP hang waiting for the SSI module to
+* be active after enabling the clocks
+*/
+   if (clk_id == DSP_CLK_SSI_ICK)
+   ssi_clk_prepare(true);
+   break;
+   default:
+   dev_err(bridge, Invalid clock id for enable\n);
}
-   /* The SSI module need to configured not to have the Forced idle for
-* master interface. If it is set to forced idle, the SSI module is
-* transitioning to standby thereby causing the client in the DSP hang
-* waiting for the SSI module to be active after enabling the clocks
-*/
-   if (clk_id == DSP_CLK_SSI_FCK)
-   ssi_clk_prepare(true);
 
return status;
 }
@@ -175,12 +212,22 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
 
DBC_REQUIRE(clk_id  DSP_CLK_NOT_DEFINED);
 
-   clk_handle = dsp_clks[clk_id].clk_handle;
-
-   if (clk_id == DSP_CLK_SSI_ICK)
-   ssi_clk_prepare(false);
-
-   clk_disable(clk_handle);
+   switch (get_clk_type(clk_id)) {
+   case IVA2_CLK:
+   case GPT_CLK:
+   case MCBSP_CLK:
+   case WDT_CLK:
+   case SSI_CLK:
+   clk_handle = dsp_clks[clk_id].clk_handle;
+
+   if (clk_id == DSP_CLK_SSI_ICK)
+   ssi_clk_prepare(false);
+
+   clk_disable(clk_handle);
+   break;
+   default:
+   dev_err(bridge, Invalid clock id for disable\n);
+   }
 
return status;
 }
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 13/19] DSPBRIDGE: remove wdt3 from dsp control

2010-04-28 Thread Omar Ramirez Luna
WDT3 is used as a way to detect dsp hangs, as of now its
control is left to arm side driver, so, no requests should
be received by the dsp to enable/disable this clock.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 2e3c64d..ee85905 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -64,8 +64,6 @@ struct dsp_clk_t {
 static struct omap_dm_timer *timer[4];
 
 static struct dsp_clk_t dsp_clks[] = {
-   {NULL, wdt_fck, 3},
-   {NULL, wdt_ick, 3},
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
 };
@@ -141,6 +139,8 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
omap_mcbsp_request(MCBSP_ID(clk_id));
break;
case WDT_CLK:
+   dev_err(bridge, ERROR: DSP requested to enable WDT3 clk\n);
+   break;
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
if (clk_enable(clk_handle)) {
@@ -191,6 +191,8 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
omap_mcbsp_free(MCBSP_ID(clk_id));
break;
case WDT_CLK:
+   dev_err(bridge, ERROR: DSP requested to disable WDT3 clk\n);
+   break;
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 12/19] DSPBRIDGE: use omap mcbsp to enable mcbsp clocks

2010-04-28 Thread Omar Ramirez Luna
Use omap mcbsp to enable mcbsp clocks

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |   24 ++--
 1 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 37739a9..2e3c64d 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -19,6 +19,7 @@
 /*  --- Host OS */
 #include dspbridge/host_os.h
 #include plat/dmtimer.h
+#include plat/mcbsp.h
 
 /*  --- DSP/BIOS Bridge */
 #include dspbridge/std.h
@@ -48,12 +49,12 @@
 #define MCBSP_CLK  3
 #define SSI_CLK4
 
-/*
- * Bridge specific DM Timer macro.
- * Bridge GPT id (1 - 4), DM Timer id (5 - 8)
- */
+/* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */
 #define DMT_ID(id) ((id) + 4)
 
+/* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (1 - 5) */
+#define MCBSP_ID(id) ((id) - 13)
+
 struct dsp_clk_t {
struct clk *clk_handle;
const char *clk_name;
@@ -65,16 +66,6 @@ static struct omap_dm_timer *timer[4];
 static struct dsp_clk_t dsp_clks[] = {
{NULL, wdt_fck, 3},
{NULL, wdt_ick, 3},
-   {NULL, mcbsp_fck, 1},
-   {NULL, mcbsp_ick, 1},
-   {NULL, mcbsp_fck, 2},
-   {NULL, mcbsp_ick, 2},
-   {NULL, mcbsp_fck, 3},
-   {NULL, mcbsp_ick, 3},
-   {NULL, mcbsp_fck, 4},
-   {NULL, mcbsp_ick, 4},
-   {NULL, mcbsp_fck, 5},
-   {NULL, mcbsp_ick, 5},
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
 };
@@ -146,6 +137,9 @@ dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id)
timer[clk_id] = omap_dm_timer_request_specific(DMT_ID(clk_id));
break;
case MCBSP_CLK:
+   omap_mcbsp_set_io_type(MCBSP_ID(clk_id), OMAP_MCBSP_POLL_IO);
+   omap_mcbsp_request(MCBSP_ID(clk_id));
+   break;
case WDT_CLK:
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
@@ -194,6 +188,8 @@ dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id)
omap_dm_timer_free(timer[clk_id]);
break;
case MCBSP_CLK:
+   omap_mcbsp_free(MCBSP_ID(clk_id));
+   break;
case WDT_CLK:
case SSI_CLK:
clk_handle = dsp_clks[clk_id].clk_handle;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 05/19] DSPBRIDGE: remove unused clock sys_ck

2010-04-28 Thread Omar Ramirez Luna
Remove unused clock sys_ck

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |1 -
 drivers/dsp/bridge/services/clk.c  |1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index a547225..2a43aab 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -46,7 +46,6 @@ enum dsp_clk_id {
DSP_CLK_SSI_FCK,
DSP_CLK_SSI_ICK,
DSP_CLK_SYS32K_CK,
-   DSP_CLK_SYS_CK,
DSP_CLK_NOT_DEFINED
 };
 
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 4101c38..23d4346 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -76,7 +76,6 @@ static struct dsp_clk_t dsp_clks[] = {
{NULL, ssi_ssr_sst_fck, -1},
{NULL, ssi_ick, -1},
{NULL, omap_32k_fck, -1},
-   {NULL, sys_ck, -1},
{NULL, }
 };
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 15/19] DSPBRIDGE: use one call for both ick and fck clocks

2010-04-28 Thread Omar Ramirez Luna
Instead of two calls to enable/disable for ick and fck use
one call to enable/disable both.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |   35 +--
 drivers/dsp/bridge/services/clk.c  |   14 +-
 drivers/dsp/bridge/wmd/_tiomap.h   |   25 +--
 drivers/dsp/bridge/wmd/tiomap3430.c|8 +++---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   35 
 5 files changed, 45 insertions(+), 72 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 2602d9f..e6b09c7 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -20,29 +20,18 @@
 #define _CLK_H
 
 enum dsp_clk_id {
-   DSP_CLK_IVA2_CK = 0,
-   DSP_CLK_GPT5_FCK,
-   DSP_CLK_GPT5_ICK,
-   DSP_CLK_GPT6_FCK,
-   DSP_CLK_GPT6_ICK,
-   DSP_CLK_GPT7_FCK,
-   DSP_CLK_GPT7_ICK,
-   DSP_CLK_GPT8_FCK,
-   DSP_CLK_GPT8_ICK,
-   DSP_CLK_WDT3_FCK,
-   DSP_CLK_WDT3_ICK,
-   DSP_CLK_MCBSP1_FCK,
-   DSP_CLK_MCBSP1_ICK,
-   DSP_CLK_MCBSP2_FCK,
-   DSP_CLK_MCBSP2_ICK,
-   DSP_CLK_MCBSP3_FCK,
-   DSP_CLK_MCBSP3_ICK,
-   DSP_CLK_MCBSP4_FCK,
-   DSP_CLK_MCBSP4_ICK,
-   DSP_CLK_MCBSP5_FCK,
-   DSP_CLK_MCBSP5_ICK,
-   DSP_CLK_SSI_FCK,
-   DSP_CLK_SSI_ICK,
+   DSP_CLK_IVA2 = 0,
+   DSP_CLK_GPT5,
+   DSP_CLK_GPT6,
+   DSP_CLK_GPT7,
+   DSP_CLK_GPT8,
+   DSP_CLK_WDT3,
+   DSP_CLK_MCBSP1,
+   DSP_CLK_MCBSP2,
+   DSP_CLK_MCBSP3,
+   DSP_CLK_MCBSP4,
+   DSP_CLK_MCBSP5,
+   DSP_CLK_SSI,
DSP_CLK_NOT_DEFINED
 };
 
diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index c72f574..9a439c7 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -52,8 +52,8 @@
 /* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */
 #define DMT_ID(id) ((id) + 4)
 
-/* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (1 - 5) */
-#define MCBSP_ID(id) ((id) - 13)
+/* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (0 - 4) */
+#define MCBSP_ID(id) ((id) - 6)
 
 static struct omap_dm_timer *timer[4];
 
@@ -71,15 +71,15 @@ static s8 get_clk_type(u8 id)
 {
s8 type;
 
-   if (id == DSP_CLK_IVA2_CK)
+   if (id == DSP_CLK_IVA2)
type = IVA2_CLK;
-   else if (id = DSP_CLK_GPT8_ICK)
+   else if (id = DSP_CLK_GPT8)
type = GPT_CLK;
-   else if (id = DSP_CLK_WDT3_ICK)
+   else if (id == DSP_CLK_WDT3)
type = WDT_CLK;
-   else if (id = DSP_CLK_MCBSP5_ICK)
+   else if (id = DSP_CLK_MCBSP5)
type = MCBSP_CLK;
-   else if (id  DSP_CLK_SSI_ICK)
+   else if (id == DSP_CLK_SSI)
type = SSI_CLK;
else
type = -1;
diff --git a/drivers/dsp/bridge/wmd/_tiomap.h b/drivers/dsp/bridge/wmd/_tiomap.h
index 887232b..56efb84 100644
--- a/drivers/dsp/bridge/wmd/_tiomap.h
+++ b/drivers/dsp/bridge/wmd/_tiomap.h
@@ -246,22 +246,21 @@ static const u32 bpwr_clkid[] = {
 
 struct bpwr_clk_t {
u32 clk_id;
-   enum dsp_clk_id fun_clk;
-   enum dsp_clk_id int_clk;
+   enum dsp_clk_id clk;
 };
 
 static const struct bpwr_clk_t bpwr_clks[] = {
-   {(u32) BPWR_GP_TIMER5, DSP_CLK_GPT5_FCK, DSP_CLK_GPT5_ICK},
-   {(u32) BPWR_GP_TIMER6, DSP_CLK_GPT6_FCK, DSP_CLK_GPT6_ICK},
-   {(u32) BPWR_GP_TIMER7, DSP_CLK_GPT7_FCK, DSP_CLK_GPT7_ICK},
-   {(u32) BPWR_GP_TIMER8, DSP_CLK_GPT8_FCK, DSP_CLK_GPT8_ICK},
-   {(u32) BPWR_WD_TIMER3, DSP_CLK_WDT3_FCK, DSP_CLK_WDT3_ICK},
-   {(u32) BPWR_MCBSP1, DSP_CLK_MCBSP1_FCK, DSP_CLK_MCBSP1_ICK},
-   {(u32) BPWR_MCBSP2, DSP_CLK_MCBSP2_FCK, DSP_CLK_MCBSP2_ICK},
-   {(u32) BPWR_MCBSP3, DSP_CLK_MCBSP3_FCK, DSP_CLK_MCBSP3_ICK},
-   {(u32) BPWR_MCBSP4, DSP_CLK_MCBSP4_FCK, DSP_CLK_MCBSP4_ICK},
-   {(u32) BPWR_MCBSP5, DSP_CLK_MCBSP5_FCK, DSP_CLK_MCBSP5_ICK},
-   {(u32) BPWR_SSI, DSP_CLK_SSI_FCK, DSP_CLK_SSI_ICK}
+   {(u32) BPWR_GP_TIMER5, DSP_CLK_GPT5},
+   {(u32) BPWR_GP_TIMER6, DSP_CLK_GPT6},
+   {(u32) BPWR_GP_TIMER7, DSP_CLK_GPT7},
+   {(u32) BPWR_GP_TIMER8, DSP_CLK_GPT8},
+   {(u32) BPWR_WD_TIMER3, DSP_CLK_WDT3},
+   {(u32) BPWR_MCBSP1, DSP_CLK_MCBSP1},
+   {(u32) BPWR_MCBSP2, DSP_CLK_MCBSP2},
+   {(u32) BPWR_MCBSP3, DSP_CLK_MCBSP3},
+   {(u32) BPWR_MCBSP4, DSP_CLK_MCBSP4},
+   {(u32) BPWR_MCBSP5, DSP_CLK_MCBSP5},
+   {(u32) BPWR_SSI, DSP_CLK_SSI}
 };
 
 /* Interrupt Register Offsets */
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index 38338d1..4ac53ea 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -305,7 +305,7 @@ static dsp_status bridge_brd_monitor(struct wmd_dev_context 
*hDevContext)
}
(*pdata-dsp_prm_rmw_bits

[PATCH v2 04/19] DSPBRIDGE: Rename services_clk_* to dsp_clk_*

2010-04-28 Thread Omar Ramirez Luna
Rename services_clk_* to dsp_clk_*

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |   78 
 drivers/dsp/bridge/services/clk.c  |   88 ++--
 drivers/dsp/bridge/services/services.c |6 +-
 drivers/dsp/bridge/wmd/_tiomap.h   |   26 
 drivers/dsp/bridge/wmd/tiomap3430.c|   10 ++--
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c|   16 +++---
 6 files changed, 112 insertions(+), 112 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index c36b634..a547225 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -21,37 +21,37 @@
 
/* Generic TIMER object: */
 struct timer_object;
-enum services_clk_id {
-   SERVICESCLK_IVA2_CK = 0,
-   SERVICESCLK_GPT5_FCK,
-   SERVICESCLK_GPT5_ICK,
-   SERVICESCLK_GPT6_FCK,
-   SERVICESCLK_GPT6_ICK,
-   SERVICESCLK_GPT7_FCK,
-   SERVICESCLK_GPT7_ICK,
-   SERVICESCLK_GPT8_FCK,
-   SERVICESCLK_GPT8_ICK,
-   SERVICESCLK_WDT3_FCK,
-   SERVICESCLK_WDT3_ICK,
-   SERVICESCLK_MCBSP1_FCK,
-   SERVICESCLK_MCBSP1_ICK,
-   SERVICESCLK_MCBSP2_FCK,
-   SERVICESCLK_MCBSP2_ICK,
-   SERVICESCLK_MCBSP3_FCK,
-   SERVICESCLK_MCBSP3_ICK,
-   SERVICESCLK_MCBSP4_FCK,
-   SERVICESCLK_MCBSP4_ICK,
-   SERVICESCLK_MCBSP5_FCK,
-   SERVICESCLK_MCBSP5_ICK,
-   SERVICESCLK_SSI_FCK,
-   SERVICESCLK_SSI_ICK,
-   SERVICESCLK_SYS32K_CK,
-   SERVICESCLK_SYS_CK,
-   SERVICESCLK_NOT_DEFINED
+enum dsp_clk_id {
+   DSP_CLK_IVA2_CK = 0,
+   DSP_CLK_GPT5_FCK,
+   DSP_CLK_GPT5_ICK,
+   DSP_CLK_GPT6_FCK,
+   DSP_CLK_GPT6_ICK,
+   DSP_CLK_GPT7_FCK,
+   DSP_CLK_GPT7_ICK,
+   DSP_CLK_GPT8_FCK,
+   DSP_CLK_GPT8_ICK,
+   DSP_CLK_WDT3_FCK,
+   DSP_CLK_WDT3_ICK,
+   DSP_CLK_MCBSP1_FCK,
+   DSP_CLK_MCBSP1_ICK,
+   DSP_CLK_MCBSP2_FCK,
+   DSP_CLK_MCBSP2_ICK,
+   DSP_CLK_MCBSP3_FCK,
+   DSP_CLK_MCBSP3_ICK,
+   DSP_CLK_MCBSP4_FCK,
+   DSP_CLK_MCBSP4_ICK,
+   DSP_CLK_MCBSP5_FCK,
+   DSP_CLK_MCBSP5_ICK,
+   DSP_CLK_SSI_FCK,
+   DSP_CLK_SSI_ICK,
+   DSP_CLK_SYS32K_CK,
+   DSP_CLK_SYS_CK,
+   DSP_CLK_NOT_DEFINED
 };
 
 /*
- *   clk_exit 
+ *   dsp_clk_exit 
  *  Purpose:
  *  Discontinue usage of module; free resources when reference count
  *  reaches 0.
@@ -62,10 +62,10 @@ enum services_clk_id {
  *  Ensures:
  *  Resources used by module are freed when cRef reaches zero.
  */
-extern void clk_exit(void);
+extern void dsp_clk_exit(void);
 
 /*
- *   services_clk_init 
+ *   dsp_clk_init 
  *  Purpose:
  *  Initializes private state of CLK module.
  *  Parameters:
@@ -75,10 +75,10 @@ extern void clk_exit(void);
  *  Ensures:
  *  CLK initialized.
  */
-extern bool services_clk_init(void);
+extern bool dsp_clk_init(void);
 
 /*
- *   services_clk_enable 
+ *   dsp_clk_enable 
  *  Purpose:
  *  Enables the clock requested.
  *  Parameters:
@@ -88,10 +88,10 @@ extern bool services_clk_init(void);
  *  Requires:
  *  Ensures:
  */
-extern dsp_status services_clk_enable(IN enum services_clk_id clk_id);
+extern dsp_status dsp_clk_enable(IN enum dsp_clk_id clk_id);
 
 /*
- *   services_clk_disable 
+ *   dsp_clk_disable 
  *  Purpose:
  *  Disables the clock requested.
  *  Parameters:
@@ -101,10 +101,10 @@ extern dsp_status services_clk_enable(IN enum 
services_clk_id clk_id);
  *  Requires:
  *  Ensures:
  */
-extern dsp_status services_clk_disable(IN enum services_clk_id clk_id);
+extern dsp_status dsp_clk_disable(IN enum dsp_clk_id clk_id);
 
 /*
- *   services_clk_get_rate 
+ *   dsp_clk_get_rate 
  *  Purpose:
  *  Get the clock rate of requested clock.
  *  Parameters:
@@ -114,7 +114,7 @@ extern dsp_status services_clk_disable(IN enum 
services_clk_id clk_id);
  *  Requires:
  *  Ensures:
  */
-extern dsp_status services_clk_get_rate(IN enum services_clk_id clk_id,
+extern dsp_status dsp_clk_get_rate(IN enum dsp_clk_id clk_id,
u32 *speedMhz);
 /*
  *   clk_set32k_hz 
@@ -127,7 +127,7 @@ extern dsp_status services_clk_get_rate(IN enum 
services_clk_id clk_id,
  *  Requires:
  *  Ensures:
  */
-extern dsp_status clk_set32k_hz(IN enum services_clk_id clk_id);
+extern dsp_status clk_set32k_hz(IN enum dsp_clk_id clk_id);
 extern void ssi_clk_prepare(bool FLAG);
 
 /*
@@ -141,6 +141,6 @@ extern void ssi_clk_prepare(bool FLAG);
  *  Requires:
  *  Ensures:
  */
-extern s32 clk_get_use_cnt(IN enum services_clk_id clk_id);
+extern s32 clk_get_use_cnt(IN enum dsp_clk_id clk_id);
 
 #endif /* _SYNC_H */
diff --git a/drivers/dsp/bridge

[PATCH v2 03/19] DSPBRIDGE: Now actually fail if a clk handle is wrong

2010-04-28 Thread Omar Ramirez Luna
The value returned by clk_get on error is not NULL.

This checks if the value returned is an error or not.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/services/clk.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/services/clk.c 
b/drivers/dsp/bridge/services/clk.c
index 1089e72..b9fb9ef 100644
--- a/drivers/dsp/bridge/services/clk.c
+++ b/drivers/dsp/bridge/services/clk.c
@@ -126,7 +126,7 @@ bool services_clk_init(void)
clk_handle = clk_get(dspbridge_device.dev,
 services_clks[i].clk_name);
 
-   if (!clk_handle) {
+   if (IS_ERR(clk_handle)) {
pr_err(%s: failed to get clk handle %s, dev id = %d\n,
   __func__, services_clks[i].clk_name,
   services_clks[i].id);
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] DSPBRIDGE: use dm timer framework for gpt timers

2010-04-28 Thread Omar Ramirez Luna

On 4/28/2010 11:36 AM, Menon, Nishanth wrote:

Kevin Hilman had written, on 04/28/2010 11:29 AM, the following:

Omar Ramirez Lunaomar.rami...@ti.com  writes:


On 4/28/2010 2:46 AM, Felipe Contreras wrote:

On Wed, Apr 28, 2010 at 4:29 AM, Omar Ramirez Lunaomar.rami...@ti.com   wrote:

This patch switches to use DM timer framework instead of
a custom one for GPT timers, currently dsp can make use of
gpt 5, 6, 7 or 8.

I heard someone that was using gpt 8 for something else. Is it
possible to configure dsp-bridge to not use it?


There are two scenarios:

1. The request comes from the DSP side (afaik for video use case), the
change should be in the DSP side binaries to request some other gpt
instead. I don't know how possible is to get this changed.

2. bridge driver also requests gpt8 whenever a mmu fault is triggered,
this to set a timer to interrupt the dsp after the mmu fault dump has
been finished, I think this can be easily replaced in bridge to use
some other gpt, but 1 is still there. (besides a new patch is needed
to remove direct access to dm timer inside ue_deh and make it to go
through dsp-clock)


Why does Bridge care at all which specific timers it requests?  They
are all the same, with the exception of GPT1 which is in the WKUP
powerdomain and already used as the kernel clocksource.

Bridge should just use the generic _request() instead of
_request_specific()


trouble I believe is that DSP BIOS uses a specific timer.



yes, dsp side wants:
bios -- GPT5 (only used during boot up - baseimage load)
load monitoring -- GPT 6 (used while the dsp is awake)
AV Sync -- GPT 8 (based on use case)

to generate the interrupt for mmu fault case it needs one connected to 
the dsp interrupt line and only 5, 6, 7 or 8 apply.


Regards,

Omar

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 03/40] DSPBRIDGE: err code replace CHNL_E_WAITTIMEOUT with ETIMEDOUT

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_WAITTIMEOUT with ETIMEDOUT

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 8ee21fd..7157029 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -610,7 +610,7 @@ typedef dsp_status(*fxn_chnl_getmgrinfo) (struct chnl_mgr
  *  Returns:
  *  0:Success;
  *  -EFAULT:Invalid chnl_obj.
- *  CHNL_E_WAITTIMEOUT: Timeout occured before channel could be idled.
+ *  -ETIMEDOUT: Timeout occured before channel could be idled.
  *  Requires:
  *  Ensures:
  */
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index 81106df..a4946c2 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -517,7 +517,7 @@ dsp_status bridge_chnl_flush_io(struct chnl_object 
*chnl_obj, u32 dwTimeOut)
continue;
 
if (chnl_ioc_obj.status  CHNL_IOCSTATTIMEOUT)
-   status = CHNL_E_WAITTIMEOUT;
+   status = -ETIMEDOUT;
 
}
} else {
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/40] DSPBRIDGE: err code replace CHNL_E_NOIORPS with EIO

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_NOIORPS with EIO

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 drivers/dsp/bridge/rmgr/strm.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 3d53881..ff352ce 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -395,7 +395,7 @@ typedef void (*fxn_deh_notify) (struct deh_mgr *hdeh_mgr,
  *  CHNL_E_OUTOFSTREAMS:No free channels available.
  *  CHNL_E_BADCHANID:   Channel ID is out of range.
  *  -EALREADY:Channel is in use.
- *  CHNL_E_NOIORPS: No free IO request packets available for
+ *  -EIO: No free IO request packets available for
  *  queuing.
  *  Requires:
  *  phChnl != NULL.
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index 3cebf94..449b897 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -185,7 +185,7 @@ func_cont:
chnl_packet_obj =
(struct chnl_irp *)lst_get_head(pchnl-free_packets_list);
if (chnl_packet_obj == NULL)
-   status = CHNL_E_NOIORPS;
+   status = -EIO;
 
}
if (DSP_SUCCEEDED(status)) {
diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c
index 7e2481f..accfb7b 100644
--- a/drivers/dsp/bridge/rmgr/strm.c
+++ b/drivers/dsp/bridge/rmgr/strm.c
@@ -448,7 +448,7 @@ dsp_status strm_issue(struct strm_object *hStrm, IN u8 
*pbuf, u32 ul_bytes,
(hStrm-chnl_obj, pbuf, ul_bytes, ul_buf_size,
 (u32) tmp_buf, dw_arg);
}
-   if (status == CHNL_E_NOIORPS)
+   if (status == -EIO)
status = -ENOSR;
}
 
@@ -587,7 +587,7 @@ func_cont:
DBC_ASSERT(status == CHNL_E_OUTOFSTREAMS ||
   status == CHNL_E_BADCHANID ||
   status == -EALREADY ||
-  status == CHNL_E_NOIORPS);
+  status == -EIO);
status = -EPERM;
}
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/40] DSPBRIDGE: err code replace CHNL_E_INVALIDMEMBASE with EINVAL

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_INVALIDMEMBASE with EINVAL

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h |2 +-
 arch/arm/plat-omap/include/dspbridge/io.h   |2 +-
 drivers/dsp/bridge/core/io_sm.c |4 ++--
 drivers/dsp/bridge/pmgr/io.c|2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index 04856c2..98336a0 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -67,7 +67,7 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
- *  CHNL_E_INVALIDMEMBASE:  Invalid base address for DSP communications.
+ *  -EINVAL:  Invalid base address for DSP communications.
  *  -EEXIST:   Channel manager already exists for this device.
  *  Requires:
  *  chnl_init(void) called.
diff --git a/arch/arm/plat-omap/include/dspbridge/io.h 
b/arch/arm/plat-omap/include/dspbridge/io.h
index f880b80..e491a50 100644
--- a/arch/arm/plat-omap/include/dspbridge/io.h
+++ b/arch/arm/plat-omap/include/dspbridge/io.h
@@ -43,7 +43,7 @@
  *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
- *  CHNL_E_INVALIDMEMBASE:  Invalid base address for DSP communications.
+ *  -EINVAL:  Invalid base address for DSP communications.
  *  Requires:
  *  io_init(void) called.
  *  phIOMgr != NULL.
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 79baa2c..72245d8 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -363,7 +363,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
goto func_end;
}
if (ul_shm_limit = ul_shm_base) {
-   status = CHNL_E_INVALIDMEMBASE;
+   status = -EINVAL;
goto func_end;
}
/* Get total length in bytes */
@@ -382,7 +382,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
   ul_msg_limit);
if (DSP_SUCCEEDED(status)) {
if (ul_msg_limit = ul_msg_base) {
-   status = CHNL_E_INVALIDMEMBASE;
+   status = -EINVAL;
} else {
/*
 * Length (bytes) of messaging part of shared
diff --git a/drivers/dsp/bridge/pmgr/io.c b/drivers/dsp/bridge/pmgr/io.c
index c0897c6..e544dee 100644
--- a/drivers/dsp/bridge/pmgr/io.c
+++ b/drivers/dsp/bridge/pmgr/io.c
@@ -63,7 +63,7 @@ dsp_status io_create(OUT struct io_mgr **phIOMgr, struct 
dev_object *hdev_obj,
 
/* A memory base of 0 implies no memory base: */
if ((pMgrAttrs-shm_base != 0)  (pMgrAttrs-usm_length == 0))
-   status = CHNL_E_INVALIDMEMBASE;
+   status = -EINVAL;
 
if (pMgrAttrs-word_size == 0)
status = CHNL_E_INVALIDWORDSIZE;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/40] DSPBRIDGE: err code replace CHNL_E_INVALIDWORDSIZE with EINVAL

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_INVALIDWORDSIZE with EINVAL

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h |2 +-
 arch/arm/plat-omap/include/dspbridge/io.h   |2 +-
 drivers/dsp/bridge/pmgr/chnl.c  |2 +-
 drivers/dsp/bridge/pmgr/io.c|2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index 98336a0..7c06869 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -66,7 +66,7 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
- *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
+ *  -EINVAL: Invalid DSP word size.  Must be  0.
  *  -EINVAL:  Invalid base address for DSP communications.
  *  -EEXIST:   Channel manager already exists for this device.
  *  Requires:
diff --git a/arch/arm/plat-omap/include/dspbridge/io.h 
b/arch/arm/plat-omap/include/dspbridge/io.h
index e491a50..752786f 100644
--- a/arch/arm/plat-omap/include/dspbridge/io.h
+++ b/arch/arm/plat-omap/include/dspbridge/io.h
@@ -42,7 +42,7 @@
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
- *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
+ *  -EINVAL: Invalid DSP word size.  Must be  0.
  *  -EINVAL:  Invalid base address for DSP communications.
  *  Requires:
  *  io_init(void) called.
diff --git a/drivers/dsp/bridge/pmgr/chnl.c b/drivers/dsp/bridge/pmgr/chnl.c
index 5bf1c66..50d49eb 100644
--- a/drivers/dsp/bridge/pmgr/chnl.c
+++ b/drivers/dsp/bridge/pmgr/chnl.c
@@ -76,7 +76,7 @@ dsp_status chnl_create(OUT struct chnl_mgr **phChnlMgr,
status = CHNL_E_MAXCHANNELS;
 
if (pMgrAttrs-word_size == 0)
-   status = CHNL_E_INVALIDWORDSIZE;
+   status = -EINVAL;
 
if (DSP_SUCCEEDED(status)) {
status = dev_get_chnl_mgr(hdev_obj, hchnl_mgr);
diff --git a/drivers/dsp/bridge/pmgr/io.c b/drivers/dsp/bridge/pmgr/io.c
index e544dee..de46cde 100644
--- a/drivers/dsp/bridge/pmgr/io.c
+++ b/drivers/dsp/bridge/pmgr/io.c
@@ -66,7 +66,7 @@ dsp_status io_create(OUT struct io_mgr **phIOMgr, struct 
dev_object *hdev_obj,
status = -EINVAL;
 
if (pMgrAttrs-word_size == 0)
-   status = CHNL_E_INVALIDWORDSIZE;
+   status = -EINVAL;
 
if (DSP_SUCCEEDED(status)) {
dev_get_intf_fxns(hdev_obj, intf_fxns);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/40] DSPBRIDGE: err code replace CHNL_E_NOEOS with EPERM

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_NOEOS with EPERM

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 7157029..6dcea60 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -452,7 +452,7 @@ typedef dsp_status(*fxn_chnl_close) (struct chnl_object 
*chnl_obj);
  *  0:Success;
  *  -EFAULT:Invalid chnl_obj.
  *  -EFAULT:   pHostBuf is invalid.
- *  CHNL_E_NOEOS:   User cannot mark EOS on an input channel.
+ *  -EPERM:   User cannot mark EOS on an input channel.
  *  -ECANCELED: I/O has been cancelled on this channel.  No further
  *  I/O is allowed.
  *  CHNL_E_EOS: End of stream was already marked on a previous
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index a4946c2..99a4a42 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -113,7 +113,7 @@ dsp_status bridge_chnl_add_io_req(struct chnl_object 
*chnl_obj, void *pHostBuf,
} else if (!pchnl) {
status = -EFAULT;
} else if (is_eos  CHNL_IS_INPUT(pchnl-chnl_mode)) {
-   status = CHNL_E_NOEOS;
+   status = -EPERM;
} else {
/*
 * Check the channel state: only queue chirp if channel state
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/40] DSPBRIDGE: err code replace CHNL_E_ISR with EIO

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_ISR with EIO

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h|2 +-
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 arch/arm/plat-omap/include/dspbridge/io.h  |2 +-
 drivers/dsp/bridge/core/io_sm.c|2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index 8761fcf..b97cced 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -63,7 +63,7 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  -EFAULT:hdev_obj is invalid.
  *  -EINVAL:max_channels is 0.
  *  -ENOMEM:Insufficient memory for requested resources.
- *  CHNL_E_ISR: Unable to plug channel ISR for configured IRQ.
+ *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index ff352ce..f56fdca 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -309,7 +309,7 @@ typedef dsp_status(*fxn_brd_write) (struct 
bridge_dev_context *hDevContext,
  *  Returns:
  *  0:Success;
  *  -ENOMEM:Insufficient memory for requested resources.
- *  CHNL_E_ISR: Unable to plug ISR for given IRQ.
+ *  -EIO: Unable to plug ISR for given IRQ.
  *  CHNL_E_NOMEMMAP:Couldn't map physical address to a virtual one.
  *  Requires:
  *  phChnlMgr != NULL.
diff --git a/arch/arm/plat-omap/include/dspbridge/io.h 
b/arch/arm/plat-omap/include/dspbridge/io.h
index 197628f..f880b80 100644
--- a/arch/arm/plat-omap/include/dspbridge/io.h
+++ b/arch/arm/plat-omap/include/dspbridge/io.h
@@ -40,7 +40,7 @@
  *  Returns:
  *  0:Success;
  *  -ENOMEM:Insufficient memory for requested resources.
- *  CHNL_E_ISR: Unable to plug channel ISR for configured IRQ.
+ *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
  *  CHNL_E_INVALIDMEMBASE:  Invalid base address for DSP communications.
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 7246c22..5902d8a 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -236,7 +236,7 @@ dsp_status bridge_io_create(OUT struct io_mgr **phIOMgr,
if (dsp_wdt_init())
status = -EPERM;
} else {
-   status = CHNL_E_ISR;
+   status = -EIO;
}
 func_end:
if (DSP_FAILED(status)) {
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/40] DSPBRIDGE: err code replace CHNL_E_BADCHANID with ECHRNG

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_BADCHANID with ECHRNG

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |4 ++--
 drivers/dsp/bridge/core/chnl_sm.c  |4 ++--
 drivers/dsp/bridge/rmgr/strm.c |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index b268c5e..c4b0922 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -393,7 +393,7 @@ typedef void (*fxn_deh_notify) (struct deh_mgr *hdeh_mgr,
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EINVAL:Invalid number of IOReqs.
  *  CHNL_E_OUTOFSTREAMS:No free channels available.
- *  CHNL_E_BADCHANID:   Channel ID is out of range.
+ *  -ECHRNG:   Channel ID is out of range.
  *  -EALREADY:Channel is in use.
  *  -EIO: No free IO request packets available for
  *  queuing.
@@ -577,7 +577,7 @@ typedef dsp_status(*fxn_chnl_getinfo) (struct chnl_object 
*chnl_obj,
  *  0:Success;
  *  -EFAULT:Invalid hchnl_mgr.
  *  -EFAULT:   pMgrInfo == NULL.
- *  CHNL_E_BADCHANID:   Invalid channel ID.
+ *  -ECHRNG:   Invalid channel ID.
  *  Requires:
  *  Ensures:
  *  0:pMgrInfo points to a filled in chnl_mgrinfo
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index 806f0c9..db03db6 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -736,7 +736,7 @@ dsp_status bridge_chnl_get_mgr_info(struct chnl_mgr 
*hchnl_mgr, u32 uChnlID,
status = -EFAULT;
}
} else {
-   status = CHNL_E_BADCHANID;
+   status = -ECHRNG;
}
} else {
status = -EFAULT;
@@ -801,7 +801,7 @@ dsp_status bridge_chnl_open(OUT struct chnl_object **phChnl,
} else {
if (uChnlId != CHNL_PICKFREE) {
if (uChnlId = chnl_mgr_obj-max_channels)
-   status = CHNL_E_BADCHANID;
+   status = -ECHRNG;
else if (chnl_mgr_obj-ap_channel[uChnlId] !=
 NULL)
status = -EALREADY;
diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c
index accfb7b..c31a5c1 100644
--- a/drivers/dsp/bridge/rmgr/strm.c
+++ b/drivers/dsp/bridge/rmgr/strm.c
@@ -585,7 +585,7 @@ func_cont:
 * assert here), and then return -EPERM.
 */
DBC_ASSERT(status == CHNL_E_OUTOFSTREAMS ||
-  status == CHNL_E_BADCHANID ||
+  status == -ECHRNG ||
   status == -EALREADY ||
   status == -EIO);
status = -EPERM;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 16/40] DSPBRIDGE: err code replace CHNL_E_MAXCHANNELS with ECHRNG

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_MAXCHANNELS with ECHRNG

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h |2 +-
 drivers/dsp/bridge/pmgr/chnl.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index 7c06869..ff3ed51 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -64,7 +64,7 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  -EINVAL:max_channels is 0.
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EIO: Unable to plug channel ISR for configured IRQ.
- *  CHNL_E_MAXCHANNELS: This manager cannot handle this many channels.
+ *  -ECHRNG: This manager cannot handle this many channels.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  -EINVAL: Invalid DSP word size.  Must be  0.
  *  -EINVAL:  Invalid base address for DSP communications.
diff --git a/drivers/dsp/bridge/pmgr/chnl.c b/drivers/dsp/bridge/pmgr/chnl.c
index 50d49eb..22087f2 100644
--- a/drivers/dsp/bridge/pmgr/chnl.c
+++ b/drivers/dsp/bridge/pmgr/chnl.c
@@ -73,7 +73,7 @@ dsp_status chnl_create(OUT struct chnl_mgr **phChnlMgr,
else if (pMgrAttrs-max_channels == 0)
status = -EINVAL;
else
-   status = CHNL_E_MAXCHANNELS;
+   status = -ECHRNG;
 
if (pMgrAttrs-word_size == 0)
status = -EINVAL;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 17/40] DSPBRIDGE: err code replace COD_E_ZLCREATEFAILED with ESPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace COD_E_ZLCREATEFAILED with ESPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cod.h |2 +-
 arch/arm/plat-omap/include/dspbridge/dev.h |4 ++--
 drivers/dsp/bridge/pmgr/cod.c  |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index 3ee2eb9..56df6d8 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -84,7 +84,7 @@ extern void cod_close(struct cod_libraryobj *lib);
  *  Returns:
  *  0:Success.
  *  COD_E_NOZLFUNCTIONS:Could not initialize ZL functions.
- *  COD_E_ZLCREATEFAILED:   ZL_Create failed.
+ *  -ESPIPE:   ZL_Create failed.
  *  -ENOSYS:   attrs was not NULL.  We don't yet support
  *  non default values of attrs.
  *  Requires:
diff --git a/arch/arm/plat-omap/include/dspbridge/dev.h 
b/arch/arm/plat-omap/include/dspbridge/dev.h
index 75e795e..8652f52 100644
--- a/arch/arm/plat-omap/include/dspbridge/dev.h
+++ b/arch/arm/plat-omap/include/dspbridge/dev.h
@@ -84,7 +84,7 @@ extern u32 dev_brd_write_fxn(void *pArb,
  *  LDR_E_NOMEMORY: PELDR is out of resources.
  *  -EPERM:  Unable to find WMD entry point function.
  *  COD_E_NOZLFUNCTIONS:One or more ZL functions exports not found.
- *  COD_E_ZLCREATEFAILED:   Unable to load ZL DLL.
+ *  -ESPIPE:   Unable to load ZL DLL.
  *  Requires:
  *  DEV Initialized.
  *  phDevObject != NULL.
@@ -126,7 +126,7 @@ extern dsp_status dev_create_device(OUT struct dev_object
  *  LDR_E_NOMEMORY: PELDR is out of resources.
  *  -EPERM:  Unable to find WMD entry point function.
  *  COD_E_NOZLFUNCTIONS:One or more ZL functions exports not found.
- *  COD_E_ZLCREATEFAILED:   Unable to load ZL DLL.
+ *  -ESPIPE:   Unable to load ZL DLL.
  *  Requires:
  *  DEV Initialized.
  *  phDevObject != NULL.
diff --git a/drivers/dsp/bridge/pmgr/cod.c b/drivers/dsp/bridge/pmgr/cod.c
index 552a03f..65acd6f 100644
--- a/drivers/dsp/bridge/pmgr/cod.c
+++ b/drivers/dsp/bridge/pmgr/cod.c
@@ -268,7 +268,7 @@ dsp_status cod_create(OUT struct cod_manager **phMgr, char 
*pstrDummyFile,
 
if (DSP_FAILED(status)) {
cod_delete(mgr_new);
-   return COD_E_ZLCREATEFAILED;
+   return -ESPIPE;
}
 
/* return the new manager */
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 15/40] DSPBRIDGE: err code replace CHNL_E_OUTOFSTREAMS with ENOSR

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_OUTOFSTREAMS with ENOSR

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 drivers/dsp/bridge/rmgr/strm.c |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index c4b0922..c3c2e4d 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -392,7 +392,7 @@ typedef void (*fxn_deh_notify) (struct deh_mgr *hdeh_mgr,
  *  -EFAULT:hchnl_mgr is invalid.
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EINVAL:Invalid number of IOReqs.
- *  CHNL_E_OUTOFSTREAMS:No free channels available.
+ *  -ENOSR:No free channels available.
  *  -ECHRNG:   Channel ID is out of range.
  *  -EALREADY:Channel is in use.
  *  -EIO: No free IO request packets available for
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index db03db6..67132c2 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -1003,7 +1003,7 @@ static struct chnl_irp *make_new_chirp(void)
 static dsp_status search_free_channel(struct chnl_mgr *chnl_mgr_obj,
  OUT u32 *pdwChnl)
 {
-   dsp_status status = CHNL_E_OUTOFSTREAMS;
+   dsp_status status = -ENOSR;
u32 i;
 
DBC_REQUIRE(chnl_mgr_obj);
diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c
index c31a5c1..d560503 100644
--- a/drivers/dsp/bridge/rmgr/strm.c
+++ b/drivers/dsp/bridge/rmgr/strm.c
@@ -584,7 +584,7 @@ func_cont:
 * strm_mgr_obj-hchnl_mgr better be valid or we
 * assert here), and then return -EPERM.
 */
-   DBC_ASSERT(status == CHNL_E_OUTOFSTREAMS ||
+   DBC_ASSERT(status == -ENOSR ||
   status == -ECHRNG ||
   status == -EALREADY ||
   status == -EIO);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 12/40] DSPBRIDGE: err code replace CHNL_E_EOS with EPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_EOS with EPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |4 ++--
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 6a2bba5..58fcbcc 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -455,7 +455,7 @@ typedef dsp_status(*fxn_chnl_close) (struct chnl_object 
*chnl_obj);
  *  -EPERM:   User cannot mark EOS on an input channel.
  *  -ECANCELED: I/O has been cancelled on this channel.  No further
  *  I/O is allowed.
- *  CHNL_E_EOS: End of stream was already marked on a previous
+ *  -EPIPE: End of stream was already marked on a previous
  *  IORequest on this channel.  No further I/O is expected.
  *  -EINVAL: Buffer submitted to this output channel is larger than
  *  the size of the physical shared memory output window.
@@ -466,7 +466,7 @@ typedef dsp_status(*fxn_chnl_close) (struct chnl_object 
*chnl_obj);
  *  ready.  In any case, notifications of I/O completion are
  *  asynchronous.
  *  If byte_size is 0 for an output channel, subsequent CHNL_AddIOReq's
- *  on this channel will fail with error code CHNL_E_EOS.  The
+ *  on this channel will fail with error code -EPIPE.  The
  *  corresponding IOC for this I/O request will have its status flag
  *  set to CHNL_IOCSTATEOS.
  */
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index 449b897..d162698 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -125,7 +125,7 @@ dsp_status bridge_chnl_add_io_req(struct chnl_object 
*chnl_obj, void *pHostBuf,
status = -ECANCELED;
else if ((dw_state  CHNL_STATEEOS) 
 CHNL_IS_OUTPUT(pchnl-chnl_mode))
-   status = CHNL_E_EOS;
+   status = -EPIPE;
else
/* No other possible states left */
DBC_ASSERT(0);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 25/40] DSPBRIDGE: err code replace DSP_ETRANSLATE with ESRCH

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_ETRANSLATE with ESRCH

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/node.c |6 +++---
 drivers/dsp/bridge/rmgr/strm.c |8 
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index 1c7742a..20bfe18 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -1861,10 +1861,10 @@ dsp_status node_get_message(struct node_object *hnode,
pmsg-dw_arg1 = (u32) tmp_buf;
pmsg-dw_arg2 *= hnode-hnode_mgr-udsp_word_size;
} else {
-   status = DSP_ETRANSLATE;
+   status = -ESRCH;
}
} else {
-   status = DSP_ETRANSLATE;
+   status = -ESRCH;
}
 func_end:
dev_dbg(bridge, %s: hnode: %p pmsg: %p utimeout: 0x%x\n, __func__,
@@ -2170,7 +2170,7 @@ dsp_status node_put_message(struct node_object *hnode,
status = -EPERM;/* bad DSPWordSize */
}
} else {/* failed to translate buffer address */
-   status = DSP_ETRANSLATE;
+   status = -ESRCH;
}
}
if (DSP_SUCCEEDED(status)) {
diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c
index d560503..094b134 100644
--- a/drivers/dsp/bridge/rmgr/strm.c
+++ b/drivers/dsp/bridge/rmgr/strm.c
@@ -440,7 +440,7 @@ dsp_status strm_issue(struct strm_object *hStrm, IN u8 
*pbuf, u32 ul_bytes,
   (void *)pbuf,
   CMM_VA2DSPPA);
if (tmp_buf == NULL)
-   status = DSP_ETRANSLATE;
+   status = -ESRCH;
 
}
if (DSP_SUCCEEDED(status)) {
@@ -676,7 +676,7 @@ dsp_status strm_reclaim(struct strm_object *hStrm, OUT u8 
** buf_ptr,
   CMM_PA2VA);
}
if (tmp_buf == NULL)
-   status = DSP_ETRANSLATE;
+   status = -ESRCH;
 
chnl_ioc_obj.pbuf = tmp_buf;
}
@@ -685,7 +685,7 @@ dsp_status strm_reclaim(struct strm_object *hStrm, OUT u8 
** buf_ptr,
 func_end:
/* ensure we return a documented return code */
DBC_ENSURE(DSP_SUCCEEDED(status) || status == -EFAULT ||
-  status == -ETIME || status == DSP_ETRANSLATE ||
+  status == -ETIME || status == -ESRCH ||
   status == -EPERM);
 
dev_dbg(bridge, %s: hStrm: %p buf_ptr: %p pulBytes: %p pdw_arg: %p 
@@ -730,7 +730,7 @@ dsp_status strm_register_notify(struct strm_object *hStrm, 
u32 event_mask,
}
/* ensure we return a documented return code */
DBC_ENSURE(DSP_SUCCEEDED(status) || status == -EFAULT ||
-  status == -ETIME || status == DSP_ETRANSLATE ||
+  status == -ETIME || status == -ESRCH ||
   status == -ENOSYS || status == -EPERM);
return status;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 36/40] DSPBRIDGE: remove custom errbase definitions

2010-06-02 Thread Omar Ramirez Luna
This are not used anymore, removing header file with
custom error codes.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/errbase.h |  177 
 arch/arm/plat-omap/include/dspbridge/ntfy.h|1 -
 arch/arm/plat-omap/include/dspbridge/pwr.h |1 -
 arch/arm/plat-omap/include/dspbridge/sync.h|1 -
 drivers/dsp/bridge/core/chnl_sm.c  |1 -
 drivers/dsp/bridge/core/dsp-clock.c|1 -
 drivers/dsp/bridge/core/io_sm.c|1 -
 drivers/dsp/bridge/core/mmu_fault.c|1 -
 drivers/dsp/bridge/core/msg_sm.c   |1 -
 drivers/dsp/bridge/core/tiomap3430.c   |1 -
 drivers/dsp/bridge/core/tiomap3430_pwr.c   |1 -
 drivers/dsp/bridge/core/tiomap_io.c|1 -
 drivers/dsp/bridge/core/ue_deh.c   |1 -
 drivers/dsp/bridge/core/wdt.c  |1 -
 drivers/dsp/bridge/pmgr/chnl.c |1 -
 drivers/dsp/bridge/pmgr/cmm.c  |1 -
 drivers/dsp/bridge/pmgr/cod.c  |1 -
 drivers/dsp/bridge/pmgr/dbll.c |1 -
 drivers/dsp/bridge/pmgr/dev.c  |1 -
 drivers/dsp/bridge/pmgr/dmm.c  |1 -
 drivers/dsp/bridge/pmgr/dspapi.c   |1 -
 drivers/dsp/bridge/pmgr/io.c   |1 -
 drivers/dsp/bridge/pmgr/msg.c  |1 -
 drivers/dsp/bridge/rmgr/dbdcd.c|1 -
 drivers/dsp/bridge/rmgr/disp.c |1 -
 drivers/dsp/bridge/rmgr/drv.c  |1 -
 drivers/dsp/bridge/rmgr/drv_interface.c|1 -
 drivers/dsp/bridge/rmgr/dspdrv.c   |1 -
 drivers/dsp/bridge/rmgr/mgr.c  |1 -
 drivers/dsp/bridge/rmgr/nldr.c |1 -
 drivers/dsp/bridge/rmgr/node.c |1 -
 drivers/dsp/bridge/rmgr/proc.c |1 -
 drivers/dsp/bridge/rmgr/rmm.c  |1 -
 drivers/dsp/bridge/rmgr/strm.c |1 -
 drivers/dsp/bridge/services/cfg.c  |1 -
 35 files changed, 0 insertions(+), 211 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/errbase.h

diff --git a/arch/arm/plat-omap/include/dspbridge/errbase.h 
b/arch/arm/plat-omap/include/dspbridge/errbase.h
deleted file mode 100644
index eeff930..000
--- a/arch/arm/plat-omap/include/dspbridge/errbase.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * errbase.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Central repository for DSP/BIOS Bridge error and status code.
- *
- * Error codes are of the form:
- * [MODULE]_EERRORCODE
- *
- * Success codes are of the form:
- * [MODULE]_SSUCCESSCODE
- *
- * Copyright (C) 2008 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 ERRBASE_
-#define ERRBASE_
-
-/* Base of generic errors and component errors */
-#define DSP_SBASE   (dsp_status)0x8000
-#define DSP_EBASE   (dsp_status)0x80008000
-
-#define DSP_COMP_EBASE  (dsp_status)0x80040200
-#define DSP_COMP_ELAST  (dsp_status)0x80047fff
-
-/* SUCCESS Codes */
-
-/* Generic success code */
-#define 0 (DSP_SBASE + 0)
-
-/* GPP is already attached to this DSP processor */
-#define 0(DSP_SBASE + 1)
-
-/* This is the last object available for enumeration. */
-#define DSP_SENUMCOMPLETE   (DSP_SBASE + 2)
-
-/* The DSP is already asleep. */
-#define 0  (DSP_SBASE + 3)
-
-/* A library contains no dependent library references */
-#define 0(DSP_SBASE + 7)
-
-/* A persistent library is already loaded by the dynamic loader */
-#define 0  (DSP_SBASE + 8)
-
-/* FAILURE Codes */
-
-/* During enumeration a change in the number or properties of the objects
- * has occurred. */
-#define DSP_ECHANGEDURINGENUM   (DSP_EBASE + 3)
-
-/* I/O is currently pending. */
-#define DSP_EPENDING(DSP_EBASE + 0x11)
-
-/* The state of the specified object is incorrect for the requested
- * operation. */
-#define DSP_EWRONGSTATE (DSP_EBASE + 0x1b)
-
-/* Symbol not found in the COFF file.  DSPNode_Create will return this if
- * the iAlg function table for an xDAIS socket is not found in the COFF file.
- * In this case, force the symbol to be linked into the COFF file.
- * DSPNode_Create, DSPNode_Execute, and DSPNode_Delete will return this if
- * the create, execute, or delete phase function, respectively, could not be
- * found in the COFF file. */
-#define DSP_ESYMBOL

[PATCH 35/40] DSPBRIDGE: err code replace DSP_ECHANGEDURINGENUM with EIDRM

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_ECHANGEDURINGENUM with EIDRM

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/mgr.h |2 +-
 drivers/dsp/bridge/rmgr/dbdcd.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/mgr.h 
b/arch/arm/plat-omap/include/dspbridge/mgr.h
index 378afe4..942797d 100644
--- a/arch/arm/plat-omap/include/dspbridge/mgr.h
+++ b/arch/arm/plat-omap/include/dspbridge/mgr.h
@@ -104,7 +104,7 @@ extern dsp_status mgr_destroy(struct mgr_object *hmgr_obj);
  *  0:Success.
  *  -EINVAL:Parameter node_id is  than the number of nodes.
  *  configutred in the system
- *  DSP_ECHANGEDURINGENUM:  During Enumeration there has been a change in
+ *  -EIDRM:  During Enumeration there has been a change in
  *  the number of nodes configured or in the
  *  the properties of the enumerated nodes.
  *  -EPERM:  Failed to querry the Node Data Base
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index c9dba67..d5b0bce 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -217,7 +217,7 @@ dsp_status dcd_enumerate_object(IN s32 cIndex, IN enum 
dsp_dcdobjtype obj_type,
 * than zero, then the current enum_refs must have been
 * incremented to greater than zero.
 */
-   status = DSP_ECHANGEDURINGENUM;
+   status = -EIDRM;
} else {
/*
 * Pre-determine final key length. It's length of DCD_REGKEY +
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 33/40] DSPBRIDGE: err code replace DSP_EWRONGSTATE with EBADR

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EWRONGSTATE with EBADR

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/node.h |   12 ++--
 arch/arm/plat-omap/include/dspbridge/proc.h |6 +++---
 drivers/dsp/bridge/core/msg_sm.c|2 +-
 drivers/dsp/bridge/rmgr/node.c  |   18 +-
 drivers/dsp/bridge/rmgr/proc.c  |4 ++--
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/node.h 
b/arch/arm/plat-omap/include/dspbridge/node.h
index 2f76c04..ed83faf 100644
--- a/arch/arm/plat-omap/include/dspbridge/node.h
+++ b/arch/arm/plat-omap/include/dspbridge/node.h
@@ -45,7 +45,7 @@
  *  -EDOM: attr_in != NULL and attr_in-prio out of
  *  range.
  *  -EPERM:  A failure occured, unable to allocate node.
- *  DSP_EWRONGSTATE:Proccessor is not in the running state.
+ *  -EBADR:Proccessor is not in the running state.
  *  Requires:
  *  node_init(void) called.
  *  hprocessor != NULL.
@@ -101,7 +101,7 @@ extern dsp_status node_alloc_msg_buf(struct node_object 
*hnode,
  *  -EFAULT:Invalid hnode.
  *  -EDOM: prio is out of range.
  *  -EPERM:  The specified node is not a task node.
- *  DSP_EWRONGSTATE:Node is not in the NODE_ALLOCATED, NODE_PAUSED,
+ *  -EBADR:Node is not in the NODE_ALLOCATED, NODE_PAUSED,
  *  or NODE_RUNNING state.
  *  -ETIME:   A timeout occurred before the DSP responded.
  *  DSP_ERESTART:   A critical error has occurred and the DSP is
@@ -170,7 +170,7 @@ extern dsp_status node_close_orphans(struct node_mgr 
*hnode_mgr,
  *  -EINVAL: A stream index parameter is invalid.
  *  -EISCONN:  A connection already exists for one of the
  *  indices uStream1 or uStream2.
- *  DSP_EWRONGSTATE:Either hNode1 or hNode2 is not in the
+ *  -EBADR:Either hNode1 or hNode2 is not in the
  *  NODE_ALLOCATED state.
  *  -ECONNREFUSED: No more connections available.
  *  -EPERM:  Attempt to make an illegal connection (eg,
@@ -200,7 +200,7 @@ extern dsp_status node_connect(struct node_object *hNode1,
  *  0:Success.
  *  -EFAULT:Invalid hnode.
  *  -ESPIPE:Create function not found in the COFF file.
- *  DSP_EWRONGSTATE:Node is not in the NODE_ALLOCATED state.
+ *  -EBADR:Node is not in the NODE_ALLOCATED state.
  *  -ENOMEM:Memory allocation failure on the DSP.
  *  DSP_ETASK:  Unable to create node's task or process on the DSP.
  *  DSP_ESTREAM:Stream creation failure on the DSP.
@@ -469,7 +469,7 @@ extern dsp_status node_pause(struct node_object *hnode);
  *  -EFAULT:Invalid hnode.
  *  -EPERM:  Messages can't be sent to this type of node.
  *  -ETIME:   Timeout occurred before message could be set.
- *  DSP_EWRONGSTATE:Node is in invalid state for sending messages.
+ *  -EBADR:Node is in invalid state for sending messages.
  *  -EPERM:  Unable to send message.
  *  Requires:
  *  node_init(void) called.
@@ -544,7 +544,7 @@ extern dsp_status node_run(struct node_object *hnode);
  *  -EFAULT:Invalid hnode.
  *  -ETIME:   A timeout occurred before the DSP responded.
  *  -EPERM:  Type of node specified cannot be terminated.
- *  DSP_EWRONGSTATE:Operation not valid for the current node state.
+ *  -EBADR:Operation not valid for the current node state.
  *  -EPERM:  Unable to terminate the node.
  *  Requires:
  *  node_init(void) called.
diff --git a/arch/arm/plat-omap/include/dspbridge/proc.h 
b/arch/arm/plat-omap/include/dspbridge/proc.h
index 9311f72..561842e 100644
--- a/arch/arm/plat-omap/include/dspbridge/proc.h
+++ b/arch/arm/plat-omap/include/dspbridge/proc.h
@@ -172,7 +172,7 @@ extern dsp_status proc_enum_nodes(void *hprocessor,
  *  Returns:
  *  0 :   Success.
  *  -EFAULT :   Invalid processor handle.
- *  DSP_EWRONGSTATE:The processor is not in the PROC_RUNNING state.
+ *  -EBADR:The processor is not in the PROC_RUNNING state.
  *  -ETIME:   A timeout occured before the DSP responded to the
  *   querry.
  *  DSP_ERESTART:   A Critical error has occured and the DSP is being
@@ -423,7 +423,7 @@ extern dsp_status proc_notify_all_clients(void *hProc, u32 
uEvents);
  *  Returns:
  *  0 :   Success.
  *  -EFAULT :   Invalid processor handle.
- *  DSP_EWRONGSTATE:Processor is not in PROC_LOADED state.
+ *  -EBADR:Processor is not in PROC_LOADED state.
  *  -EPERM   :   Unable to start the processor.
  *  Requires:
  *  PROC Initialized.
@@ -445,7 +445,7 @@ extern dsp_status proc_start

[PATCH 37/40] DSPBRIDGE: cleanup for duplicated error codes

2010-06-02 Thread Omar Ramirez Luna
Some comments and pieces of code make reference to the same
error code, this was removed to just have one instance where
the code won't get too nested or complicated.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfg.h  |9 ++-
 arch/arm/plat-omap/include/dspbridge/chnl.h |6 ++--
 arch/arm/plat-omap/include/dspbridge/cod.h  |8 +++---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h|   19 +
 arch/arm/plat-omap/include/dspbridge/dblldefs.h |5 +--
 arch/arm/plat-omap/include/dspbridge/dev.h  |4 +-
 arch/arm/plat-omap/include/dspbridge/dspdefs.h  |   12 +++---
 arch/arm/plat-omap/include/dspbridge/io.h   |4 +-
 arch/arm/plat-omap/include/dspbridge/node.h |   25 +++
 arch/arm/plat-omap/include/dspbridge/strm.h |6 ++--
 drivers/dsp/bridge/core/chnl_sm.c   |8 +-
 drivers/dsp/bridge/rmgr/strm.c  |3 +-
 12 files changed, 44 insertions(+), 65 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfg.h 
b/arch/arm/plat-omap/include/dspbridge/cfg.h
index 2226723..4d5bd69 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfg.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfg.h
@@ -82,8 +82,7 @@ extern dsp_status cfg_get_cd_version(OUT u32 *pdwVersion);
  *  pdwValue:   Ptr to location to store the value.
  *  Returns:
  *  0:Success.
- *  -EFAULT:  dev_node_obj is invalid.
- *  -EFAULT:   phDevObject is invalid.
+ *  -EFAULT: dev_node_obj is invalid or phDevObject is invalid.
  *  -ENODATA: The resource is not available.
  *  Requires:
  *  CFG initialized.
@@ -104,8 +103,7 @@ extern dsp_status cfg_get_dev_object(IN struct cfg_devnode 
*dev_node_obj,
  *  pstrExecFile:   Ptr to character buf to hold ExecFile.
  *  Returns:
  *  0:Success.
- *  -EFAULT:  dev_node_obj is invalid.
- *  -EFAULT:   pstrExecFile is invalid.
+ *  -EFAULT:  dev_node_obj is invalid or pstrExecFile is invalid.
  *  -ENODATA: The resource is not available.
  *  Requires:
  *  CFG initialized.
@@ -160,8 +158,7 @@ extern void cfg_get_perf_value(OUT bool *pfEnablePerf);
  *  pstrZLFileName: Ptr to character buf to hold ZLFileName.
  *  Returns:
  *  0:Success.
- *  -EFAULT:   pstrZLFileName is invalid.
- *  -EFAULT:  dev_node_obj is invalid.
+ *  -EFAULT: pstrZLFileName is invalid or dev_node_obj is invalid.
  *  -ENODATA: couldn't find the ZLFileName.
  *  Requires:
  *  CFG initialized.
diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index ff3ed51..ac9acd9 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -61,13 +61,13 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  Returns:
  *  0:Success;
  *  -EFAULT:hdev_obj is invalid.
- *  -EINVAL:max_channels is 0.
+ *  -EINVAL: max_channels is 0.
+ *   Invalid DSP word size (must be  0).
+ *   Invalid base address for DSP communications.
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  -ECHRNG: This manager cannot handle this many channels.
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
- *  -EINVAL: Invalid DSP word size.  Must be  0.
- *  -EINVAL:  Invalid base address for DSP communications.
  *  -EEXIST:   Channel manager already exists for this device.
  *  Requires:
  *  chnl_init(void) called.
diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index 8a4919e..e27f942 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -212,8 +212,8 @@ extern dsp_status cod_get_loader(struct cod_manager 
*cod_mgr_obj,
  *  puLen:  Location to store length.
  *  Returns:
  *  0:Success
- *  -ESPIPE:  Symbols have not been loaded onto the board.
- *  -ESPIPE:   The symbol could not be found.
+ *  -ESPIPE:  Symbols could not be found or have not been loaded onto
+ *the board.
  *  Requires:
  *  COD module initialized.
  *  valid cod_mgr_obj.
@@ -242,8 +242,8 @@ extern dsp_status cod_get_section(struct cod_libraryobj 
*lib,
  *  value:  value of the symbol
  *  Returns:
  *  0:Success.
- *  -ESPIPE:  Symbols have not been loaded onto the board.
- *  -ESPIPE:   The symbol could not be found.
+ *  -ESPIPE:  Symbols could not be found or have not been loaded onto
+ *the board.
  *  Requires:
  *  COD module initialized.
  *  Valid cod_mgr_obj.
diff --git a/arch/arm/plat-omap/include/dspbridge

[PATCH 32/40] DSPBRIDGE: err code replace DSP_ESYMBOL with ESPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_ESYMBOL with ESPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/nldrdefs.h |2 +-
 arch/arm/plat-omap/include/dspbridge/node.h |8 
 drivers/dsp/bridge/rmgr/nldr.c  |4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h 
b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
index e5108b4..9ab99d3 100644
--- a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
@@ -214,7 +214,7 @@ typedef void (*nldr_freefxn) (struct nldr_nodeobject 
*nldr_node_obj);
  *  pulAddr:Location to store function address.
  *  Returns:
  *  0:Success.
- *  DSP_ESYMBOL:Address of function not found.
+ *  -ESPIPE:Address of function not found.
  *  Requires:
  *  nldr_init(void) called.
  *  Valid nldr_node_obj.
diff --git a/arch/arm/plat-omap/include/dspbridge/node.h 
b/arch/arm/plat-omap/include/dspbridge/node.h
index bcfc65c..2f76c04 100644
--- a/arch/arm/plat-omap/include/dspbridge/node.h
+++ b/arch/arm/plat-omap/include/dspbridge/node.h
@@ -41,7 +41,7 @@
  *  0:Success.
  *  -ENOMEM:Insufficient memory on GPP.
  *  -ENOKEY:  Node UUID has not been registered.
- *  DSP_ESYMBOL:iAlg functions not found for a DAIS node.
+ *  -ESPIPE:iAlg functions not found for a DAIS node.
  *  -EDOM: attr_in != NULL and attr_in-prio out of
  *  range.
  *  -EPERM:  A failure occured, unable to allocate node.
@@ -199,7 +199,7 @@ extern dsp_status node_connect(struct node_object *hNode1,
  *  Returns:
  *  0:Success.
  *  -EFAULT:Invalid hnode.
- *  DSP_ESYMBOL:Create function not found in the COFF file.
+ *  -ESPIPE:Create function not found in the COFF file.
  *  DSP_EWRONGSTATE:Node is not in the NODE_ALLOCATED state.
  *  -ENOMEM:Memory allocation failure on the DSP.
  *  DSP_ETASK:  Unable to create node's task or process on the DSP.
@@ -255,7 +255,7 @@ extern dsp_status node_create_mgr(OUT struct node_mgr 
**phNodeMgr,
  *  DSP_EDELETE:A deletion failure occurred.
  *  DSP_EUSER1-16:  Node specific failure occurred on the DSP.
  *  -EPERM:  A failure occurred in deleting the node.
- *  DSP_ESYMBOL:Delete function not found in the COFF file.
+ *  -ESPIPE:Delete function not found in the COFF file.
  *  Requires:
  *  node_init(void) called.
  *  Ensures:
@@ -522,7 +522,7 @@ extern dsp_status node_register_notify(struct node_object 
*hnode,
  *  -ETIME:   A timeout occurred before the DSP responded.
  *  DSP_EWRONGSTSATE:   Node is not in NODE_PAUSED or NODE_CREATED state.
  *  -EPERM:  Unable to start or resume execution.
- *  DSP_ESYMBOL:Execute function not found in the COFF file.
+ *  -ESPIPE:Execute function not found in the COFF file.
  *  Requires:
  *  node_init(void) called.
  *  Ensures:
diff --git a/drivers/dsp/bridge/rmgr/nldr.c b/drivers/dsp/bridge/rmgr/nldr.c
index d2cd465..f5b7239 100644
--- a/drivers/dsp/bridge/rmgr/nldr.c
+++ b/drivers/dsp/bridge/rmgr/nldr.c
@@ -764,7 +764,7 @@ dsp_status nldr_get_fxn_addr(struct nldr_nodeobject 
*nldr_node_obj,
if (status1)
*pulAddr = dbll_sym-value;
else
-   status = DSP_ESYMBOL;
+   status = -ESPIPE;
 
return status;
 }
@@ -1992,7 +1992,7 @@ dsp_status nldr_find_addr(struct nldr_nodeobject 
*nldr_node, u32 sym_addr,
if (!status1) {
pr_debug(%s: Address 0x%x not found in range %d.\n,
__func__, sym_addr, offset_range);
-   status = DSP_ESYMBOL;
+   status = -ESPIPE;
}
 
return status;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 39/40] DSPBRIDGE: error code guide

2010-06-02 Thread Omar Ramirez Luna
Document which specifies the uses of kernel error codes within
bridge driver, in some case it also contains a common use case
were the error might be seen.

It was generated from a previously deleted errbase.h file.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 Documentation/tidspbridge/error-codes |  157 +
 1 files changed, 157 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/tidspbridge/error-codes

diff --git a/Documentation/tidspbridge/error-codes 
b/Documentation/tidspbridge/error-codes
new file mode 100644
index 000..12826e2
--- /dev/null
+++ b/Documentation/tidspbridge/error-codes
@@ -0,0 +1,157 @@
+   DSP/Bridge Error Code Guide
+
+
+Success code is always taken as 0, except for one case where a success status
+different than 0 can be possible, this is when enumerating a series of dsp
+objects, if the enumeration doesn't have any more objects it is considered as a
+successful case. In this case a positive ENODATA is returned (TODO: Change to
+avoid this case).
+
+Error codes are returned as a negative 1, if an specific code is expected, it
+can be propagated to user space by reading errno symbol defined in errno.h, for
+specific details on the implementation a copy of the standard used should be
+read first.
+
+The error codes used by this driver are:
+
+[EPERM]
+General driver failure.
+
+According to the use case the following might apply:
+- Device is in 'sleep/suspend' mode due to DPM.
+- User cannot mark end of stream on an input channel.
+- Requested operation is invalid for the node type.
+- Invalid alignment for the node messaging buffer.
+- The specified direction is invalid for the stream.
+- Invalid stream mode.
+
+[ENOENT]
+The specified object or file was not found.
+
+[ESRCH]
+A shared memory buffer contained in a message or stream could not be mapped
+to the GPP client process's virtual space.
+
+[EIO]
+Driver interface I/O error.
+
+or:
+- Unable to plug channel ISR for configured IRQ.
+- No free I/O request packets are available.
+
+[ENXIO]
+Unable to find a named section in DSP executable or a non-existent memory
+segment identifier was specified.
+
+[EBADF]
+General error for file handling:
+
+- Unable to open file.
+- Unable to read file.
+- An error occurred while parsing the DSP executable file.
+
+[ENOMEM]
+A memory allocation failure occurred.
+
+[EACCES]
+- Unable to read content of DCD data section; this is typically caused by
+improperly configured nodes.
+- Unable to decode DCD data section content; this is typically caused by
+changes to DSP/BIOS Bridge data structures.
+- Unable to get pointer to DCD data section; this is typically caused by
+improperly configured UUIDs.
+- Unable to load file containing DCD data section; this is typically
+caused by a missing COFF file.
+- The specified COFF file does not contain a valid node registration
+section.
+
+[EFAULT]
+Invalid pointer or handler.
+
+[EEXIST]
+Attempted to create a channel manager  when one already exists.
+
+[EINVAL]
+Invalid argument.
+
+[ESPIPE]
+Symbol not found in the COFF file.  DSPNode_Create will return this if
+the iAlg function table for an xDAIS socket is not found in the COFF file.
+In this case, force the symbol to be linked into the COFF file.
+DSPNode_Create, DSPNode_Execute, and DSPNode_Delete will return this if
+the create, execute, or delete phase function, respectively, could not be
+found in the COFF file.
+
+- No symbol table is loaded/found for this board.
+- Unable to initialize the ZL COFF parsing module.
+
+[EPIPE]
+I/O is currently pending.
+
+- End of stream was already requested on this output channel.
+
+[EDOM]
+A parameter is specified outside its valid range.
+
+[ENOSYS]
+The indicated operation is not supported.
+
+[EIDRM]
+During enumeration a change in the number or properties of the objects
+has occurred.
+
+[ECHRNG]
+Attempt to created channel manager with too many channels or channel ID out
+of range.
+
+[EBADR]
+The state of the specified object is incorrect for the requested operation.
+
+- Invalid segment ID.
+
+[ENODATA]
+Unable to retrieve resource information from the registry.
+
+- No more registry values.
+
+[ETIME]
+A timeout occurred before the requested operation could complete.
+
+[ENOSR]
+A stream has been issued the maximum number of buffers allowed in the
+stream at once; buffers must be reclaimed from the stream before any more
+can be issued.
+
+- No free channels are available.
+
+[EILSEQ]
+Error occurred in a dynamic loader library function.
+
+[EISCONN]
+The Specified Connection already exists.
+
+[ENOTCONN]
+Nodes not connected.
+
+[ETIMEDOUT]
+Timeout occurred waiting for a response from the hardware.
+
+- Wait

[PATCH 38/40] DSPBRIDGE: removed unused error codes from comments

2010-06-02 Thread Omar Ramirez Luna
Only removed error codes which now does not exist,
previously those were not used in the code.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h |1 -
 arch/arm/plat-omap/include/dspbridge/cod.h  |3 ---
 arch/arm/plat-omap/include/dspbridge/dblldefs.h |2 --
 arch/arm/plat-omap/include/dspbridge/dev.h  |   14 --
 arch/arm/plat-omap/include/dspbridge/disp.h |3 ---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h  |4 
 arch/arm/plat-omap/include/dspbridge/io.h   |1 -
 arch/arm/plat-omap/include/dspbridge/nldrdefs.h |1 -
 arch/arm/plat-omap/include/dspbridge/node.h |9 +
 arch/arm/plat-omap/include/dspbridge/proc.h |   11 ---
 arch/arm/plat-omap/include/dspbridge/strm.h |1 -
 11 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index ac9acd9..a166d1b 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -67,7 +67,6 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EIO: Unable to plug channel ISR for configured IRQ.
  *  -ECHRNG: This manager cannot handle this many channels.
- *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  -EEXIST:   Channel manager already exists for this device.
  *  Requires:
  *  chnl_init(void) called.
diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index e27f942..16e95c3 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -83,7 +83,6 @@ extern void cod_close(struct cod_libraryobj *lib);
  *  will cause default attrs to be used.
  *  Returns:
  *  0:Success.
- *  COD_E_NOZLFUNCTIONS:Could not initialize ZL functions.
  *  -ESPIPE:   ZL_Create failed.
  *  -ENOSYS:   attrs was not NULL.  We don't yet support
  *  non default values of attrs.
@@ -285,7 +284,6 @@ extern bool cod_init(void);
  *  Returns:
  *  0:   Success.
  *  -EBADF:   Failed to open target code.
- *  COD_E_LOADFAILED:   Failed to load code onto target.
  *  Requires:
  *  COD module initialized.
  *  hmgr is valid.
@@ -356,7 +354,6 @@ extern dsp_status cod_open_base(struct cod_manager *hmgr, 
IN char *pszCoffPath,
  *  Returns:
  *  0: on success, error code on failure
  *  -ESPIPE:  Symbols have not been loaded onto the board.
- *  COD_E_READFAILED: Failed to read content of code section.
  *  Requires:
  *  COD module initialized.
  *  valid cod_mgr_obj.
diff --git a/arch/arm/plat-omap/include/dspbridge/dblldefs.h 
b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
index 7b79207..e1a0364 100644
--- a/arch/arm/plat-omap/include/dspbridge/dblldefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
@@ -338,7 +338,6 @@ typedef bool(*dbll_init_fxn) (void);
  *  Returns:
  *  0:Success.
  *  -EBADF: File read failed.
- *  DSP_EFWRITE:Write to target failed.
  *  -EILSEQ:   Failure in dynamic loader library.
  *  Requires:
  *  DBL initialized.
@@ -360,7 +359,6 @@ typedef dsp_status(*dbll_load_fxn) (struct dbll_library_obj 
*lib,
  *  Returns:
  *  0:Success.
  *  -ENXIO:Section not found.
- *  DSP_EFWRITE:Write function failed.
  *  -ENOSYS:   Function not implemented.
  *  Requires:
  *  Valid lib.
diff --git a/arch/arm/plat-omap/include/dspbridge/dev.h 
b/arch/arm/plat-omap/include/dspbridge/dev.h
index eb9ea39..b4350de 100644
--- a/arch/arm/plat-omap/include/dspbridge/dev.h
+++ b/arch/arm/plat-omap/include/dspbridge/dev.h
@@ -76,14 +76,7 @@ extern u32 dev_brd_write_fxn(void *pArb,
  *  Returns:
  *  0:Module is loaded, device object has been created
  *  -ENOMEM:Insufficient memory to create needed resources.
- *  DEV_E_NEWWMD:   The WMD was compiled for a newer version of WCD.
- *  DEV_E_NULLWMDINTF:  WMD passed back a NULL fxn Interface Struct Ptr
- *  DEV_E_NOCODMODULE:  No ZL file name was specified in the registry
- *  for this dev_node_obj.
- *  LDR_E_FILEUNABLETOOPEN: Unable to open the specified WMD.
- *  LDR_E_NOMEMORY: PELDR is out of resources.
  *  -EPERM:  Unable to find WMD entry point function.
- *  COD_E_NOZLFUNCTIONS:One or more ZL functions exports not found.
  *  -ESPIPE:   Unable to load ZL DLL.
  *  Requires:
  *  DEV Initialized.
@@ -118,14 +111,7 @@ extern dsp_status dev_create_device(OUT struct dev_object
  *  Returns:
  *  0:Module is loaded, device object has been

[PATCH 28/40] DSPBRIDGE: err code replace DSP_EDCDLOADBASE with EACCES

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDCDLOADBASE with EACCES

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |8 
 drivers/dsp/bridge/rmgr/dbdcd.c  |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index 17fb57a..b8daea9 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -36,7 +36,7 @@
  *  0:Success.
  *  -EACCES: Unable to find auto-registration section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
- *  DSP_EDCDLOADBASE:   Unable to load code base.
+ *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
  *  DCD initialized.
@@ -62,7 +62,7 @@ extern dsp_status dcd_auto_register(IN struct dcd_manager 
*hdcd_mgr,
  *  0:Success.
  *  -EACCES: Unable to find auto-registration section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
- *  DSP_EDCDLOADBASE:   Unable to load code base.
+ *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
  *  DCD initialized.
@@ -258,7 +258,7 @@ extern dsp_status dcd_get_library_name(IN struct 
dcd_manager *hdcd_mgr,
  *  DSP_EDCDPARSESECT:  Unable to parse content of object code section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
  *  DSP_EDCDGETSECT:Unable to access object code section.
- *  DSP_EDCDLOADBASE:   Unable to load code base.
+ *  -EACCES:   Unable to load code base.
  *  -EPERM:  General failure.
  *  -EFAULT:Invalid DCD_HMANAGER handle.
  *  Requires:
@@ -291,7 +291,7 @@ extern dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
  *  0:Success.
  *  -EACCES: Unable to find .dcd_register section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
- *  DSP_EDCDLOADBASE:   Unable to load code base.
+ *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
  *  DCD initialized.
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index dcca612..a2cda6b 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -467,7 +467,7 @@ dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
status = cod_open(dcd_mgr_obj-cod_mgr, dcd_key-path,
COD_NOLOAD, lib);
if (DSP_FAILED(status)) {
-   status = DSP_EDCDLOADBASE;
+   status = -EACCES;
goto func_end;
}
 
@@ -560,7 +560,7 @@ dsp_status dcd_get_objects(IN struct dcd_manager *hdcd_mgr,
/* Open DSP coff file, don't load symbols. */
status = cod_open(dcd_mgr_obj-cod_mgr, pszCoffPath, COD_NOLOAD, lib);
if (DSP_FAILED(status)) {
-   status = DSP_EDCDLOADBASE;
+   status = -EACCES;
goto func_cont;
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 29/40] DSPBRIDGE: err code replace DSP_EDCDGETSECT with EACCES

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDCDGETSECT with EACCES

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |2 +-
 drivers/dsp/bridge/rmgr/dbdcd.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index b8daea9..e615c8a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -257,7 +257,7 @@ extern dsp_status dcd_get_library_name(IN struct 
dcd_manager *hdcd_mgr,
  *  0: Success.
  *  DSP_EDCDPARSESECT:  Unable to parse content of object code section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
- *  DSP_EDCDGETSECT:Unable to access object code section.
+ *  -EACCES:Unable to access object code section.
  *  -EACCES:   Unable to load code base.
  *  -EPERM:  General failure.
  *  -EFAULT:Invalid DCD_HMANAGER handle.
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index a2cda6b..a3d79ba 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -483,7 +483,7 @@ dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
/* Get section information. */
status = cod_get_section(lib, sz_sect_name, ul_addr, ul_len);
if (DSP_FAILED(status)) {
-   status = DSP_EDCDGETSECT;
+   status = -EACCES;
goto func_end;
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 34/40] DSPBRIDGE: err code replace DSP_EPENDING with EPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EPENDING with EPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/strm.h |2 +-
 drivers/dsp/bridge/rmgr/strm.c  |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/strm.h 
b/arch/arm/plat-omap/include/dspbridge/strm.h
index 97d657d..c4b1d91 100644
--- a/arch/arm/plat-omap/include/dspbridge/strm.h
+++ b/arch/arm/plat-omap/include/dspbridge/strm.h
@@ -59,7 +59,7 @@ extern dsp_status strm_allocate_buffer(struct strm_object 
*hStrm,
  *  Returns:
  *  0:Success.
  *  -EFAULT:Invalid hStrm.
- *  DSP_EPENDING:   Some data buffers issued to the stream have not
+ *  -EPIPE:   Some data buffers issued to the stream have not
  *  been reclaimed.
  *  -EPERM:  Failure to close stream.
  *  Requires:
diff --git a/drivers/dsp/bridge/rmgr/strm.c b/drivers/dsp/bridge/rmgr/strm.c
index 061175e..58ec979 100644
--- a/drivers/dsp/bridge/rmgr/strm.c
+++ b/drivers/dsp/bridge/rmgr/strm.c
@@ -166,7 +166,7 @@ dsp_status strm_close(struct strm_object *hStrm,
status = -EFAULT;
} else {
/* Have all buffers been reclaimed? If not, return
-* DSP_EPENDING */
+* -EPIPE */
intf_fxns = hStrm-strm_mgr_obj-intf_fxns;
status =
(*intf_fxns-pfn_chnl_get_info) (hStrm-chnl_obj,
@@ -174,7 +174,7 @@ dsp_status strm_close(struct strm_object *hStrm,
DBC_ASSERT(DSP_SUCCEEDED(status));
 
if (chnl_info_obj.cio_cs  0 || chnl_info_obj.cio_reqs  0)
-   status = DSP_EPENDING;
+   status = -EPIPE;
else
status = delete_strm(hStrm);
}
@@ -187,7 +187,7 @@ dsp_status strm_close(struct strm_object *hStrm,
drv_proc_remove_strm_res_element(hstrm_res, pr_ctxt);
 func_end:
DBC_ENSURE(status == 0 || status == -EFAULT ||
-  status == DSP_EPENDING || status == -EPERM);
+  status == -EPIPE || status == -EPERM);
 
dev_dbg(bridge, %s: hStrm: %p, status 0x%x\n, __func__,
hStrm, status);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 26/40] DSPBRIDGE: err code replace DSP_ENOTFOUND with ENOENT

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_ENOTFOUND with ENOENT

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/proc.h |6 +++---
 drivers/dsp/bridge/pmgr/dmm.c   |6 +++---
 drivers/dsp/bridge/rmgr/drv.c   |8 
 drivers/dsp/bridge/rmgr/nldr.c  |2 +-
 drivers/dsp/bridge/rmgr/node.c  |4 ++--
 drivers/dsp/bridge/rmgr/strm.c  |6 +++---
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/proc.h 
b/arch/arm/plat-omap/include/dspbridge/proc.h
index 11595d6..9311f72 100644
--- a/arch/arm/plat-omap/include/dspbridge/proc.h
+++ b/arch/arm/plat-omap/include/dspbridge/proc.h
@@ -515,7 +515,7 @@ extern dsp_status proc_invalidate_memory(void *hprocessor,
  *  -EFAULT :   Invalid processor handle.
  *  -EPERM   :   General failure.
  *  -ENOMEM :   MPU side memory allocation error.
- *  DSP_ENOTFOUND   :   Cannot find a reserved region starting with this
+ *  -ENOENT   :   Cannot find a reserved region starting with this
  *   :   address.
  *  Requires:
  *  pmpu_addr is not NULL
@@ -566,7 +566,7 @@ extern dsp_status proc_reserve_memory(void *hprocessor,
  *  0   :   Success.
  *  -EFAULT :   Invalid processor handle.
  *  -EPERM   :   General failure.
- *  DSP_ENOTFOUND   :   Cannot find a mapped region starting with this
+ *  -ENOENT   :   Cannot find a mapped region starting with this
  *   :   address.
  *  Requires:
  *  map_addr is not NULL
@@ -588,7 +588,7 @@ extern dsp_status proc_un_map(void *hprocessor, void 
*map_addr,
  *  0   :   Success.
  *  -EFAULT :   Invalid processor handle.
  *  -EPERM   :   General failure.
- *  DSP_ENOTFOUND   :   Cannot find a reserved region starting with this
+ *  -ENOENT   :   Cannot find a reserved region starting with this
  *   :   address.
  *  Requires:
  *  prsv_addr is not NULL
diff --git a/drivers/dsp/bridge/pmgr/dmm.c b/drivers/dsp/bridge/pmgr/dmm.c
index 5e8b770..bf2c0e1 100644
--- a/drivers/dsp/bridge/pmgr/dmm.c
+++ b/drivers/dsp/bridge/pmgr/dmm.c
@@ -261,7 +261,7 @@ dsp_status dmm_map_memory(struct dmm_object *dmm_mgr, u32 
addr, u32 size)
chunk-mapped = true;
chunk-mapped_size = (size / PG_SIZE4K);
} else
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
spin_unlock(dmm_obj-dmm_lock);
 
dev_dbg(bridge, %s dmm_mgr %p, addr %x, size %x\n\tstatus %x, 
@@ -336,7 +336,7 @@ dsp_status dmm_un_map_memory(struct dmm_object *dmm_mgr, 
u32 addr, u32 *psize)
spin_lock(dmm_obj-dmm_lock);
chunk = get_mapped_region(addr);
if (chunk == NULL)
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
 
if (DSP_SUCCEEDED(status)) {
/* Unmap the region */
@@ -370,7 +370,7 @@ dsp_status dmm_un_reserve_memory(struct dmm_object 
*dmm_mgr, u32 rsv_addr)
/* Find the chunk containing the reserved address */
chunk = get_mapped_region(rsv_addr);
if (chunk == NULL)
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
 
if (DSP_SUCCEEDED(status)) {
/* Free all the mapped pages for this reserved region */
diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c
index 4869e2c..a92b0d7 100644
--- a/drivers/dsp/bridge/rmgr/drv.c
+++ b/drivers/dsp/bridge/rmgr/drv.c
@@ -131,7 +131,7 @@ dsp_status drv_remove_node_res_element(void *hNodeRes, void 
*hPCtxt)
while (temp_node  temp_node-next != node_res_obj)
temp_node = temp_node-next;
if (!temp_node)
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
else
temp_node-next = node_res_obj-next;
}
@@ -267,7 +267,7 @@ dsp_status drv_get_node_res_element(void *hnode, void 
*hNodeRes,
if (temp_node != NULL)
*node_res = temp_node;
else
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
 
return status;
 }
@@ -328,7 +328,7 @@ dsp_status drv_proc_remove_strm_res_element(void 
*hstrm_res, void *hPCtxt)
while (temp_strm_res  temp_strm_res-next != pstrm_res)
temp_strm_res = temp_strm_res-next;
if (temp_strm_res == NULL)
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
else
temp_strm_res-next = pstrm_res-next;
}
@@ -405,7 +405,7 @@ dsp_status drv_get_strm_res_element(void *hStrm, void 
*hstrm_res,
if (temp_strm != NULL)
*strm_res = temp_strm;
else
-   status = DSP_ENOTFOUND;
+   status = -ENOENT;
 
return status;
 }
diff

[PATCH 24/40] DSPBRIDGE: err code replace DSP_ENOSECT with ENXIO

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_ENOSECT with ENXIO

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dblldefs.h |8 
 drivers/dsp/bridge/pmgr/dbll.c  |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dblldefs.h 
b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
index 18a862f..e780e87 100644
--- a/arch/arm/plat-omap/include/dspbridge/dblldefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
@@ -299,7 +299,7 @@ typedef bool(*dbll_get_c_addr_fxn) (struct dbll_library_obj 
*lib, char *name,
  *  psize   - Location to store section size on output.
  *  Returns:
  *  0:Success.
- *  DSP_ENOSECT:Section not found.
+ *  -ENXIO:Section not found.
  *  Requires:
  *  DBL initialized.
  *  Valid lib.
@@ -359,7 +359,7 @@ typedef dsp_status(*dbll_load_fxn) (struct dbll_library_obj 
*lib,
  *  attrs   - Contains write function and handle to pass to it.
  *  Returns:
  *  0:Success.
- *  DSP_ENOSECT:Section not found.
+ *  -ENXIO:Section not found.
  *  DSP_EFWRITE:Write function failed.
  *  -ENOSYS:   Function not implemented.
  *  Requires:
@@ -412,7 +412,7 @@ typedef dsp_status(*dbll_open_fxn) (struct dbll_tar_obj 
*target, char *file,
  *  size- Buffer size
  *  Returns:
  *  0:Success.
- *  DSP_ENOSECT:Named section does not exists.
+ *  -ENXIO:Named section does not exists.
  *  Requires:
  *  DBL initialized.
  *  Valid lib.
@@ -465,7 +465,7 @@ typedef void (*dbll_unload_fxn) (struct dbll_library_obj 
*library,
  *  attrs   - Contains free() function and handle to pass to it.
  *  Returns:
  *  0:Success.
- *  DSP_ENOSECT:Named section not found.
+ *  -ENXIO:Named section not found.
  *  -ENOSYS
  *  Requires:
  *  DBL initialized.
diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 6a01f56..8e76bf6 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -419,7 +419,7 @@ dsp_status dbll_get_sect(struct dbll_library_obj *lib, char 
*name, u32 *paddr,
/* Align size */
*psize = DOFF_ALIGN(*psize);
} else {
-   status = DSP_ENOSECT;
+   status = -ENXIO;
}
}
if (opened_doff) {
@@ -764,7 +764,7 @@ dsp_status dbll_read_sect(struct dbll_library_obj *lib, 
char *name,
 
byte_size = 1;
if (!dload_get_section_info(zl_lib-desc, name, sect)) {
-   status = DSP_ENOSECT;
+   status = -ENXIO;
goto func_cont;
}
/*
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 27/40] DSPBRIDGE: err code replace DSP_EDCDNOAUTOREGISTER with EACCES

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDCDNOAUTOREGISTER with EACCES

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |6 +++---
 drivers/dsp/bridge/rmgr/dbdcd.c  |2 +-
 drivers/dsp/bridge/rmgr/proc.c   |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index f7e4e79..17fb57a 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -34,7 +34,7 @@
  *  objects to be registered.
  *  Returns:
  *  0:Success.
- *  DSP_EDCDNOAUTOREGISTER: Unable to find auto-registration section.
+ *  -EACCES: Unable to find auto-registration section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
  *  DSP_EDCDLOADBASE:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
@@ -60,7 +60,7 @@ extern dsp_status dcd_auto_register(IN struct dcd_manager 
*hdcd_mgr,
  *  DCD objects to be unregistered.
  *  Returns:
  *  0:Success.
- *  DSP_EDCDNOAUTOREGISTER: Unable to find auto-registration section.
+ *  -EACCES: Unable to find auto-registration section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
  *  DSP_EDCDLOADBASE:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
@@ -289,7 +289,7 @@ extern dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
  *  handle: Handle to pass to callback.
  *  Returns:
  *  0:Success.
- *  DSP_EDCDNOAUTOREGISTER: Unable to find .dcd_register section.
+ *  -EACCES: Unable to find .dcd_register section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
  *  DSP_EDCDLOADBASE:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index 1731334..dcca612 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -567,7 +567,7 @@ dsp_status dcd_get_objects(IN struct dcd_manager *hdcd_mgr,
/* Get DCD_RESIGER_SECTION section information. */
status = cod_get_section(lib, DCD_REGISTER_SECTION, ul_addr, ul_len);
if (DSP_FAILED(status) || !(ul_len  0)) {
-   status = DSP_EDCDNOAUTOREGISTER;
+   status = -EACCES;
goto func_cont;
}
 
diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 1f46f66..1afdff0 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -907,13 +907,13 @@ dsp_status proc_load(void *hprocessor, IN CONST s32 
argc_index,
if (DSP_SUCCEEDED(status)) {
/*  Auto register nodes in specified COFF
 *  file.  If registration did not fail,
-*  (status = 0 or DSP_EDCDNOAUTOREGISTER)
+*  (status = 0 or -EACCES)
 *  save the name of the COFF file for
 *  de-registration in the future. */
status =
dcd_auto_register(hdcd_handle,
  (char *)user_args[0]);
-   if (status == DSP_EDCDNOAUTOREGISTER)
+   if (status == -EACCES)
status = 0;
 
if (DSP_FAILED(status)) {
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 23/40] DSPBRIDGE: err code replace DSP_EOVERLAYMEMORY with ENXIO

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EOVERLAYMEMORY with ENXIO

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/nldrdefs.h |2 +-
 arch/arm/plat-omap/include/dspbridge/rmm.h  |2 +-
 drivers/dsp/bridge/rmgr/rmm.c   |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h 
b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
index b93671b..e5108b4 100644
--- a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
@@ -247,7 +247,7 @@ typedef bool(*nldr_initfxn) (void);
  *  Returns:
  *  0:Success.
  *  -ENOMEM:Insufficient memory on GPP.
- *  DSP_EOVERLAYMEMORY: Can't overlay phase because overlay memory
+ *  -ENXIO: Can't overlay phase because overlay memory
  *  is already in use.
  *  -EILSEQ:   Failure in dynamic loader library.
  *  DSP_EFWRITE:Failed to write phase's code or date to target.
diff --git a/arch/arm/plat-omap/include/dspbridge/rmm.h 
b/arch/arm/plat-omap/include/dspbridge/rmm.h
index 42da289..8958a50 100644
--- a/arch/arm/plat-omap/include/dspbridge/rmm.h
+++ b/arch/arm/plat-omap/include/dspbridge/rmm.h
@@ -63,7 +63,7 @@ struct rmm_target_obj;
  *  Returns:
  *  0:Success.
  *  -ENOMEM:Memory allocation on GPP failed.
- *  DSP_EOVERLAYMEMORY: Cannot allocate overlay memory because it's
+ *  -ENXIO: Cannot allocate overlay memory because it's
  *  already in use.
  *  Requires:
  *  RMM initialized.
diff --git a/drivers/dsp/bridge/rmgr/rmm.c b/drivers/dsp/bridge/rmgr/rmm.c
index 64d8c56..efefb65 100644
--- a/drivers/dsp/bridge/rmgr/rmm.c
+++ b/drivers/dsp/bridge/rmgr/rmm.c
@@ -130,7 +130,7 @@ dsp_status rmm_alloc(struct rmm_target_obj *target, u32 
segid, u32 size,
   (prev_sect-addr +
prev_sect-size 
addr))) {
-   status = DSP_EOVERLAYMEMORY;
+   status = -ENXIO;
}
break;
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 30/40] DSPBRIDGE: err code replace DSP_EDCDPARSESECT with EACCES

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDCDPARSESECT with EACCES

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |2 +-
 drivers/dsp/bridge/rmgr/dbdcd.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index e615c8a..2a43d6e 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -255,7 +255,7 @@ extern dsp_status dcd_get_library_name(IN struct 
dcd_manager *hdcd_mgr,
  *  union of various possible DCD object types.
  *  Returns:
  *  0: Success.
- *  DSP_EDCDPARSESECT:  Unable to parse content of object code section.
+ *  -EACCES:  Unable to parse content of object code section.
  *  DSP_EDCDREADSECT:   Unable to read object code section.
  *  -EACCES:Unable to access object code section.
  *  -EACCES:   Unable to load code base.
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index a3d79ba..5592033 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -516,7 +516,7 @@ dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
status =
get_attrs_from_buf(psz_coff_buf, ul_len, obj_type, pObjDef);
if (DSP_FAILED(status))
-   status = DSP_EDCDPARSESECT;
+   status = -EACCES;
} else {
status = DSP_EDCDREADSECT;
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 31/40] DSPBRIDGE: err code replace DSP_EDCDREADSECT with EACCES

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDCDREADSECT with EACCES

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |   12 ++--
 drivers/dsp/bridge/rmgr/dbdcd.c  |4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index 2a43d6e..a879d6b 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -35,7 +35,7 @@
  *  Returns:
  *  0:Success.
  *  -EACCES: Unable to find auto-registration section.
- *  DSP_EDCDREADSECT:   Unable to read object code section.
+ *  -EACCES:   Unable to read object code section.
  *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
@@ -61,7 +61,7 @@ extern dsp_status dcd_auto_register(IN struct dcd_manager 
*hdcd_mgr,
  *  Returns:
  *  0:Success.
  *  -EACCES: Unable to find auto-registration section.
- *  DSP_EDCDREADSECT:   Unable to read object code section.
+ *  -EACCES:   Unable to read object code section.
  *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
@@ -164,7 +164,7 @@ extern void dcd_exit(void);
  *  Returns:
  *  0: Success.
  *  -ENOMEM: Memory allocation failure.
- *  DSP_EDCDREADSECT: Failure to read section containing library info.
+ *  -EACCES: Failure to read section containing library info.
  *  -EPERM: General failure.
  *  Requires:
  *  DCD initialized.
@@ -194,7 +194,7 @@ extern dsp_status dcd_get_dep_libs(IN struct dcd_manager 
*hdcd_mgr,
  *  Returns:
  *  0: Success.
  *  -ENOMEM: Memory allocation failure.
- *  DSP_EDCDREADSECT: Failure to read section containing library info.
+ *  -EACCES: Failure to read section containing library info.
  *  -EPERM: General failure.
  *  Requires:
  *  DCD initialized.
@@ -256,7 +256,7 @@ extern dsp_status dcd_get_library_name(IN struct 
dcd_manager *hdcd_mgr,
  *  Returns:
  *  0: Success.
  *  -EACCES:  Unable to parse content of object code section.
- *  DSP_EDCDREADSECT:   Unable to read object code section.
+ *  -EACCES:   Unable to read object code section.
  *  -EACCES:Unable to access object code section.
  *  -EACCES:   Unable to load code base.
  *  -EPERM:  General failure.
@@ -290,7 +290,7 @@ extern dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
  *  Returns:
  *  0:Success.
  *  -EACCES: Unable to find .dcd_register section.
- *  DSP_EDCDREADSECT:   Unable to read object code section.
+ *  -EACCES:   Unable to read object code section.
  *  -EACCES:   Unable to load code base.
  *  -EFAULT:Invalid DCD_HMANAGER handle..
  *  Requires:
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index 5592033..c9dba67 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -518,7 +518,7 @@ dsp_status dcd_get_object_def(IN struct dcd_manager 
*hdcd_mgr,
if (DSP_FAILED(status))
status = -EACCES;
} else {
-   status = DSP_EDCDREADSECT;
+   status = -EACCES;
}
 
/* Free the previously allocated dynamic buffer. */
@@ -625,7 +625,7 @@ dsp_status dcd_get_objects(IN struct dcd_manager *hdcd_mgr,
}
}
} else {
-   status = DSP_EDCDREADSECT;
+   status = -EACCES;
}
 
/* Free the previously allocated dynamic buffer. */
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 20/40] DSPBRIDGE: err code replace DSP_EDPMSUSPEND with EPERM

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDPMSUSPEND with EPERM

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index e7eff24..08ad56d 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -112,7 +112,7 @@ static int omap34_xxbridge_suspend_lockout(struct 
omap34_xx_bridge_suspend_data
 {
if ((s)-suspended) {
if ((f)-f_flags  O_NONBLOCK)
-   return DSP_EDPMSUSPEND;
+   return -EPERM;
wait_event_interruptible((s)-suspend_wq, (s)-suspended == 0);
}
return 0;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 22/40] DSPBRIDGE: err code replace DSP_EBADSEGID with EBADR

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EBADSEGID with EBADR

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/node.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index 159ea2b..1c7742a 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -731,7 +731,7 @@ DBAPI node_alloc_msg_buf(struct node_object *hnode, u32 
usize,
if (DSP_SUCCEEDED(status)  (!va_flag)) {
if (pattr-segment_id != 1) {
/* Node supports single SM segment only. */
-   status = DSP_EBADSEGID;
+   status = -EBADR;
}
/*  Arbitrary SM buffer alignment not supported for host side
 *  allocs, but guaranteed for the following alignment
@@ -1695,7 +1695,7 @@ dsp_status node_free_msg_buf(struct node_object *hnode, 
IN u8 * pbuffer,
}
/* Node supports single SM segment only */
if (pattr-segment_id != 1)
-   status = DSP_EBADSEGID;
+   status = -EBADR;
 
/* pbuffer is clients Va. */
status = cmm_xlator_free_buf(pnode-xlator, pbuffer);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 18/40] DSPBRIDGE: err code replace COD_E_SYMBOLNOTFOUND with ESPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace COD_E_SYMBOLNOTFOUND with ESPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cod.h |4 ++--
 arch/arm/plat-omap/include/dspbridge/dev.h |2 +-
 drivers/dsp/bridge/pmgr/cod.c  |2 +-
 drivers/dsp/bridge/rmgr/node.c |2 +-
 drivers/dsp/bridge/rmgr/proc.c |2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index 56df6d8..76b6ae9 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -213,7 +213,7 @@ extern dsp_status cod_get_loader(struct cod_manager 
*cod_mgr_obj,
  *  Returns:
  *  0:Success
  *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
- *  COD_E_SYMBOLNOTFOUND:   The symbol could not be found.
+ *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  COD module initialized.
  *  valid cod_mgr_obj.
@@ -243,7 +243,7 @@ extern dsp_status cod_get_section(struct cod_libraryobj 
*lib,
  *  Returns:
  *  0:Success.
  *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
- *  COD_E_SYMBOLNOTFOUND:   The symbol could not be found.
+ *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  COD module initialized.
  *  Valid cod_mgr_obj.
diff --git a/arch/arm/plat-omap/include/dspbridge/dev.h 
b/arch/arm/plat-omap/include/dspbridge/dev.h
index 8652f52..e75a141 100644
--- a/arch/arm/plat-omap/include/dspbridge/dev.h
+++ b/arch/arm/plat-omap/include/dspbridge/dev.h
@@ -493,7 +493,7 @@ extern dsp_status dev_get_node_manager(struct dev_object
  *  0:Success.
  *  -EFAULT:Invalid hdev_obj.
  *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
- *  COD_E_SYMBOLNOTFOUND:   The symbol could not be found.
+ *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  pstrSym != NULL.
  *  pul_value != NULL.
diff --git a/drivers/dsp/bridge/pmgr/cod.c b/drivers/dsp/bridge/pmgr/cod.c
index 65acd6f..5a18853 100644
--- a/drivers/dsp/bridge/pmgr/cod.c
+++ b/drivers/dsp/bridge/pmgr/cod.c
@@ -450,7 +450,7 @@ dsp_status cod_get_sym_value(struct cod_manager *hmgr, char 
*pstrSym,
get_addr_fxn(hmgr-base_lib, pstrSym, dbll_sym)) {
if (!hmgr-fxns.
get_c_addr_fxn(hmgr-base_lib, pstrSym, dbll_sym))
-   return COD_E_SYMBOLNOTFOUND;
+   return -ESPIPE;
}
} else {
return COD_E_NOSYMBOLSLOADED;
diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index e087238..159ea2b 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -3098,7 +3098,7 @@ static dsp_status get_rms_fxns(struct node_mgr *hnode_mgr)
status = dev_get_symbol(dev_obj, psz_fxns[i],
(hnode_mgr-ul_fxn_addrs[i]));
if (DSP_FAILED(status)) {
-   if (status == COD_E_SYMBOLNOTFOUND) {
+   if (status == -ESPIPE) {
/*
 *  May be loaded dynamically (in the future),
 *  but return an error for now.
diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index f3a9b2b..1f46f66 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -970,7 +970,7 @@ dsp_status proc_load(void *hprocessor, IN CONST s32 
argc_index,
dev_dbg(bridge, %s: Failure to Load the EXE\n,
__func__);
}
-   if (status == COD_E_SYMBOLNOTFOUND) {
+   if (status == -ESPIPE) {
pr_err(%s: Couldn't parse the file\n,
   __func__);
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 21/40] DSPBRIDGE: err code replace DSP_EDYNLOAD with EILSEQ

2010-06-02 Thread Omar Ramirez Luna
Replace DSP_EDYNLOAD with EILSEQ

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dblldefs.h |2 +-
 arch/arm/plat-omap/include/dspbridge/nldrdefs.h |2 +-
 drivers/dsp/bridge/pmgr/dbll.c  |8 
 drivers/dsp/bridge/rmgr/nldr.c  |4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dblldefs.h 
b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
index 0e7e3c4..18a862f 100644
--- a/arch/arm/plat-omap/include/dspbridge/dblldefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dblldefs.h
@@ -339,7 +339,7 @@ typedef bool(*dbll_init_fxn) (void);
  *  0:Success.
  *  -EBADF: File read failed.
  *  DSP_EFWRITE:Write to target failed.
- *  DSP_EDYNLOAD:   Failure in dynamic loader library.
+ *  -EILSEQ:   Failure in dynamic loader library.
  *  Requires:
  *  DBL initialized.
  *  Valid lib.
diff --git a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h 
b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
index 008e12c..b93671b 100644
--- a/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/nldrdefs.h
@@ -249,7 +249,7 @@ typedef bool(*nldr_initfxn) (void);
  *  -ENOMEM:Insufficient memory on GPP.
  *  DSP_EOVERLAYMEMORY: Can't overlay phase because overlay memory
  *  is already in use.
- *  DSP_EDYNLOAD:   Failure in dynamic loader library.
+ *  -EILSEQ:   Failure in dynamic loader library.
  *  DSP_EFWRITE:Failed to write phase's code or date to target.
  *  Requires:
  *  nldr_init(void) called.
diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 7e126a7..6a01f56 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -544,12 +544,12 @@ dsp_status dbll_load(struct dbll_library_obj *lib, 
dbll_flags flags,
  zl_lib-dload_mod_obj);
 
if (err != 0) {
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
} else if (redefined_symbol) {
zl_lib-load_ref++;
dbll_unload(zl_lib, (struct dbll_attrs *)attrs);
redefined_symbol = false;
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
} else {
*pEntry = zl_lib-entry;
}
@@ -684,7 +684,7 @@ dsp_status dbll_open(struct dbll_tar_obj *target, char 
*file, dbll_flags flags,
  zl_lib-init.dl_init, 0,
  zl_lib-dload_mod_obj);
if (err != 0) {
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
} else {
/* Now that we have the symbol table, we can unload */
err = dynamic_unload_module(zl_lib-dload_mod_obj,
@@ -692,7 +692,7 @@ dsp_status dbll_open(struct dbll_tar_obj *target, char 
*file, dbll_flags flags,
zl_lib-allocate.dl_alloc,
zl_lib-init.dl_init);
if (err != 0)
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
 
zl_lib-dload_mod_obj = NULL;
}
diff --git a/drivers/dsp/bridge/rmgr/nldr.c b/drivers/dsp/bridge/rmgr/nldr.c
index 8257a83..b6044e0 100644
--- a/drivers/dsp/bridge/rmgr/nldr.c
+++ b/drivers/dsp/bridge/rmgr/nldr.c
@@ -1314,7 +1314,7 @@ static dsp_status load_lib(struct nldr_nodeobject 
*nldr_node_obj,
if (root-lib == lib_path[i]) {
/* This condition could be checked by a
 * tool at build time. */
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
}
}
}
@@ -1376,7 +1376,7 @@ static dsp_status load_lib(struct nldr_nodeobject 
*nldr_node_obj,
if (!rootPersistent  persistent_dep_libs[i] 
*nldr_node_obj-pf_phase_split) {
if ((nldr_node_obj-pers_libs)  MAXLIBS) {
-   status = DSP_EDYNLOAD;
+   status = -EILSEQ;
break;
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo

[PATCH 09/40] DSPBRIDGE: err code replace CHNL_E_NOMEMMAP with EFAULT

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_NOMEMMAP with EFAULT

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/io_sm.c|   22 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index f56fdca..6a2bba5 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -310,7 +310,7 @@ typedef dsp_status(*fxn_brd_write) (struct 
bridge_dev_context *hDevContext,
  *  0:Success;
  *  -ENOMEM:Insufficient memory for requested resources.
  *  -EIO: Unable to plug ISR for given IRQ.
- *  CHNL_E_NOMEMMAP:Couldn't map physical address to a virtual one.
+ *  -EFAULT:Couldn't map physical address to a virtual one.
  *  Requires:
  *  phChnlMgr != NULL.
  *  pMgrAttrs != NULL
diff --git a/drivers/dsp/bridge/core/io_sm.c b/drivers/dsp/bridge/core/io_sm.c
index 5902d8a..79baa2c 100644
--- a/drivers/dsp/bridge/core/io_sm.c
+++ b/drivers/dsp/bridge/core/io_sm.c
@@ -353,13 +353,13 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = cod_get_sym_value(cod_man, CHNL_SHARED_BUFFER_BASE_SYM,
   ul_shm_base);
if (DSP_FAILED(status)) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
}
status = cod_get_sym_value(cod_man, CHNL_SHARED_BUFFER_LIMIT_SYM,
   ul_shm_limit);
if (DSP_FAILED(status)) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
}
if (ul_shm_limit = ul_shm_base) {
@@ -398,10 +398,10 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
ul_mem_length = ul_shm_length + ul_msg_length;
}
} else {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
}
} else {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
 #ifndef DSP_TRACEBUF_DISABLED
@@ -412,18 +412,18 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
   shm0_end);
 #endif
if (DSP_FAILED(status))
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
status =
cod_get_sym_value(cod_man, DYNEXTBASE, ul_dyn_ext_base);
if (DSP_FAILED(status))
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
status = cod_get_sym_value(cod_man, EXTEND, ul_ext_end);
if (DSP_FAILED(status))
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
}
if (DSP_SUCCEEDED(status)) {
/* Get memory reserved in host resources */
@@ -680,7 +680,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
 * num_procs = 1.
 */
if (!hio_mgr-ext_proc_info.ty_tlb[0].ul_gpp_phys || num_procs != 1) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
} else {
if (ae_proc[0].ul_dsp_va  ul_shm_base) {
@@ -751,7 +751,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = cod_get_sym_value(cod_man, SYS_PUTCBEG,
   hio_mgr-ul_trace_buffer_begin);
if (DSP_FAILED(status)) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
}
 
@@ -762,7 +762,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = cod_get_sym_value(cod_man, SYS_PUTCEND,
   hio_mgr-ul_trace_buffer_end);
if (DSP_FAILED(status)) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
}
hio_mgr-ul_trace_buffer_end =
@@ -772,7 +772,7 @@ dsp_status bridge_io_on_loaded(struct io_mgr *hio_mgr)
status = cod_get_sym_value(cod_man, BRIDGE_SYS_PUTC_CURRENT,
   hio_mgr-ul_trace_buffer_current);
if (DSP_FAILED(status)) {
-   status = CHNL_E_NOMEMMAP;
+   status = -EFAULT;
goto func_end;
}
hio_mgr-ul_trace_buffer_current =
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 19/40] DSPBRIDGE: err code replace COD_E_NOSYMBOLSLOADED with ESPIPE

2010-06-02 Thread Omar Ramirez Luna
Replace COD_E_NOSYMBOLSLOADED with ESPIPE

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cod.h |6 +++---
 arch/arm/plat-omap/include/dspbridge/dev.h |2 +-
 drivers/dsp/bridge/pmgr/cod.c  |6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cod.h 
b/arch/arm/plat-omap/include/dspbridge/cod.h
index 76b6ae9..8a4919e 100644
--- a/arch/arm/plat-omap/include/dspbridge/cod.h
+++ b/arch/arm/plat-omap/include/dspbridge/cod.h
@@ -212,7 +212,7 @@ extern dsp_status cod_get_loader(struct cod_manager 
*cod_mgr_obj,
  *  puLen:  Location to store length.
  *  Returns:
  *  0:Success
- *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
+ *  -ESPIPE:  Symbols have not been loaded onto the board.
  *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  COD module initialized.
@@ -242,7 +242,7 @@ extern dsp_status cod_get_section(struct cod_libraryobj 
*lib,
  *  value:  value of the symbol
  *  Returns:
  *  0:Success.
- *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
+ *  -ESPIPE:  Symbols have not been loaded onto the board.
  *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  COD module initialized.
@@ -355,7 +355,7 @@ extern dsp_status cod_open_base(struct cod_manager *hmgr, 
IN char *pszCoffPath,
  *  pstrContent - buffer to store content of the section.
  *  Returns:
  *  0: on success, error code on failure
- *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
+ *  -ESPIPE:  Symbols have not been loaded onto the board.
  *  COD_E_READFAILED: Failed to read content of code section.
  *  Requires:
  *  COD module initialized.
diff --git a/arch/arm/plat-omap/include/dspbridge/dev.h 
b/arch/arm/plat-omap/include/dspbridge/dev.h
index e75a141..cf48c07 100644
--- a/arch/arm/plat-omap/include/dspbridge/dev.h
+++ b/arch/arm/plat-omap/include/dspbridge/dev.h
@@ -492,7 +492,7 @@ extern dsp_status dev_get_node_manager(struct dev_object
  *  Returns:
  *  0:Success.
  *  -EFAULT:Invalid hdev_obj.
- *  COD_E_NOSYMBOLSLOADED:  Symbols have not been loaded onto the board.
+ *  -ESPIPE:  Symbols have not been loaded onto the board.
  *  -ESPIPE:   The symbol could not be found.
  *  Requires:
  *  pstrSym != NULL.
diff --git a/drivers/dsp/bridge/pmgr/cod.c b/drivers/dsp/bridge/pmgr/cod.c
index 5a18853..342c1b3 100644
--- a/drivers/dsp/bridge/pmgr/cod.c
+++ b/drivers/dsp/bridge/pmgr/cod.c
@@ -417,7 +417,7 @@ dsp_status cod_get_section(struct cod_libraryobj *lib, IN 
char *pstrSect,
status = cod_mgr_obj-fxns.get_sect_fxn(lib-dbll_lib, pstrSect,
puAddr, puLen);
} else {
-   status = COD_E_NOSYMBOLSLOADED;
+   status = -ESPIPE;
}
 
DBC_ENSURE(DSP_SUCCEEDED(status) || ((*puAddr == 0)  (*puLen == 0)));
@@ -453,7 +453,7 @@ dsp_status cod_get_sym_value(struct cod_manager *hmgr, char 
*pstrSym,
return -ESPIPE;
}
} else {
-   return COD_E_NOSYMBOLSLOADED;
+   return -ESPIPE;
}
 
*pul_value = dbll_sym-value;
@@ -642,7 +642,7 @@ dsp_status cod_read_section(struct cod_libraryobj *lib, IN 
char *pstrSect,
lib-cod_mgr-fxns.read_sect_fxn(lib-dbll_lib, pstrSect,
 pstrContent, cContentSize);
else
-   status = COD_E_NOSYMBOLSLOADED;
+   status = -ESPIPE;
 
return status;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/40] DSPBRIDGE: err code replace CHNL_E_MGREXISTS with EEXIST

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_MGREXISTS with EEXIST

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/chnl.h |2 +-
 drivers/dsp/bridge/pmgr/chnl.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl.h 
b/arch/arm/plat-omap/include/dspbridge/chnl.h
index b97cced..04856c2 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl.h
@@ -68,7 +68,7 @@ extern dsp_status chnl_close(struct chnl_object *chnl_obj);
  *  CHNL_E_INVALIDIRQ:  Invalid IRQ number. Must be 0 = birq = 15.
  *  CHNL_E_INVALIDWORDSIZE: Invalid DSP word size.  Must be  0.
  *  CHNL_E_INVALIDMEMBASE:  Invalid base address for DSP communications.
- *  CHNL_E_MGREXISTS:   Channel manager already exists for this device.
+ *  -EEXIST:   Channel manager already exists for this device.
  *  Requires:
  *  chnl_init(void) called.
  *  phChnlMgr != NULL.
diff --git a/drivers/dsp/bridge/pmgr/chnl.c b/drivers/dsp/bridge/pmgr/chnl.c
index 1c9cc5e..5bf1c66 100644
--- a/drivers/dsp/bridge/pmgr/chnl.c
+++ b/drivers/dsp/bridge/pmgr/chnl.c
@@ -81,7 +81,7 @@ dsp_status chnl_create(OUT struct chnl_mgr **phChnlMgr,
if (DSP_SUCCEEDED(status)) {
status = dev_get_chnl_mgr(hdev_obj, hchnl_mgr);
if (DSP_SUCCEEDED(status)  hchnl_mgr != NULL)
-   status = CHNL_E_MGREXISTS;
+   status = -EEXIST;
 
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 05/40] DSPBRIDGE: err code replace CHNL_E_BUFSIZE with EINVAL

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_BUFSIZE with EINVAL

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 6dcea60..3d53881 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -457,7 +457,7 @@ typedef dsp_status(*fxn_chnl_close) (struct chnl_object 
*chnl_obj);
  *  I/O is allowed.
  *  CHNL_E_EOS: End of stream was already marked on a previous
  *  IORequest on this channel.  No further I/O is expected.
- *  CHNL_E_BUFSIZE: Buffer submitted to this output channel is larger than
+ *  -EINVAL: Buffer submitted to this output channel is larger than
  *  the size of the physical shared memory output window.
  *  Requires:
  *  Ensures:
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index 99a4a42..3cebf94 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -176,7 +176,7 @@ func_cont:
/* Check buffer size on output channels for fit. */
if (byte_size 
io_buf_size(pchnl-chnl_mgr_obj-hio_mgr))
-   status = CHNL_E_BUFSIZE;
+   status = -EINVAL;
 
}
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 13/40] DSPBRIDGE: err code replace CHNL_E_NOIOC with EREMOTEIO

2010-06-02 Thread Omar Ramirez Luna
Replace CHNL_E_NOIOC with EREMOTEIO

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |2 +-
 drivers/dsp/bridge/core/chnl_sm.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dspdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
index 58fcbcc..b268c5e 100644
--- a/arch/arm/plat-omap/include/dspbridge/dspdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dspdefs.h
@@ -493,7 +493,7 @@ typedef dsp_status(*fxn_chnl_addioreq) (struct chnl_object
  *  0:Success.
  *  -EFAULT:Invalid chnl_obj.
  *  -EFAULT:   pIOC is invalid.
- *  CHNL_E_NOIOC:   CHNL_IOCNOWAIT was specified as the dwTimeOut parameter
+ *  -EREMOTEIO:   CHNL_IOCNOWAIT was specified as the dwTimeOut parameter
  *  yet no I/O completions were queued.
  *  Requires:
  *  dwTimeOut == CHNL_IOCNOWAIT.
diff --git a/drivers/dsp/bridge/core/chnl_sm.c 
b/drivers/dsp/bridge/core/chnl_sm.c
index d162698..806f0c9 100644
--- a/drivers/dsp/bridge/core/chnl_sm.c
+++ b/drivers/dsp/bridge/core/chnl_sm.c
@@ -589,7 +589,7 @@ dsp_status bridge_chnl_get_ioc(struct chnl_object 
*chnl_obj, u32 dwTimeOut,
status = -EFAULT;
} else if (dwTimeOut == CHNL_IOCNOWAIT) {
if (LST_IS_EMPTY(pchnl-pio_completions))
-   status = CHNL_E_NOIOC;
+   status = -EREMOTEIO;
 
}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/40] DSPBRIDGE: change DSP_SENUMCOMPLETE for ENODATA

2010-06-02 Thread Omar Ramirez Luna
This is not an error code, however the way it is coded
it doesn't expects a success (zero) either, return a positive
number on this case given that this is not an error code.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h |2 +-
 drivers/dsp/bridge/rmgr/dbdcd.c  |6 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdcd.h 
b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
index 3bf3b4d..f7e4e79 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdcd.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdcd.h
@@ -123,7 +123,7 @@ extern dsp_status dcd_destroy_manager(IN struct dcd_manager 
*hdcd_mgr);
  *  Returns:
  *  0:Success.
  *  -EPERM:  Unable to enumerate through the DCD database.
- *  DSP_SENUMCOMPLETE:  Enumeration completed. This is not an error code.
+ *  ENODATA:  Enumeration completed. This is not an error code.
  *  Requires:
  *  DCD initialized.
  *  uuid_obj is a valid pointer.
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index e0417a2..1731334 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -286,7 +286,11 @@ dsp_status dcd_enumerate_object(IN s32 cIndex, IN enum 
dsp_dcdobjtype obj_type,
/* At the end of enumeration. Reset enum_refs. */
enum_refs = 0;
 
-   status = DSP_SENUMCOMPLETE;
+   /*
+* TODO: Revisit, this is not an errror case but code
+* expects non-zero value.
+*/
+   status = ENODATA;
} else {
status = -EPERM;
}
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/40] dspbridge: trivial error code cleanup

2010-06-02 Thread Omar Ramirez Luna
These set of patches gets rid of the custom error codes still present.

Although there are a lot of patches most of them are just replacements
which were broken into single patches to avoid big patch files.

One of the patches creates a help file with the matching linux
error codes just in case the error is not descriptive enough, and
it also lists a common scenario where the error might be seen.

Finally, the last patch replaces a custom typedef (dsp_status)
with an int type as now those errors can have a negative value.

Omar Ramirez Luna (40):
  DSPBRIDGE: Remove success codes
  DSPBRIDGE: change DSP_SENUMCOMPLETE for ENODATA
  DSPBRIDGE: err code replace CHNL_E_WAITTIMEOUT with ETIMEDOUT
  DSPBRIDGE: err code replace CHNL_E_NOEOS with EPERM
  DSPBRIDGE: err code replace CHNL_E_BUFSIZE with EINVAL
  DSPBRIDGE: err code replace CHNL_E_NOIORPS with EIO
  DSPBRIDGE: err code replace CHNL_E_ISR with EIO
  DSPBRIDGE: err code replace CHNL_E_MGREXISTS with EEXIST
  DSPBRIDGE: err code replace CHNL_E_NOMEMMAP with EFAULT
  DSPBRIDGE: err code replace CHNL_E_INVALIDMEMBASE with EINVAL
  DSPBRIDGE: err code replace CHNL_E_INVALIDWORDSIZE with EINVAL
  DSPBRIDGE: err code replace CHNL_E_EOS with EPIPE
  DSPBRIDGE: err code replace CHNL_E_NOIOC with EREMOTEIO
  DSPBRIDGE: err code replace CHNL_E_BADCHANID with ECHRNG
  DSPBRIDGE: err code replace CHNL_E_OUTOFSTREAMS with ENOSR
  DSPBRIDGE: err code replace CHNL_E_MAXCHANNELS with ECHRNG
  DSPBRIDGE: err code replace COD_E_ZLCREATEFAILED with ESPIPE
  DSPBRIDGE: err code replace COD_E_SYMBOLNOTFOUND with ESPIPE
  DSPBRIDGE: err code replace COD_E_NOSYMBOLSLOADED with ESPIPE
  DSPBRIDGE: err code replace DSP_EDPMSUSPEND with EPERM
  DSPBRIDGE: err code replace DSP_EDYNLOAD with EILSEQ
  DSPBRIDGE: err code replace DSP_EBADSEGID with EBADR
  DSPBRIDGE: err code replace DSP_EOVERLAYMEMORY with ENXIO
  DSPBRIDGE: err code replace DSP_ENOSECT with ENXIO
  DSPBRIDGE: err code replace DSP_ETRANSLATE with ESRCH
  DSPBRIDGE: err code replace DSP_ENOTFOUND with ENOENT
  DSPBRIDGE: err code replace DSP_EDCDNOAUTOREGISTER with EACCES
  DSPBRIDGE: err code replace DSP_EDCDLOADBASE with EACCES
  DSPBRIDGE: err code replace DSP_EDCDGETSECT with EACCES
  DSPBRIDGE: err code replace DSP_EDCDPARSESECT with EACCES
  DSPBRIDGE: err code replace DSP_EDCDREADSECT with EACCES
  DSPBRIDGE: err code replace DSP_ESYMBOL with ESPIPE
  DSPBRIDGE: err code replace DSP_EWRONGSTATE with EBADR
  DSPBRIDGE: err code replace DSP_EPENDING with EPIPE
  DSPBRIDGE: err code replace DSP_ECHANGEDURINGENUM with EIDRM
  DSPBRIDGE: remove custom errbase definitions
  DSPBRIDGE: cleanup for duplicated error codes
  DSPBRIDGE: removed unused error codes from comments
  DSPBRIDGE: error code guide
  DSPBRIDGE: remove dsp_status typedef

 Documentation/tidspbridge/error-codes  |  157 ++
 arch/arm/plat-omap/include/dspbridge/_chnl_sm.h|2 +-
 arch/arm/plat-omap/include/dspbridge/cfg.h |   57 +++---
 arch/arm/plat-omap/include/dspbridge/chnl.h|   31 ++--
 arch/arm/plat-omap/include/dspbridge/clk.h |8 +-
 arch/arm/plat-omap/include/dspbridge/cmm.h |   44 ++--
 arch/arm/plat-omap/include/dspbridge/cod.h |   61 +++---
 arch/arm/plat-omap/include/dspbridge/dbdcd.h   |   73 +++
 arch/arm/plat-omap/include/dspbridge/dbdcddef.h|2 +-
 arch/arm/plat-omap/include/dspbridge/dbdefs.h  |5 +-
 arch/arm/plat-omap/include/dspbridge/dbldefs.h |2 +-
 arch/arm/plat-omap/include/dspbridge/dbll.h|   14 +-
 arch/arm/plat-omap/include/dspbridge/dblldefs.h|   47 ++---
 arch/arm/plat-omap/include/dspbridge/dev.h |  156 ++
 arch/arm/plat-omap/include/dspbridge/disp.h|   25 +--
 arch/arm/plat-omap/include/dspbridge/dmm.h |   18 +-
 arch/arm/plat-omap/include/dspbridge/drv.h |   38 ++--
 .../arm/plat-omap/include/dspbridge/dspapi-ioctl.h |2 +-
 arch/arm/plat-omap/include/dspbridge/dspapi.h  |8 +-
 arch/arm/plat-omap/include/dspbridge/dspchnl.h |   24 +-
 arch/arm/plat-omap/include/dspbridge/dspdefs.h |  226 ++--
 arch/arm/plat-omap/include/dspbridge/dspdeh.h  |8 +-
 arch/arm/plat-omap/include/dspbridge/dspio.h   |   10 +-
 arch/arm/plat-omap/include/dspbridge/dspmsg.h  |   10 +-
 arch/arm/plat-omap/include/dspbridge/errbase.h |  177 ---
 arch/arm/plat-omap/include/dspbridge/io.h  |   19 +-
 arch/arm/plat-omap/include/dspbridge/io_sm.h   |6 +-
 arch/arm/plat-omap/include/dspbridge/mgr.h |   34 ++--
 arch/arm/plat-omap/include/dspbridge/msg.h |2 +-
 arch/arm/plat-omap/include/dspbridge/nldr.h|   14 +-
 arch/arm/plat-omap/include/dspbridge/nldrdefs.h|   31 ++--
 arch/arm/plat-omap/include/dspbridge/node.h|  148 ++---
 arch/arm/plat-omap/include/dspbridge/nodepriv.h|8 +-
 arch/arm/plat-omap/include/dspbridge/ntfy.h|   13 +-
 arch/arm/plat

[PATCH 0/2] dspbridge: reorganize initialization and probe

2010-06-08 Thread Omar Ramirez Luna
Split the functions to have cleaner error handling paths, this
will aslo cover a case where bridge initialization has failed but
device entry is still available which leads to unknown behavior.

Omar Ramirez Luna (2):
  DSPRBIDGE: split probe from bridge initializations
  DSPBRIDGE: reorganize probe function

 drivers/dsp/bridge/rmgr/drv_interface.c |  202 ++-
 1 files changed, 118 insertions(+), 84 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] DSPRBIDGE: split probe from bridge initializations

2010-06-08 Thread Omar Ramirez Luna
A function containing driver low lever initializations has been
created. Now device entry should be available only if the startup
call has completed successfully, in case of error rollback any
of the changes that apply.

Now, device entry is created after bridge initializations
have been completed.

Reported-by: Ameya Palande ameya.pala...@nokia.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |  178 ++-
 1 files changed, 105 insertions(+), 73 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index c29de2c..f80b15b 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -233,23 +233,125 @@ static struct notifier_block iva_clk_notifier = {
 };
 #endif
 
+/**
+ * omap3_bridge_startup() - perform low lever initializations
+ * @pdev:  pointer to platform device
+ *
+ * Initializes recovery, PM and DVFS required data, before calling
+ * clk and memory init routines.
+ */
+static int omap3_bridge_startup(struct platform_device *pdev)
+{
+   struct dspbridge_platform_data *pdata = pdev-dev.platform_data;
+   struct drv_data *drv_datap = NULL;
+   u32 phys_membase, phys_memsize;
+   int err;
+
+#ifdef CONFIG_BRIDGE_RECOVERY
+   bridge_rec_queue = create_workqueue(bridge_rec_queue);
+   INIT_WORK(bridge_recovery_work, bridge_recover);
+   INIT_COMPLETION(bridge_comp);
+#endif
+
+#ifdef CONFIG_PM
+   /* Initialize the wait queue */
+   bridge_suspend_data.suspended = 0;
+   init_waitqueue_head(bridge_suspend_data.suspend_wq);
+
+#ifdef CONFIG_BRIDGE_DVFS
+   for (i = 0; i  6; i++)
+   pdata-mpu_speed[i] = vdd1_rate_table_bridge[i].rate;
+
+   err = cpufreq_register_notifier(iva_clk_notifier,
+   CPUFREQ_TRANSITION_NOTIFIER);
+   if (err)
+   pr_err(%s: clk_notifier_register failed for iva2_ck\n,
+   __func__);
+#endif
+#endif
+
+   dsp_clk_init();
+   services_init();
+
+   drv_datap = kzalloc(sizeof(struct drv_data), GFP_KERNEL);
+   if (!drv_datap) {
+   err = -ENOMEM;
+   goto err1;
+   }
+
+   drv_datap-shm_size = shm_size;
+   drv_datap-tc_wordswapon = tc_wordswapon;
+
+   if (base_img) {
+   drv_datap-base_img = kmalloc(strlen(base_img) + 1, GFP_KERNEL);
+   if (!drv_datap-base_img) {
+   err = -ENOMEM;
+   goto err2;
+   }
+   strncpy(drv_datap-base_img, base_img, strlen(base_img) + 1);
+   }
+
+   dev_set_drvdata(bridge, drv_datap);
+
+   if (shm_size  0x1) {   /* 64 KB */
+   err = -EINVAL;
+   pr_err(%s: shm size must be at least 64 KB\n, __func__);
+   goto err3;
+   }
+   dev_dbg(bridge, %s: requested shm_size = 0x%x\n, __func__, shm_size);
+
+   phys_membase = pdata-phys_mempool_base;
+   phys_memsize = pdata-phys_mempool_size;
+   if (phys_membase  0  phys_memsize  0)
+   mem_ext_phys_pool_init(phys_membase, phys_memsize);
+
+   if (tc_wordswapon)
+   dev_dbg(bridge, %s: TC Word Swap is enabled\n, __func__);
+
+   driver_context = dsp_init(err);
+   if (err) {
+   pr_err(DSP Bridge driver initialization failed\n);
+   goto err4;
+   }
+
+   return 0;
+
+err4:
+   mem_ext_phys_pool_release();
+err3:
+   kfree(drv_datap-base_img);
+err2:
+   kfree(drv_datap);
+err1:
+#ifdef CONFIG_BRIDGE_DVFS
+   cpufreq_unregister_notifier(iva_clk_notifier,
+   CPUFREQ_TRANSITION_NOTIFIER);
+#endif
+   dsp_clk_exit();
+   services_exit();
+
+   return err;
+}
+
 static int __devinit omap34_xx_bridge_probe(struct platform_device *pdev)
 {
int status;
-   u32 init_status = 0;
dev_t dev = 0;
int result;
 #ifdef CONFIG_BRIDGE_DVFS
int i = 0;
 #endif
-   struct dspbridge_platform_data *pdata = pdev-dev.platform_data;
-   struct drv_data *drv_datap = NULL;
 
omap_dspbridge_dev = pdev;
 
/* Global bridge device */
bridge = omap_dspbridge_dev-dev;
 
+   /* Bridge low level initializations */
+   status = omap3_bridge_startup(pdev);
+   if (status)
+   goto err1;
+
/* use 2.6 device model */
result = alloc_chrdev_region(dev, 0, 1, driver_name);
if (result  0) {
@@ -277,76 +379,6 @@ static int __devinit omap34_xx_bridge_probe(struct 
platform_device *pdev)
device_create(bridge_class, NULL, MKDEV(driver_major, 0),
  NULL, DspBridge);
 
-#ifdef CONFIG_PM
-   /* Initialize the wait queue */
-   if (!status) {
-   bridge_suspend_data.suspended = 0

[PATCH 2/2] DSPBRIDGE: reorganize probe function

2010-06-08 Thread Omar Ramirez Luna
Renaming and deleting unused variables, few enhancement on
error path.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |   28 +++-
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index f80b15b..16a74c4 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -335,9 +335,8 @@ err1:
 
 static int __devinit omap34_xx_bridge_probe(struct platform_device *pdev)
 {
-   int status;
+   int err;
dev_t dev = 0;
-   int result;
 #ifdef CONFIG_BRIDGE_DVFS
int i = 0;
 #endif
@@ -348,43 +347,46 @@ static int __devinit omap34_xx_bridge_probe(struct 
platform_device *pdev)
bridge = omap_dspbridge_dev-dev;
 
/* Bridge low level initializations */
-   status = omap3_bridge_startup(pdev);
-   if (status)
+   err = omap3_bridge_startup(pdev);
+   if (err)
goto err1;
 
/* use 2.6 device model */
-   result = alloc_chrdev_region(dev, 0, 1, driver_name);
-   if (result  0) {
+   err = alloc_chrdev_region(dev, 0, 1, driver_name);
+   if (err) {
pr_err(%s: Can't get major %d\n, __func__, driver_major);
goto err1;
}
 
-   driver_major = MAJOR(dev);
-
cdev_init(bridge_cdev, bridge_fops);
bridge_cdev.owner = THIS_MODULE;
 
-   status = cdev_add(bridge_cdev, dev, 1);
-   if (status) {
+   err = cdev_add(bridge_cdev, dev, 1);
+   if (err) {
pr_err(%s: Failed to add bridge device\n, __func__);
goto err2;
}
 
/* udev support */
bridge_class = class_create(THIS_MODULE, ti_bridge);
-
-   if (IS_ERR(bridge_class))
+   if (IS_ERR(bridge_class)) {
pr_err(%s: Error creating bridge class\n, __func__);
+   goto err3;
+   }
 
+   driver_major = MAJOR(dev);
device_create(bridge_class, NULL, MKDEV(driver_major, 0),
  NULL, DspBridge);
+   pr_info(DSP Bridge driver loaded\n);
 
return 0;
 
+err3:
+   cdev_del(bridge_cdev);
 err2:
unregister_chrdev_region(dev, 1);
 err1:
-   return result;
+   return err;
 }
 
 static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] DSPBRIDGE: fix a wrong clk index for gpt8

2010-06-10 Thread Omar Ramirez Luna
Mismatch between index for gpt clocks will result in writting
out of bounds into dsp clock timer array when requesting gpt8,
for the other gpt the bogus code is being masked as it falls
within the array's range.

Discovered-by: Ernesto Ramos Falcon erne...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/core/dsp-clock.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/core/dsp-clock.c 
b/drivers/dsp/bridge/core/dsp-clock.c
index 4613de9..dba0535 100644
--- a/drivers/dsp/bridge/core/dsp-clock.c
+++ b/drivers/dsp/bridge/core/dsp-clock.c
@@ -212,7 +212,8 @@ int dsp_clk_enable(IN enum dsp_clk_id clk_id)
clk_enable(iva2_clk);
break;
case GPT_CLK:
-   timer[clk_id] = omap_dm_timer_request_specific(DMT_ID(clk_id));
+   timer[clk_id - 1] =
+   omap_dm_timer_request_specific(DMT_ID(clk_id));
break;
case MCBSP_CLK:
mcbsp_clk_prepare(true, clk_id);
@@ -287,7 +288,7 @@ int dsp_clk_disable(IN enum dsp_clk_id clk_id)
clk_disable(iva2_clk);
break;
case GPT_CLK:
-   omap_dm_timer_free(timer[clk_id]);
+   omap_dm_timer_free(timer[clk_id - 1]);
break;
case MCBSP_CLK:
mcbsp_clk_prepare(false, clk_id);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] DSPBRIDGE: reorganize gpt8 overflow handling

2010-06-10 Thread Omar Ramirez Luna
New function to encapsulate previous code to configure gpt overflow,
this prevents accessing dmtimer framework outside dsp-clock interface
or exposing clock handles to other bridge modules.

Besides that: duplicated and unused defines were removed, conditional
test for cnt was replaced for a time after jiffes macro.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
Signed-off-by: Ernesto Ramos Falcon erne...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/clk.h |2 +
 drivers/dsp/bridge/core/dsp-clock.c|   38 ++
 drivers/dsp/bridge/core/ue_deh.c   |   59 ++-
 3 files changed, 45 insertions(+), 54 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/clk.h 
b/arch/arm/plat-omap/include/dspbridge/clk.h
index 0814e92..61474bc 100644
--- a/arch/arm/plat-omap/include/dspbridge/clk.h
+++ b/arch/arm/plat-omap/include/dspbridge/clk.h
@@ -62,6 +62,8 @@ extern void dsp_clk_exit(void);
  */
 extern void dsp_clk_init(void);
 
+void dsp_gpt_wait_overflow(short int clk_id, unsigned int load);
+
 /*
  *   dsp_clk_enable 
  *  Purpose:
diff --git a/drivers/dsp/bridge/core/dsp-clock.c 
b/drivers/dsp/bridge/core/dsp-clock.c
index dba0535..dde63bd 100644
--- a/drivers/dsp/bridge/core/dsp-clock.c
+++ b/drivers/dsp/bridge/core/dsp-clock.c
@@ -192,6 +192,44 @@ static void mcbsp_clk_prepare(bool flag, u8 id)
}
 }
 
+/**
+ * dsp_gpt_wait_overflow - set gpt overflow and wait for fixed timeout
+ * @clk_id:  GP Timer clock id.
+ * @load:Overflow value.
+ *
+ * Sets an overflow interrupt for the desired GPT waiting for a timeout
+ * of 5 msecs for the interrupt to occur.
+ */
+void dsp_gpt_wait_overflow(short int clk_id, unsigned int load)
+{
+   struct omap_dm_timer *gpt = timer[clk_id - 1];
+   unsigned long timeout;
+
+   if (!gpt)
+   return;
+
+   /* Enable overflow interrupt */
+   omap_dm_timer_set_int_enable(gpt, OMAP_TIMER_INT_OVERFLOW);
+
+   /*
+* Set counter value to overflow counter after
+* one tick and start timer.
+*/
+   omap_dm_timer_set_load_start(gpt, 0, load);
+
+   /* Wait 80us for timer to overflow */
+   udelay(80);
+
+   timeout = msecs_to_jiffies(5);
+   /* Check interrupt status and wait for interrupt */
+   while (!(omap_dm_timer_read_status(gpt)  OMAP_TIMER_INT_OVERFLOW)) {
+   if (time_is_after_jiffies(timeout)) {
+   pr_err(%s: GPTimer interrupt failed\n, __func__);
+   break;
+   }
+   }
+}
+
 /*
  *   dsp_clk_enable 
  *  Purpose:
diff --git a/drivers/dsp/bridge/core/ue_deh.c b/drivers/dsp/bridge/core/ue_deh.c
index fa0cc71..cf084cf 100644
--- a/drivers/dsp/bridge/core/ue_deh.c
+++ b/drivers/dsp/bridge/core/ue_deh.c
@@ -18,7 +18,6 @@
 
 /*  --- Host OS */
 #include dspbridge/host_os.h
-#include plat/dmtimer.h
 
 /*  --- DSP/BIOS Bridge */
 #include dspbridge/std.h
@@ -29,6 +28,7 @@
 
 /*  --- OS Adaptation Layer */
 #include dspbridge/cfg.h
+#include dspbridge/clk.h
 #include dspbridge/ntfy.h
 #include dspbridge/drv.h
 
@@ -54,13 +54,6 @@
 
 #define ALIGN_DOWN(x, a)  ((x)(~((a)-1)))
 
-/* GP Timer number to trigger interrupt for MMU-fault ISR on DSP */
-#define GPTIMER_FOR_DSP_MMU_FAULT  8
-/* Bit mask to enable overflow interrupt */
-#define GPTIMER_IRQ_OVERFLOW   2
-/* Max time to check for GP Timer IRQ */
-#define GPTIMER_IRQ_WAIT_MAX_CNT   1000
-
 static struct hw_mmu_map_attrs_t map_attrs = { HW_LITTLE_ENDIAN,
HW_ELEM_SIZE16BIT,
HW_MMU_CPUES
@@ -123,17 +116,7 @@ err:
/* If create failed, cleanup */
bridge_deh_destroy(deh_mgr);
deh_mgr = NULL;
-   } else {
-   timer = omap_dm_timer_request_specific(
-   GPTIMER_FOR_DSP_MMU_FAULT);
-   if (timer) {
-   omap_dm_timer_disable(timer);
-   } else {
-   pr_err(%s: GPTimer not available\n, __func__);
-   return -ENODEV;
-   }
}
-
 leave:
*ret_deh_mgr = deh_mgr;
 
@@ -161,10 +144,6 @@ int bridge_deh_destroy(struct deh_mgr *deh_mgr)
/* Deallocate the DEH manager object */
kfree(deh_mgr);
 
-   /* The GPTimer is no longer needed */
-   omap_dm_timer_free(timer);
-   timer = NULL;
-
return 0;
 }
 
@@ -194,7 +173,6 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo)
u32 hw_mmu_max_tlb_count = 31;
struct cfg_hostres *resources;
hw_status hw_status_obj;
-   u32 cnt = 0;
 
if (!deh_mgr)
return;
@@ -253,42 +231,15 @@ void bridge_deh_notify(struct deh_mgr *deh_mgr, u32 
ulEventMask, u32 dwErrInfo

[PATCH] DSPBRIDGE: driver version 0.3

2010-06-14 Thread Omar Ramirez Luna
driver version 0.3

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index cdc7f1b..f0f089b 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -69,7 +69,7 @@
 #define BRIDGE_NAME C6410
 /*  --- Globals */
 #define DRIVER_NAME  DspBridge
-#define DSPBRIDGE_VERSION  0.2
+#define DSPBRIDGE_VERSION  0.3
 s32 dsp_debug;
 
 struct platform_device *omap_dspbridge_dev;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] staging: ti dspbridge: enable driver building

2010-07-06 Thread Omar Ramirez Luna

On 7/4/2010 5:53 AM, Felipe Contreras wrote:

On Thu, Jun 24, 2010 at 1:41 AM, Greg KHg...@kroah.com  wrote:

The default is always 'n' so you don't need this.

Also, this enables the driver to be built on x86, which fails horribly,
and I don't think is what you really want to have happen :)

So I need some more Kconfig changes here, care to redo just this one
patch?  I've applied all the others and they will show up in linux-next
tomorrow.


I fixed all that stuff some time ago:
http://article.gmane.org/gmane.linux.ports.arm.omap/36065

But the patches were ignored.


Patches were not ignored, discussion was held privately (you and me), 
patch 13 was not accepted because changing indentation doesn't deserve a 
copyright assignment (IMHO), at that point *you* wanted your patches not 
to be included if the last one wasn't merged in.


- omar

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] staging: tidspbridge: remove GlobalTypes.h

2010-07-22 Thread Omar Ramirez Luna
From: Menon, Nishanth n...@ti.com

Remove custom globaltypes.h header

Signed-off-by: Nishanth Menon n...@ti.com
---
 drivers/staging/tidspbridge/hw/GlobalTypes.h |  291 --
 drivers/staging/tidspbridge/hw/MMURegAcM.h   |1 -
 drivers/staging/tidspbridge/hw/hw_defs.h |2 -
 drivers/staging/tidspbridge/hw/hw_mmu.c  |   32 ---
 4 files changed, 0 insertions(+), 326 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/hw/GlobalTypes.h

diff --git a/drivers/staging/tidspbridge/hw/GlobalTypes.h 
b/drivers/staging/tidspbridge/hw/GlobalTypes.h
deleted file mode 100644
index 4d142a1..000
--- a/drivers/staging/tidspbridge/hw/GlobalTypes.h
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * GlobalTypes.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Global HW definitions
- *
- * Copyright (C) 2007 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 _GLOBALTYPES_H
-#define _GLOBALTYPES_H
-
-/*
- * Definition: RET_CODE_BASE
- *
- * DESCRIPTION:  Base value for return code offsets
- */
-#define RET_CODE_BASE  0
-
-/*
- * Definition: *BIT_OFFSET
- *
- * DESCRIPTION:  offset in bytes from start of 32-bit word.
- */
-#define LOWER16BIT_OFFSET0
-#define UPPER16BIT_OFFSET2
-
-#define LOWER8BIT_OFFSET  0
-#define LOWER_MIDDLE8BIT_OFFSET1
-#define UPPER_MIDDLE8BIT_OFFSET2
-#define UPPER8BIT_OFFSET  3
-
-#define LOWER8BIT_OF16_OFFSET  0
-#define UPPER8BIT_OF16_OFFSET  1
-
-/*
- * Definition: *BIT_SHIFT
- *
- * DESCRIPTION:  offset in bits from start of 32-bit word.
- */
-#define LOWER16BIT_SHIFT 0
-#define UPPER16BIT_SHIFT 16
-
-#define LOWER8BIT_SHIFT   0
-#define LOWER_MIDDLE8BIT_SHIFT8
-#define UPPER_MIDDLE8BIT_SHIFT16
-#define UPPER8BIT_SHIFT   24
-
-#define LOWER8BIT_OF16_SHIFT  0
-#define UPPER8BIT_OF16_SHIFT  8
-
-/*
- * Definition: LOWER16BIT_MASK
- *
- * DESCRIPTION: 16 bit mask used for inclusion of lower 16 bits i.e. mask out
- * the upper 16 bits
- */
-#define LOWER16BIT_MASK0x
-
-/*
- * Definition: LOWER8BIT_MASK
- *
- * DESCRIPTION: 8 bit masks used for inclusion of 8 bits i.e. mask out
- * the upper 16 bits
- */
-#define LOWER8BIT_MASK0x00FF
-
-/*
- * Definition: RETURN32BITS_FROM16LOWER_AND16UPPER(lower16_bits, upper16_bits)
- *
- * DESCRIPTION: Returns a 32 bit value given a 16 bit lower value and a 16
- * bit upper value
- */
-#define RETURN32BITS_FROM16LOWER_AND16UPPER(lower16_bits, upper16_bits)\
-(u32)lower16_bits)   LOWER16BIT_MASK)) | \
- (u32)upper16_bits)  LOWER16BIT_MASK)  UPPER16BIT_SHIFT)))
-
-/*
- * Definition: RETURN16BITS_FROM8LOWER_AND8UPPER(lower16_bits, upper16_bits)
- *
- * DESCRIPTION:  Returns a 16 bit value given a 8 bit lower value and a 8
- *bit upper value
- */
-#define RETURN16BITS_FROM8LOWER_AND8UPPER(lower8_bits, upper8_bits)\
-(u32)lower8_bits)   LOWER8BIT_MASK)) | \
- (u32)upper8_bits)  LOWER8BIT_MASK)  UPPER8BIT_OF16_SHIFT)))
-
-/*
- * Definition: RETURN32BITS_FROM48BIT_VALUES(lower8_bits, lower_middle8_bits,
- * lower_upper8_bits, upper8_bits)
- *
- * DESCRIPTION:  Returns a 32 bit value given four 8 bit values
- */
-#define RETURN32BITS_FROM48BIT_VALUES(lower8_bits, lower_middle8_bits,\
-   lower_upper8_bits, upper8_bits)\
-   (u32)lower8_bits)  LOWER8BIT_MASK)) | \
-   (u32)lower_middle8_bits)  LOWER8BIT_MASK) \
-   LOWER_MIDDLE8BIT_SHIFT)) | \
-   (u32)lower_upper8_bits)  LOWER8BIT_MASK) \
-   UPPER_MIDDLE8BIT_SHIFT)) | \
-   (u32)upper8_bits)  LOWER8BIT_MASK) \
-   UPPER8BIT_SHIFT)))
-
-/*
- * Definition: READ_LOWER16BITS_OF32(value32bits)
- *
- * DESCRIPTION:  Returns a 16 lower bits of 32bit value
- */
-#define READ_LOWER16BITS_OF32(value32bits)\
-((u16)((u32)(value32bits)  LOWER16BIT_MASK))
-
-/*
- * Definition: READ_UPPER16BITS_OF32(value32bits)
- *
- * DESCRIPTION:  Returns a 16 lower bits of 32bit value
- */
-#define READ_UPPER16BITS_OF32(value32bits)\
-   (((u16)((u32)(value32bits)  UPPER16BIT_SHIFT)) \
-   LOWER16BIT_MASK)
-
-/*
- * Definition: READ_LOWER8BITS_OF32(value32bits)
- *
- * DESCRIPTION:  Returns a 8 lower bits of 32bit value
- */
-#define READ_LOWER8BITS_OF32(value32bits)\
-((u8)((u32)(value32bits)  LOWER8BIT_MASK))
-
-/*
- * Definition: READ_LOWER_MIDDLE8BITS_OF32(value32bits)
- *
- * DESCRIPTION:  Returns a 8 lower middle bits of 32bit value
- */
-#define 

[PATCH 6/6] staging: tidspbridge: remove dbdefs.h

2010-07-22 Thread Omar Ramirez Luna
From: Menon, Nishanth n...@ti.com

Remove yet another custom definition header

Signed-off-by: Nishanth Menon n...@ti.com
---
 .../staging/tidspbridge/include/dspbridge/dbdefs.h |1 -
 .../staging/tidspbridge/include/dspbridge/dbtype.h |   69 
 .../tidspbridge/include/dspbridge/host_os.h|1 -
 3 files changed, 0 insertions(+), 71 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/dbtype.h

diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h 
b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h
index a815b67..8f84735 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/dbdefs.h
@@ -21,7 +21,6 @@
 
 #include linux/types.h
 
-#include dspbridge/dbtype.h  /* GPP side type definitions */
 #include dspbridge/rms_sh.h  /* Types shared between GPP and DSP */
 
 #define PG_SIZE4K 4096
diff --git a/drivers/staging/tidspbridge/include/dspbridge/dbtype.h 
b/drivers/staging/tidspbridge/include/dspbridge/dbtype.h
deleted file mode 100644
index ca5eaf8..000
--- a/drivers/staging/tidspbridge/include/dspbridge/dbtype.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * dbtype.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * This header defines data types for DSP/BIOS Bridge APIs and device
- * driver modules. It also defines the Hungarian prefix to use for each
- * base type.
- *
- * Copyright (C) 2008 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 DBTYPE_
-#define DBTYPE_
-
-/*===*/
-/*  Argument specification syntax */
-/*===*/
-
-#ifndef IN
-#define IN /* Following parameter is for input. */
-#endif
-
-#ifndef OUT
-#define OUT/* Following parameter is for output. */
-#endif
-
-#ifndef OPTIONAL
-#define OPTIONAL   /* Function may optionally use previous parameter. */
-#endif
-
-#ifndef CONST
-#define CONST   const
-#endif
-
-/*===*/
-/*  NULL character   (normally used for string termination) */
-/*===*/
-
-#ifndef NULL_CHAR
-#define NULL_CHAR'\0'  /* Null character. */
-#endif
-
-/*===*/
-/*  Basic Type definitions (with Prefixes for Hungarian notation) */
-/*===*/
-
-#ifndef OMAPBRIDGE_TYPES
-#define OMAPBRIDGE_TYPES
-typedef volatile unsigned short reg_uword16;
-#endif
-
-#define TEXT(x) x
-
-#define DLLIMPORT
-#define DLLEXPORT
-
-/* Define DSPAPIDLL correctly in dspapi.h */
-#define _DSPSYSDLL32_
-
-#endif /* DBTYPE_ */
diff --git a/drivers/staging/tidspbridge/include/dspbridge/host_os.h 
b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
index a91c136..6b4feb4 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/host_os.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/host_os.h
@@ -42,7 +42,6 @@
 #include linux/vmalloc.h
 #include linux/ioport.h
 #include linux/platform_device.h
-#include dspbridge/dbtype.h
 #include plat/clock.h
 #include linux/clk.h
 #include plat/mailbox.h
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] staging: tidspbridge: replace CONST with c standard const

2010-07-22 Thread Omar Ramirez Luna
From: Menon, Nishanth n...@ti.com

Signed-off-by: Nishanth Menon n...@ti.com
---
 drivers/staging/tidspbridge/core/chnl_sm.c |4 ++--
 drivers/staging/tidspbridge/core/io_sm.c   |2 +-
 drivers/staging/tidspbridge/core/msg_sm.c  |2 +-
 drivers/staging/tidspbridge/core/tiomap3430.c  |2 +-
 .../staging/tidspbridge/include/dspbridge/chnl.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/cmm.h|2 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|2 +-
 .../staging/tidspbridge/include/dspbridge/dev.h|8 
 .../staging/tidspbridge/include/dspbridge/disp.h   |4 ++--
 .../staging/tidspbridge/include/dspbridge/dmm.h|2 +-
 .../tidspbridge/include/dspbridge/dspchnl.h|4 ++--
 .../tidspbridge/include/dspbridge/dspdefs.h|   10 +-
 .../staging/tidspbridge/include/dspbridge/dspio.h  |2 +-
 .../staging/tidspbridge/include/dspbridge/dspmsg.h |2 +-
 drivers/staging/tidspbridge/include/dspbridge/io.h |2 +-
 .../staging/tidspbridge/include/dspbridge/nldr.h   |4 ++--
 .../tidspbridge/include/dspbridge/nldrdefs.h   |4 ++--
 .../staging/tidspbridge/include/dspbridge/node.h   |   10 +-
 .../staging/tidspbridge/include/dspbridge/proc.h   |6 +++---
 .../staging/tidspbridge/include/dspbridge/pwr.h|4 ++--
 drivers/staging/tidspbridge/pmgr/chnl.c|2 +-
 drivers/staging/tidspbridge/pmgr/cmm.c |2 +-
 drivers/staging/tidspbridge/pmgr/cod.c |4 ++--
 drivers/staging/tidspbridge/pmgr/dev.c |4 ++--
 drivers/staging/tidspbridge/pmgr/dmm.c |2 +-
 drivers/staging/tidspbridge/pmgr/dspapi.c  |2 +-
 drivers/staging/tidspbridge/pmgr/io.c  |2 +-
 drivers/staging/tidspbridge/rmgr/disp.c|4 ++--
 drivers/staging/tidspbridge/rmgr/nldr.c|4 ++--
 drivers/staging/tidspbridge/rmgr/node.c|   14 +++---
 drivers/staging/tidspbridge/rmgr/proc.c|8 
 drivers/staging/tidspbridge/rmgr/pwr.c |4 ++--
 32 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/chnl_sm.c 
b/drivers/staging/tidspbridge/core/chnl_sm.c
index db106f3..39e9691 100644
--- a/drivers/staging/tidspbridge/core/chnl_sm.c
+++ b/drivers/staging/tidspbridge/core/chnl_sm.c
@@ -383,7 +383,7 @@ func_cont:
  */
 int bridge_chnl_create(OUT struct chnl_mgr **channel_mgr,
  struct dev_object *hdev_obj,
- IN CONST struct chnl_mgrattrs *mgr_attrts)
+ IN const struct chnl_mgrattrs *mgr_attrts)
 {
int status = 0;
struct chnl_mgr *chnl_mgr_obj = NULL;
@@ -777,7 +777,7 @@ int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 
timeout,
  */
 int bridge_chnl_open(OUT struct chnl_object **chnl,
struct chnl_mgr *hchnl_mgr, s8 chnl_mode,
-   u32 ch_id, CONST IN struct chnl_attr *pattrs)
+   u32 ch_id, const IN struct chnl_attr *pattrs)
 {
int status = 0;
struct chnl_mgr *chnl_mgr_obj = hchnl_mgr;
diff --git a/drivers/staging/tidspbridge/core/io_sm.c 
b/drivers/staging/tidspbridge/core/io_sm.c
index 31b623a..27f4481 100644
--- a/drivers/staging/tidspbridge/core/io_sm.c
+++ b/drivers/staging/tidspbridge/core/io_sm.c
@@ -163,7 +163,7 @@ static int register_shm_segs(struct io_mgr *hio_mgr,
  */
 int bridge_io_create(OUT struct io_mgr **io_man,
struct dev_object *hdev_obj,
-   IN CONST struct io_attrs *mgr_attrts)
+   IN const struct io_attrs *mgr_attrts)
 {
int status = 0;
struct io_mgr *pio_mgr = NULL;
diff --git a/drivers/staging/tidspbridge/core/msg_sm.c 
b/drivers/staging/tidspbridge/core/msg_sm.c
index a86f0ce..6434854 100644
--- a/drivers/staging/tidspbridge/core/msg_sm.c
+++ b/drivers/staging/tidspbridge/core/msg_sm.c
@@ -383,7 +383,7 @@ func_end:
  *  Put a message onto a msg_ctrl queue.
  */
 int bridge_msg_put(struct msg_queue *msg_queue_obj,
- IN CONST struct dsp_msg *pmsg, u32 utimeout)
+ IN const struct dsp_msg *pmsg, u32 utimeout)
 {
struct msg_frame *msg_frame_obj;
struct msg_mgr *hmsg_mgr;
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c 
b/drivers/staging/tidspbridge/core/tiomap3430.c
index 745e1a5..428389b 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -237,7 +237,7 @@ static void bad_page_dump(u32 pa, struct page *pg)
  *  Bridge Driver entry point.
  */
 void bridge_drv_entry(OUT struct bridge_drv_interface **drv_intf,
-  IN CONST char *driver_file_name)
+  IN const char *driver_file_name)
 {
 
DBC_REQUIRE(driver_file_name != NULL);
diff 

[PATCH v2 0/6] staging: tidspbridge: header cleanup series

2010-07-22 Thread Omar Ramirez Luna
Rebased version of the patches that couldn't be applied.

Original set:
[1] http://marc.info/?l=linux-kernelm=127897548706686w=2
[2] http://marc.info/?l=linux-kernelm=127982129204138w=2

Fixed unexpected change while replacing IN modifier
[3] http://marc.info/?l=linux-kernelm=127972475532227w=2

Menon, Nishanth (6):
  staging: tidspbridge: remove GlobalTypes.h
  staging: tidspbridge: replace CONST with c standard const
  staging: tidspbridge: remove IN modifier
  staging: tidspbridge: remove OPTIONAL
  staging: tidspbridge: remove OUT define
  staging: tidspbridge: remove dbdefs.h

 drivers/staging/tidspbridge/core/_tiomap_pwr.h |   14 +-
 drivers/staging/tidspbridge/core/chnl_sm.c |   20 +-
 drivers/staging/tidspbridge/core/dsp-clock.c   |4 +-
 drivers/staging/tidspbridge/core/io_sm.c   |   26 +-
 drivers/staging/tidspbridge/core/msg_sm.c  |6 +-
 drivers/staging/tidspbridge/core/tiomap3430.c  |   28 +-
 drivers/staging/tidspbridge/core/tiomap3430_pwr.c  |   14 +-
 drivers/staging/tidspbridge/core/tiomap_io.c   |6 +-
 drivers/staging/tidspbridge/core/tiomap_io.h   |   14 +-
 drivers/staging/tidspbridge/dynload/cload.c|2 +-
 .../tidspbridge/dynload/tramp_table_c6000.c|2 +-
 drivers/staging/tidspbridge/gen/uuidutil.c |6 +-
 drivers/staging/tidspbridge/hw/GlobalTypes.h   |  291 
 drivers/staging/tidspbridge/hw/MMURegAcM.h |1 -
 drivers/staging/tidspbridge/hw/hw_defs.h   |2 -
 drivers/staging/tidspbridge/hw/hw_mmu.c|   32 ---
 .../staging/tidspbridge/include/dspbridge/cfg.h|   28 +-
 .../staging/tidspbridge/include/dspbridge/chnl.h   |4 +-
 .../staging/tidspbridge/include/dspbridge/clk.h|4 +-
 .../staging/tidspbridge/include/dspbridge/cmm.h|   14 +-
 .../staging/tidspbridge/include/dspbridge/cod.h|   20 +-
 .../staging/tidspbridge/include/dspbridge/dbdcd.h  |   74 +++---
 .../tidspbridge/include/dspbridge/dbdcddef.h   |6 +-
 .../staging/tidspbridge/include/dspbridge/dbdefs.h |1 -
 .../staging/tidspbridge/include/dspbridge/dbtype.h |   69 -
 .../staging/tidspbridge/include/dspbridge/dev.h|   46 ++--
 .../staging/tidspbridge/include/dspbridge/disp.h   |8 +-
 .../staging/tidspbridge/include/dspbridge/dmm.h|6 +-
 .../staging/tidspbridge/include/dspbridge/drv.h|   12 +-
 .../tidspbridge/include/dspbridge/dspapi-ioctl.h   |2 +-
 .../tidspbridge/include/dspbridge/dspchnl.h|   16 +-
 .../tidspbridge/include/dspbridge/dspdefs.h|   44 ++--
 .../staging/tidspbridge/include/dspbridge/dspdrv.h |2 +-
 .../staging/tidspbridge/include/dspbridge/dspio.h  |8 +-
 .../staging/tidspbridge/include/dspbridge/dspmsg.h |6 +-
 .../tidspbridge/include/dspbridge/host_os.h|1 -
 drivers/staging/tidspbridge/include/dspbridge/io.h |4 +-
 .../staging/tidspbridge/include/dspbridge/io_sm.h  |   10 +-
 .../staging/tidspbridge/include/dspbridge/mgr.h|   16 +-
 .../staging/tidspbridge/include/dspbridge/msg.h|2 +-
 .../staging/tidspbridge/include/dspbridge/nldr.h   |   12 +-
 .../tidspbridge/include/dspbridge/nldrdefs.h   |   10 +-
 .../staging/tidspbridge/include/dspbridge/node.h   |   40 ++--
 .../tidspbridge/include/dspbridge/nodepriv.h   |2 +-
 .../staging/tidspbridge/include/dspbridge/proc.h   |   18 +-
 .../staging/tidspbridge/include/dspbridge/pwr.h|8 +-
 .../staging/tidspbridge/include/dspbridge/strm.h   |   22 +-
 .../tidspbridge/include/dspbridge/uuidutil.h   |6 +-
 drivers/staging/tidspbridge/pmgr/chnl.c|4 +-
 drivers/staging/tidspbridge/pmgr/cmm.c |   14 +-
 drivers/staging/tidspbridge/pmgr/cod.c |   18 +-
 drivers/staging/tidspbridge/pmgr/dev.c |   36 ++--
 drivers/staging/tidspbridge/pmgr/dmm.c |6 +-
 drivers/staging/tidspbridge/pmgr/dspapi.c  |4 +-
 drivers/staging/tidspbridge/pmgr/io.c  |4 +-
 drivers/staging/tidspbridge/pmgr/msg.c |2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c   |   94 
 drivers/staging/tidspbridge/rmgr/disp.c|   10 +-
 drivers/staging/tidspbridge/rmgr/drv.c |6 +-
 drivers/staging/tidspbridge/rmgr/dspdrv.c  |2 +-
 drivers/staging/tidspbridge/rmgr/mgr.c |   14 +-
 drivers/staging/tidspbridge/rmgr/nldr.c|   22 +-
 drivers/staging/tidspbridge/rmgr/node.c|   44 ++--
 drivers/staging/tidspbridge/rmgr/proc.c|   18 +-
 drivers/staging/tidspbridge/rmgr/pwr.c |8 +-
 drivers/staging/tidspbridge/rmgr/strm.c|   18 +-
 drivers/staging/tidspbridge/services/cfg.c |8 +-
 67 files changed, 462 insertions(+), 859 deletions(-)
 delete mode 100644 drivers/staging/tidspbridge/hw/GlobalTypes.h
 delete mode 100644 drivers/staging/tidspbridge/include/dspbridge/dbtype.h

--
To unsubscribe 

[RESEND][PATCH] DSPBRIDGE: Replacing custom implementation for Mapping

2009-04-21 Thread Omar Ramirez Luna
From: Omar Ramirez Luna x0084...@ti.com

Currently, we walk through the entire page table
translating the addresses from virtual to physical
whenever we map a buffer. This custom implementation
is meant to be optimized for performance, but it bypasses
the standard memory management subsystem.

This patch removes the custom implementation and uses
the kernel APIs to get the virtual to physical maps.

Map times for DMM

 Buffer | Kernel APIs  | Custom Implement. |
  Size  | time (usec)  |time (usec)|
  4  KB | 427  |396|
 64  KB |1038  |824|
  1  MB |9827  |   7110|
  4  MB |   37811  |  26916|
  6  MB |   56366  |  39978|

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Omar Ramirez Luna x0084...@ti.com
---
 drivers/dsp/bridge/wmd/tiomap3430.c |  491 +++
 1 files changed, 149 insertions(+), 342 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index df350c6..ff0db9a 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -1,4 +1,3 @@
-
 /*
  * tiomap.c
  *
@@ -133,9 +132,7 @@ static DSP_STATUS WMD_DEV_Create(OUT struct WMD_DEV_CONTEXT 
**ppDevContext,
 static DSP_STATUS WMD_DEV_Ctrl(struct WMD_DEV_CONTEXT *pDevContext, u32 dwCmd,
IN OUT void *pArgs);
 static DSP_STATUS WMD_DEV_Destroy(struct WMD_DEV_CONTEXT *pDevContext);
-static DSP_STATUS TIOMAP_VirtToPhysical(struct mm_struct *mm, u32 ulMpuAddr,
-   u32 ulNumBytes, u32 *numOfTableEntries,
-   u32 *physicalAddrTable);
+static u32 user_va2pa(struct mm_struct *mm, u32 address);
 static DSP_STATUS PteUpdate(struct WMD_DEV_CONTEXT *hDevContext, u32 pa,
u32 va, u32 size,
struct HW_MMUMapAttrs_t *mapAttrs);
@@ -270,6 +267,21 @@ static inline void flush_all(struct WMD_DEV_CONTEXT 
*pDevContext)
tlb_flush_all(pDevContext-dwDSPMmuBase);
 }
 
+void badpagedump(u32 pa, struct page *pg)
+{
+   printk(KERN_EMERG DSPBRIDGE:MAP  function: COUNT 0 FOR PA 0x%x\n, pa);
+   printk(KERN_EMERG Bad page state in process '%s'\n
+   page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n
+   Trying to fix it up, but a reboot is needed\n
+   Backtrace:\n,
+   current-comm, pg, (int)(2*sizeof(unsigned long)),
+   (unsigned long)pg-flags, pg-mapping,
+   page_mapcount(pg), page_count(pg));
+   dump_stack();
+   BUG_ON(1);
+
+}
+
 /*
  *   WMD_DRV_Entry 
  *  purpose:
@@ -1352,11 +1364,16 @@ static DSP_STATUS WMD_BRD_MemMap(struct WMD_DEV_CONTEXT 
*hDevContext,
DSP_STATUS status = DSP_SOK;
struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
struct HW_MMUMapAttrs_t hwAttrs;
-   u32 numOfActualTabEntries = 0;
-   u32 *pPhysAddrPageTbl = NULL;
struct vm_area_struct *vma;
struct mm_struct *mm = current-mm;
-   u32 temp = 0;
+   u32  write = 0;
+   u32 numUsrPgs = 0;
+   struct page *mappedPage, *pg;
+   s32 pgNum;
+   u32 va = ulVirtAddr;
+   struct task_struct *curr_task = current;
+   u32 pgI = 0;
+   u32 mpuAddr, pa;
 
DBG_Trace(DBG_ENTER,  WMD_BRD_MemMap hDevContext %x, pa %x, va %x, 
 size %x, ulMapAttr %x\n, hDevContext, ulMpuAddr, ulVirtAddr,
@@ -1424,7 +1441,6 @@ static DSP_STATUS WMD_BRD_MemMap(struct WMD_DEV_CONTEXT 
*hDevContext,
 * virtual memory address space in order to be of use to us here!  */
down_read(mm-mmap_sem);
vma = find_vma(mm, ulMpuAddr);
-   up_read(mm-mmap_sem);
if (vma)
DBG_Trace(DBG_LEVEL6, VMAfor UserBuf: ulMpuAddr=%x, 
ulNumBytes=%x, vm_start=%x vm_end=%x vm_flags=%x \n,
@@ -1436,9 +1452,7 @@ static DSP_STATUS WMD_BRD_MemMap(struct WMD_DEV_CONTEXT 
*hDevContext,
 * user buffer is covered */
while ((vma != NULL)  (ulMpuAddr + ulNumBytes  vma-vm_end)) {
/* jump to the next VMA region */
-   down_read(mm-mmap_sem);
vma = find_vma(mm, vma-vm_end + 1);
-   up_read(mm-mmap_sem);
DBG_Trace(DBG_LEVEL6, VMAfor UserBuf ulMpuAddr=%x, 
ulNumBytes=%x, vm_start=%x vm_end=%x vm_flags=%x\n,
ulMpuAddr, ulNumBytes, vma-vm_start,
@@ -1449,44 +1463,100 @@ static DSP_STATUS WMD_BRD_MemMap(struct 
WMD_DEV_CONTEXT *hDevContext,
  MPU Buffer !!! \n);
status = DSP_EINVALIDARG;
}
-   if (DSP_FAILED(status))
-   goto func_cont;
-   pPhysAddrPageTbl = DMM_GetPhysicalAddrTable();
-   /* Build the array with virtual to physical translations */
-   status = TIOMAP_VirtToPhysical(mm, ulMpuAddr, ulNumBytes

[PATCH 03/14] DSPBRIDGE: Fixed Double notification when a sys_error happens

2009-05-19 Thread Omar Ramirez Luna
There is no need to keep sending notifications once an mmu fault
or sys error was sent, one notification should be enough to
signal the reload of baseimage for recovery.

Signed-off-by: Omar Ramirez Luna x00o...@ti.com
Acked-by: Hari Kanigeri h-kanige...@ti.com
---
 drivers/dsp/bridge/wmd/ue_deh.c |   13 +++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c
index d5551cb..278dae2 100644
--- a/drivers/dsp/bridge/wmd/ue_deh.c
+++ b/drivers/dsp/bridge/wmd/ue_deh.c
@@ -197,6 +197,7 @@ void WMD_DEH_Notify(struct DEH_MGR *hDehMgr, u32 
ulEventMask,
struct DEH_MGR *pDehMgr = (struct DEH_MGR *)hDehMgr;
struct WMD_DEV_CONTEXT *pDevContext;
DSP_STATUS status = DSP_SOK;
+   DSP_STATUS status1 = DSP_EFAIL;
u32 memPhysical = 0;
u32 HW_MMU_MAX_TLB_COUNT = 31;
u32 extern faultAddr;
@@ -285,6 +286,11 @@ void WMD_DEH_Notify(struct DEH_MGR *hDehMgr, u32 
ulEventMask,
 0x%x\n, dwErrInfo);
break;
}
+
+   /* Filter subsequent notifications when an error occurs */
+   if (pDevContext-dwBrdState != BRD_ERROR)
+   status1 = DSP_SOK;
+
/* Set the Board state as ERROR */
pDevContext-dwBrdState = BRD_ERROR;
/* Disable all the clocks that were enabled by DSP */
@@ -292,8 +298,11 @@ void WMD_DEH_Notify(struct DEH_MGR *hDehMgr, u32 
ulEventMask,
/* Call DSP Trace Buffer */
PrintDspTraceBuffer(hDehMgr-hWmdContext);
 
-   /* Signal DSP error/exception event. */
-   NTFY_Notify(pDehMgr-hNtfy, ulEventMask);
+   if (DSP_SUCCEEDED(status1)) {
+   /* Signal DSP error/exception event. */
+   NTFY_Notify(pDehMgr-hNtfy, ulEventMask);
+   }
+
}
DBG_Trace(DBG_LEVEL1, Exiting WMD_DEH_Notify\n);
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 01/14] DSPBRIDGE: Remove SEEK_* redefinitions

2009-05-19 Thread Omar Ramirez Luna
From: Guzman Lugo Fernando x0095...@ti.com

This patch removes the SEEK_* redefinitions in host_os.h

Signed-off-by: Guzman Lugo Fernando x0095...@ti.com
Acked-by: Omar Ramirez Luna x00o...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/host_os.h |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/host_os.h 
b/arch/arm/plat-omap/include/dspbridge/host_os.h
index f539bd0..6fe1462 100644
--- a/arch/arm/plat-omap/include/dspbridge/host_os.h
+++ b/arch/arm/plat-omap/include/dspbridge/host_os.h
@@ -60,12 +60,6 @@
 #include asm/cacheflush.h
 #include linux/dma-mapping.h
 
-/*  --- Macros */
-
-#define SEEK_SET0  /* Seek from beginning of file.  */
-#define SEEK_CUR1  /* Seek from current position.  */
-#define SEEK_END2  /* Seek from end of file.  */
-
 /* TODO -- Remove, once BP defines them */
 #define INT_MAIL_MPU_IRQ26
 #define INT_DSP_MMU_IRQ28
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/14] DSPBRIDGE: base image reload suppor after DSP error

2009-05-19 Thread Omar Ramirez Luna
From: Fernando Guzman Lugo x0095...@ti.com

Added support for reloading the base image after DSP error

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
Signed-off-by: Omar Ramirez Luna x00o...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/wmddeh.h |2 +
 drivers/dsp/bridge/rmgr/node.c|   72 +++--
 drivers/dsp/bridge/rmgr/proc.c|  153 +++--
 drivers/dsp/bridge/wmd/ue_deh.c   |   37 +-
 4 files changed, 188 insertions(+), 76 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/wmddeh.h 
b/arch/arm/plat-omap/include/dspbridge/wmddeh.h
index dd50a3a..60704da 100644
--- a/arch/arm/plat-omap/include/dspbridge/wmddeh.h
+++ b/arch/arm/plat-omap/include/dspbridge/wmddeh.h
@@ -61,4 +61,6 @@
 
extern void WMD_DEH_Notify(struct DEH_MGR *hDehMgr,
   u32 ulEventMask, u32 dwErrInfo);
+
+   extern void WMD_DEH_ReleaseDummyMem(void);
 #endif /* WMDDEH_ */
diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
index af604f9..53a42bf 100644
--- a/drivers/dsp/bridge/rmgr/node.c
+++ b/drivers/dsp/bridge/rmgr/node.c
@@ -864,8 +864,7 @@ DBAPI NODE_AllocMsgBuf(struct NODE_OBJECT *hNode, u32 uSize,
 
if (!MEM_IsValidHandle(pNode, NODE_SIGNATURE))
status = DSP_EHANDLE;
-
-   if (NODE_GetType(pNode) == NODE_DEVICE)
+   else if (NODE_GetType(pNode) == NODE_DEVICE)
status = DSP_ENODETYPE;
 
if (DSP_FAILED(status))
@@ -1337,6 +1336,10 @@ DSP_STATUS NODE_Create(struct NODE_OBJECT *hNode)
DBC_Require(cRefs  0);
GT_1trace(NODE_debugMask, GT_ENTER, NODE_Create: hNode: 0x%x\n,
 hNode);
+   if (!MEM_IsValidHandle(pNode, NODE_SIGNATURE)) {
+   status = DSP_EHANDLE;
+   goto func_end;
+   }
hProcessor = hNode-hProcessor;
status = PROC_GetState(hProcessor, procStatus,
sizeof(struct DSP_PROCESSORSTATE));
@@ -1921,9 +1924,10 @@ DSP_STATUS NODE_FreeMsgBuf(struct NODE_OBJECT *hNode, IN 
u8 *pBuffer,
DBC_Require(pNode-hXlator != NULL);
GT_3trace(NODE_debugMask, GT_ENTER, NODE_FreeMsgBuf: hNode: 0x%x\t
 pBuffer: 0x%x\tpAttr: 0x%x\n, hNode, pBuffer, pAttr);
-   if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE))
+   if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE)) {
status = DSP_EHANDLE;
-
+   goto func_end;
+   }
status = PROC_GetProcessorId(pNode-hProcessor, procId);
if (procId == DSP_UNIT) {
if (DSP_SUCCEEDED(status)) {
@@ -1946,6 +1950,7 @@ DSP_STATUS NODE_FreeMsgBuf(struct NODE_OBJECT *hNode, IN 
u8 *pBuffer,
} else {
DBC_Assert(NULL);   /* BUG */
}
+func_end:
return status;
 }
 
@@ -2063,6 +2068,10 @@ DSP_STATUS NODE_GetMessage(struct NODE_OBJECT *hNode, 
OUT struct DSP_MSG *pMsg,
GT_3trace(NODE_debugMask, GT_ENTER,
 NODE_GetMessage: hNode: 0x%x\tpMsg: 
 0x%x\tuTimeout: 0x%x\n, hNode, pMsg, uTimeout);
+   if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE)) {
+   status = DSP_EHANDLE;
+   goto func_end;
+   }
hProcessor = hNode-hProcessor;
status = PROC_GetState(hProcessor, procStatus,
sizeof(struct DSP_PROCESSORSTATE));
@@ -2076,10 +2085,6 @@ DSP_STATUS NODE_GetMessage(struct NODE_OBJECT *hNode, 
OUT struct DSP_MSG *pMsg,
status = DSP_EFAIL;
goto func_end;
}
-   if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE)) {
-   status = DSP_EHANDLE;
-   goto func_end;
-   }
hNodeMgr = hNode-hNodeMgr;
nodeType = NODE_GetType(hNode);
if (nodeType != NODE_MESSAGE  nodeType != NODE_TASK 
@@ -2295,12 +2300,14 @@ DSP_STATUS NODE_Pause(struct NODE_OBJECT *hNode)
 
if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE)) {
status = DSP_EHANDLE;
+   goto func_end;
} else {
nodeType = NODE_GetType(hNode);
if (nodeType != NODE_TASK  nodeType != NODE_DAISSOCKET)
status = DSP_ENODETYPE;
-
}
+   if (DSP_FAILED(status))
+   goto func_end;
 
status = PROC_GetProcessorId(pNode-hProcessor, procId);
 
@@ -2387,6 +2394,10 @@ DSP_STATUS NODE_PutMessage(struct NODE_OBJECT *hNode,
GT_3trace(NODE_debugMask, GT_ENTER,
 NODE_PutMessage: hNode: 0x%x\tpMsg: 
 0x%x\tuTimeout: 0x%x\n, hNode, pMsg, uTimeout);
+   if (!MEM_IsValidHandle(hNode, NODE_SIGNATURE)) {
+   status = DSP_EHANDLE;
+   goto func_end;
+   }
hProcessor = hNode-hProcessor;
status = PROC_GetState(hProcessor, procStatus

[PATCH 14/14] DSPBRIDGE: Remove run_IdleBoot support

2009-05-19 Thread Omar Ramirez Luna
From: Hari Kanigeri h-kanige...@ti.com

Changed the Bridge boot process in order to avoid the
usage of the IDLE boot mode and the DSP ROM.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/wmd/tiomap3430.c |   60 +++---
 1 files changed, 6 insertions(+), 54 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index afeeb2c..7a9603d 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -141,8 +141,6 @@ static DSP_STATUS PteSet(struct PgTableAttrs *pt, u32 pa, 
u32 va,
 static DSP_STATUS MemMapVmalloc(struct WMD_DEV_CONTEXT *hDevContext,
u32 ulMpuAddr, u32 ulVirtAddr,
u32 ulNumBytes, struct HW_MMUMapAttrs_t *hwAttrs);
-static DSP_STATUS run_IdleBoot(void __iomem *prcm_base, void __iomem *cm_base,
-   void __iomem *sysctrl_base);
 static void GetHWRegs(void __iomem *prcm_base, void __iomem *cm_base);
 
 /*  --- Globals */
@@ -341,8 +339,9 @@ static DSP_STATUS WMD_BRD_Monitor(struct WMD_DEV_CONTEXT 
*hDevContext)
}
DBG_Trace(DBG_LEVEL6, WMD_BRD_Monitor - Middle ** \n);
GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
-   status = run_IdleBoot(resources.dwPrmBase, resources.dwCmBase,
- resources.dwSysCtrlBase);
+   HW_RST_UnReset(resources.dwPrmBase, HW_RST2_IVA2);
+   CLK_Enable(SERVICESCLK_iva2_ck);
+
if (DSP_SUCCEEDED(status)) {
/* set the device state to IDLE */
pDevContext-dwBrdState = BRD_IDLE;
@@ -811,8 +810,6 @@ static DSP_STATUS WMD_BRD_Stop(struct WMD_DEV_CONTEXT 
*hDevContext)
CHNLSM_InterruptDSP2(pDevContext, MBX_PM_DSPIDLE);
mdelay(10);
GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
-   run_IdleBoot(resources.dwPrmBase, resources.dwCmBase,
-   resources.dwSysCtrlBase);
udelay(50);
 
clk_status = CLK_Disable(SERVICESCLK_iva2_ck);
@@ -916,6 +913,9 @@ static DSP_STATUS WMD_BRD_Delete(struct WMD_DEV_CONTEXT 
*hDevContext)
(pPtAttrs-L2NumPages * sizeof(struct PageInfo)));
}
DBG_Trace(DBG_LEVEL6, WMD_BRD_Stop - End ** \n);
+   HW_RST_Reset(resources.dwPrmBase, HW_RST1_IVA2);
+   HW_RST_Reset(resources.dwPrmBase, HW_RST2_IVA2);
+
return status;
 }
 
@@ -2018,54 +2018,6 @@ static DSP_STATUS MemMapVmalloc(struct WMD_DEV_CONTEXT 
*pDevContext,
return status;
 }
 
-static DSP_STATUS run_IdleBoot(void __iomem *prm_base, void __iomem *cm_base,
-  void __iomem *sysctrl_base)
-{
-   u32 temp;
-   DSP_STATUS status = DSP_SOK;
-   enum HW_PwrState_tpwrState;
-
-   /* Read PM_PWSTST_IVA2 */
-   HW_PWRST_IVA2RegGet(prm_base, temp);
-   if ((temp  0x03) != 0x03 || (temp  0x03) != 0x02) {
-   /* IVA2 is not in ON state */
-   /* Set PM_PWSTCTRL_IVA2  to ON */
-   HW_PWR_IVA2PowerStateSet(prm_base, HW_PWR_DOMAIN_DSP,
- HW_PWR_STATE_ON);
-   /* Set the SW supervised state transition */
-   HW_PWR_CLKCTRL_IVA2RegSet(cm_base, HW_SW_SUP_WAKEUP);
-   /* Wait until the state has moved to ON */
-   HW_PWR_IVA2StateGet(prm_base, HW_PWR_DOMAIN_DSP, pwrState);
-   }
-   CLK_Disable(SERVICESCLK_iva2_ck);
-   udelay(10);
-   /* Assert IVA2-RST1 and IVA2-RST2  */
-   __raw_writel((u32)0x07, (prm_base) + 0x50);
-   udelay(30);
-   /* set the SYSC for Idle Boot */
-   __raw_writel((u32)0x01, (sysctrl_base) + 0x404);
-  temp = (u32) *((REG_UWORD32 *)
-  ((u32) (cm_base) + 0x34));
-  temp = (temp  0xFFFE) | 0x1;
-  *((REG_UWORD32 *) ((u32) (cm_base) + 0x34)) =
-  (u32) temp;
-  temp = (u32) *((REG_UWORD32 *)
-  ((u32) (cm_base) + 0x4));
-  temp =  (temp  0xFC8) | 0x37;
-  *((REG_UWORD32 *) ((u32) (cm_base) + 0x4)) =
-  (u32) temp;
-   CLK_Enable(SERVICESCLK_iva2_ck);
-   udelay(20);
-   GetHWRegs(prm_base, cm_base);
-   /* Release Reset1 and Reset2 */
-   __raw_writel((u32)0x05, (prm_base) + 0x50);
-   udelay(20);
-   __raw_writel((u32)0x04, (prm_base) + 0x50);
-   udelay(30);
-   return status;
-}
-
-
 static void GetHWRegs(void __iomem *prm_base, void __iomem *cm_base)
 {
u32 temp;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/14] DSPBRIDGE: Remove variables not used in cfgdefs.h

2009-05-19 Thread Omar Ramirez Luna
From: Guzman Lugo Fernando x0095...@ti.com

This patch removes some variables that are not used.

Signed-off-by: Guzman Lugo Fernando x0095...@ti.com
Signed-off-by: Omar Ramirez Luna x00o...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |   10 --
 drivers/dsp/bridge/rmgr/drv.c  |2 --
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h 
b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index a2115f6..0155e13 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
@@ -77,15 +77,6 @@
u8 bIRQAttrib;  /* IRQ Attribute */
u32 dwOffsetForMonitor; /* The Shared memory starts from
 * dwMemBase + this offset */
-   u32 dwBusType;  /* Bus type for this device */
-   u32 dwProgBase; /* DSP ProgBase */
-   u32 dwProgLength;   /* DSP ProgBase Length */
-   u32 dwRegBase;  /* DSP memory mapped register base */
-   u32 dwRegLength;/* DSP Register Base Length */
-   u32 ClientHandle;   /* Client Handle */
-   u32 SocketHandle;   /* Socket and Function Pair */
-   u32 CardInfo;   /* This will be used as a context data in
-* in the CardRequestIRQ */
/*
 *  Info needed by NODE for allocating channels to communicate with RMS:
 *  dwChnlOffset:   Offset of RMS channels. Lower channels are
@@ -104,7 +95,6 @@
void __iomem *dwWdTimerDspBase;
void __iomem *dwMboxBase;
void __iomem *dwDmmuBase;
-   u32 *dwDipiBase;
void __iomem *dwSysCtrlBase;
} ;
 
diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c
index ae6ea7f..e7da578 100644
--- a/drivers/dsp/bridge/rmgr/drv.c
+++ b/drivers/dsp/bridge/rmgr/drv.c
@@ -1736,7 +1736,6 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, 
s32 bRequest)
/* Second window is for DSP external memory shared with MPU */
if (DSP_SUCCEEDED(status)) {
/* for Linux, these are hard-coded values */
-   pResources-dwBusType = 0;
pResources-bIRQRegisters = 0;
pResources-bIRQAttrib = 0;
pResources-dwOffsetForMonitor = 0;
@@ -1863,7 +1862,6 @@ static DSP_STATUS RequestBridgeResourcesDSP(u32 
dwContext, s32 bRequest)
}
if (DSP_SUCCEEDED(status)) {
/* for Linux, these are hard-coded values */
-   pResources-dwBusType = 0;
pResources-bIRQRegisters = 0;
pResources-bIRQAttrib = 0;
pResources-dwOffsetForMonitor = 0;
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/14] DSPBRIDGE: Removes wrappers funtions of readl and writel

2009-05-19 Thread Omar Ramirez Luna
From: Guzman Lugo Fernando x0095...@ti.com

This patch change the call to RD_MEM_32_VOLATILE and
WR_MEM_32_VOLATILE with __raw_readl and __raw_writel

Signed-off-by: Guzman Lugo Fernando x0095...@ti.com
Acked-by: Omar Ramirez Luna x00o...@ti.com
---
 drivers/dsp/bridge/hw/MLBRegAcM.h|   41 
 drivers/dsp/bridge/hw/MMURegAcM.h|   62 ++--
 drivers/dsp/bridge/hw/PRCMRegAcM.h   |  181 +-
 drivers/dsp/bridge/hw/hw_dspssC64P.c |5 +-
 4 files changed, 146 insertions(+), 143 deletions(-)

diff --git a/drivers/dsp/bridge/hw/MLBRegAcM.h 
b/drivers/dsp/bridge/hw/MLBRegAcM.h
index 747a2e1..29f6de3 100644
--- a/drivers/dsp/bridge/hw/MLBRegAcM.h
+++ b/drivers/dsp/bridge/hw/MLBRegAcM.h
@@ -18,6 +18,7 @@
 #define _MLB_REG_ACM_H
 
 #include GlobalTypes.h
+#include linux/io.h
 #include EasiGlobal.h
 #include MLBAccInt.h
 
@@ -25,7 +26,7 @@
 
 #define MLBMAILBOX_SYSCONFIGReadRegister32(baseAddress)\
 (_DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGReadRegister32),\
-  RD_MEM_32_VOLATILE(((u32)(baseAddress))+ \
+  __raw_readl(((baseAddress))+ \
   MLB_MAILBOX_SYSCONFIG_OFFSET))
 
 
@@ -34,13 +35,13 @@
 const u32 offset = MLB_MAILBOX_SYSCONFIG_OFFSET;\
 register u32 newValue = ((u32)(value));\
 _DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGWriteRegister32);\
-WR_MEM_32_VOLATILE(((u32)(baseAddress))+offset, newValue);\
+__raw_writel(newValue, ((baseAddress))+offset);\
 }
 
 
 #define MLBMAILBOX_SYSCONFIGSIdleModeRead32(baseAddress)\
 (_DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGSIdleModeRead32),\
-  (((RD_MEM_32_VOLATILEu32)(baseAddress))+\
+  (((__raw_readlu32)(baseAddress))+\
   (MLB_MAILBOX_SYSCONFIG_OFFSET \
   MLB_MAILBOX_SYSCONFIG_SIdleMode_MASK) \
   MLB_MAILBOX_SYSCONFIG_SIdleMode_OFFSET))
@@ -49,7 +50,7 @@
 #define MLBMAILBOX_SYSCONFIGSIdleModeWrite32(baseAddress, value)\
 {\
 const u32 offset = MLB_MAILBOX_SYSCONFIG_OFFSET;\
-register u32 data = RD_MEM_32_VOLATILE(((u32)(baseAddress)) +\
+register u32 data = __raw_readl(((u32)(baseAddress)) +\
offset);\
 register u32 newValue = ((u32)(value));\
 _DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGSIdleModeWrite32);\
@@ -57,7 +58,7 @@
 newValue = MLB_MAILBOX_SYSCONFIG_SIdleMode_OFFSET;\
 newValue = MLB_MAILBOX_SYSCONFIG_SIdleMode_MASK;\
 newValue |= data;\
-WR_MEM_32_VOLATILE((u32)(baseAddress)+offset, newValue);\
+__raw_writel(newValue, (u32)(baseAddress)+offset);\
 }
 
 
@@ -65,20 +66,20 @@
 {\
 const u32 offset = MLB_MAILBOX_SYSCONFIG_OFFSET;\
 register u32 data =\
-RD_MEM_32_VOLATILE(((u32)(baseAddress))+offset);\
+__raw_readl(((u32)(baseAddress))+offset);\
 register u32 newValue = ((u32)(value));\
 _DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGSoftResetWrite32);\
 data = ~(MLB_MAILBOX_SYSCONFIG_SoftReset_MASK);\
 newValue = MLB_MAILBOX_SYSCONFIG_SoftReset_OFFSET;\
 newValue = MLB_MAILBOX_SYSCONFIG_SoftReset_MASK;\
 newValue |= data;\
-WR_MEM_32_VOLATILE((u32)(baseAddress)+offset, newValue);\
+__raw_writel(newValue, (u32)(baseAddress)+offset);\
 }
 
 
 #define MLBMAILBOX_SYSCONFIGAutoIdleRead32(baseAddress)\
 (_DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGAutoIdleRead32),\
-  (((RD_MEM_32_VOLATILEu32)(baseAddress))+\
+  (((__raw_readlu32)(baseAddress))+\
   (MLB_MAILBOX_SYSCONFIG_OFFSET \
   MLB_MAILBOX_SYSCONFIG_AutoIdle_MASK) \
   MLB_MAILBOX_SYSCONFIG_AutoIdle_OFFSET))
@@ -88,20 +89,20 @@
 {\
 const u32 offset = MLB_MAILBOX_SYSCONFIG_OFFSET;\
 register u32 data =\
-RD_MEM_32_VOLATILE(((u32)(baseAddress))+offset);\
+__raw_readl(((u32)(baseAddress))+offset);\
 register u32 newValue = ((u32)(value));\
 _DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSCONFIGAutoIdleWrite32);\
 data = ~(MLB_MAILBOX_SYSCONFIG_AutoIdle_MASK);\
 newValue = MLB_MAILBOX_SYSCONFIG_AutoIdle_OFFSET;\
 newValue = MLB_MAILBOX_SYSCONFIG_AutoIdle_MASK;\
 newValue |= data;\
-WR_MEM_32_VOLATILE((u32)(baseAddress)+offset, newValue);\
+__raw_writel(newValue, (u32)(baseAddress)+offset);\
 }
 
 
 #define MLBMAILBOX_SYSSTATUSResetDoneRead32(baseAddress)\
 (_DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_SYSSTATUSResetDoneRead32),\
-  (((RD_MEM_32_VOLATILEu32)(baseAddress))+\
+  (((__raw_readlu32)(baseAddress))+\
   (MLB_MAILBOX_SYSSTATUS_OFFSET \
   MLB_MAILBOX_SYSSTATUS_ResetDone_MASK) \
   MLB_MAILBOX_SYSSTATUS_ResetDone_OFFSET))
@@ -109,7 +110,7 @@
 
 #define MLBMAILBOX_MESSAGE___0_15ReadRegister32(baseAddress, bank)\
 (_DEBUG_LEVEL_1_EASI(EASIL1_MLBMAILBOX_MESSAGE___0_15ReadRegister32),\
-  RD_MEM_32_VOLATILE(((u32)(baseAddress))+\
+  __raw_readl(((baseAddress))+\
   (MLB_MAILBOX_MESSAGE___REGSET_0_15_OFFSET +\
   MLB_MAILBOX_MESSAGE___0_15_OFFSET+(\
   (bank)*MLB_MAILBOX_MESSAGE___REGSET_0_15_STEP
@@ -122,14 +123,14

[PATCH 05/14] DSPBRIDGE: Change address resources to void __iomem *

2009-05-19 Thread Omar Ramirez Luna
From: Guzman Lugo Fernando x0095...@ti.com

This patch changes address resources to void __iomem *

Ported for linux-omap-pm  bridge-2.6.29 branch.

Signed-off-by: Guzman Lugo Fernando x0095...@ti.com
Signed-off-by: Omar Ramirez Luna x00o...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/cfgdefs.h |   20 +-
 drivers/dsp/bridge/hw/hw_dspssC64P.c   |2 +-
 drivers/dsp/bridge/hw/hw_dspssC64P.h   |2 +-
 drivers/dsp/bridge/hw/hw_mbox.c|   25 ++--
 drivers/dsp/bridge/hw/hw_mbox.h|   16 
 drivers/dsp/bridge/hw/hw_mmu.c |   41 ++--
 drivers/dsp/bridge/hw/hw_mmu.h |   28 +++---
 drivers/dsp/bridge/hw/hw_prcm.c|   26 ++--
 drivers/dsp/bridge/hw/hw_prcm.h|   17 
 drivers/dsp/bridge/rmgr/drv.c  |   38 +-
 drivers/dsp/bridge/rmgr/node.c |2 +-
 drivers/dsp/bridge/wmd/_tiomap.h   |2 +-
 drivers/dsp/bridge/wmd/tiomap3430.c|   49 
 13 files changed, 135 insertions(+), 133 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h 
b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
index 4f78d82..a2115f6 100644
--- a/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/cfgdefs.h
@@ -96,16 +96,16 @@
u32 dwChnlOffset;
u32 dwChnlBufSize;
u32 dwNumChnls;
-   u32 dwPrmBase;
-   u32 dwCmBase;
-   u32 dwPerBase;
-   u32 dwPerPmBase;
-   u32 dwCorePmBase;
-   u32 dwWdTimerDspBase;
-   u32 dwMboxBase;
-   u32 dwDmmuBase;
-   u32 dwDipiBase;
-   u32 dwSysCtrlBase;
+   void __iomem *dwPrmBase;
+   void __iomem *dwCmBase;
+   void __iomem *dwPerBase;
+   u32 dwPerPmBase;
+   u32 dwCorePmBase;
+   void __iomem *dwWdTimerDspBase;
+   void __iomem *dwMboxBase;
+   void __iomem *dwDmmuBase;
+   u32 *dwDipiBase;
+   void __iomem *dwSysCtrlBase;
} ;
 
struct CFG_DSPMEMDESC {
diff --git a/drivers/dsp/bridge/hw/hw_dspssC64P.c 
b/drivers/dsp/bridge/hw/hw_dspssC64P.c
index d697871..c61af81 100644
--- a/drivers/dsp/bridge/hw/hw_dspssC64P.c
+++ b/drivers/dsp/bridge/hw/hw_dspssC64P.c
@@ -34,7 +34,7 @@
 #include IPIAccInt.h
 
 /* HW FUNCTIONS */
-HW_STATUS HW_DSPSS_BootModeSet(const u32 baseAddress,
+HW_STATUS HW_DSPSS_BootModeSet(const void __iomem *baseAddress,
  enum HW_DSPSYSC_BootMode_t bootMode,
  const u32 bootAddress)
 {
diff --git a/drivers/dsp/bridge/hw/hw_dspssC64P.h 
b/drivers/dsp/bridge/hw/hw_dspssC64P.h
index 493effd..50f9af4 100644
--- a/drivers/dsp/bridge/hw/hw_dspssC64P.h
+++ b/drivers/dsp/bridge/hw/hw_dspssC64P.h
@@ -41,7 +41,7 @@
 
 #define HW_DSP_IDLEBOOT_ADDR   0x007E
 
-   extern HW_STATUS HW_DSPSS_BootModeSet(const u32 baseAddress,
+   extern HW_STATUS HW_DSPSS_BootModeSet(const void __iomem *baseAddress,
enum HW_DSPSYSC_BootMode_t bootMode,
const u32 bootAddress);
 
diff --git a/drivers/dsp/bridge/hw/hw_mbox.c b/drivers/dsp/bridge/hw/hw_mbox.c
index 9f14f34..ee79032 100644
--- a/drivers/dsp/bridge/hw/hw_mbox.c
+++ b/drivers/dsp/bridge/hw/hw_mbox.c
@@ -36,7 +36,7 @@
 struct MAILBOX_CONTEXT mboxsetting = {0x4, 0x1, 0x1};
 
 /* Saves the mailbox context */
-HW_STATUS HW_MBOX_saveSettings(u32 baseAddress)
+HW_STATUS HW_MBOX_saveSettings(void __iomem *baseAddress)
 {
HW_STATUS status = RET_OK;
 
@@ -50,7 +50,7 @@ HW_STATUS HW_MBOX_saveSettings(u32 baseAddress)
 }
 
 /* Restores the mailbox context */
-HW_STATUS HW_MBOX_restoreSettings(u32 baseAddress)
+HW_STATUS HW_MBOX_restoreSettings(void __iomem *baseAddress)
 {
 HW_STATUS status = RET_OK;
/* Restor IRQ enable status */
@@ -65,8 +65,8 @@ HW_STATUS HW_MBOX_restoreSettings(u32 baseAddress)
 
 /* Reads a u32 from the sub module message box Specified. if there are no
  * messages in the mailbox then and error is returned. */
-HW_STATUS HW_MBOX_MsgRead(const u32 baseAddress, const HW_MBOX_Id_t mailBoxId,
-   u32 *const pReadValue)
+HW_STATUS HW_MBOX_MsgRead(const void __iomem *baseAddress,
+   const HW_MBOX_Id_t mailBoxId, u32 *const pReadValue)
 {
HW_STATUS status = RET_OK;
 
@@ -86,8 +86,8 @@ HW_STATUS HW_MBOX_MsgRead(const u32 baseAddress, const 
HW_MBOX_Id_t mailBoxId,
 }
 
 /* Writes a u32 from the sub module message box Specified. */
-HW_STATUS HW_MBOX_MsgWrite(const u32 baseAddress, const HW_MBOX_Id_t mailBoxId,
-   const u32 writeValue)
+HW_STATUS HW_MBOX_MsgWrite(const void __iomem *baseAddress,
+   const HW_MBOX_Id_t

[PATCH 10/14] BRIDGE: Number of supported OPPs increased to 5

2009-05-19 Thread Omar Ramirez Luna
From: Armando Uribe de Leon x0095...@ti.com

This patch increases the supported opp numbers within bridge driver,
it will also fix the opp table to be fully populated in the shared memory;
before, it was causing the QOS test reported numbers to be inaccurate.

Signed-off-by: Armando Uribe de Leon x0095...@ti.com
Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index c8af75c..e937766 100755
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -210,7 +210,7 @@ static struct file_operations bridge_fops = {
 static u32 timeOut = 1000;
 #ifdef CONFIG_BRIDGE_DVFS
 static struct clk *clk_handle;
-s32 dsp_max_opps = VDD1_OPP3;
+s32 dsp_max_opps = VDD1_OPP5;
 #endif
 
 /* Maximum Opps that can be requested by IVA*/
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 04/14] DSPBRIDGE: Fixed typo in debug traces

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

Fixed typo in Bridge traces for Msg and Nldr.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
Acked-by: Hari Kanigeri h-kanige...@ti.com
---
 drivers/dsp/bridge/pmgr/msg.c  |2 +-
 drivers/dsp/bridge/rmgr/nldr.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/msg.c b/drivers/dsp/bridge/pmgr/msg.c
index bbf5174..be4acdb 100644
--- a/drivers/dsp/bridge/pmgr/msg.c
+++ b/drivers/dsp/bridge/pmgr/msg.c
@@ -158,7 +158,7 @@ bool MSG_Init(void)
 
if (cRefs == 0) {
DBC_Assert(!MSG_debugMask.flags);
-   GT_create(MSG_debugMask, MG);/* MG for MsG */
+   GT_create(MSG_debugMask, MS);/* MS for MSg */
}
 
cRefs++;
diff --git a/drivers/dsp/bridge/rmgr/nldr.c b/drivers/dsp/bridge/rmgr/nldr.c
index f3c429c..79f7505 100644
--- a/drivers/dsp/bridge/rmgr/nldr.c
+++ b/drivers/dsp/bridge/rmgr/nldr.c
@@ -893,7 +893,7 @@ bool NLDR_Init(void)
 
if (cRefs == 0) {
DBC_Assert(!NLDR_debugMask.flags);
-   GT_create(NLDR_debugMask, DL);   /* DL for DLdr */
+   GT_create(NLDR_debugMask, NL);   /* NL for NLdr */
 
RMM_init();
}
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 08/14] DSPBRIDGE: trivial spacing cleanup for memory module

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

trivial spacing cleanup for memory module

Signed-off-by: Omar Ramirez Luna x00o...@ti.com
---
 drivers/dsp/bridge/services/mem.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/dsp/bridge/services/mem.c 
b/drivers/dsp/bridge/services/mem.c
index 0a10304..47ec09b 100644
--- a/drivers/dsp/bridge/services/mem.c
+++ b/drivers/dsp/bridge/services/mem.c
@@ -281,11 +281,11 @@ void *MEM_Alloc(u32 cBytes, enum MEM_POOLATTRS type)
/* If non-paged memory required, see note at top of file. */
case MEM_PAGED:
 #ifndef MEM_CHECK
-  pMem = kmalloc(cBytes,
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   pMem = kmalloc(cBytes,
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
 #else
pMem = kmalloc(cBytes + sizeof(struct memInfo),
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
if (pMem) {
pMem-size = cBytes;
pMem-caller = __builtin_return_address(0);
@@ -304,12 +304,12 @@ void *MEM_Alloc(u32 cBytes, enum MEM_POOLATTRS type)
case MEM_LARGEVIRTMEM:
 #ifndef MEM_CHECK
/* FIXME - Replace with 'vmalloc' after BP fix */
-  pMem = __vmalloc(cBytes,
-  (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
+   pMem = __vmalloc(cBytes,
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
 #else
/* FIXME - Replace with 'vmalloc' after BP fix */
pMem = __vmalloc((cBytes + sizeof(struct memInfo)),
-  (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
if (pMem) {
pMem-size = cBytes;
pMem-caller = __builtin_return_address(0);
@@ -359,7 +359,7 @@ void *MEM_AllocPhysMem(u32 cBytes, u32 ulAlign, OUT u32 
*pPhysicalAddress)
(u32 *)paMem);
} else
pVaMem = dma_alloc_coherent(NULL, cBytes, paMem,
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
if (pVaMem == NULL) {
*pPhysicalAddress = 0;
GT_1trace(MEM_debugMask, GT_6CLASS,
@@ -391,14 +391,14 @@ void *MEM_Calloc(u32 cBytes, enum MEM_POOLATTRS type)
/* If non-paged memory required, see note at top of file. */
case MEM_PAGED:
 #ifndef MEM_CHECK
-  pMem = kmalloc(cBytes,
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   pMem = kmalloc(cBytes,
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
if (pMem)
memset(pMem, 0, cBytes);
 
 #else
pMem = kmalloc(cBytes + sizeof(struct memInfo),
-  (in_atomic()) ? GFP_ATOMIC : 
GFP_KERNEL);
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL);
if (pMem) {
memset((void *)((u32)pMem +
sizeof(struct memInfo)), 0, cBytes);
@@ -417,15 +417,15 @@ void *MEM_Calloc(u32 cBytes, enum MEM_POOLATTRS type)
case MEM_LARGEVIRTMEM:
 #ifndef MEM_CHECK
/* FIXME - Replace with 'vmalloc' after BP fix */
-  pMem = __vmalloc(cBytes,
-  (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
+   pMem = __vmalloc(cBytes,
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
if (pMem)
memset(pMem, 0, cBytes);
 
 #else
/* FIXME - Replace with 'vmalloc' after BP fix */
pMem = __vmalloc(cBytes + sizeof(struct memInfo),
-  (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
+   (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL, 
PAGE_KERNEL);
if (pMem) {
memset((void *)((u32)pMem +
sizeof(struct memInfo)), 0, cBytes);
-- 
1.6.2.4

[PATCH 12/14] DSPBRIDGE: Remove all resources on driver exit

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

There is no need to walk the process context list
on exit, remove all process instead without exception.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |   32 +-
 1 files changed, 6 insertions(+), 26 deletions(-)
 mode change 100755 = 100644 drivers/dsp/bridge/rmgr/drv_interface.c

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
old mode 100755
new mode 100644
index e937766..d17d3cf
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -451,44 +451,24 @@ static int __devexit omap34xx_bridge_remove(struct 
platform_device *pdev)
HANDLE   hDrvObject = NULL;
struct PROCESS_CONTEXT  *pTmp = NULL;
struct PROCESS_CONTEXT*pCtxtclosed = NULL;
-   struct PROCESS_CONTEXT*pCtxttraverse = NULL;
 
GT_0trace(driverTrace, GT_ENTER, - driver_exit\n);
 
dsp_status = CFG_GetObject((u32 *)hDrvObject, REG_DRV_OBJECT);
+   if (DSP_FAILED(dsp_status))
+   goto func_cont;
DRV_GetProcCtxtList(pCtxtclosed, (struct DRV_OBJECT *)hDrvObject);
while (pCtxtclosed != NULL) {
+   GT_1trace(driverTrace, GT_5CLASS, ***Cleanup of 
+process***%d\n, pCtxtclosed-pid);
DRV_RemoveAllResources(pCtxtclosed);
-   if (pCtxtclosed-hProcessor != NULL) {
-   DRV_GetProcCtxtList(pCtxttraverse,
-   (struct DRV_OBJECT *)hDrvObject);
-   if (pCtxttraverse-next == NULL) {
-   PROC_Detach(pCtxtclosed-hProcessor);
-   goto func_cont;
-   }
-   if ((pCtxtclosed-pid == pCtxttraverse-pid) 
-  (pCtxttraverse-next != NULL)) {
-   pCtxttraverse = pCtxttraverse-next;
-   }
-   while ((pCtxttraverse != NULL) 
- (pCtxtclosed-hProcessor
- != pCtxttraverse-hProcessor)) {
-   pCtxttraverse = pCtxttraverse-next;
-   if ((pCtxttraverse != NULL) 
-  (pCtxtclosed-pid == pCtxttraverse-pid)) {
-   pCtxttraverse = pCtxttraverse-next;
-   }
-   }
-   if (pCtxttraverse == NULL)
-   PROC_Detach(pCtxtclosed-hProcessor);
-   }
-func_cont:
+   PROC_Detach(pCtxtclosed-hProcessor);
pTmp = pCtxtclosed-next;
DRV_RemoveProcContext((struct DRV_OBJECT *)hDrvObject,
 pCtxtclosed, (void *)pCtxtclosed-pid);
pCtxtclosed = pTmp;
}
-
+func_cont:
/* unregister the clock notifier */
 #ifdef CONFIG_BRIDGE_DVFS
if (!clk_notifier_unregister(clk_handle, iva_clk_notifier)) {
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/14] DSPBRIDGE: New PWRERROR event notification

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

This patch defines a new DSP_PWRERROR event which can be
registered for notification. It uses the same mechanism
as MMUFAULT or SYSERROR. And will notify to ayn client registered
if there was any error when entering forced sleep state.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dbdefs.h |7 +--
 drivers/dsp/bridge/rmgr/proc.c|   11 ++-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c   |6 ++
 drivers/dsp/bridge/wmd/ue_deh.c   |   10 ++
 4 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dbdefs.h 
b/arch/arm/plat-omap/include/dspbridge/dbdefs.h
index 9782693..78be880 100644
--- a/arch/arm/plat-omap/include/dspbridge/dbdefs.h
+++ b/arch/arm/plat-omap/include/dspbridge/dbdefs.h
@@ -101,6 +101,7 @@
 #define DSP_MMUFAULT0x0010
 #define DSP_SYSERROR0x0020
 #define DSP_EXCEPTIONABORT  0x0300
+#define DSP_PWRERROR0x0080
 
 /* IVA exception events (IVA MMU fault) */
 #define IVA_MMUFAULT0x0040
@@ -174,7 +175,8 @@
DSP_STREAMDONE | \
DSP_STREAMIOCOMPLETION | \
DSP_MMUFAULT | \
-   DSP_SYSERROR))  \
+   DSP_SYSERROR | \
+   DSP_PWRERROR))  \
!((x)  ~(DSP_PROCESSORSTATECHANGE | \
DSP_PROCESSORATTACH | \
DSP_PROCESSORDETACH | \
@@ -183,7 +185,8 @@
DSP_STREAMDONE | \
DSP_STREAMIOCOMPLETION | \
DSP_MMUFAULT | \
-   DSP_SYSERROR
+   DSP_SYSERROR | \
+   DSP_PWRERROR
 
 #define IsValidNodeEvent(x)(((x) == 0) || (((x)  (DSP_NODESTATECHANGE | \
DSP_NODEMESSAGEREADY))  \
diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index bb8cff3..8a5dfa7 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -1499,7 +1499,7 @@ DSP_STATUS PROC_RegisterNotify(DSP_HPROCESSOR hProcessor, 
u32 uEventMask,
/* Check if event mask is a valid processor related event */
if (uEventMask  ~(DSP_PROCESSORSTATECHANGE | DSP_PROCESSORATTACH |
   DSP_PROCESSORDETACH | DSP_PROCESSORRESTART | DSP_MMUFAULT |
-  DSP_SYSERROR))
+  DSP_SYSERROR | DSP_PWRERROR))
status = DSP_EVALUE;
 
/* Check if notify type is valid */
@@ -1507,12 +1507,13 @@ DSP_STATUS PROC_RegisterNotify(DSP_HPROCESSOR 
hProcessor, u32 uEventMask,
status = DSP_EVALUE;
 
if (DSP_SUCCEEDED(status)) {
-   /* * If event mask is not DSP_SYSERROR or DSP_MMUFAULT,
-* then register event immediately.  */
-   if (uEventMask  ~(DSP_SYSERROR | DSP_MMUFAULT)) {
+   /* If event mask is not DSP_SYSERROR, DSP_MMUFAULT,
+* or DSP_PWRERROR then register event immediately. */
+   if (uEventMask 
+   ~(DSP_SYSERROR | DSP_MMUFAULT | DSP_PWRERROR)) {
status = NTFY_Register(pProcObject-hNtfy,
 hNotification, uEventMask, uNotifyType);
-   /* * Special case alert, special case alert!
+   /* Special case alert, special case alert!
 * If we're trying to *deregister* (i.e. uEventMask
 * is 0), a DSP_SYSERROR or DSP_MMUFAULT notification,
 * we have to deregister with the DEH manager.
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c 
b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
index d9ee480..a651963 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
@@ -57,6 +57,9 @@
 
 #include dspbridge/pwr_sh.h
 
+/*  --- Mini Driver */
+#include dspbridge/wmddeh.h
+
 /*  --- specific to this file */
 #include _tiomap.h
 #include _tiomap_pwr.h
@@ -188,6 +191,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN 
u32 dwCmd,
DSP_STATUS status = DSP_SOK;
 #ifdef CONFIG_PM
struct CFG_HOSTRES resources;
+   struct DEH_MGR *hDehMgr;
u16 usCount = TIHELEN_ACKTIMEOUT;
enum HW_PwrState_t pwrState;
enum HW_PwrState_t targetPwrState;
@@ -257,6 +261,8 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN 
u32 dwCmd,
if (usCount == 0) {
DBG_Trace(DBG_LEVEL7, SleepDSP

[PATCH 13/14] DSPBRIDGE: Stop and reset DSP before removing constraints

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

This patch implements the DSP Reset procedure to be made
on bridge exit before unregistering the constraints set by dsp.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |   17 -
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index d17d3cf..d14e663 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -469,6 +469,14 @@ static int __devexit omap34xx_bridge_remove(struct 
platform_device *pdev)
pCtxtclosed = pTmp;
}
 func_cont:
+   if (driverContext) {
+   /* Put the DSP in reset state */
+   ret = DSP_Deinit(driverContext);
+   driverContext = 0;
+   DBC_Assert(ret == true);
+   }
+   SERVICES_Exit();
+   GT_exit();
/* unregister the clock notifier */
 #ifdef CONFIG_BRIDGE_DVFS
if (!clk_notifier_unregister(clk_handle, iva_clk_notifier)) {
@@ -483,15 +491,6 @@ func_cont:
clk_handle = NULL;
 #endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
-   if (driverContext) {
-   ret = DSP_Deinit(driverContext);
-   driverContext = 0;
-
-   DBC_Assert(ret == true);
-   }
-   SERVICES_Exit();
-   GT_exit();
-
devno = MKDEV(driver_major, driver_minor);
if (bridge_device) {
cdev_del(bridge_device-cdev);
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/14] DSPBRIDGE: Fixing indentation

2009-05-19 Thread Omar Ramirez Luna
From: Omar Ramirez Luna omar.rami...@ti.com

Trivial patch to change spaces for tabs, and a proper indentation

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/wmd/tiomap3430.c |  280 +++---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |  402 +++---
 2 files changed, 337 insertions(+), 345 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index 2c372fc..afeeb2c 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -188,7 +188,6 @@ struct PgTableAttrs {
  */
 extern s32 dsp_debug;
 
-
 /*
  *  This mini driver's function interface table.
  */
@@ -246,7 +245,7 @@ static struct WMD_DRV_INTERFACE drvInterfaceFxns = {
 
 static inline void tlb_flush_all(const void __iomem *base)
 {
-__raw_writeb(__raw_readb(base + MMU_GFLUSH) | 1, base + MMU_GFLUSH);
+   __raw_writeb(__raw_readb(base + MMU_GFLUSH) | 1, base + MMU_GFLUSH);
 }
 
 static inline void flush_all(struct WMD_DEV_CONTEXT *pDevContext)
@@ -254,7 +253,8 @@ static inline void flush_all(struct WMD_DEV_CONTEXT 
*pDevContext)
struct CFG_HOSTRES resources;
u32 temp = 0;
 
-   CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), 
resources);
+   CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+   resources);
HW_PWRST_IVA2RegGet(resources.dwPrmBase, temp);
 
if ((temp  HW_PWR_STATE_ON) == HW_PWR_STATE_OFF ||
@@ -291,9 +291,9 @@ void WMD_DRV_Entry(OUT struct WMD_DRV_INTERFACE 
**ppDrvInterface,
DBC_Require(pstrWMDFileName != NULL);
DBG_Trace(DBG_ENTER, In the WMD_DRV_Entry \n);
 
-   IO_SM_init(); /* Initialization of io_sm module */
+   IO_SM_init(); /* Initialization of io_sm module */
 
-   if (strcmp(pstrWMDFileName, UMA) == 0)
+   if (strcmp(pstrWMDFileName, UMA) == 0)
*ppDrvInterface = drvInterfaceFxns;
else
DBG_Trace(DBG_LEVEL7, WMD_DRV_Entry Unknown WMD file name);
@@ -325,20 +325,19 @@ static DSP_STATUS WMD_BRD_Monitor(struct WMD_DEV_CONTEXT 
*hDevContext)
 
GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
HW_PWRST_IVA2RegGet(resources.dwPrmBase, temp);
-if ((temp  0x03) != 0x03 || (temp  0x03) != 0x02) {
+   if ((temp  0x03) != 0x03 || (temp  0x03) != 0x02) {
/* IVA2 is not in ON state */
/* Read and set PM_PWSTCTRL_IVA2  to ON */
HW_PWR_IVA2PowerStateSet(resources.dwPrmBase,
  HW_PWR_DOMAIN_DSP,
  HW_PWR_STATE_ON);
/* Set the SW supervised state transition */
-   HW_PWR_CLKCTRL_IVA2RegSet(resources.dwCmBase,
-  HW_SW_SUP_WAKEUP);
+   HW_PWR_CLKCTRL_IVA2RegSet(resources.dwCmBase, HW_SW_SUP_WAKEUP);
/* Wait until the state has moved to ON */
HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 pwrState);
/* Disable Automatic transition */
-   HW_PWR_CLKCTRL_IVA2RegSet(resources.dwCmBase, HW_AUTOTRANS_DIS);
+   HW_PWR_CLKCTRL_IVA2RegSet(resources.dwCmBase, HW_AUTOTRANS_DIS);
}
DBG_Trace(DBG_LEVEL6, WMD_BRD_Monitor - Middle ** \n);
GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
@@ -347,7 +346,6 @@ static DSP_STATUS WMD_BRD_Monitor(struct WMD_DEV_CONTEXT 
*hDevContext)
if (DSP_SUCCEEDED(status)) {
/* set the device state to IDLE */
pDevContext-dwBrdState = BRD_IDLE;
-
}
 error_return:
DBG_Trace(DBG_LEVEL6, WMD_BRD_Monitor - End ** \n);
@@ -449,7 +447,7 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT 
*hDevContext,
DBG_Trace(DBG_ENTER, Entering WMD_BRD_Start:\n hDevContext: 0x%x\n\t 
 dwDSPAddr: 0x%x\n, hDevContext, dwDSPAddr);
 
-/* The device context contains all the mmu setup info from when the
+   /* The device context contains all the mmu setup info from when the
 * last dsp base image was loaded. The first entry is always
 * SHMMEM base. */
/* Get SHM_BEG - convert to byte address */
@@ -518,23 +516,23 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT 
*hDevContext,
for (iEntryNdx = 0; iEntryNdx  WMDIOCTL_NUMOFMMUTLB;
iEntryNdx++) {
if ((pDevContext-aTLBEntry[iEntryNdx].ulGppPa != 0) 
-   (pDevContext-aTLBEntry[iEntryNdx].ulDspVa != 
0)) {
+  (pDevContext-aTLBEntry[iEntryNdx].ulDspVa != 0)) {
DBG_Trace(DBG_LEVEL4, ** (proc) MMU %d GppPa:
-0x%x DspVa 0x%x Size 0x%x\n

[PATCH] DSPBRIDGE: Revert removing all resources on proc detach

2009-06-03 Thread Omar Ramirez Luna
This patch changes removing all resources for the process
context on processor detach, it only frees the dmm resources
and let resource cleanup take care of the rest.

This regression was introduced with the following patch:
DSPBRIDGE: base image reload support after DSP error

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
Acked-by: Hari Kanigeri h-kanige...@ti.com
---
 drivers/dsp/bridge/rmgr/proc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index d4d20ae..43f2d29 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -659,7 +659,7 @@ DSP_STATUS PROC_Detach(DSP_HPROCESSOR hProcessor)
(struct DRV_OBJECT *)hDRVObject, pPctxt,
 NULL, 0);
if (pPctxt != NULL) {
-   DRV_RemoveAllResources(pPctxt);
+   DRV_ProcFreeDMMRes(pPctxt);
pPctxt-hProcessor = NULL;
}
}
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] DSPBRIDGE: Increased DMM size to 256MB

2009-06-17 Thread Omar Ramirez Luna
From: Hari Kanigeri h-kanige...@ti.com

This patch increases the DMM from 64MB to 256MB.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dmm.h |2 +-
 drivers/dsp/bridge/pmgr/dmm.c  |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dmm.h 
b/arch/arm/plat-omap/include/dspbridge/dmm.h
index ef37668..37f272f 100644
--- a/arch/arm/plat-omap/include/dspbridge/dmm.h
+++ b/arch/arm/plat-omap/include/dspbridge/dmm.h
@@ -41,7 +41,7 @@
u32 reserved;
} ;
 
-#define DMMPOOLSIZE  0x400
+#define DMMPOOLSIZE  0x1000
 
 /*
  *   DMM_GetHandle 
diff --git a/drivers/dsp/bridge/pmgr/dmm.c b/drivers/dsp/bridge/pmgr/dmm.c
index 803de93..19b8f29 100644
--- a/drivers/dsp/bridge/pmgr/dmm.c
+++ b/drivers/dsp/bridge/pmgr/dmm.c
@@ -103,10 +103,10 @@ static struct GT_Mask DMM_debugMask = { NULL, NULL }; 
/* GT trace variable */
 
 static u32 cRefs;  /* module reference count */
 struct MapPage {
-   u32   RegionSize:15;
-   u32   MappedSize:15;
-   u32   bReserved:1;
-   u32   bMapped:1;
+   u64   RegionSize:31;
+   u64   MappedSize:31;
+   u64   bReserved:1;
+   u64   bMapped:1;
 };
 
 /*  Create the free list */
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] DSPBRIDGE: latest set of patches

2009-06-17 Thread Omar Ramirez Luna
These are the latest set of patches for d.o-z dspbridge.

Fernando Guzman Lugo (2):
  DSPBRIDGE: Allow separate load/run addresses for Dynamic Loader
  DSPBRIDGE: Reset MMU and DSP on board stop

Hari Kanigeri (3):
  DSPBRIDGE: Handle properly user space pointers
  DSPBRIDGE: Increased DMM size to 256MB
  DSPBRIDGE: Keep DMM resources for other nodes on PROC_Detach

Omar Ramirez Luna (2):
  DSPBRIDGE: Removing UTIL module
  DSPBRIDGE: Shared memory size increased to 5MB

 arch/arm/plat-omap/include/dspbridge/dmm.h  |2 +-
 arch/arm/plat-omap/include/dspbridge/util.h |  122 --
 drivers/dsp/bridge/pmgr/cmm.c   |2 +-
 drivers/dsp/bridge/pmgr/dbll.c  |   17 +++-
 drivers/dsp/bridge/pmgr/dev.c   |1 -
 drivers/dsp/bridge/pmgr/dmm.c   |8 +-
 drivers/dsp/bridge/pmgr/wcd.c   |  148 ---
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +-
 drivers/dsp/bridge/rmgr/proc.c  |4 +-
 drivers/dsp/bridge/services/clk.c   |2 -
 drivers/dsp/bridge/services/services.c  |   15 +--
 drivers/dsp/bridge/wmd/tiomap3430.c |6 +-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |1 -
 drivers/dsp/bridge/wmd/tiomap_io.c  |1 -
 14 files changed, 138 insertions(+), 193 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/util.h

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] DSPBRIDGE: Allow separate load/run addresses for Dynamic Loader

2009-06-17 Thread Omar Ramirez Luna
From: Fernando Guzman Lugo x0095...@ti.com

Allow separate load/run addresses for Dynamic Loader.

Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/pmgr/dbll.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 82430a3..5e58e80 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -1313,6 +1313,7 @@ static int rmmAlloc(struct Dynamic_Loader_Allocate *this,
s32 req = -1;
s32 count = 0;
u32 allocSize = 0;
+   u32 runAddrFlag = 0;
 
DBC_Require(this != NULL);
lib = pAlloc-lib;
@@ -1357,10 +1358,9 @@ static int rmmAlloc(struct Dynamic_Loader_Allocate *this,
if (strcmp(szSecLastToken, DYN_SARAM) == 0) {
segId = 1;
} else {
-   if (strcmp(szSecLastToken,
-  DYN_EXTERNAL) == 0) {
+   if (strcmp(szSecLastToken,
+  DYN_EXTERNAL) == 0)
segId = 2;
-   }
}
}
if (segId != -1) {
@@ -1381,6 +1381,11 @@ func_cont:
allocSize = info-size + GEM_L1P_PREFETCH_SIZE;
else
allocSize = info-size;
+   GT_2trace(DBLL_debugMask, GT_5CLASS,
+Beg info-run_addr = 0x%x, info-load_addr= 0x%x\n,
+info-run_addr, info-load_addr);
+   if (info-load_addr != info-run_addr)
+   runAddrFlag = 1;
/* TODO - ideally, we can pass the alignment requirement also
 * from here */
if (lib != NULL) {
@@ -1393,12 +1398,16 @@ func_cont:
} else {
/* RMM gives word address. Need to convert to byte address */
info-load_addr = rmmAddr.addr * DSPWORDSIZE;
-   info-run_addr = info-load_addr;
+   if (!runAddrFlag)
+   info-run_addr = info-load_addr;
info-context = (u32)rmmAddr.segid;
GT_3trace(DBLL_debugMask, GT_5CLASS,
 Remote alloc: %s  base = 0x%lx len
 = 0x%lx\n, info-name, info-load_addr / DSPWORDSIZE,
 info-size / DSPWORDSIZE);
+   GT_2trace(DBLL_debugMask, GT_5CLASS,
+info-run_addr = 0x%x, info-load_addr= 0x%x\n,
+info-run_addr, info-load_addr);
}
return retVal;
 }
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] DSPBRIDGE: Keep DMM resources for other nodes on PROC_Detach

2009-06-17 Thread Omar Ramirez Luna
From: Hari Kanigeri h-kanige...@ti.com

Removed resource cleanup for DMM on PROC_Detach due to LCML
detaching the processor when it deletes each node, therefore
resource cleanup was freeing DMM resources of other nodes that
might be still in use, this would cause unexpected behavior,
possibly MMU fault.

Signed-of-by: Hari Kanigeri h-kanige...@ti.com
---
 drivers/dsp/bridge/rmgr/proc.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 43f2d29..f6045bb 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -658,10 +658,8 @@ DSP_STATUS PROC_Detach(DSP_HPROCESSOR hProcessor)
DRV_GetProcContext(hProcess,
(struct DRV_OBJECT *)hDRVObject, pPctxt,
 NULL, 0);
-   if (pPctxt != NULL) {
-   DRV_ProcFreeDMMRes(pPctxt);
+   if (pPctxt != NULL)
pPctxt-hProcessor = NULL;
-   }
}
 #endif
/* Notify the Client */
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] DSPBRIDGE: Reset MMU and DSP on board stop

2009-06-17 Thread Omar Ramirez Luna
From: Fernando Guzman Lugo x0095...@ti.com

This patch resets MMU and DSP by writintg into those registers,
this will solve MMU faults occured when the processor is stopped.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
Signed-off-by: Fernando Guzman x0095...@ti.com
---
 drivers/dsp/bridge/wmd/tiomap3430.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index 4919314..b317015 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -849,6 +849,9 @@ static DSP_STATUS WMD_BRD_Stop(struct WMD_DEV_CONTEXT 
*hDevContext)
   (pPtAttrs-L2NumPages * sizeof(struct PageInfo)));
}
DBG_Trace(DBG_LEVEL6, WMD_BRD_Stop - End ** \n);
+   HW_RST_Reset(resources.dwPrmBase, HW_RST1_IVA2);
+   HW_RST_Reset(resources.dwPrmBase, HW_RST2_IVA2);
+
return status;
 }
 
@@ -911,7 +914,7 @@ static DSP_STATUS WMD_BRD_Delete(struct WMD_DEV_CONTEXT 
*hDevContext)
memset((u8 *)pPtAttrs-pgInfo, 0x00,
(pPtAttrs-L2NumPages * sizeof(struct PageInfo)));
}
-   DBG_Trace(DBG_LEVEL6, WMD_BRD_Stop - End ** \n);
+   DBG_Trace(DBG_LEVEL6, WMD_BRD_Delete - End ** \n);
HW_RST_Reset(resources.dwPrmBase, HW_RST1_IVA2);
HW_RST_Reset(resources.dwPrmBase, HW_RST2_IVA2);
 
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] DSPBRIDGE: Handle properly user space pointers

2009-06-17 Thread Omar Ramirez Luna
From: Hari Kanigeri h-kanige...@ti.com

This patch fixes bridge crash in UUID_UuidToString function. This
error was due to user pointers not handled properly.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
---
 drivers/dsp/bridge/pmgr/wcd.c |  147 ++---
 1 files changed, 109 insertions(+), 38 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index cd84e4e..995a833 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -519,15 +519,38 @@ u32 MGRWRAP_EnumProc_Info(union Trapped_Args *args)
 u32 MGRWRAP_RegisterObject(union Trapped_Args *args)
 {
u32 retVal;
+   struct DSP_UUID pUuid;
+   u32 pathSize = 0;
+   char *pszPathName = NULL;
+   DSP_STATUS status = DSP_SOK;
+
+   cp_fm_usr(pUuid, args-ARGS_MGR_REGISTEROBJECT.pUuid, status, 1);
+   if (DSP_FAILED(status))
+   goto func_end;
+   pathSize = strlen_user((char *)
+   args-ARGS_MGR_REGISTEROBJECT.pszPathName);
+   pszPathName = MEM_Alloc(pathSize, MEM_NONPAGED);
+   if (!pszPathName)
+   goto func_end;
+   retVal = strncpy_from_user(pszPathName,
+   (char *)args-ARGS_MGR_REGISTEROBJECT.pszPathName,
+   pathSize);
+   if (!retVal) {
+   status = DSP_EPOINTER;
+   goto func_end;
+   }
+   pszPathName[pathSize] = '\0';
 
GT_1trace(WCD_debugMask, GT_ENTER,
 MGRWRAP_RegisterObject: entered pg2hMsg 
 0x%x\n, args-ARGS_MGR_REGISTEROBJECT.pUuid);
-   retVal = DCD_RegisterObject(WRAP_MAP2CALLER
-   (args-ARGS_MGR_REGISTEROBJECT.pUuid),
-   args-ARGS_MGR_REGISTEROBJECT.objType,
-   WRAP_MAP2CALLER(args-ARGS_MGR_REGISTEROBJECT.pszPathName));
-   return retVal;
+   status = DCD_RegisterObject(pUuid,
+   args-ARGS_MGR_REGISTEROBJECT.objType,
+   (char *)pszPathName);
+func_end:
+   if (pszPathName)
+   MEM_Free(pszPathName);
+   return status;
 }
 
 /*
@@ -535,16 +558,21 @@ u32 MGRWRAP_RegisterObject(union Trapped_Args *args)
  */
 u32 MGRWRAP_UnregisterObject(union Trapped_Args *args)
 {
-   u32 retVal;
+   DSP_STATUS status = DSP_SOK;
+   struct DSP_UUID pUuid;
+
+   cp_fm_usr(pUuid, args-ARGS_MGR_REGISTEROBJECT.pUuid, status, 1);
+   if (DSP_FAILED(status))
+   goto func_end;
 
GT_1trace(WCD_debugMask, GT_ENTER,
 MGRWRAP_UnregisterObject: entered pg2hMsg
  0x%x\n, args-ARGS_MGR_UNREGISTEROBJECT.pUuid);
-   retVal = DCD_UnregisterObject(WRAP_MAP2CALLER
-   (args-ARGS_MGR_UNREGISTEROBJECT.pUuid),
+   status = DCD_UnregisterObject(pUuid,
args-ARGS_MGR_UNREGISTEROBJECT.objType);
+func_end:
+   return status;
 
-   return retVal;
 }
 
 /*
@@ -628,11 +656,15 @@ u32 PROCWRAP_Attach(union Trapped_Args *args)
cp_fm_usr(attrIn, args-ARGS_PROC_ATTACH.pAttrIn, status, 1);
if (DSP_SUCCEEDED(status))
pAttrIn = attrIn;
+   else
+   goto func_end;
+
 
}
status = PROC_Attach(args-ARGS_PROC_ATTACH.uProcessor, pAttrIn,
processor);
cp_to_usr(args-ARGS_PROC_ATTACH.phProcessor, processor, status, 1);
+func_end:
return status;
 }
 
@@ -653,16 +685,20 @@ u32 PROCWRAP_Ctrl(union Trapped_Args *args)
 args-ARGS_PROC_CTRL.dwCmd,
 args-ARGS_PROC_CTRL.pArgs);
if (pSize) {
-   if (get_user(cbDataSize, pSize))
+   if (get_user(cbDataSize, pSize)) {
status = DSP_EFAIL;
-
+   goto func_end;
+   }
cbDataSize += sizeof(u32);
if (DSP_SUCCEEDED(status)) {
pArgs = MEM_Alloc(cbDataSize, MEM_NONPAGED);
-   if (pArgs == NULL)
+   if (pArgs == NULL) {
status = DSP_EMEMORY;
+   goto func_end;
+   }
+   } else
+   goto func_end;
 
-   }
cp_fm_usr(pArgs, args-ARGS_PROC_CTRL.pArgs, status,
 cbDataSize);
}
@@ -675,7 +711,7 @@ u32 PROCWRAP_Ctrl(union Trapped_Args *args)
/* cp_to_usr(args-ARGS_PROC_CTRL.pArgs, pArgs, status, 1);*/
if (pArgs)
MEM_Free(pArgs);
-
+func_end:
return status;
 }
 
@@ -767,7 +803,11 @@ u32 PROCWRAP_InvalidateMemory(union Trapped_Args *args)
  */
 u32 PROCWRAP_EnumResources(union Trapped_Args *args)
 {
-   u32 retVal;
+   DSP_STATUS status = DSP_SOK;
+   struct DSP_RESOURCEINFO pResourceInfo;
+
+   if (DSP_FAILED(status))
+

[PATCH 4/7] DSPBRIDGE: Shared memory size increased to 5MB

2009-06-17 Thread Omar Ramirez Luna
Increase the shared memory size to 5MB, bridge
initialization should reserve 5MB of shared memory
by default.

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/rmgr/drv_interface.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c 
b/drivers/dsp/bridge/rmgr/drv_interface.c
index f41e153..eaac89d 100644
--- a/drivers/dsp/bridge/rmgr/drv_interface.c
+++ b/drivers/dsp/bridge/rmgr/drv_interface.c
@@ -129,7 +129,7 @@ static s32 driver_minor = DRIVER_MINOR;
 static char *base_img;
 char *iva_img;
 static char *num_procs = C55=1;
-static s32 shm_size = 0x40;/* 4 MB */
+static s32 shm_size = 0x50;/* 5 MB */
 static u32 phys_mempool_base;
 static u32 phys_mempool_size;
 static int tc_wordswapon;  /* Default value is always false */
-- 
1.6.2.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] DSPBRIDGE: less code nesting for MemUnMap

2009-07-19 Thread Omar Ramirez Luna
less code nesting for MemUnMap

Signed-off-by: Omar Ramirez Luna omar.rami...@ti.com
---
 drivers/dsp/bridge/wmd/tiomap3430.c |  271 +--
 1 files changed, 130 insertions(+), 141 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index 449de01..268de07 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -1612,157 +1612,146 @@ static DSP_STATUS WMD_BRD_MemUnMap(struct 
WMD_DEV_CONTEXT *hDevContext,
pteAddrL1 = HW_MMU_PteAddrL1(L1BaseVa, vaCurr);
pteVal = *(u32 *)pteAddrL1;
pteSize = HW_MMU_PteSizeL1(pteVal);
-   if (pteSize == HW_MMU_COARSE_PAGE_SIZE) {
-   /*
-* Get the L2 PA from the L1 PTE, and find
-* corresponding L2 VA
-*/
-   L2BasePa = HW_MMU_PteCoarseL1(pteVal);
-   L2BaseVa = L2BasePa - pt-L2BasePa + pt-L2BaseVa;
-   L2PageNum = (L2BasePa - pt-L2BasePa) /
-   HW_MMU_COARSE_PAGE_SIZE;
-   /*
-* Find the L2 PTE address from which we will start
-* clearing, the number of PTEs to be cleared on this
-* page, and the size of VA space that needs to be
-* cleared on this L2 page
-*/
-   pteAddrL2 = HW_MMU_PteAddrL2(L2BaseVa, vaCurr);
-   pteCount = pteAddrL2  (HW_MMU_COARSE_PAGE_SIZE - 1);
-   pteCount = (HW_MMU_COARSE_PAGE_SIZE - pteCount) /
-   sizeof(u32);
-   if (remBytes  (pteCount * PG_SIZE_4K))
-   pteCount = remBytes / PG_SIZE_4K;
-
-   remBytesL2 = pteCount * PG_SIZE_4K;
-   DBG_Trace(DBG_LEVEL1, WMD_BRD_MemUnMap L2BasePa %x, 
- L2BaseVa %x pteAddrL2 %x, remBytesL2 %x\n,
- L2BasePa, L2BaseVa, pteAddrL2, remBytesL2);
-   /*
-* Unmap the VA space on this L2 PT. A quicker way
-* would be to clear pteCount entries starting from
-* pteAddrL2. However, below code checks that we don't
-* clear invalid entries or less than 64KB for a 64KB
-* entry. Similar checking is done for L1 PTEs too
-* below
-*/
-   while (remBytesL2  (DSP_SUCCEEDED(status))) {
-   pteVal = *(u32 *)pteAddrL2;
-   pteSize = HW_MMU_PteSizeL2(pteVal);
-   /* vaCurr aligned to pteSize? */
-   if ((pteSize != 0)  (remBytesL2 = pteSize) 
-  !(vaCurr  (pteSize - 1))) {
-   /* Collect Physical addresses from VA */
-   pAddr = (pteVal  ~(pteSize - 1));
-   if (pteSize == HW_PAGE_SIZE_64KB)
-   numof4KPages = 16;
-   else
-   numof4KPages = 1;
-   temp = 0;
-   while (temp++  numof4KPages) {
-   if (!pfn_valid(__phys_to_pfn(
-   pAddr))) {
-   pAddr +=
-   HW_PAGE_SIZE_4KB;
-   continue;
-   }
-   pg = phys_to_page(pAddr);
-   if (page_count(pg)  1) {
-   pr_info(DSPBRIDGE:
-   UNMAP function: 
-   COUNT 0 FOR PA 
-   0x%x, size = 
-   0x%x\n, pAddr,
-   ulNumBytes);
-   bad_page_dump(pAddr,
-   pg);
-   }
-   SetPageDirty(pg);
-   page_cache_release(pg

[PATCH 1/3] DSPBRIDGE: Remove DMM physical addres table

2009-07-19 Thread Omar Ramirez Luna
From: Hari Kanigeri h-kanige...@ti.com

Physical address is not needed anymore since Mapping migration
to open source API, this patch removes the physical table entry.

Signed-off-by: Hari Kanigeri h-kanige...@ti.com
Signed-off-by: Fernando Guzman Lugo x0095...@ti.com
---
 arch/arm/plat-omap/include/dspbridge/dmm.h |1 -
 drivers/dsp/bridge/pmgr/dmm.c  |   35 --
 drivers/dsp/bridge/wmd/tiomap3430.c|   55 +---
 3 files changed, 34 insertions(+), 57 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/dmm.h 
b/arch/arm/plat-omap/include/dspbridge/dmm.h
index ef37668..335edf8 100644
--- a/arch/arm/plat-omap/include/dspbridge/dmm.h
+++ b/arch/arm/plat-omap/include/dspbridge/dmm.h
@@ -81,5 +81,4 @@
 
extern DSP_STATUS DMM_CreateTables(struct DMM_OBJECT *hDmmMgr,
u32 addr, u32 size);
-   extern u32 *DMM_GetPhysicalAddrTable(void);
 #endif /* DMM_ */
diff --git a/drivers/dsp/bridge/pmgr/dmm.c b/drivers/dsp/bridge/pmgr/dmm.c
index 803de93..f4fc6ec 100644
--- a/drivers/dsp/bridge/pmgr/dmm.c
+++ b/drivers/dsp/bridge/pmgr/dmm.c
@@ -113,7 +113,6 @@ struct MapPage {
 static struct MapPage *pVirtualMappingTable;
 static u32  iFreeRegion;   /* The index of free region */
 static u32  iFreeSize;
-static u32  *pPhysicalAddrTable;   /* Physical address of MPU buffer */
 static u32  dynMemMapBeg;  /* The Beginning of dynamic memory mapping */
 static u32  TableSize;/* The size of virtual and physical pages tables */
 
@@ -151,28 +150,11 @@ DSP_STATUS DMM_CreateTables(struct DMM_OBJECT *hDmmMgr, 
u32 addr, u32 size)
if (pVirtualMappingTable == NULL)
status = DSP_EMEMORY;
else {
-   /* This table will be used
-   * to store the virtual to physical
-   * address translations
-   */
-   pPhysicalAddrTable = (u32 *)MEM_Calloc
-   (TableSize*sizeof(u32), MEM_NONPAGED);
-   GT_1trace(DMM_debugMask, GT_4CLASS,
-   DMM_CreateTables: Allocate
-   memory for pPhysicalAddrTable=%d entries\n,
-   TableSize);
-   if (pPhysicalAddrTable == NULL) {
-   status = DSP_EMEMORY;
-   GT_0trace(DMM_debugMask, GT_7CLASS,
-   DMM_CreateTables: Memory allocation for 
-   pPhysicalAddrTable failed\n);
-   } else {
/* On successful allocation,
* all entries are zero ('free') */
iFreeRegion = 0;
iFreeSize = TableSize*PG_SIZE_4K;
pVirtualMappingTable[0].RegionSize = TableSize;
-   }
}
SYNC_LeaveCS(pDmmObj-hDmmLock);
} else
@@ -275,9 +257,6 @@ DSP_STATUS DMM_DeleteTables(struct DMM_OBJECT *hDmmMgr)
if (pVirtualMappingTable != NULL)
MEM_Free(pVirtualMappingTable);
 
-   if (pPhysicalAddrTable != NULL)
-   MEM_Free(pPhysicalAddrTable);
-
SYNC_LeaveCS(pDmmObj-hDmmLock);
} else
status = DSP_EHANDLE;
@@ -361,7 +340,6 @@ bool DMM_Init(void)
DBC_Ensure((fRetval  (cRefs  0)) || (!fRetval  (cRefs = 0)));
 
pVirtualMappingTable = NULL ;
-   pPhysicalAddrTable = NULL ;
TableSize = 0;
 
return fRetval;
@@ -635,19 +613,6 @@ static struct MapPage *GetMappedRegion(u32 aAddr)
return currRegion;
 }
 
-/*
- *   DMM_GetPhysicalAddrTable 
- *  Purpose:
- *  Returns the physical table address
- */
-u32 *DMM_GetPhysicalAddrTable(void)
-{
-   GT_1trace(DMM_debugMask, GT_ENTER, Entered 
-   DMM_GetPhysicalAddrTable()- pPhysicalAddrTable 0x%x\n,
-   pPhysicalAddrTable);
-   return pPhysicalAddrTable;
-}
-
 #ifdef DSP_DMM_DEBUG
 u32 DMM_MemMapDump(struct DMM_OBJECT *hDmmMgr)
 {
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c 
b/drivers/dsp/bridge/wmd/tiomap3430.c
index b317015..449de01 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -1592,16 +1592,12 @@ static DSP_STATUS WMD_BRD_MemUnMap(struct 
WMD_DEV_CONTEXT *hDevContext,
DSP_STATUS status = DSP_SOK;
struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
struct PgTableAttrs *pt = pDevContext-pPtAttrs;
-   u32 pacount = 0;
-   u32 *pPhysAddrPageTbl = NULL;
u32 temp;
-   u32 patemp = 0;
u32 pAddr;
u32 numof4KPages = 0;
 
DBG_Trace(DBG_ENTER,  WMD_BRD_MemUnMap hDevContext %x, va %x, 
  NumBytes %x\n, hDevContext, ulVirtAddr, 

<    1   2   3   4   5   6   7   >