linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH A 00/15] tidspbridge: general cleanups
@ 2009-03-18  1:22 Felipe Contreras
  2009-03-18  1:22 ` [PATCH A 01/15] tidspbridge: remove revision history Felipe Contreras
  2009-03-18 12:55 ` [PATCH A 00/15] tidspbridge: general cleanups Kanigeri, Hari
  0 siblings, 2 replies; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:22 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

This patch series is not doing much, just cleaning up the irq mailbox functions
and related stuff.

Among the sem-functional changes are:
 * 0010: avoid udelay and use time_after
 * 0015: print an error when timing out

Felipe Contreras (15):
  tidspbridge: remove revision history
  tidspbridge: trivial cleanup
  tidspbridge: remove unused stuff
  tidspbridge: remove IO_CALLDPC
  tidspbridge: whitespace cleanups
  tidspbridge: trivial cleanups
  tidspbridge: hDevContext == pDevContext
  tidspbridge: remove UTIL_Wait wrapper
  tidspbridge: cleanup and remove HW_MBOX_IsFull
  tidspbridge: remove udelay and use time_after instead
  tidspbridge: Remove IO_InterruptDSP
  tidspbridge: remove IO_InterruptDSP2
  tidspbridge: remove CHNLSM_InterruptDSP
  tidspbridge: remove wIntrVal2Dsp
  tidspbridge: print an error when timing out

 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |   42 ----
 arch/arm/plat-omap/include/dspbridge/io_sm.h   |    3 -
 arch/arm/plat-omap/include/dspbridge/util.h    |   51 -----
 drivers/dsp/bridge/hw/hw_mbox.c                |   25 ---
 drivers/dsp/bridge/hw/hw_mbox.h                |   35 ----
 drivers/dsp/bridge/wmd/_tiomap.h               |   23 --
 drivers/dsp/bridge/wmd/_tiomap_pwr.h           |    4 -
 drivers/dsp/bridge/wmd/_tiomap_util.h          |    1 -
 drivers/dsp/bridge/wmd/io_sm.c                 |   78 +-------
 drivers/dsp/bridge/wmd/tiomap3430.c            |   18 +-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c        |   22 +-
 drivers/dsp/bridge/wmd/tiomap_sm.c             |  260 +++++++-----------------
 12 files changed, 101 insertions(+), 461 deletions(-)


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH A 01/15] tidspbridge: remove revision history
  2009-03-18  1:22 [PATCH A 00/15] tidspbridge: general cleanups Felipe Contreras
@ 2009-03-18  1:22 ` Felipe Contreras
  2009-03-18  1:22   ` [PATCH A 02/15] tidspbridge: trivial cleanup Felipe Contreras
  2009-03-18 12:55 ` [PATCH A 00/15] tidspbridge: general cleanups Kanigeri, Hari
  1 sibling, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:22 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras, Felipe Contreras

No need for that with git.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |    9 ---
 arch/arm/plat-omap/include/dspbridge/util.h    |   18 -------
 drivers/dsp/bridge/wmd/_tiomap.h               |   22 --------
 drivers/dsp/bridge/wmd/io_sm.c                 |   64 ------------------------
 drivers/dsp/bridge/wmd/tiomap_sm.c             |   15 ------
 5 files changed, 0 insertions(+), 128 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
index fc67cc7..8a9553b 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
@@ -36,15 +36,6 @@
  *      Currently, CHNLSM_Read() and CHNLSM_Write() are not called, but must
  *      be defined to link.
  *
- *! Revision History:
- *! ================
- *! 06-Jan-2002 ag: Added CHNLSM_InterruptDSP2 to set Mailbox value.
- *! 05-Nov-2001 kc: Updated CHNLSM_ISR to read value returned by interrupt.
- *! 21-Jan-2000 ag: Updated comments per code review.
- *! 18-Dec-1997 gp: Added CDECL.
- *! 16-Jun-1997 gp: Added function UpdateSHMLength().
- *! 13-Nov-1996 gp: Renamed CHNL_ to CHNLSM_.
- *! 10-Jul-1996 gp: Created.
  */
 
 #ifndef CHNLSM_
diff --git a/arch/arm/plat-omap/include/dspbridge/util.h b/arch/arm/plat-omap/include/dspbridge/util.h
index 3b3e9c0..9d8842a 100644
--- a/arch/arm/plat-omap/include/dspbridge/util.h
+++ b/arch/arm/plat-omap/include/dspbridge/util.h
@@ -27,24 +27,6 @@
  *      UTIL_GetSysInfo
  *      UTIL_Init
  *      UTIL_Wait
- *
- *  Private Functions:
- *      isspace
- *
- *  Notes:
- *
- *! Revision History
- *! ================
- *! 12-Aug-2000 ag: Added UTIL_GetSysInfo().
- *! 31-Jan-2000 rr: Comments modifed for UTIL_Wait fxn.
- *! 17-Jan-2000 rr: UTIL_Wait fxn added. Busy waits x number of micro seconds.
- *! 12-Nov-1999 kc: Modified UTIL_CmdLineToArgs for use by different tests.
- *! 02-Nov-1999 kc: Removed parameter from UTIL_CDTestDll.
- *! 29-Oct-1999 kc: Cleaned up for code review.
- *! 08-Oct-1999 kc: Renamed UTIL_TestDllExec to UTIL_CDTestDll; added
- *!                 UTIL_CmdLineToArgs(); added isspace private func.
- *! 26-Dec-1996 cr: Created from misc pieces of wcd95.c, ktest.c.
- *
  */
 
 #ifndef _UTIL_H
diff --git a/drivers/dsp/bridge/wmd/_tiomap.h b/drivers/dsp/bridge/wmd/_tiomap.h
index 5267eb2..10fd9cd 100644
--- a/drivers/dsp/bridge/wmd/_tiomap.h
+++ b/drivers/dsp/bridge/wmd/_tiomap.h
@@ -19,28 +19,6 @@
  *  Description:
  *      Definitions and types private to this WMD.
  *
- *! Revision History
- *! ================
- *! 12-Apr-2004 hp:  Removed the L4 entry of Dsp DMA , not needed
- *! 08-Mar-2004 sb:  Added the Dynamic Memory Mapping feature - PgTableAttrs
- *! 21-Mar-2003 sb:  Added numTLBEntries to struct WMD_DEV_CONTEXT
- *! 20-Feb-2003 vp:  Ported to Linux platform.
- *! 30-Jul-2002 rr:  Modified TBC_ID_VALUE to 0xb47002f.
- *! 10-May-2002 sg:  Added ARM_SYSST_OFFSET and IDLE_DSP_MASK.
- *! 14-Mar-2002 rr:  Added Boot vector field to pDevContext.
- *!                  Added TBC Register defines and value for OMAP1510.
- *! 12-Jan-2002 ag:  wIntrVal2Dsp Added.
- *! 05-Nov-2001 kc:  Added MMU fault related definitions.
- *! 03-Aug-2001 ag   Added TLB table for OEM cofig of DSP-MMU.
- *! 23-Aug-2001 rr:  Added API_SIZE define.
- *! 16-Aug-2001 rr:  Added dwDspExtBaseAddr to access the Ext memory.
- *! 24-Jul-2001 ag:  Added Internal SRAM MMU table entry.
- *! 27-Jun-2001 rr:  Name changed to _tihelen.h.
- *! 27-Jun-2001 ag:  Added dwIntAddr in WMD_DEV_CONTEXT used for MB INTRs msk.
- *! 07-May-2001 ag:  Added DSP Clock Module CLKM2.
- *!                  Added TIHEL_SDRAMPHYSBASE used for DSP MMU init.
- *!                  Added ClearBit() MACRO.
- *! 18-Jan-2001 rr:  Created
  */
 
 #ifndef _TIOMAP_
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index 037f4f3..7fc4304 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -43,70 +43,6 @@
  *      which may cause timeouts and/or failure of the WIN32_WaitSingleObject
  *      function (SYNC_WaitOnEvent).
  *
- *! Revision History:
- *! ================
- *! 28-Apr-2004 vp: Updated IVA MMU entries based on Aptix validation.
- *! 19-Apr-2004 sb: Clear MBX_DEH_RESET from hIOMgr->wIntrVal to prevent
-		    DEH when MPU invokes DPC before next DSP interrupt.
-		    Revert back GP timer mapping endianness to LE
- *! 22-Apr-2004 sb: Fixed SHM & peripherals endianness settings for 2420
-		    Optimized num. of SHM entries for any SHM size.
- *! 08-Mar-2004 sb: Updated HW_MMU page size macros
- *! 09-Feb-2004 vp: Updated for IVA link driver.
- *! 05-Jan-2004 vp: Updated for the 24xx platform.
- *! 23-Apr-2003 sb: Fixed mailbox deadlock
- *! 13-Apr-2003 vp: Updated to support TC Word Swap option.
- *! 21-Mar-2003 sb: OEM configuration updates
- *! 24-Feb-2003 vp: Code Review Updates.
- *! 18-Oct-2002 sb: Ported to Linux platform
- *! 28-Mar-2002 jeh Assume word addresses for SHM, MSG, ... symbol values.
- *! 25-Jan-2002 ag  bDspAck incorrectly set in IO_DDZCDispatchChnl()
- *! 05-Jan-2002 ag  Set MBX value to DSP using IO_InterruptDSP2().
- *!		 Check for CHNL_STATECANCEL in ACK processing.
- *! 20-Dec-2001 ag  Removed #ifdef CHNL_NOIPCINTR & CHNL_PREOMAP for DSP-DMA.
- *!		 Removed unused fxn GetDDMAChnl().
- *! 11-Dec-2001 ag  Fix in DDMA_Dispatch for multi-bufs.
- *! 06-Nov-2001 ag  DSP-DMA I/O processing support added.
- *! 05-Nov-2001 kc  Updated to support DEH module.
- *! 18-Sep-2001 ag  Using virtual cached addressing for SM.
- *! 29-Aug-2001 ag  User SM regions registered during prog load.
- *! 10-Aug-2001 ag  Removed dependency on platform\inc\Config.h.
- *!		 MMU setup OnLoaded & per DEV context.
- *! 08-May-2001 ag  Don't SwapWord if TIHELEN.
- *! 31-May-2001 ag  Fixed bug in pInput calc.
- *! 21-May-2001 ag  Helen SM uses TICFG_BRIDGE_DATA_BASE[SIZE] in Config.h.
- *! 04-May-2001 jeh Replaced CHNL_PREOMAP with CHNL_OMAP, added CHNL_HELEN.
- *!		 Cleaned up WMD_IO_OnLoaded a bit.
- *! 10-Apr-2001 rr: Replaced DBG_ENTER with DBG_LEVEL3.
- *! 28-Mar-2001 ag  Added CHNL_NOIPCINTR. Disables IPC INTR handling.
- *! 16-Feb-2001 jeh Messaging disabled for PREOMAP.
- *! 16-Dec-2000 ag  IO_DispatchMsg() enabled for PreOMAP.
- *!		 SM must be in last 4 Meg region SDRAM for PreOMAP.
- *! 14-Dec-2000 jeh Now reads SM addresses from COFF for PreOMAP.
- *! 04-Dec-2000 jeh Bug fixes for messaging.
- *! 20-Nov-2000 jeh Updated to handle messaging.
- *! 23-Oct-2000 jeh Added notifications of IO complete and end of stream for
- *!		 DSPStream support. Pass arg in SHM structure.
- *! 07-Jul-2000 rr: Changed Prefix proc to prcs for Process module.
- *! 03-Feb-2000 rr: DBG statements during fxn entry added.
- *! 21-Jan-2000 ag: Clean-up per code review.
- *! 10-Dev-1999 ag: Added critical section in IO_Dispatch() to protect IOCL/IOR.
- *!		 Removed DBC_Asserts after cancelled/closed channels.
- *!		 Replaced x86 specific __asm int 3 with DBC_Assert(false);
- *! 12-Nov-1999 ag: Removed some warnings when compiling for 16 bit targets.
- *!		 (See #if _CHNL_WORDSIZE).
- *! 04-Nov-1999 ag: WinCE port.
- *! 25-May-1999 jg: Test that CHNL_IOCLASS boards have a loaded program with
- *!		 a defined shared memory buffer.
- *! 09-Jul-1997 gp: Added some checks for validity of SHM control block values.
- *! 17-Jan-1997 db: Added capability to log shared memory header.
- *! 15-Jan-1997 gp: Code Review mods: moved static dwLastId to CHNL_MGR object.
- *! 03-Jan-1997 gp: Added call to CHNLSM_DPC from IO_DPC. Check for ISR failing
- *!		 to process interrupt on a non-shared IRQ line.
- *! 10-Dec-1996 gp: Added EOS notification on input channel (CHNL_MODEFROMDSP).
- *! 27-Nov-1996 gp: Fixed bug in IO_Dispatch(), which fixed flushing.
- *! 23-Oct-1996 gp: Ensure client buffer bounds are not overrun on input.
- *! 12-Aug-1996 gp: Created.
  */
 
 /*  ----------------------------------- Host OS */
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 9bc5b54..6e258f4 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -19,21 +19,6 @@
  *  Description:
  *      Implements lower edge channel class library functions.
  *
- *! Revision History:
- *! ================
- *! 05-Jan-2004 vp    Updated for the new HW library for 24xx platform.
- *! 12-Feb-2004 hp    use 'CFG_GetHostResources' to fetch virtual addresses of
- *!           PRCM, dMMU components.
- *! 08-Oct-2002 rr    Renamed to tiomap1510_sm.c
- *! 15-Feb-2002 ag    Remove #include <pkfuncs.h> & util.h.
- *! 07-Jan-2001 ag    Set DSP MBX val (to DSP) contained in DEV context.
- *! 05-Nov-2001 kc:   Modified CHNLSM_ISR to read mailbox1 interrupt values
- *! 26-Sep-2001 rr:   InterruptDSP does not spin forever for retail build.
- *! 29-Aug-2001 rr:   Cleaned up the non referenced variables.
- *! 26-Jul-2001 jeh   Enable interrupt to DSP.
- *! 28-Jun-2001 ag    Disable INTR gen to DSP in CHNLSM_InterruptDSP().
- *! 26-Jun-2001 ag    Added INTR support.
- *! 17-May-2000 ag    Initial. No INTR support.
  */
 
 /*  ----------------------------------- Host OS */
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 02/15] tidspbridge: trivial cleanup
  2009-03-18  1:22 ` [PATCH A 01/15] tidspbridge: remove revision history Felipe Contreras
@ 2009-03-18  1:22   ` Felipe Contreras
  2009-03-18  1:22     ` [PATCH A 03/15] tidspbridge: remove unused stuff Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:22 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Remove comments that introduce noise.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |   46 ++---------------------------------
 1 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 6e258f4..6755944 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -1,10 +1,8 @@
 /*
- * tiomap_sm.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
  * Copyright (C) 2005-2006 Texas Instruments, Inc.
  *
+ * Implements lower edge channel class library functions.
+ *
  * 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.
@@ -14,40 +12,25 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-/*
- *  ======== tiomap_sm.c ========
- *  Description:
- *      Implements lower edge channel class library functions.
- *
- */
-
-/*  ----------------------------------- Host OS */
 #include <dspbridge/host_os.h>
-/*  ----------------------------------- DSP/BIOS Bridge */
 #include <dspbridge/std.h>
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/errbase.h>
 
-/*  ----------------------------------- Trace & Debug */
 #include <dspbridge/dbg.h>
 
-/*  ----------------------------------- OS Adaptation Layer */
 #include <dspbridge/cfg.h>
 #include <dspbridge/drv.h>
 #include <dspbridge/util.h>
 
-/*  ----------------------------------- Mini Driver */
 #include <dspbridge/wmd.h>
 
-/*  ----------------------------------- Platform Manager */
 #include <dspbridge/wcd.h>
 #include <dspbridge/dev.h>
 
-/* ------------------------------------ Hardware Abstraction Layer */
 #include <hw_defs.h>
 #include <hw_mbox.h>
 
-/*  ----------------------------------- This */
 #include "_tiomap.h"
 #include <dspbridge/chnl_sm.h>
 #include "_tiomap_pwr.h"
@@ -56,7 +39,6 @@
 extern struct platform_device omap_dspbridge_dev;
 #endif
 
-/*  ----------------------------------- Defines, Data Structures, Typedefs */
 #ifndef DEBUG
 #define TIHELEN_INT_TIMEOUT     1
 #define LOOP_COUNT              1000000
@@ -65,10 +47,7 @@ extern struct platform_device omap_dspbridge_dev;
 extern struct MAILBOX_CONTEXT mboxsetting;
 extern DSP_STATUS DSP_PeripheralClocks_Enable(struct WMD_DEV_CONTEXT
 					     *pDevContext, IN void *pArgs);
-/*
- *  ======== CHNLSM_EnableInterrupt ========
- *      Enables interrupts from DSP.
- */
+
 DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
@@ -121,10 +100,6 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 	return status;
 }
 
-/*
- *  ======== CHNLSM_DisableInterrupt ========
- *      Disables interrupts from DSP.
- */
 DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
@@ -141,10 +116,6 @@ DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 	return status;
 }
 
-/*
- *  ======== CHNLSM_InterruptDSP ========
- *      Send an interrupt to the DSP processor(s).
- */
 DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
@@ -221,10 +192,6 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 	return status;
 }
 
-/*
- *  ======== CHNLSM_InterruptDSP2 ========
- *      Set MBX value & send an interrupt to the DSP processor(s).
- */
 DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *hDevContext,
 				u16 wMbVal)
 {
@@ -235,17 +202,11 @@ DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *hDevContext,
 	return CHNLSM_InterruptDSP(hDevContext);
 }
 
-/*
- *  ======== CHNLSM_DPC ========
- */
 void CHNLSM_DPC(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DBG_Trace(DBG_ENTER, "CHNLSM_DPC(0x%x)\n", hDevContext);
 }
 
-/*
- *  ======== CHNLSM_ISR ========
- */
 bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
 		OUT u16 *pwIntrVal)
 {
@@ -277,4 +238,3 @@ bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
 	*pfSchedDPC = true;
 	return fMyInterrupt;
 }
-
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 03/15] tidspbridge: remove unused stuff
  2009-03-18  1:22   ` [PATCH A 02/15] tidspbridge: trivial cleanup Felipe Contreras
@ 2009-03-18  1:22     ` Felipe Contreras
  2009-03-18  1:23       ` [PATCH A 04/15] tidspbridge: remove IO_CALLDPC Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:22 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 6755944..58234d2 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -12,42 +12,22 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#include <dspbridge/host_os.h>
-#include <dspbridge/std.h>
 #include <dspbridge/dbdefs.h>
 #include <dspbridge/errbase.h>
 
-#include <dspbridge/dbg.h>
-
 #include <dspbridge/cfg.h>
 #include <dspbridge/drv.h>
-#include <dspbridge/util.h>
-
-#include <dspbridge/wmd.h>
-
-#include <dspbridge/wcd.h>
 #include <dspbridge/dev.h>
 
-#include <hw_defs.h>
-#include <hw_mbox.h>
+#include <dspbridge/dbg.h>
 
 #include "_tiomap.h"
-#include <dspbridge/chnl_sm.h>
 #include "_tiomap_pwr.h"
 
 #ifdef CONFIG_BRIDGE_DVFS
 extern struct platform_device omap_dspbridge_dev;
 #endif
 
-#ifndef DEBUG
-#define TIHELEN_INT_TIMEOUT     1
-#define LOOP_COUNT              1000000
-#endif
-
-extern struct MAILBOX_CONTEXT mboxsetting;
-extern DSP_STATUS DSP_PeripheralClocks_Enable(struct WMD_DEV_CONTEXT
-					     *pDevContext, IN void *pArgs);
-
 DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 04/15] tidspbridge: remove IO_CALLDPC
  2009-03-18  1:22     ` [PATCH A 03/15] tidspbridge: remove unused stuff Felipe Contreras
@ 2009-03-18  1:23       ` Felipe Contreras
  2009-03-18  1:23         ` [PATCH A 05/15] tidspbridge: whitespace cleanups Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Doesn't do anything

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |   17 -----------------
 arch/arm/plat-omap/include/dspbridge/io_sm.h   |    1 -
 drivers/dsp/bridge/wmd/io_sm.c                 |    2 --
 drivers/dsp/bridge/wmd/tiomap_sm.c             |    5 -----
 4 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
index 8a9553b..546754b 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
@@ -23,7 +23,6 @@
  *
  *  Public Functions:
  *      CHNLSM_DisableInterrupt;
- *      CHNLSM_DPC;
  *      CHNLSM_EnableInterrupt;
  *      CHNLSM_InterruptDSP;
  *      CHNLSM_ISR;
@@ -57,22 +56,6 @@
 							hDevContext);
 
 /*
- *  ======== CHNLSM_DPC ========
- *  Purpose:
- *      This mini-driver's deferred processing routine.  Finishes processing
- *      deferred by the WMD's ISR.
- *  Parameters:
- *      hDevContext:    Handle to mini-driver defined device info.
- *  Returns:
- *  Requires:
- *      Must not block.
- *      Must not acquire resources.
- *      All data objects touched must be locked in memory.
- *  Ensures:
- */
-       extern void CHNLSM_DPC(struct WMD_DEV_CONTEXT *hDevContext);
-
-/*
  *  ======== CHNLSM_EnableInterrupt ========
  *  Purpose:
  *      Enable interrupts from the DSP board to the PC.
diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index 69b321c..81f7d93 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -79,7 +79,6 @@
 #define IO_EnableInterrupt(h)   CHNLSM_EnableInterrupt(h)
 #define IO_InterruptDSP(h)      CHNLSM_InterruptDSP(h)
 #define IO_InterruptDSP2(h, v)  CHNLSM_InterruptDSP2(h, v)
-#define IO_CALLDPC(h)           CHNLSM_DPC(h)
 #define IO_CALLISR(h, pFlag, pwMBRegVal)   CHNLSM_ISR(h, pFlag, pwMBRegVal)
 
 /*
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index 7fc4304..9050862 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -955,8 +955,6 @@ void IO_DPC(IN OUT void *pRefData)
 			WMD_DEH_Notify(hDehMgr, DSP_SYSERROR, pIOMgr->wIntrVal);
 
 	}
-	/* Call WMD's DPC: */
-	IO_CALLDPC(pIOMgr->hWmdContext);
 	IO_DispatchChnl(pIOMgr, NULL, IO_SERVICE);
 #ifdef CHNL_MESSAGES
 	if (pMsgMgr) {
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 58234d2..5249ea5 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -182,11 +182,6 @@ DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *hDevContext,
 	return CHNLSM_InterruptDSP(hDevContext);
 }
 
-void CHNLSM_DPC(struct WMD_DEV_CONTEXT *hDevContext)
-{
-	DBG_Trace(DBG_ENTER, "CHNLSM_DPC(0x%x)\n", hDevContext);
-}
-
 bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
 		OUT u16 *pwIntrVal)
 {
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 05/15] tidspbridge: whitespace cleanups
  2009-03-18  1:23       ` [PATCH A 04/15] tidspbridge: remove IO_CALLDPC Felipe Contreras
@ 2009-03-18  1:23         ` Felipe Contreras
  2009-03-18  1:23           ` [PATCH A 06/15] tidspbridge: trivial cleanups Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |   83 +++++++++++++++++-------------------
 1 files changed, 39 insertions(+), 44 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 5249ea5..fe4acd8 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -43,38 +43,37 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 
 	/* Read the messages in the mailbox until the message queue is empty */
 
-	status = CFG_GetHostResources(
-			(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-			&resources);
+	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+				      &resources);
 	status = DEV_GetDevType(pDevContext->hDevObject, &devType);
 	status = DEV_GetIOMgr(pDevContext->hDevObject, &hIOMgr);
 	if (devType == DSP_UNIT) {
 		hwStatus = HW_MBOX_NumMsgGet(resources.dwMboxBase,
-					       MBOX_DSP2ARM, &numMbxMsg);
+					     MBOX_DSP2ARM, &numMbxMsg);
 		while (numMbxMsg != 0) {
 			hwStatus = HW_MBOX_MsgRead(resources.dwMboxBase,
-						     MBOX_DSP2ARM,
-						     &mbxValue);
+						   MBOX_DSP2ARM,
+						   &mbxValue);
 			numMbxMsg--;
 		}
 		/* clear the DSP mailbox as well...*/
 		hwStatus = HW_MBOX_NumMsgGet(resources.dwMboxBase,
-					       MBOX_ARM2DSP, &numMbxMsg);
+					     MBOX_ARM2DSP, &numMbxMsg);
 		while (numMbxMsg != 0) {
 			hwStatus = HW_MBOX_MsgRead(resources.dwMboxBase,
-						    MBOX_ARM2DSP, &mbxValue);
+						   MBOX_ARM2DSP, &mbxValue);
 			numMbxMsg--;
 			UTIL_Wait(10);
 
 			HW_MBOX_EventAck(resources.dwMboxBase, MBOX_ARM2DSP,
-					  HW_MBOX_U1_DSP1,
-					  HW_MBOX_INT_NEW_MSG);
+					 HW_MBOX_U1_DSP1,
+					 HW_MBOX_INT_NEW_MSG);
 		}
 		/* Enable the new message events on this IRQ line */
 		hwStatus = HW_MBOX_EventEnable(resources.dwMboxBase,
-						 MBOX_DSP2ARM,
-						 MBOX_ARM,
-						 HW_MBOX_INT_NEW_MSG);
+					       MBOX_DSP2ARM,
+					       MBOX_ARM,
+					       HW_MBOX_INT_NEW_MSG);
 	}
 
 	return status;
@@ -88,11 +87,10 @@ DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 
 	DBG_Trace(DBG_ENTER, "CHNLSM_DisableInterrupt(0x%x)\n", hDevContext);
 
-	status = CFG_GetHostResources(
-			(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-			&resources);
+	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+				      &resources);
 	hwStatus = HW_MBOX_EventDisable(resources.dwMboxBase, MBOX_DSP2ARM,
-					  MBOX_ARM, HW_MBOX_INT_NEW_MSG);
+					MBOX_ARM, HW_MBOX_INT_NEW_MSG);
 	return status;
 }
 
@@ -103,7 +101,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 
 #ifdef CONFIG_BRIDGE_DVFS
 	struct dspbridge_platform_data *pdata =
-				omap_dspbridge_dev.dev.platform_data;
+		omap_dspbridge_dev.dev.platform_data;
 	u32 opplevel = 0;
 #endif
 	HW_STATUS hwStatus;
@@ -113,37 +111,35 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 	u32 temp;
 	/* We are waiting indefinitely here. This needs to be fixed in the
 	 * second phase */
-	status = CFG_GetHostResources(
-			(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-			&resources);
+	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+				      &resources);
 #ifdef CONFIG_BRIDGE_DVFS
-		if (pdata->dsp_get_opp)
-			opplevel = (*pdata->dsp_get_opp)();
-
-		/* If OPP is at minimum level, increase it before waking up
-		* the DSP */
-		if (opplevel == 1) {
-			if (pdata->dsp_set_min_opp) {
-				(*pdata->dsp_set_min_opp)(opplevel+1);
-				DBG_Trace(DBG_LEVEL7, "CHNLSM_InterruptDSP: "
-					"Setting the vdd1 opp level to %d "
-					"before waking DSP \n",
-					(opplevel + 1));
-			}
+	if (pdata->dsp_get_opp)
+		opplevel = (*pdata->dsp_get_opp)();
+
+	/* If OPP is at minimum level, increase it before waking up
+	 * the DSP */
+	if (opplevel == 1) {
+		if (pdata->dsp_set_min_opp) {
+			(*pdata->dsp_set_min_opp)(opplevel+1);
+			DBG_Trace(DBG_LEVEL7, "CHNLSM_InterruptDSP: "
+				  "Setting the vdd1 opp level to %d "
+				  "before waking DSP \n",
+				  (opplevel + 1));
 		}
+	}
 #endif
 
-	if  (pDevContext->dwBrdState == BRD_DSP_HIBERNATION ||
+	if (pDevContext->dwBrdState == BRD_DSP_HIBERNATION ||
 	    pDevContext->dwBrdState == BRD_HIBERNATION) {
 
-		temp = (u32) *((REG_UWORD32 *) ((u32)
-		       (resources.dwDmmuBase) + 0x10));
+		temp = (u32) *((REG_UWORD32 *) ((u32) (resources.dwDmmuBase) + 0x10));
 
 		/* Restore mailbox settings */
 		status = HW_MBOX_restoreSettings(resources.dwMboxBase);
 
-                /* Restart the peripheral clocks that were disabled only
-                 * in DSP initiated Hibernation case.*/
+		/* Restart the peripheral clocks that were disabled only
+		 * in DSP initiated Hibernation case.*/
 		if (pDevContext->dwBrdState == BRD_DSP_HIBERNATION)
 			DSP_PeripheralClocks_Enable(hDevContext, NULL);
 
@@ -151,7 +147,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 	}
 	while (--cnt) {
 		hwStatus = HW_MBOX_IsFull(resources.dwMboxBase,
-					   MBOX_ARM2DSP, &mbxFull);
+					  MBOX_ARM2DSP, &mbxFull);
 		if (mbxFull)
 			UTIL_Wait(1000);	/* wait for 1 ms)      */
 		else
@@ -163,10 +159,10 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 		return status;
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
-		 pDevContext->wIntrVal2Dsp);
+		  pDevContext->wIntrVal2Dsp);
 
 	hwStatus = HW_MBOX_MsgWrite(resources.dwMboxBase, MBOX_ARM2DSP,
-				     pDevContext->wIntrVal2Dsp);
+				    pDevContext->wIntrVal2Dsp);
 	/* set the Mailbox interrupt to default value */
 	pDevContext->wIntrVal2Dsp = MBX_PCPY_CLASS;
 	return status;
@@ -195,8 +191,7 @@ bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
 
 	DBG_Trace(DBG_ENTER, "CHNLSM_ISR(0x%x)\n", hDevContext);
 
-	CFG_GetHostResources(
-		(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), &resources);
+	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), &resources);
 
 	HW_MBOX_NumMsgGet(resources.dwMboxBase, MBOX_DSP2ARM, &numMbxMsg);
 
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 06/15] tidspbridge: trivial cleanups
  2009-03-18  1:23         ` [PATCH A 05/15] tidspbridge: whitespace cleanups Felipe Contreras
@ 2009-03-18  1:23           ` Felipe Contreras
  2009-03-18  1:23             ` [PATCH A 07/15] tidspbridge: hDevContext == pDevContext Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |   81 +++++++++++++++---------------------
 1 files changed, 34 insertions(+), 47 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index fe4acd8..d70f51e 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -31,7 +31,6 @@ extern struct platform_device omap_dspbridge_dev;
 DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
-	HW_STATUS hwStatus;
 	struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
 	u32 numMbxMsg;
 	u32 mbxValue;
@@ -43,25 +42,25 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 
 	/* Read the messages in the mailbox until the message queue is empty */
 
-	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-				      &resources);
-	status = DEV_GetDevType(pDevContext->hDevObject, &devType);
+	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			     &resources);
+	DEV_GetDevType(pDevContext->hDevObject, &devType);
 	status = DEV_GetIOMgr(pDevContext->hDevObject, &hIOMgr);
 	if (devType == DSP_UNIT) {
-		hwStatus = HW_MBOX_NumMsgGet(resources.dwMboxBase,
-					     MBOX_DSP2ARM, &numMbxMsg);
+		HW_MBOX_NumMsgGet(resources.dwMboxBase,
+				  MBOX_DSP2ARM, &numMbxMsg);
 		while (numMbxMsg != 0) {
-			hwStatus = HW_MBOX_MsgRead(resources.dwMboxBase,
-						   MBOX_DSP2ARM,
-						   &mbxValue);
+			HW_MBOX_MsgRead(resources.dwMboxBase,
+					MBOX_DSP2ARM,
+					&mbxValue);
 			numMbxMsg--;
 		}
 		/* clear the DSP mailbox as well...*/
-		hwStatus = HW_MBOX_NumMsgGet(resources.dwMboxBase,
-					     MBOX_ARM2DSP, &numMbxMsg);
+		HW_MBOX_NumMsgGet(resources.dwMboxBase,
+				  MBOX_ARM2DSP, &numMbxMsg);
 		while (numMbxMsg != 0) {
-			hwStatus = HW_MBOX_MsgRead(resources.dwMboxBase,
-						   MBOX_ARM2DSP, &mbxValue);
+			HW_MBOX_MsgRead(resources.dwMboxBase,
+					MBOX_ARM2DSP, &mbxValue);
 			numMbxMsg--;
 			UTIL_Wait(10);
 
@@ -70,10 +69,10 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 					 HW_MBOX_INT_NEW_MSG);
 		}
 		/* Enable the new message events on this IRQ line */
-		hwStatus = HW_MBOX_EventEnable(resources.dwMboxBase,
-					       MBOX_DSP2ARM,
-					       MBOX_ARM,
-					       HW_MBOX_INT_NEW_MSG);
+		HW_MBOX_EventEnable(resources.dwMboxBase,
+				    MBOX_DSP2ARM,
+				    MBOX_ARM,
+				    HW_MBOX_INT_NEW_MSG);
 	}
 
 	return status;
@@ -81,22 +80,19 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 
 DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 {
-	DSP_STATUS status = DSP_SOK;
-	HW_STATUS hwStatus;
 	struct CFG_HOSTRES resources;
 
 	DBG_Trace(DBG_ENTER, "CHNLSM_DisableInterrupt(0x%x)\n", hDevContext);
 
-	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-				      &resources);
-	hwStatus = HW_MBOX_EventDisable(resources.dwMboxBase, MBOX_DSP2ARM,
-					MBOX_ARM, HW_MBOX_INT_NEW_MSG);
-	return status;
+	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			     &resources);
+	HW_MBOX_EventDisable(resources.dwMboxBase, MBOX_DSP2ARM,
+			     MBOX_ARM, HW_MBOX_INT_NEW_MSG);
+	return DSP_SOK;
 }
 
 DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 {
-	DSP_STATUS status = DSP_SOK;
 	struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
 
 #ifdef CONFIG_BRIDGE_DVFS
@@ -104,15 +100,14 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 		omap_dspbridge_dev.dev.platform_data;
 	u32 opplevel = 0;
 #endif
-	HW_STATUS hwStatus;
 	u32 mbxFull;
 	struct CFG_HOSTRES resources;
 	u16 cnt = 10;
 	u32 temp;
 	/* We are waiting indefinitely here. This needs to be fixed in the
 	 * second phase */
-	status = CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
-				      &resources);
+	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			     &resources);
 #ifdef CONFIG_BRIDGE_DVFS
 	if (pdata->dsp_get_opp)
 		opplevel = (*pdata->dsp_get_opp)();
@@ -136,7 +131,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 		temp = (u32) *((REG_UWORD32 *) ((u32) (resources.dwDmmuBase) + 0x10));
 
 		/* Restore mailbox settings */
-		status = HW_MBOX_restoreSettings(resources.dwMboxBase);
+		HW_MBOX_restoreSettings(resources.dwMboxBase);
 
 		/* Restart the peripheral clocks that were disabled only
 		 * in DSP initiated Hibernation case.*/
@@ -146,8 +141,8 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
 	while (--cnt) {
-		hwStatus = HW_MBOX_IsFull(resources.dwMboxBase,
-					  MBOX_ARM2DSP, &mbxFull);
+		HW_MBOX_IsFull(resources.dwMboxBase,
+			       MBOX_ARM2DSP, &mbxFull);
 		if (mbxFull)
 			UTIL_Wait(1000);	/* wait for 1 ms)      */
 		else
@@ -155,36 +150,28 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 	}
 	if (!cnt) {
 		DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
-		status = WMD_E_TIMEOUT;
-		return status;
+		return WMD_E_TIMEOUT;
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
 		  pDevContext->wIntrVal2Dsp);
 
-	hwStatus = HW_MBOX_MsgWrite(resources.dwMboxBase, MBOX_ARM2DSP,
-				    pDevContext->wIntrVal2Dsp);
+	HW_MBOX_MsgWrite(resources.dwMboxBase, MBOX_ARM2DSP,
+			 pDevContext->wIntrVal2Dsp);
 	/* set the Mailbox interrupt to default value */
 	pDevContext->wIntrVal2Dsp = MBX_PCPY_CLASS;
-	return status;
+	return DSP_SOK;
 }
 
 DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *hDevContext,
 				u16 wMbVal)
 {
-	struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
-
-	pDevContext->wIntrVal2Dsp = wMbVal;
-
+	hDevContext->wIntrVal2Dsp = wMbVal;
 	return CHNLSM_InterruptDSP(hDevContext);
 }
 
-bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
-		OUT u16 *pwIntrVal)
+bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, bool *pfSchedDPC,
+		u16 *pwIntrVal)
 {
-	bool fMyInterrupt = true;	/*
-					 * We own the mbx and
-					 * we're not sharing it
-					 */
 	struct CFG_HOSTRES resources;
 	u32 numMbxMsg;
 	u32 mbxValue;
@@ -206,5 +193,5 @@ bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, OUT bool *pfSchedDPC,
 	}
 	/* Set *pfSchedDPC to true; */
 	*pfSchedDPC = true;
-	return fMyInterrupt;
+	return true;
 }
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 07/15] tidspbridge: hDevContext == pDevContext
  2009-03-18  1:23           ` [PATCH A 06/15] tidspbridge: trivial cleanups Felipe Contreras
@ 2009-03-18  1:23             ` Felipe Contreras
  2009-03-18  1:23               ` [PATCH A 08/15] tidspbridge: remove UTIL_Wait wrapper Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index d70f51e..0e18613 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -28,10 +28,9 @@
 extern struct platform_device omap_dspbridge_dev;
 #endif
 
-DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
+DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *pDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
-	struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
 	u32 numMbxMsg;
 	u32 mbxValue;
 	struct CFG_HOSTRES resources;
@@ -78,11 +77,11 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 	return status;
 }
 
-DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
+DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *pDevContext)
 {
 	struct CFG_HOSTRES resources;
 
-	DBG_Trace(DBG_ENTER, "CHNLSM_DisableInterrupt(0x%x)\n", hDevContext);
+	DBG_Trace(DBG_ENTER, "CHNLSM_DisableInterrupt(0x%x)\n", pDevContext);
 
 	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
 			     &resources);
@@ -91,10 +90,8 @@ DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *hDevContext)
 	return DSP_SOK;
 }
 
-DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
+DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 {
-	struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
-
 #ifdef CONFIG_BRIDGE_DVFS
 	struct dspbridge_platform_data *pdata =
 		omap_dspbridge_dev.dev.platform_data;
@@ -136,7 +133,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 		/* Restart the peripheral clocks that were disabled only
 		 * in DSP initiated Hibernation case.*/
 		if (pDevContext->dwBrdState == BRD_DSP_HIBERNATION)
-			DSP_PeripheralClocks_Enable(hDevContext, NULL);
+			DSP_PeripheralClocks_Enable(pDevContext, NULL);
 
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
@@ -162,21 +159,21 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
 	return DSP_SOK;
 }
 
-DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *hDevContext,
+DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
 				u16 wMbVal)
 {
-	hDevContext->wIntrVal2Dsp = wMbVal;
-	return CHNLSM_InterruptDSP(hDevContext);
+	pDevContext->wIntrVal2Dsp = wMbVal;
+	return CHNLSM_InterruptDSP(pDevContext);
 }
 
-bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *hDevContext, bool *pfSchedDPC,
+bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *pDevContext, bool *pfSchedDPC,
 		u16 *pwIntrVal)
 {
 	struct CFG_HOSTRES resources;
 	u32 numMbxMsg;
 	u32 mbxValue;
 
-	DBG_Trace(DBG_ENTER, "CHNLSM_ISR(0x%x)\n", hDevContext);
+	DBG_Trace(DBG_ENTER, "CHNLSM_ISR(0x%x)\n", pDevContext);
 
 	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), &resources);
 
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 08/15] tidspbridge: remove UTIL_Wait wrapper
  2009-03-18  1:23             ` [PATCH A 07/15] tidspbridge: hDevContext == pDevContext Felipe Contreras
@ 2009-03-18  1:23               ` Felipe Contreras
  2009-03-18  1:23                 ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

Wrappers only hurt readability, use native kernel functions instead
(udelay, mdelay).

Also remove useless defines.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 arch/arm/plat-omap/include/dspbridge/util.h |   33 ---------------------------
 drivers/dsp/bridge/wmd/_tiomap_pwr.h        |    4 ---
 drivers/dsp/bridge/wmd/_tiomap_util.h       |    1 -
 drivers/dsp/bridge/wmd/tiomap3430.c         |   10 ++++----
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c     |    4 +-
 drivers/dsp/bridge/wmd/tiomap_sm.c          |    4 +-
 6 files changed, 9 insertions(+), 47 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/util.h b/arch/arm/plat-omap/include/dspbridge/util.h
index 9d8842a..e6815ca 100644
--- a/arch/arm/plat-omap/include/dspbridge/util.h
+++ b/arch/arm/plat-omap/include/dspbridge/util.h
@@ -26,7 +26,6 @@
  *      UTIL_Exit
  *      UTIL_GetSysInfo
  *      UTIL_Init
- *      UTIL_Wait
  */
 
 #ifndef _UTIL_H
@@ -120,36 +119,4 @@
 		return true;
 	}
 
-/*
- *  ======== UTIL_Wait ========
- *  Purpose:
- *      This fucntion busy waits given a certain number of micro seconds
- *      independent of the processor speed. This is acheived by the
- *      OEM functions QueryPerformanceCounter and QueryPerformanceFrequency.
- *  Parameters:
- *      u32   Number of Micro seconds to busy wait
- *  Returns:
- *          Nothing
- *  Requires:
- *          UTIL_Initalized.
- *  Ensures:
- *      Busy waits x Micro seconds or Sleeps X milli seconds; in that
- *      case, it is a blocking call there will be a context switching
- *      hence it may not represent the absolute busy wait time.
- */
-	static inline void UTIL_Wait(IN u32 dwMicroSeconds)
-	{
-		if (dwMicroSeconds / 1000 <= 1) {
-			/* <= 1 millisecond delay */
-			udelay(dwMicroSeconds);
-		} else if (dwMicroSeconds * HZ / 1000000 <= 1) {
-			/* <= 10 millisecond delay */
-			mdelay(dwMicroSeconds / 1000);
-		} else {
-			/* > 10 millisecond delay */
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(dwMicroSeconds * HZ / 1000000);
-		}
-	}
-
 #endif				/* _UTIL_H */
diff --git a/drivers/dsp/bridge/wmd/_tiomap_pwr.h b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
index 15ff2d3..8a7cf1b 100644
--- a/drivers/dsp/bridge/wmd/_tiomap_pwr.h
+++ b/drivers/dsp/bridge/wmd/_tiomap_pwr.h
@@ -28,10 +28,6 @@
 #ifndef _TIOMAP_PWR_
 #define _TIOMAP_PWR_
 
-/* Wait time between MBX and IDLE checks for PWR */
-#define PWR_WAIT_USECS          500
-#define PWR_WAIT_MSECS          50
-
 /*
  * ======== WakeDSP =========
  * Wakes up the DSP from DeepSleep
diff --git a/drivers/dsp/bridge/wmd/_tiomap_util.h b/drivers/dsp/bridge/wmd/_tiomap_util.h
index b655409..47e1e5d 100644
--- a/drivers/dsp/bridge/wmd/_tiomap_util.h
+++ b/drivers/dsp/bridge/wmd/_tiomap_util.h
@@ -30,7 +30,6 @@
 
 /* Time out Values in uSeconds*/
 #define TIHELEN_ACKTIMEOUT  10000
-#define TIHELEN_WRITE_DELAY 10
 
 /*  Time delay for HOM->SAM transition. */
 #define  WAIT_SAM   1000000	/* in usec (1000 millisec) */
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c
index a6e695a..2ce7295 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -460,9 +460,9 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT *hDevContext,
 		/* Reset and Unreset the RST2, so that BOOTADDR is copied to
 		 * IVA2 SYSC register */
 		HW_RST_Reset(resources.dwPrmBase, HW_RST2_IVA2);
-		UTIL_Wait(100);
+		udelay(100);
 		HW_RST_UnReset(resources.dwPrmBase, HW_RST2_IVA2);
-		UTIL_Wait(100);
+		udelay(100);
 		DBG_Trace(DBG_LEVEL6, "WMD_BRD_Start 0 ****** \n");
 		GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
 		/* Disbale the DSP MMU */
@@ -737,7 +737,7 @@ static DSP_STATUS WMD_BRD_Stop(struct WMD_DEV_CONTEXT *hDevContext)
 
 			IO_InterruptDSP2(pDevContext, MBX_PM_DSPIDLE);
 
-			UTIL_Wait(10000);	/* 10 msec */
+			mdelay(10);
 
 			GetHWRegs(resources.dwPrmBase, resources.dwCmBase);
 
@@ -1053,7 +1053,7 @@ static DSP_STATUS WMD_DEV_Create(OUT struct WMD_DEV_CONTEXT **ppDevContext,
 				 "WMD_DEV_create:Reset mail box and "
 				 "enable the clock Fail\n");
 		}
-		UTIL_Wait(5);
+		udelay(5);
 		/* 24xx-Linux MMU address is obtained from the host
 		 * resources struct */
 		pDevContext->dwDSPMmuBase = resources.dwDmmuBase;
@@ -2174,7 +2174,7 @@ bool WaitForStart(struct WMD_DEV_CONTEXT *pDevContext, u32 dwSyncAddr)
 
 	/*  Wait for response from board */
 	while (*((volatile u16 *)dwSyncAddr) && --usCount)
-		UTIL_Wait(TIHELEN_WRITE_DELAY);
+		udelay(10);
 
 	/*  If timed out: return FALSE */
 	if (!usCount) {
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
index f3e7645..95a89b3 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
@@ -122,7 +122,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	/* Wait for DSP to move into Off state,  how much time should
 	 * we wait? */
 	while ((pwrState != HW_PWR_STATE_OFF) && --usCount) {
-		UTIL_Wait(PWR_WAIT_USECS);
+		udelay(500);
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 	}
@@ -243,7 +243,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 	/* Wait for DSP to move into Standby state,  how much time
 	 * should we wait?*/
 	while ((pwrState != targetPwrState) && --usCount) {
-		UTIL_Wait(PWR_WAIT_USECS);
+		udelay(500);
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 	}
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 0e18613..574cf28 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -61,7 +61,7 @@ DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *pDevContext)
 			HW_MBOX_MsgRead(resources.dwMboxBase,
 					MBOX_ARM2DSP, &mbxValue);
 			numMbxMsg--;
-			UTIL_Wait(10);
+			udelay(10);
 
 			HW_MBOX_EventAck(resources.dwMboxBase, MBOX_ARM2DSP,
 					 HW_MBOX_U1_DSP1,
@@ -141,7 +141,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 		HW_MBOX_IsFull(resources.dwMboxBase,
 			       MBOX_ARM2DSP, &mbxFull);
 		if (mbxFull)
-			UTIL_Wait(1000);	/* wait for 1 ms)      */
+			mdelay(1);
 		else
 			break;
 	}
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull
  2009-03-18  1:23               ` [PATCH A 08/15] tidspbridge: remove UTIL_Wait wrapper Felipe Contreras
@ 2009-03-18  1:23                 ` Felipe Contreras
  2009-03-18  1:23                   ` [PATCH A 10/15] tidspbridge: remove udelay and use time_after instead Felipe Contreras
  2009-03-18  7:29                   ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
  0 siblings, 2 replies; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

HW_MBOX_IsFull has many convoluted macros and is used only once. Clean
it up so it's easier to see what it's actually doing.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/hw/hw_mbox.c    |   25 -------------------------
 drivers/dsp/bridge/hw/hw_mbox.h    |   35 -----------------------------------
 drivers/dsp/bridge/wmd/tiomap_sm.c |   25 +++++++++++++------------
 3 files changed, 13 insertions(+), 72 deletions(-)

diff --git a/drivers/dsp/bridge/hw/hw_mbox.c b/drivers/dsp/bridge/hw/hw_mbox.c
index 2c14ade..31b890a 100644
--- a/drivers/dsp/bridge/hw/hw_mbox.c
+++ b/drivers/dsp/bridge/hw/hw_mbox.c
@@ -104,31 +104,6 @@ HW_STATUS HW_MBOX_MsgWrite(const u32 baseAddress, const HW_MBOX_Id_t mailBoxId,
 	return status;
 }
 
-/* Reads the full status register for mailbox. */
-HW_STATUS HW_MBOX_IsFull(const u32 baseAddress, const HW_MBOX_Id_t mailBoxId,
-			u32 *const pIsFull)
-{
-	HW_STATUS status = RET_OK;
-	u32 fullStatus;
-
-	/* Check input parameters */
-	CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
-			RES_INVALID_INPUT_PARAM);
-	CHECK_INPUT_PARAM(pIsFull,  NULL, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
-			RES_INVALID_INPUT_PARAM);
-	CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
-			RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
-	/* read the is full status parameter for Mailbox */
-	fullStatus = MLBMAILBOX_FIFOSTATUS___0_15FifoFullMBmRead32(baseAddress,
-							(u32)mailBoxId);
-
-	/* fill in return parameter */
-	*pIsFull = (fullStatus & 0xFF);
-
-	return status;
-}
-
 /* Gets number of messages in a specified mailbox. */
 HW_STATUS HW_MBOX_NumMsgGet(const u32 baseAddress, const HW_MBOX_Id_t mailBoxId,
 				u32 *const pNumMsg)
diff --git a/drivers/dsp/bridge/hw/hw_mbox.h b/drivers/dsp/bridge/hw/hw_mbox.h
index 225fb40..d2981d3 100644
--- a/drivers/dsp/bridge/hw/hw_mbox.h
+++ b/drivers/dsp/bridge/hw/hw_mbox.h
@@ -130,41 +130,6 @@ extern HW_STATUS HW_MBOX_MsgWrite(
 		  );
 
 /*
-* FUNCTION      : HW_MBOX_IsFull
-*
-* INPUTS:
-*
-*   Identifier  : baseAddress
-*   Type	: const u32
-*   Description : Base Address of instance of Mailbox module
-*
-*   Identifier  : mailBoxId
-*   Type	: const HW_MBOX_Id_t
-*   Description : Mail Box Sub module Id to check
-*
-* OUTPUTS:
-*
-*   Identifier  : pIsFull
-*   Type	: u32 *const
-*   Description : false means mail box not Full
-*		 true means mailbox full.
-*
-* RETURNS:
-*
-*   Type	: ReturnCode_t
-*   Description : RET_OK	      No errors occured
-*		 RET_BAD_NULL_PARAM  Address/pointer Paramater was set to 0/NULL
-*		 RET_INVALID_ID      Invalid Id used
-*
-* PURPOSE:      : this function reads the full status register for mailbox.
-*/
-extern HW_STATUS HW_MBOX_IsFull(
-		      const u32	 baseAddress,
-		      const HW_MBOX_Id_t   mailBoxId,
-		      u32 *const	pIsFull
-		  );
-
-/*
 * FUNCTION      : HW_MBOX_NumMsgGet
 *
 * INPUTS:
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 574cf28..658064f 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -28,6 +28,13 @@
 extern struct platform_device omap_dspbridge_dev;
 #endif
 
+#define MAILBOX_FIFOSTATUS(m) (0x80 + 4 * (m))
+
+static inline unsigned int fifo_full(void __iomem *mbox_base, int mbox_id)
+{
+	return __raw_readb(mbox_base + MAILBOX_FIFOSTATUS(mbox_id)) & 0x1;
+}
+
 DSP_STATUS CHNLSM_EnableInterrupt(struct WMD_DEV_CONTEXT *pDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
@@ -97,7 +104,6 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 		omap_dspbridge_dev.dev.platform_data;
 	u32 opplevel = 0;
 #endif
-	u32 mbxFull;
 	struct CFG_HOSTRES resources;
 	u16 cnt = 10;
 	u32 temp;
@@ -137,17 +143,12 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
-	while (--cnt) {
-		HW_MBOX_IsFull(resources.dwMboxBase,
-			       MBOX_ARM2DSP, &mbxFull);
-		if (mbxFull)
-			mdelay(1);
-		else
-			break;
-	}
-	if (!cnt) {
-		DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
-		return WMD_E_TIMEOUT;
+	while (fifo_full((void __iomem *) resources.dwMboxBase, 0)) {
+		if (--cnt == 0) {
+			DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
+			return WMD_E_TIMEOUT;
+		}
+		mdelay(1);
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
 		  pDevContext->wIntrVal2Dsp);
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 10/15] tidspbridge: remove udelay and use time_after instead
  2009-03-18  1:23                 ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
@ 2009-03-18  1:23                   ` Felipe Contreras
  2009-03-18  1:23                     ` [PATCH A 11/15] tidspbridge: Remove IO_InterruptDSP Felipe Contreras
  2009-03-18  7:29                   ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
  1 sibling, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

As suggested by Juha Yrjola.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 658064f..735f8e9 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -105,7 +105,7 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	u32 opplevel = 0;
 #endif
 	struct CFG_HOSTRES resources;
-	u16 cnt = 10;
+	unsigned long timeout;
 	u32 temp;
 	/* We are waiting indefinitely here. This needs to be fixed in the
 	 * second phase */
@@ -143,12 +143,12 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
+	timeout = jiffies + msecs_to_jiffies(10);
 	while (fifo_full((void __iomem *) resources.dwMboxBase, 0)) {
-		if (--cnt == 0) {
+		if (time_after(jiffies, timeout)) {
 			DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
 			return WMD_E_TIMEOUT;
 		}
-		mdelay(1);
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
 		  pDevContext->wIntrVal2Dsp);
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 11/15] tidspbridge: Remove IO_InterruptDSP
  2009-03-18  1:23                   ` [PATCH A 10/15] tidspbridge: remove udelay and use time_after instead Felipe Contreras
@ 2009-03-18  1:23                     ` Felipe Contreras
  2009-03-18  1:23                       ` [PATCH A 12/15] tidspbridge: remove IO_InterruptDSP2 Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

IO_InterruptDSP2 can do the same.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 arch/arm/plat-omap/include/dspbridge/io_sm.h |    1 -
 drivers/dsp/bridge/wmd/io_sm.c               |   10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index 81f7d93..02010d0 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -77,7 +77,6 @@
 
 #define IO_DisableInterrupt(h)  CHNLSM_DisableInterrupt(h)
 #define IO_EnableInterrupt(h)   CHNLSM_EnableInterrupt(h)
-#define IO_InterruptDSP(h)      CHNLSM_InterruptDSP(h)
 #define IO_InterruptDSP2(h, v)  CHNLSM_InterruptDSP2(h, v)
 #define IO_CALLISR(h, pFlag, pwMBRegVal)   CHNLSM_ISR(h, pFlag, pwMBRegVal)
 
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index 9050862..e4d8528 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -831,7 +831,7 @@ void IO_CancelChnl(struct IO_MGR *hIOMgr, u32 ulChnl)
 	IO_AndValue(pIOMgr->hWmdContext, struct SHM, sm, hostFreeMask,
 		   (~(1 << ulChnl)));
 
-	IO_InterruptDSP(pIOMgr->hWmdContext);
+	IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 }
 
 /*
@@ -1201,7 +1201,7 @@ static void InputChnl(struct IO_MGR *pIOMgr, struct CHNL_OBJECT *pChnl,
 	if (fClearChnl) {
 		/* Indicate to the DSP we have read the input: */
 		IO_SetValue(pIOMgr->hWmdContext, struct SHM, sm, inputFull, 0);
-		IO_InterruptDSP(pIOMgr->hWmdContext);
+		IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	}
 	if (fNotifyClient) {
 		/* Notify client with IO completion record:  */
@@ -1303,7 +1303,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 			   true);
 		IO_SetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, postSWI,
 			   true);
-		IO_InterruptDSP(pIOMgr->hWmdContext);
+		IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	}
 }
 
@@ -1406,7 +1406,7 @@ static void OutputChnl(struct IO_MGR *pIOMgr, struct CHNL_OBJECT *pChnl,
 #endif
 	IO_SetValue(pIOMgr->hWmdContext, struct SHM, sm, outputFull, 1);
 	/* Indicate to the DSP we have written the output: */
-	IO_InterruptDSP(pIOMgr->hWmdContext);
+	IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	/* Notify client with IO completion record (keep EOS) */
 	pChirp->status &= CHNL_IOCSTATEOS;
 	NotifyChnlComplete(pChnl, pChirp);
@@ -1493,7 +1493,7 @@ static void OutputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 			IO_SetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				   postSWI, true);
 			/* Tell the DSP we have written the output. */
-			IO_InterruptDSP(pIOMgr->hWmdContext);
+			IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 		}
 	}
 }
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 12/15] tidspbridge: remove IO_InterruptDSP2
  2009-03-18  1:23                     ` [PATCH A 11/15] tidspbridge: Remove IO_InterruptDSP Felipe Contreras
@ 2009-03-18  1:23                       ` Felipe Contreras
  2009-03-18  1:23                         ` [PATCH A 13/15] tidspbridge: remove CHNLSM_InterruptDSP Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

It's just wrapping CHNLSM_InterruptDSP2.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 arch/arm/plat-omap/include/dspbridge/io_sm.h |    1 -
 drivers/dsp/bridge/wmd/io_sm.c               |   12 ++++++------
 drivers/dsp/bridge/wmd/tiomap3430.c          |    6 +++---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c      |   18 +++++++++---------
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/io_sm.h b/arch/arm/plat-omap/include/dspbridge/io_sm.h
index 02010d0..3dcbf74 100644
--- a/arch/arm/plat-omap/include/dspbridge/io_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/io_sm.h
@@ -77,7 +77,6 @@
 
 #define IO_DisableInterrupt(h)  CHNLSM_DisableInterrupt(h)
 #define IO_EnableInterrupt(h)   CHNLSM_EnableInterrupt(h)
-#define IO_InterruptDSP2(h, v)  CHNLSM_InterruptDSP2(h, v)
 #define IO_CALLISR(h, pFlag, pwMBRegVal)   CHNLSM_ISR(h, pFlag, pwMBRegVal)
 
 /*
diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index e4d8528..40062cb 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -831,7 +831,7 @@ void IO_CancelChnl(struct IO_MGR *hIOMgr, u32 ulChnl)
 	IO_AndValue(pIOMgr->hWmdContext, struct SHM, sm, hostFreeMask,
 		   (~(1 << ulChnl)));
 
-	IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
+	CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 }
 
 /*
@@ -1201,7 +1201,7 @@ static void InputChnl(struct IO_MGR *pIOMgr, struct CHNL_OBJECT *pChnl,
 	if (fClearChnl) {
 		/* Indicate to the DSP we have read the input: */
 		IO_SetValue(pIOMgr->hWmdContext, struct SHM, sm, inputFull, 0);
-		IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
+		CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	}
 	if (fNotifyClient) {
 		/* Notify client with IO completion record:  */
@@ -1303,7 +1303,7 @@ static void InputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 			   true);
 		IO_SetValue(pIOMgr->hWmdContext, struct MSG, pCtrl, postSWI,
 			   true);
-		IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
+		CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	}
 }
 
@@ -1406,7 +1406,7 @@ static void OutputChnl(struct IO_MGR *pIOMgr, struct CHNL_OBJECT *pChnl,
 #endif
 	IO_SetValue(pIOMgr->hWmdContext, struct SHM, sm, outputFull, 1);
 	/* Indicate to the DSP we have written the output: */
-	IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
+	CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 	/* Notify client with IO completion record (keep EOS) */
 	pChirp->status &= CHNL_IOCSTATEOS;
 	NotifyChnlComplete(pChnl, pChirp);
@@ -1493,7 +1493,7 @@ static void OutputMsg(struct IO_MGR *pIOMgr, struct MSG_MGR *hMsgMgr)
 			IO_SetValue(pIOMgr->hWmdContext, struct MSG, pCtrl,
 				   postSWI, true);
 			/* Tell the DSP we have written the output. */
-			IO_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
+			CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, MBX_PCPY_CLASS);
 		}
 	}
 }
@@ -1624,7 +1624,7 @@ static u32 WriteData(struct WMD_DEV_CONTEXT *hDevContext, void *pDest,
 /* ZCPY IO routines. */
 void IO_IntrDSP2(IN struct IO_MGR *pIOMgr, IN u16 wMbVal)
 {
-	IO_InterruptDSP2(pIOMgr->hWmdContext, wMbVal);
+	CHNLSM_InterruptDSP2(pIOMgr->hWmdContext, wMbVal);
 }
 
 /*
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c
index 2ce7295..e2b590f 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -735,7 +735,7 @@ static DSP_STATUS WMD_BRD_Stop(struct WMD_DEV_CONTEXT *hDevContext)
 	HW_PWRST_IVA2RegGet(resources.dwPrmBase, &dspPwrState);
 	if (dspPwrState != HW_PWR_STATE_OFF) {
 
-			IO_InterruptDSP2(pDevContext, MBX_PM_DSPIDLE);
+			CHNLSM_InterruptDSP2(pDevContext, MBX_PM_DSPIDLE);
 
 			mdelay(10);
 
@@ -1573,7 +1573,7 @@ static DSP_STATUS WMD_BRD_MemUnMap(struct WMD_DEV_CONTEXT *hDevContext,
 	 /* It is better to flush the TLB here, so that any stale old entries
 	 * get flushed */
 EXIT_LOOP:
-	IO_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
+	CHNLSM_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
 	HW_MMU_TLBFlushAll(pDevContext->dwDSPMmuBase);
 	DBG_Trace(DBG_LEVEL1, "WMD_BRD_MemUnMap vaCurr %x, pteAddrL1 %x "
 		  "pteAddrL2 %x\n", vaCurr, pteAddrL1, pteAddrL2);
@@ -2058,7 +2058,7 @@ func_cont:
 	 * repetition while mapping non-contiguous physical regions of a virtual
 	 * region */
 	/* Waking up DSP before calling TLB Flush */
-	IO_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
+	CHNLSM_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
 	HW_MMU_TLBFlushAll(pDevContext->dwDSPMmuBase);
 	DBG_Trace(DBG_LEVEL7, "< WMD_BRD_MemMap  at end status %x\n", status);
 	return status;
diff --git a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
index 95a89b3..5fac79e 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
@@ -201,23 +201,23 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 	case BRD_RUNNING:
 		status = HW_MBOX_saveSettings(resources.dwMboxBase);
 		if (dsp_test_sleepstate == HW_PWR_STATE_OFF) {
-			IO_InterruptDSP2(pDevContext,
-					 MBX_PM_DSPHIBERNATE);
+			CHNLSM_InterruptDSP2(pDevContext,
+					     MBX_PM_DSPHIBERNATE);
 			DBG_Trace(DBG_LEVEL7,
 				 "SleepDSP - Sent hibernate "
 				 "command to DSP\n");
 			targetPwrState = HW_PWR_STATE_OFF;
 		} else {
-			IO_InterruptDSP2(pDevContext,
-					 MBX_PM_DSPRETENTION);
+			CHNLSM_InterruptDSP2(pDevContext,
+					     MBX_PM_DSPRETENTION);
 			targetPwrState = HW_PWR_STATE_RET;
 		}
 		break;
 	case BRD_RETENTION:
 		status = HW_MBOX_saveSettings(resources.dwMboxBase);
 		if (dsp_test_sleepstate == HW_PWR_STATE_OFF) {
-			IO_InterruptDSP2(pDevContext,
-					 MBX_PM_DSPHIBERNATE);
+			CHNLSM_InterruptDSP2(pDevContext,
+					     MBX_PM_DSPHIBERNATE);
 			targetPwrState = HW_PWR_STATE_OFF;
 		} else
 			return DSP_SOK;
@@ -301,7 +301,7 @@ DSP_STATUS WakeDSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
 	udelay(10);
 	if (DSP_SUCCEEDED(status)) {
 		/* Send a message to DSP to wake up */
-		IO_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
+		CHNLSM_InterruptDSP2(pDevContext, MBX_PM_DSPWAKEUP);
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 		DBG_Trace(DBG_LEVEL7,
@@ -425,7 +425,7 @@ DSP_STATUS PreScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
 		/* Send a prenotificatio to DSP */
 		DBG_Trace(DBG_LEVEL7,
 			 "PreScale_DSP: Sent notification to DSP\n");
-		IO_InterruptDSP2(pDevContext, MBX_PM_SETPOINT_PRENOTIFY);
+		CHNLSM_InterruptDSP2(pDevContext, MBX_PM_SETPOINT_PRENOTIFY);
 		return DSP_SOK;
 	} else {
 		DBG_Trace(DBG_LEVEL7, "PreScale_DSP: Failed - DSP BRD"
@@ -469,7 +469,7 @@ DSP_STATUS PostScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
 		/* Update the OPP value in shared memory */
 		IO_SHMsetting(hIOMgr, SHM_CURROPP, &level);
 		/* Send a post notification to DSP */
-		IO_InterruptDSP2(pDevContext, MBX_PM_SETPOINT_POSTNOTIFY);
+		CHNLSM_InterruptDSP2(pDevContext, MBX_PM_SETPOINT_POSTNOTIFY);
 		DBG_Trace(DBG_LEVEL7,
 			 "PostScale_DSP: Wrote to shared memory Sent post"
 			 " notification to DSP\n");
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 13/15] tidspbridge: remove CHNLSM_InterruptDSP
  2009-03-18  1:23                       ` [PATCH A 12/15] tidspbridge: remove IO_InterruptDSP2 Felipe Contreras
@ 2009-03-18  1:23                         ` Felipe Contreras
  2009-03-18  1:23                           ` [PATCH A 14/15] tidspbridge: remove wIntrVal2Dsp Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Not used anymore, move to CHNLSM_InterruptDSP2.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 arch/arm/plat-omap/include/dspbridge/chnl_sm.h |   16 ----------------
 drivers/dsp/bridge/wmd/tiomap_sm.c             |   10 ++--------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
index 546754b..789b9bd 100644
--- a/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
+++ b/arch/arm/plat-omap/include/dspbridge/chnl_sm.h
@@ -24,7 +24,6 @@
  *  Public Functions:
  *      CHNLSM_DisableInterrupt;
  *      CHNLSM_EnableInterrupt;
- *      CHNLSM_InterruptDSP;
  *      CHNLSM_ISR;
  *      CHNLSM_Read;
  *      CHNLSM_UpdateSHMLength;
@@ -69,21 +68,6 @@
 						       hDevContext);
 
 /*
- *  ======== CHNLSM_InterruptDSP ========
- *  Purpose:
- *      Send an interrupt to the DSP processor(s).
- *  Parameters:
- *      hDevContext:    Handle to mini-driver defined device info.
- *  Returns:
- *      DSP_SOK:        Interrupt sent;
- *      else:           Unable to send interrupt.
- *  Requires:
- *  Ensures:
- */
-       extern DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT*
-						    hDevContext);
-
-/*
  *  ======== CHNLSM_InterruptDSP2 ========
  *  Purpose:
  *      Set interrupt value & send an interrupt to the DSP processor(s).
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 735f8e9..5ae94ea 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -97,7 +97,8 @@ DSP_STATUS CHNLSM_DisableInterrupt(struct WMD_DEV_CONTEXT *pDevContext)
 	return DSP_SOK;
 }
 
-DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
+DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
+				u16 wMbVal)
 {
 #ifdef CONFIG_BRIDGE_DVFS
 	struct dspbridge_platform_data *pdata =
@@ -160,13 +161,6 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	return DSP_SOK;
 }
 
-DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
-				u16 wMbVal)
-{
-	pDevContext->wIntrVal2Dsp = wMbVal;
-	return CHNLSM_InterruptDSP(pDevContext);
-}
-
 bool CHNLSM_ISR(struct WMD_DEV_CONTEXT *pDevContext, bool *pfSchedDPC,
 		u16 *pwIntrVal)
 {
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 14/15] tidspbridge: remove wIntrVal2Dsp
  2009-03-18  1:23                         ` [PATCH A 13/15] tidspbridge: remove CHNLSM_InterruptDSP Felipe Contreras
@ 2009-03-18  1:23                           ` Felipe Contreras
  2009-03-18  1:23                             ` [PATCH A 15/15] tidspbridge: print an error when timing out Felipe Contreras
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

Not really used.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/_tiomap.h    |    1 -
 drivers/dsp/bridge/wmd/tiomap3430.c |    2 --
 drivers/dsp/bridge/wmd/tiomap_sm.c  |    6 ++----
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/_tiomap.h b/drivers/dsp/bridge/wmd/_tiomap.h
index 10fd9cd..815f695 100644
--- a/drivers/dsp/bridge/wmd/_tiomap.h
+++ b/drivers/dsp/bridge/wmd/_tiomap.h
@@ -361,7 +361,6 @@ struct WMD_DEV_CONTEXT {
 	u32 dwBrdState;	/* Last known board state.      */
 	u32 ulIntMask;	/* int mask                     */
 	u16 ioBase;	/* Board I/O base               */
-	u16 wIntrVal2Dsp;	/* MBX value to DSP. See mbx_sh.h */
 	u32 numTLBEntries;	/* DSP MMU TLB entry counter    */
 	u32 fixedTLBEntries;	/* Fixed DSPMMU TLB entry count */
 
diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c
index e2b590f..c0f4ffc 100644
--- a/drivers/dsp/bridge/wmd/tiomap3430.c
+++ b/drivers/dsp/bridge/wmd/tiomap3430.c
@@ -1035,8 +1035,6 @@ static DSP_STATUS WMD_DEV_Create(OUT struct WMD_DEV_CONTEXT **ppDevContext,
 
 	if (DSP_SUCCEEDED(status)) {
 		/* Set the Endianism Register */ /* Need to set this */
-		/* default to Proc-copy */
-		pDevContext->wIntrVal2Dsp = MBX_PCPY_CLASS;
 		/* Retrieve the TC u16 SWAP Option */
 		status = REG_GetValue(NULL, CURRENTCONFIG, TCWORDSWAP,
 				     (u8 *)&tcWordSwap, &tcWordSwapSize);
diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 5ae94ea..da90821 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -152,12 +152,10 @@ DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
 		}
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
-		  pDevContext->wIntrVal2Dsp);
+		  wMbVal);
 
 	HW_MBOX_MsgWrite(resources.dwMboxBase, MBOX_ARM2DSP,
-			 pDevContext->wIntrVal2Dsp);
-	/* set the Mailbox interrupt to default value */
-	pDevContext->wIntrVal2Dsp = MBX_PCPY_CLASS;
+			 wMbVal);
 	return DSP_SOK;
 }
 
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH A 15/15] tidspbridge: print an error when timing out
  2009-03-18  1:23                           ` [PATCH A 14/15] tidspbridge: remove wIntrVal2Dsp Felipe Contreras
@ 2009-03-18  1:23                             ` Felipe Contreras
  0 siblings, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  1:23 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

From: Felipe Contreras <felipe.contreras@nokia.com>

We really want to catch these.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index da90821..1b31162 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -147,7 +147,7 @@ DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
 	timeout = jiffies + msecs_to_jiffies(10);
 	while (fifo_full((void __iomem *) resources.dwMboxBase, 0)) {
 		if (time_after(jiffies, timeout)) {
-			DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
+			printk(KERN_ERR "dspbridge: timed out waiting for mailbox\n");
 			return WMD_E_TIMEOUT;
 		}
 	}
-- 
1.6.2.1.287.g9a8be


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull
  2009-03-18  1:23                 ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
  2009-03-18  1:23                   ` [PATCH A 10/15] tidspbridge: remove udelay and use time_after instead Felipe Contreras
@ 2009-03-18  7:29                   ` Felipe Contreras
  1 sibling, 0 replies; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18  7:29 UTC (permalink / raw)
  To: linux-omap
  Cc: Hari Kanigeri, Hiroshi DOYU, Ameya Palande, Fernando Guzman Lugo,
	Felipe Contreras

On Wed, Mar 18, 2009 at 03:23:05AM +0200, Felipe Contreras wrote:
> From: Felipe Contreras <felipe.contreras@nokia.com>
> 
> HW_MBOX_IsFull has many convoluted macros and is used only once. Clean
> it up so it's easier to see what it's actually doing.

I probably should have integrated this too:

---
 drivers/dsp/bridge/hw/MLBAccInt.h |   18 ------------------
 drivers/dsp/bridge/hw/MLBRegAcM.h |   20 --------------------
 2 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/drivers/dsp/bridge/hw/MLBAccInt.h b/drivers/dsp/bridge/hw/MLBAccInt.h
index 7a03c6a..1cc5fdd 100644
--- a/drivers/dsp/bridge/hw/MLBAccInt.h
+++ b/drivers/dsp/bridge/hw/MLBAccInt.h
@@ -33,10 +33,6 @@
 						(MLB_BASE_EASIL1 + 50)
 #define EASIL1_MLBMAILBOX_MESSAGE___0_15WriteRegister32  \
 						(MLB_BASE_EASIL1 + 51)
-#define EASIL1_MLBMAILBOX_FIFOSTATUS___0_15ReadRegister32  \
-						(MLB_BASE_EASIL1 + 56)
-#define EASIL1_MLBMAILBOX_FIFOSTATUS___0_15FifoFullMBmRead32 \
-						(MLB_BASE_EASIL1 + 57)
 #define EASIL1_MLBMAILBOX_MSGSTATUS___0_15NbOfMsgMBmRead32  \
 						(MLB_BASE_EASIL1 + 60)
 #define EASIL1_MLBMAILBOX_IRQSTATUS___0_3ReadRegister32  \
@@ -60,18 +56,6 @@
 #define MLB_MAILBOX_MESSAGE___0_15_OFFSET   (u32)(0x0)
 
 
-/* Register set MAILBOX_FIFOSTATUS___REGSET_0_15 address offset, bank address
- * increment and number of banks */
-
-#define MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_OFFSET  (u32)(0x0080)
-#define MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_STEP   (u32)(0x0004)
-
-/* Register offset address definitions relative to register set
- * MAILBOX_FIFOSTATUS___REGSET_0_15 */
-
-#define MLB_MAILBOX_FIFOSTATUS___0_15_OFFSET    (u32)(0x0)
-
-
 /* Register set MAILBOX_MSGSTATUS___REGSET_0_15 address offset, bank address
  * increment and number of banks */
 
@@ -124,8 +108,6 @@
 #define MLB_MAILBOX_SYSCONFIG_AutoIdle_OFFSET        (u32)(0)
 #define MLB_MAILBOX_SYSSTATUS_ResetDone_MASK         (u32)(0x1)
 #define MLB_MAILBOX_SYSSTATUS_ResetDone_OFFSET         (u32)(0)
-#define MLB_MAILBOX_FIFOSTATUS___0_15_FifoFullMBm_MASK   (u32)(0x1)
-#define MLB_MAILBOX_FIFOSTATUS___0_15_FifoFullMBm_OFFSET  (u32)(0)
 #define MLB_MAILBOX_MSGSTATUS___0_15_NbOfMsgMBm_MASK    (u32)(0x7f)
 #define MLB_MAILBOX_MSGSTATUS___0_15_NbOfMsgMBm_OFFSET    (u32)(0)
 
diff --git a/drivers/dsp/bridge/hw/MLBRegAcM.h b/drivers/dsp/bridge/hw/MLBRegAcM.h
index 747a2e1..004e10b 100644
--- a/drivers/dsp/bridge/hw/MLBRegAcM.h
+++ b/drivers/dsp/bridge/hw/MLBRegAcM.h
@@ -126,26 +126,6 @@
 }
 
 
-#define MLBMAILBOX_FIFOSTATUS___0_15ReadRegister32(baseAddress, bank)\
-    (_DEBUG_LEVEL_1_EASI(\
-      EASIL1_MLBMAILBOX_FIFOSTATUS___0_15ReadRegister32),\
-      RD_MEM_32_VOLATILE(((u32)(baseAddress))+\
-      (MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_OFFSET +\
-      MLB_MAILBOX_FIFOSTATUS___0_15_OFFSET+\
-      ((bank)*MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_STEP))))
-
-
-#define MLBMAILBOX_FIFOSTATUS___0_15FifoFullMBmRead32(baseAddress, bank)\
-    (_DEBUG_LEVEL_1_EASI(\
-      EASIL1_MLBMAILBOX_FIFOSTATUS___0_15FifoFullMBmRead32),\
-      (((RD_MEM_32_VOLATILE(((u32)(baseAddress))+\
-      (MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_OFFSET +\
-      MLB_MAILBOX_FIFOSTATUS___0_15_OFFSET+\
-      ((bank)*MLB_MAILBOX_FIFOSTATUS___REGSET_0_15_STEP)))) &\
-      MLB_MAILBOX_FIFOSTATUS___0_15_FifoFullMBm_MASK) >>\
-      MLB_MAILBOX_FIFOSTATUS___0_15_FifoFullMBm_OFFSET))
-
-
 #define MLBMAILBOX_MSGSTATUS___0_15NbOfMsgMBmRead32(baseAddress, bank)\
     (_DEBUG_LEVEL_1_EASI(\
       EASIL1_MLBMAILBOX_MSGSTATUS___0_15NbOfMsgMBmRead32),\
-- 

-- 
Felipe Contreras

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* RE: [PATCH A 00/15] tidspbridge: general cleanups
  2009-03-18  1:22 [PATCH A 00/15] tidspbridge: general cleanups Felipe Contreras
  2009-03-18  1:22 ` [PATCH A 01/15] tidspbridge: remove revision history Felipe Contreras
@ 2009-03-18 12:55 ` Kanigeri, Hari
  2009-03-18 13:30   ` Felipe Contreras
  1 sibling, 1 reply; 20+ messages in thread
From: Kanigeri, Hari @ 2009-03-18 12:55 UTC (permalink / raw)
  To: Felipe Contreras, linux-omap
  Cc: Hiroshi DOYU, Ameya Palande, Guzman Lugo, Fernando

Felipe,

Thanks for your contributions. We will push these changes to OZ tree as soon as possible.

Thank you,
Best


> -----Original Message-----
> From: Felipe Contreras [mailto:felipe.contreras@gmail.com]
> Sent: Tuesday, March 17, 2009 8:23 PM
> To: linux-omap@vger.kernel.org
> Cc: Kanigeri, Hari; Hiroshi DOYU; Ameya Palande; Guzman Lugo, Fernando;
> Felipe Contreras
> Subject: [PATCH A 00/15] tidspbridge: general cleanups
> 
> This patch series is not doing much, just cleaning up the irq mailbox
> functions
> and related stuff.
> 
> Among the sem-functional changes are:
>  * 0010: avoid udelay and use time_after
>  * 0015: print an error when timing out
> 
> Felipe Contreras (15):
>   tidspbridge: remove revision history
>   tidspbridge: trivial cleanup
>   tidspbridge: remove unused stuff
>   tidspbridge: remove IO_CALLDPC
>   tidspbridge: whitespace cleanups
>   tidspbridge: trivial cleanups
>   tidspbridge: hDevContext == pDevContext
>   tidspbridge: remove UTIL_Wait wrapper
>   tidspbridge: cleanup and remove HW_MBOX_IsFull
>   tidspbridge: remove udelay and use time_after instead
>   tidspbridge: Remove IO_InterruptDSP
>   tidspbridge: remove IO_InterruptDSP2
>   tidspbridge: remove CHNLSM_InterruptDSP
>   tidspbridge: remove wIntrVal2Dsp
>   tidspbridge: print an error when timing out
> 
>  arch/arm/plat-omap/include/dspbridge/chnl_sm.h |   42 ----
>  arch/arm/plat-omap/include/dspbridge/io_sm.h   |    3 -
>  arch/arm/plat-omap/include/dspbridge/util.h    |   51 -----
>  drivers/dsp/bridge/hw/hw_mbox.c                |   25 ---
>  drivers/dsp/bridge/hw/hw_mbox.h                |   35 ----
>  drivers/dsp/bridge/wmd/_tiomap.h               |   23 --
>  drivers/dsp/bridge/wmd/_tiomap_pwr.h           |    4 -
>  drivers/dsp/bridge/wmd/_tiomap_util.h          |    1 -
>  drivers/dsp/bridge/wmd/io_sm.c                 |   78 +-------
>  drivers/dsp/bridge/wmd/tiomap3430.c            |   18 +-
>  drivers/dsp/bridge/wmd/tiomap3430_pwr.c        |   22 +-
>  drivers/dsp/bridge/wmd/tiomap_sm.c             |  260 +++++++------------
> -----
>  12 files changed, 101 insertions(+), 461 deletions(-)
> 


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH A 00/15] tidspbridge: general cleanups
  2009-03-18 12:55 ` [PATCH A 00/15] tidspbridge: general cleanups Kanigeri, Hari
@ 2009-03-18 13:30   ` Felipe Contreras
  2009-03-18 14:11     ` Kanigeri, Hari
  0 siblings, 1 reply; 20+ messages in thread
From: Felipe Contreras @ 2009-03-18 13:30 UTC (permalink / raw)
  To: Kanigeri, Hari
  Cc: linux-omap, Hiroshi DOYU, Ameya Palande, Guzman Lugo, Fernando

On Wed, Mar 18, 2009 at 2:55 PM, Kanigeri, Hari <h-kanigeri2@ti.com> wrote:
> Felipe,
>
> Thanks for your contributions. We will push these changes to OZ tree as soon as possible.

Cool :)

Would that be an ack for l-o?

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH A 00/15] tidspbridge: general cleanups
  2009-03-18 13:30   ` Felipe Contreras
@ 2009-03-18 14:11     ` Kanigeri, Hari
  0 siblings, 0 replies; 20+ messages in thread
From: Kanigeri, Hari @ 2009-03-18 14:11 UTC (permalink / raw)
  To: Felipe Contreras
  Cc: linux-omap, Hiroshi DOYU, Ameya Palande, Guzman Lugo, Fernando

Felipe,

> Would that be an ack for l-o?

- Yes. 

Thank you,
Best regards,
Hari



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2009-03-18 14:12 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-18  1:22 [PATCH A 00/15] tidspbridge: general cleanups Felipe Contreras
2009-03-18  1:22 ` [PATCH A 01/15] tidspbridge: remove revision history Felipe Contreras
2009-03-18  1:22   ` [PATCH A 02/15] tidspbridge: trivial cleanup Felipe Contreras
2009-03-18  1:22     ` [PATCH A 03/15] tidspbridge: remove unused stuff Felipe Contreras
2009-03-18  1:23       ` [PATCH A 04/15] tidspbridge: remove IO_CALLDPC Felipe Contreras
2009-03-18  1:23         ` [PATCH A 05/15] tidspbridge: whitespace cleanups Felipe Contreras
2009-03-18  1:23           ` [PATCH A 06/15] tidspbridge: trivial cleanups Felipe Contreras
2009-03-18  1:23             ` [PATCH A 07/15] tidspbridge: hDevContext == pDevContext Felipe Contreras
2009-03-18  1:23               ` [PATCH A 08/15] tidspbridge: remove UTIL_Wait wrapper Felipe Contreras
2009-03-18  1:23                 ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
2009-03-18  1:23                   ` [PATCH A 10/15] tidspbridge: remove udelay and use time_after instead Felipe Contreras
2009-03-18  1:23                     ` [PATCH A 11/15] tidspbridge: Remove IO_InterruptDSP Felipe Contreras
2009-03-18  1:23                       ` [PATCH A 12/15] tidspbridge: remove IO_InterruptDSP2 Felipe Contreras
2009-03-18  1:23                         ` [PATCH A 13/15] tidspbridge: remove CHNLSM_InterruptDSP Felipe Contreras
2009-03-18  1:23                           ` [PATCH A 14/15] tidspbridge: remove wIntrVal2Dsp Felipe Contreras
2009-03-18  1:23                             ` [PATCH A 15/15] tidspbridge: print an error when timing out Felipe Contreras
2009-03-18  7:29                   ` [PATCH A 09/15] tidspbridge: cleanup and remove HW_MBOX_IsFull Felipe Contreras
2009-03-18 12:55 ` [PATCH A 00/15] tidspbridge: general cleanups Kanigeri, Hari
2009-03-18 13:30   ` Felipe Contreras
2009-03-18 14:11     ` Kanigeri, Hari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).