Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [FYI] TI dspbridge rebase against latest l-o
  2008-10-09  4:48 ` Hiroshi DOYU
@ 2008-10-21  9:15   ` Hiroshi DOYU
  0 siblings, 0 replies; 9+ messages in thread
From: Hiroshi DOYU @ 2008-10-21  9:15 UTC (permalink / raw)
  To: linux-omap; +Cc: x00omar, vikram.pandita

Hi,

TI's dspbridge patchset has been rebased on the latest l-o just for
its easy intergration.  Most of the patches just came from o-z(Thanks
TI dspbridge team!) and I just collected them. The latest one is:

	http://4869037.web.fc2.com/tidspbridge-20081021.tgz

So steps are:

  $ git clone http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
  $ cd linux-omap-2.6
  $ wget http://4869037.web.fc2.com/tidspbridge-<date>.tgz
  $ tar xvzf tidspbridge-<date>.tgz
  $ git am *.patch
  $ make <your omap3 board>_defconfig
  $ make menuconfig # add the following options in the menuconfig
 ...
 CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
 ...
 CONFIG_MPU_BRIDGE=m
 CONFIG_DISABLE_BRIDGE_DVFS=y
 # CONFIG_DISABLE_BRIDGE_PM is not set
 CONFIG_BRIDGE_DEBUG=y
 ...

You can get bridge sample binaries as below:

  https://omapzoom.org/gf/download/frsrelease/132/632/dspbridge_binaries.tar.bz2

And extract it somewhere on target rootfs. After kernel booted up:

 $ depmod -a
 $ modprobe bridgedriver base_img=ddspbase_tiomap3430.dof64P
 $ <Thy some sample applications>

If I missed something here, please let me know.

   Hiroshi DOYU

From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Subject: Re: [PATCH][omapzoom] BRIDGE Add preemption support to unprotected functions
Date: Thu, 09 Oct 2008 07:48:29 +0300 (EEST)

> Hi Omar,
> 
> This patch has been added to l-o tidspbridge patchset for its easy
> integration against l-o:
> 
> http://4869037.web.fc2.com/tidspbridge-20081010.tgz
> 
> 	Hiroshi DOYU
> 
> It has been sync'ed with omapzoom("o-z") bridge patches[1] and rebased
> on the latest l-o.  Most of the patches come from o-z(Thanks TI bridge
> team!) and I just collected them;)
> 
> So steps are:
> 
>   $ git clone http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
>   $ cd linux-omap-2.6
>   $ wget http://4869037.web.fc2.com/tidspbridge-<date>.tgz
>   $ tar xvzf tidspbridge-<date>.tgz
>   $ git am *.patch
>   $ make <your omap3 board>_defconfig
>   $ make menuconfig # add the following options in the menuconfig
>  ...
>  CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
>  ...
>  CONFIG_MPU_BRIDGE=m
>  CONFIG_DISABLE_BRIDGE_DVFS=y
>  ...
> 
> You can get bridge sample binaries as below:
> 
>   https://omapzoom.org/gf/download/frsrelease/132/632/dspbridge_binaries.tar.bz2
> 
> And extract it somewhere on target rootfs.
> 
> After kernel booted up:
> 
>  $ depmod -a
>  $ modprobe bridgedriver base_img=ddbase_tiomap3430.dof64P
>  $ <Thy some sample applications>
> 
> 
> From: "ext Ramirez Luna, Omar" <x00omar@ti.com>
> Subject: [PATCH][omapzoom] BRIDGE Add preemption support to unprotected functions
> Date: Wed, 8 Oct 2008 17:07:15 -0500
> 
> > From: Hari Kanigeri <h-kanigeri2@ti.com>
> > Date: Fri, 3 Oct 2008 12:20:45 -0500
> > Subject: [PATCH] BRIDGE Add preemption support to unprotected functions
> > 
> > This patch protects the critical sections in bridge
> > driver that otherwise might end in unexpected behavior.
> > 
> > Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
> > Signed-off-by: Omar Ramirez Luna <x00omar@ti.com>
> > ---
> >  arch/arm/plat-omap/include/dspbridge/sync.h |   15 +++++++-----
> >  drivers/dsp/bridge/rmgr/proc.c              |   31 ++++++++++++++++++++------
> >  drivers/dsp/bridge/services/sync.c          |    9 +-------
> >  3 files changed, 34 insertions(+), 21 deletions(-)
> > 
> > diff --git a/arch/arm/plat-omap/include/dspbridge/sync.h b/arch/arm/plat-omap/include/dspbridge/sync.h
> > index e340c88..26aa370 100644
> > --- a/arch/arm/plat-omap/include/dspbridge/sync.h
> > +++ b/arch/arm/plat-omap/include/dspbridge/sync.h
> > @@ -55,6 +55,11 @@
> >  #ifndef _SYNC_H
> >  #define _SYNC_H
> >  
> > +#include <asm/semaphore.h>
> > +
> > +#define SIGNATURECS     0x53435953	/* "SYCS" (in reverse) */
> > +#define SIGNATUREDPCCS  0x53445953	/* "SYDS" (in reverse) */
> > +
> >  /* Special timeout value indicating an infinite wait: */
> >  #define SYNC_INFINITE  0xffffffff
> >  
> > @@ -63,14 +68,12 @@
> >  
> >  /* Generic SYNC object: */
> >  	struct SYNC_OBJECT;
> > -	/*typedef struct SYNC_OBJECT *SYNC_HOBJECT;*/
> >  
> >  /* Generic SYNC CS object: */
> > -	struct SYNC_CSOBJECT;
> > -	/*typedef struct SYNC_CSOBJECT *SYNC_HCSOBJECT;*/
> > -
> > -/* Used SYNC_CSOBJECT instead of SYNC_DPCCSOBJECT to avoid warnings */
> > -	/*typedef struct SYNC_CSOBJECT *SYNC_HDPCCSOBJECT;*/
> > +struct SYNC_CSOBJECT {
> > +	u32 dwSignature;	/* used for object validation */
> > +	struct semaphore sem;
> > +} ;
> >  
> >  /* SYNC object attributes: */
> >  	struct SYNC_ATTRS {
> > diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
> > index b60fd3a..4464c62 100644
> > --- a/drivers/dsp/bridge/rmgr/proc.c
> > +++ b/drivers/dsp/bridge/rmgr/proc.c
> > @@ -118,7 +118,7 @@
> >  #include <dspbridge/list.h>
> >  #include <dspbridge/mem.h>
> >  #include <dspbridge/ntfy.h>
> > -
> > +#include <dspbridge/sync.h>
> >  /*  ----------------------------------- Mini Driver */
> >  #include <dspbridge/wmd.h>
> >  
> > @@ -197,6 +197,8 @@ static struct GT_Mask PROC_DebugMask = { NULL, NULL };	/* WCD MGR Mask */
> >  
> >  static u32 cRefs;
> >  
> > +struct SYNC_CSOBJECT *hProcLock;	/* For critical sections */
> > +
> >  #ifndef CONFIG_DISABLE_BRIDGE_PM
> >  #ifndef CONFIG_DISABLE_BRIDGE_DVFS
> >  #ifdef CONFIG_OMAP3_PM
> > @@ -733,12 +735,13 @@ DSP_STATUS PROC_FlushMemory(DSP_HPROCESSOR hProcessor, void *pMpuAddr,
> >  		 "Entered PROC_FlushMemory, args:\n\t"
> >  		 "hProcessor: 0x%x pMpuAddr: 0x%x ulSize 0x%x, ulFlags 0x%x\n",
> >  		 hProcessor, pMpuAddr, ulSize, ulFlags);
> > -
> > +	/* Critical section */
> > +	(void)SYNC_EnterCS(hProcLock);
> >  	MEM_FlushCache(pMpuAddr, ulSize, FlushMemType);
> > +	(void)SYNC_LeaveCS(hProcLock);
> >  
> >  	GT_1trace(PROC_DebugMask, GT_ENTER, "Leaving PROC_FlushMemory [0x%x]",
> >  		 status);
> > -
> >  	return status;
> >  }
> >  
> > @@ -759,7 +762,10 @@ DSP_STATUS PROC_InvalidateMemory(DSP_HPROCESSOR hProcessor, void *pMpuAddr,
> >  		 "Entered PROC_InvalidateMemory, args:\n\t"
> >  		 "hProcessor: 0x%x pMpuAddr: 0x%x ulSize 0x%x\n", hProcessor,
> >  		 pMpuAddr, ulSize);
> > +	(void)SYNC_EnterCS(hProcLock);
> >  	MEM_FlushCache(pMpuAddr, ulSize, FlushMemType);
> > +	(void)SYNC_LeaveCS(hProcLock);
> > +
> >  	GT_1trace(PROC_DebugMask, GT_ENTER,
> >  		 "Leaving PROC_InvalidateMemory [0x%x]", status);
> >  	return status;
> > @@ -847,6 +853,9 @@ void PROC_Exit(void)
> >  {
> >  	DBC_Require(cRefs > 0);
> >  
> > +	if (hProcLock)
> > +		(void)SYNC_DeleteCS(hProcLock);
> > +
> >  	cRefs--;
> >  
> >  	GT_1trace(PROC_DebugMask, GT_5CLASS,
> > @@ -992,6 +1001,8 @@ bool PROC_Init(void)
> >  		DBC_Assert(!PROC_DebugMask.flags);
> >  		GT_create(&PROC_DebugMask, "PR");  /* "PR" for Processor */
> >  
> > +		MEM_AllocObject(hProcLock, struct SYNC_CSOBJECT, SIGNATURECS);
> > +		(void)SYNC_InitializeCS(&hProcLock);
> >  	}
> >  
> >  	if (fRetval)
> > @@ -1384,6 +1395,8 @@ DSP_STATUS PROC_Map(DSP_HPROCESSOR hProcessor, void *pMpuAddr, u32 ulSize,
> >  	GT_3trace(PROC_DebugMask, GT_ENTER, "PROC_Map: vaAlign %x, paAlign %x, "
> >  		 "sizeAlign %x\n", vaAlign, paAlign, sizeAlign);
> >  
> > +	/* Critical section */
> > +	(void)SYNC_EnterCS(hProcLock);
> >  	status = DMM_GetHandle(pProcObject, &hDmmMgr);
> >  	if (DSP_FAILED(status)) {
> >  		GT_1trace(PROC_DebugMask, GT_7CLASS,
> > @@ -1406,6 +1419,8 @@ DSP_STATUS PROC_Map(DSP_HPROCESSOR hProcessor, void *pMpuAddr, u32 ulSize,
> >  	} else {
> >  		DMM_UnMapMemory(hDmmMgr, vaAlign, &sizeAlign);
> >  	}
> > +	(void)SYNC_LeaveCS(hProcLock);
> > +
> >  #ifndef RES_CLEANUP_DISABLE
> >  	if (DSP_SUCCEEDED(status)) {
> >  		/* Update the node and stream resource status */
> > @@ -1532,9 +1547,9 @@ DSP_STATUS PROC_ReserveMemory(DSP_HPROCESSOR hProcessor, u32 ulSize,
> >  	if (DSP_FAILED(status)) {
> >  		GT_1trace(PROC_DebugMask, GT_7CLASS, "PROC_ReserveMemory: "
> >  			 "Failed to get DMM Mgr handle: 0x%x\n", status);
> > -	} else {
> > +	} else
> >  		status = DMM_ReserveMemory(hDmmMgr, ulSize, (u32 *)ppRsvAddr);
> > -	}
> > +
> >  	GT_1trace(PROC_DebugMask, GT_ENTER, "Leaving PROC_ReserveMemory [0x%x]",
> >  		 status);
> >  	return status;
> > @@ -1743,6 +1758,8 @@ DSP_STATUS PROC_UnMap(DSP_HPROCESSOR hProcessor, void *pMapAddr)
> >  	vaAlign = PG_ALIGN_LOW((u32) pMapAddr, PG_SIZE_4K);
> >  
> >  	status = DMM_GetHandle(hProcessor, &hDmmMgr);
> > +	/* Critical section */
> > +	(void)SYNC_EnterCS(hProcLock);
> >  	if (DSP_FAILED(status)) {
> >  		GT_1trace(PROC_DebugMask, GT_7CLASS, "PROC_UnMap: "
> >  			 "Failed to get DMM Mgr handle: 0x%x\n", status);
> > @@ -1751,12 +1768,12 @@ DSP_STATUS PROC_UnMap(DSP_HPROCESSOR hProcessor, void *pMapAddr)
> >  		 This function returns error if the VA is not mapped */
> >  		status = DMM_UnMapMemory(hDmmMgr, (u32) vaAlign, &sizeAlign);
> >  	}
> > -
> >  	/* Remove mapping from the page tables. */
> >  	if (DSP_SUCCEEDED(status)) {
> >  		status = (*pProcObject->pIntfFxns->pfnBrdMemUnMap)
> >  			 (pProcObject->hWmdContext, vaAlign, sizeAlign);
> >  	}
> > +	(void)SYNC_LeaveCS(hProcLock);
> >  #ifndef RES_CLEANUP_DISABLE
> >  	GT_1trace(PROC_DebugMask, GT_ENTER,
> >  		   "PROC_UnMap DRV_GetDMMResElement "
> > @@ -1804,7 +1821,7 @@ DSP_STATUS PROC_UnReserveMemory(DSP_HPROCESSOR hProcessor, void *pRsvAddr)
> >  	status = DMM_GetHandle(pProcObject, &hDmmMgr);
> >  	if (DSP_FAILED(status))
> >  		GT_1trace(PROC_DebugMask, GT_7CLASS,
> > -			 "PROC_Map: Failed to get DMM Mgr "
> > +			 "PROC_UnReserveMemory: Failed to get DMM Mgr "
> >  			 "handle: 0x%x\n", status);
> >  	else
> >  		status = DMM_UnReserveMemory(hDmmMgr, (u32) pRsvAddr);
> > diff --git a/drivers/dsp/bridge/services/sync.c b/drivers/dsp/bridge/services/sync.c
> > index 40c832f..d3453fa 100644
> > --- a/drivers/dsp/bridge/services/sync.c
> > +++ b/drivers/dsp/bridge/services/sync.c
> > @@ -15,7 +15,7 @@
> >   */
> >  
> >  /*
> > - *  ======== syncce.c ========
> > + *  ======== sync.c ========
> >   *  Purpose:
> >   *      Synchronization services.
> >   *
> > @@ -68,8 +68,6 @@
> >  
> >  /*  ----------------------------------- Defines, Data Structures, Typedefs */
> >  #define SIGNATURE       0x434e5953	/* "SYNC" (in reverse) */
> > -#define SIGNATURECS     0x53435953	/* "SYCS" (in reverse) */
> > -#define SIGNATUREDPCCS  0x53445953	/* "SYDS" (in reverse) */
> >  
> >  enum wait_state {
> >  	wo_waiting,
> > @@ -95,11 +93,6 @@ struct SYNC_OBJECT {
> >  	struct WAIT_OBJECT *pWaitObj;
> >  };
> >  
> > -struct SYNC_CSOBJECT {
> > -	u32 dwSignature;	/* used for object validation */
> > -	struct semaphore sem;
> > -} ;
> > -
> >  struct SYNC_DPCCSOBJECT {
> >  	u32 dwSignature;	/* used for object validation */
> >  	spinlock_t sync_dpccs_lock;
> > -- 
> > 1.5.6.3
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [FYI] TI dspbridge rebase against latest l-o
  2008-11-01  1:38 [PATCH] BRIDGE Power Management cleanup Ramirez Luna, Omar
@ 2008-11-07 13:23 ` Hiroshi DOYU
  0 siblings, 0 replies; 9+ messages in thread
From: Hiroshi DOYU @ 2008-11-07 13:23 UTC (permalink / raw)
  To: linux-omap; +Cc: vpasam, bshah, grgupta, tony, x00omar, jouni.hogander

Hi,

"CONFIG_BRIDGE_DVFS" hasn't been verified since it requires the latest
PM patches. I will wait for the new pm-* branch.

The changes against the previous are:

Ramesh Gupta (1):
      BRIDGE Power Management cleanup

Tony Lindgren (1):
      DSPBRIDGE: Flush posted write when acking mailbox irq

TI's dspbridge patchset has been rebased on the latest l-o just for
its easy intergration.  Most of the patches just came from o-z(Thanks
TI dspbridge team!) and I just collected them. The latest one is:

	http://4869037.web.fc2.com/tidspbridge-20081107.tgz

So steps are:

  $ git clone http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
  $ cd linux-omap-2.6
  $ wget http://4869037.web.fc2.com/tidspbridge-<date>.tgz
  $ tar xvzf tidspbridge-<date>.tgz
  $ git am *.patch
  $ make <your omap3 board>_defconfig
  $ make menuconfig # add the following options in the menuconfig
 ...
 CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
 ...
 #
 # CBUS support
 #
 # CONFIG_CBUS is not set
 CONFIG_MPU_BRIDGE=m
 # CONFIG_BRIDGE_DVFS is not set
 CONFIG_BRIDGE_DEBUG=y
 ...

You can get bridge sample binaries as below:

  https://omapzoom.org/gf/download/frsrelease/132/632/dspbridge_binaries.tar.bz2

And extract it somewhere on target rootfs. After kernel booted up:

 $ depmod -a
 $ modprobe bridgedriver base_img=ddspbase_tiomap3430.dof64P
 $ <Thy some sample applications>

If I missed something here, please let me know.

   Hiroshi DOYU

From: "ext Ramirez Luna, Omar" <x00omar@ti.com>
Subject: [PATCH] BRIDGE Power Management cleanup
Date: Fri, 31 Oct 2008 20:38:43 -0500

> Hi All,
> 
> Here it is Bridge Power Management cleanup patch that applies in top of currently bridge patches series for linux-omap kernel.
> 
> ---
> 
> From: Ramesh Gupta <grgupta@ti.com>
> Date: Fri, 31 Oct 2008 18:09:16 -0500
> Subject: [PATCH] BRIDGE Power Management cleanup
> 
> 1. Removed DISABLE_BRIDGE_* Flags.
> 2. Used platform_data for calling the functions.
> 3. Check for CONFIG_CPU_FREQ added while boosting the opp.
> 4. Removed CONFIG_OMAP3_PM flag.
> 
> Signed-off-by: Ramesh Gupta <grgupta@ti.com>
> ---
>  arch/arm/plat-omap/include/dspbridge/host_os.h |   20 +++
>  drivers/dsp/bridge/Kconfig                     |   16 +--
>  drivers/dsp/bridge/rmgr/drv_interface.c        |  176 ++++++++----------------
>  drivers/dsp/bridge/rmgr/node.c                 |   79 ++++-------
>  drivers/dsp/bridge/rmgr/proc.c                 |   58 ++------
>  drivers/dsp/bridge/services/clk.c              |    9 +-
>  drivers/dsp/bridge/wmd/io_sm.c                 |   36 ++----
>  drivers/dsp/bridge/wmd/tiomap3430.c            |   15 ++-
>  drivers/dsp/bridge/wmd/tiomap3430_pwr.c        |   89 ++++---------
>  drivers/dsp/bridge/wmd/tiomap_sm.c             |   73 ++++-------
>  10 files changed, 202 insertions(+), 369 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/dspbridge/host_os.h b/arch/arm/plat-omap/include/dspbridge/host_os.h
> index ff49e0d..dab2111 100644
> --- a/arch/arm/plat-omap/include/dspbridge/host_os.h
> +++ b/arch/arm/plat-omap/include/dspbridge/host_os.h
> @@ -70,4 +70,24 @@
>  #define INT_MAIL_MPU_IRQ        26
>  #define INT_DSP_MMU_IRQ        28
> 
> +#ifdef CONFIG_PM
> +struct dspbridge_platform_data {
> +       void    (*dsp_set_min_opp)(u8 opp_id);
> +       u8      (*dsp_get_opp)(void);
> +       void    (*cpu_set_freq)(unsigned long f);
> +       unsigned long (*cpu_get_freq)(void);
> +       unsigned long mpu_speed[6];
> +};
> +
> +#define PRCM_VDD1 1
> +
> +#ifndef CONFIG_OMAP_PM_SRF
> +#define VDD1_OPP1 1
> +#define VDD1_OPP2 2
> +#define VDD1_OPP3 3
> +#define VDD1_OPP4 4
> +#define VDD1_OPP5 5
> +#endif
> +
> +#endif
>  #endif
> diff --git a/drivers/dsp/bridge/Kconfig b/drivers/dsp/bridge/Kconfig
> index cba1338..78aed30 100644
> --- a/drivers/dsp/bridge/Kconfig
> +++ b/drivers/dsp/bridge/Kconfig
> @@ -11,26 +11,18 @@ menuconfig MPU_BRIDGE
>           "host" processor, and the attached DSPs are processing resources
>           that can be utilized by applications and drivers running on the GPP.
> 
> -config DISABLE_BRIDGE_DVFS
> -       bool "Disable Bridge Dynamic Voltage and Frequency Scaling (DVFS)"
> +config BRIDGE_DVFS
> +       bool "Enable Bridge Dynamic Voltage and Frequency Scaling (DVFS)"
>         depends on MPU_BRIDGE
> -       default y
> +       default n
>         help
>           DVFS allows DSP Bridge to initiate the operating point change to
>           scale the chip voltage and frequency in order to match the
>           performance and power consumption to the current processing
>           requirements.
> 
> -config DISABLE_BRIDGE_PM
> -       bool "Disable Bridge Power Management"
> -       depends on MPU_BRIDGE && PM
> -       default y
> -       help
> -         DSP Bridge employs power management techniques to save dynamic and
> -         static power consumption of the IVA sub system.
> -
>  config BRIDGE_DEBUG
>         bool "DSP Bridge Debug Support"
>         depends on MPU_BRIDGE
>         help
> -         Say Y to enable Bridge debugging capabilities
> \ No newline at end of file
> +         Say Y to enable Bridge debugging capabilities
> diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c
> index cf28f86..4650370 100644
> --- a/drivers/dsp/bridge/rmgr/drv_interface.c
> +++ b/drivers/dsp/bridge/rmgr/drv_interface.c
> @@ -58,16 +58,8 @@
>  #include <linux/init.h>
>  #include <linux/moduleparam.h>
>  #include <linux/cdev.h>
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> -#else
> -#include <mach/resource.h>
> -#include <mach/prcm_34xx.h>
> -#endif
> -#endif
> -#endif
> +
> +#include <mach/board-3430sdp.h>
> 
>  /*  ----------------------------------- DSP/BIOS Bridge */
>  #include <dspbridge/std.h>
> @@ -108,16 +100,14 @@
>  #include <dspbridge/dbreg.h>
>  #endif
> 
> -#ifndef DISABLE_BRIDGE_PM
> -#ifndef DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#define PRCM_VDD1 1
> -struct clk *clk_handle;
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +#if (defined CONFIG_OMAP_PM_NOOP) || (defined CONFIG_OMAP_PM_SRF)
> +#include <mach/omap-pm.h>
>  #endif
>  #endif
> 
> 
> +
>  #define BRIDGE_NAME "C6410"
>  /*  ----------------------------------- Globals */
>  #define DRIVER_NAME  "DspBridge"
> @@ -149,7 +139,7 @@ static u32 phys_mempool_base;
>  static u32 phys_mempool_size;
>  static int tc_wordswapon;      /* Default value is always false */
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>  struct omap34xx_bridge_suspend_data {
>         int suspended;
>         wait_queue_head_t suspend_wq;
> @@ -219,11 +209,33 @@ static struct file_operations bridge_fops = {
>         .mmap           = bridge_mmap,
>  };
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>  static u32 timeOut = 1000;
> +#ifdef CONFIG_BRIDGE_DVFS
> +static struct clk *clk_handle;
> +s32 dsp_max_opps = VDD1_OPP3;
> +#endif
> 
>  static int bridge_suspend(struct platform_device *pdev, pm_message_t state);
>  static int bridge_resume(struct platform_device *pdev);
> +
> +/* Maximum Opps that can be requested by IVA*/
> +/*vdd1 rate table*/
> +#if (defined CONFIG_OMAP_PM_NOOP) || (defined CONFIG_OMAP_PM_SRF)
> +const struct vdd_prcm_config vdd1_rate_table_bridge[] = {
> +       {0, 0, 0},
> +       /*OPP1*/
> +       {S125M, VDD1_OPP1, 0},
> +       /*OPP2*/
> +       {S250M, VDD1_OPP2, 0},
> +       /*OPP3*/
> +       {S500M, VDD1_OPP3, 0},
> +       /*OPP4*/
> +       {S550M, VDD1_OPP4, 0},
> +       /*OPP5*/
> +       {S600M, VDD1_OPP5, 0},
> +};
> +#endif
>  #endif
> 
>  static void bridge_free(struct device *dev);
> @@ -235,41 +247,27 @@ static int omap34xx_bridge_probe(struct platform_device *dev)
>         return 0;
>  }
> 
> -static struct platform_device omap_dspbridge_dev = {
> +static struct dspbridge_platform_data dspbridge_pdata = {
> +#if (defined CONFIG_OMAP_PM_NOOP) || (defined CONFIG_OMAP_PM_SRF)
> +       .dsp_set_min_opp = omap_pm_dsp_set_min_opp,
> +       .dsp_get_opp = omap_pm_dsp_get_opp,
> +       .cpu_set_freq = omap_pm_cpu_set_freq,
> +       .cpu_get_freq = omap_pm_cpu_get_freq,
> +#endif
> +
> +};
> +
> +struct platform_device omap_dspbridge_dev = {
>                 .name = BRIDGE_NAME,
>                 .id = -1,
>                 .num_resources = 0,
>                 .dev = {
>                 .release = bridge_free,
> +               .platform_data = &dspbridge_pdata,
>                 },
>                 .resource = NULL,
>  };
> 
> -
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -/* Maximum Opps that can be requested by IVA*/
> -s32 dsp_max_opps = VDD1_OPP3;
> -/*vdd1 rate table*/
> -const struct vdd_prcm_config vdd1_rate_table[] = {
> -       {0, 0, 0},
> -       /*OPP1*/
> -       {S125M, VDD1_OPP1, 0},
> -       /*OPP2*/
> -       {S250M, VDD1_OPP2, 0},
> -       /*OPP3*/
> -       {S500M, VDD1_OPP3, 0},
> -       /*OPP4*/
> -       {S550M, VDD1_OPP4, 0},
> -       /*OPP5*/
> -       {S600M, VDD1_OPP5, 0},
> -};
> -#else
> -/* Maximum Opps that can be requested by IVA*/
> -s32 dsp_max_opps = CO_VDD1_OPP3;
> -#endif
> -
>  u32 vdd1_dsp_freq[6][4] = {
>         {0, 0, 0, 0},
>         /*OPP1*/
> @@ -284,6 +282,7 @@ u32 vdd1_dsp_freq[6][4] = {
>         {0, 430000, 355000, 430000},
>  };
> 
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> 
>  static int dspbridge_post_scale(struct notifier_block *op, unsigned long level,
>                                 void *ptr)
> @@ -292,27 +291,11 @@ static int dspbridge_post_scale(struct notifier_block *op, unsigned long level,
>         return 0;
>  }
> 
> -#ifndef CONFIG_OMAP3_PM
>  static struct notifier_block iva_clk_notifier = {
>         .notifier_call = dspbridge_post_scale,
>         NULL,
>  };
> 
> -#else
> -/* The handle for setting constraints */
> -struct constraint_handle *dsp_constraint_handle;
> -struct constraint_handle *mpu_constraint_handle;
> -
> -static struct notifier_block omap34xxbridge_post_scale = {
> -       .notifier_call = dspbridge_post_scale,
> -       NULL,
> -};
> -static struct constraint_id cnstr_id_vdd1 = {
> -       .type = RES_OPP_CO,
> -       .data = (void *)"vdd1_opp",
> -};
> -#endif
> -#endif
>  #endif
> 
>  static struct platform_driver bridge_driver_ldm = {
> @@ -321,7 +304,7 @@ static struct platform_driver bridge_driver_ldm = {
>               .name     = BRIDGE_NAME,
>          },
>        .probe = omap34xx_bridge_probe,
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>        .suspend = bridge_suspend,
>        .resume = bridge_resume,
>  #endif
> @@ -344,6 +327,9 @@ static int __init bridge_init(void)
>         u32 temp;
>         dev_t   dev = 0 ;
>         int     result;
> +       int i = 0;
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> 
>         /* use 2.6 device model */
>         if (driver_major) {
> @@ -409,7 +395,7 @@ static int __init bridge_init(void)
>         if (!status)
>                 status = platform_device_register(&omap_dspbridge_dev);
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>         /* Initialize the wait queue */
>         if (!status) {
>                 bridge_suspend_data.suspended = 0;
> @@ -486,9 +472,11 @@ static int __init bridge_init(void)
>                         GT_0trace(driverTrace, GT_5CLASS,
>                                         "DSP/BIOS Bridge driver loaded\n");
>                 }
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> +#ifdef CONFIG_PM
> +#if (defined CONFIG_OMAP_PM_NOOP) || (defined CONFIG_OMAP_PM_SRF)
> +               for (i = 0; i < 5; i++)
> +                       pdata->mpu_speed[i] = vdd1_rate_table_bridge[i].speed;
> +
>                 clk_handle = clk_get(NULL, "iva2_ck");
>                 if (!clk_handle) {
>                         GT_0trace(driverTrace, GT_7CLASS,
> @@ -505,19 +493,6 @@ static int __init bridge_init(void)
>                         "clk_notifier_register FAIL for iva2_ck \n");
>                 }
> 
> -#else
> -               /* Register for the constraints */
> -               dsp_constraint_handle = constraint_get("dspbridge",
> -                                                     &cnstr_id_vdd1);
> -               constraint_register_post_notification(dsp_constraint_handle,
> -                                                &omap34xxbridge_post_scale,
> -                                                CO_VDD1_OPP5 + 1);
> -               mpu_constraint_handle = constraint_get("mpubridge",
> -                                                     &cnstr_id_vdd1);
> -               constraint_register_post_notification(mpu_constraint_handle,
> -                                                &omap34xxbridge_post_scale,
> -                                                CO_VDD1_OPP5 + 1);
> -#endif
>  #endif
>  #endif
>         }
> @@ -536,10 +511,9 @@ static void __exit bridge_exit(void)
>         bool ret;
>         GT_0trace(driverTrace, GT_ENTER, "-> driver_exit\n");
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -       /* remove the constraints */
> -#ifndef CONFIG_OMAP3_PM
> +       /* unregister the clock notifier */
> +#ifdef CONFIG_PM
> +#if (defined CONFIG_OMAP_PM_NOOP) || (defined CONFIG_OMAP_PM_SRF)
>         if (!clk_notifier_unregister(clk_handle, &iva_clk_notifier)) {
>                 GT_0trace(driverTrace, GT_7CLASS,
>                 "clk_notifier_unregister PASS for iva2_ck \n");
> @@ -551,38 +525,8 @@ static void __exit bridge_exit(void)
>         clk_put(clk_handle);
>         clk_handle = NULL;
> 
> -#else
> -       if (dsp_constraint_handle != NULL) {
> -               GT_0trace(driverTrace, GT_7CLASS,
> -                        "bridge_exit: remove constraints\n");
> -               constraint_remove(dsp_constraint_handle);
> -               constraint_unregister_post_notification(dsp_constraint_handle,
> -                                               &omap34xxbridge_post_scale,
> -                                               CO_VDD1_OPP5 + 1);
> -               constraint_put(dsp_constraint_handle);
> -               dsp_constraint_handle = NULL;
> -       } else {
> -               GT_0trace(driverTrace, GT_7CLASS,
> -                        "dsp_constraint_handle is NULL\n");
> -
> -       }
> -       if (mpu_constraint_handle != NULL) {
> -               GT_0trace(driverTrace, GT_7CLASS,
> -                        "bridge_exit: remove constraints\n");
> -               constraint_remove(mpu_constraint_handle);
> -               constraint_unregister_post_notification(mpu_constraint_handle,
> -                                               &omap34xxbridge_post_scale,
> -                                               CO_VDD1_OPP5 + 1);
> -               constraint_put(mpu_constraint_handle);
> -               mpu_constraint_handle = NULL;
> -       } else {
> -               GT_0trace(driverTrace, GT_7CLASS,
> -                        "mpu_constraint_handle is NULL\n");
> -
> -       }
> -#endif /*#ifndef CONFIG_OMAP3_PM*/
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_DVFS*/
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_PM*/
> +#endif
> +#endif /*#ifdef CONFIG_PM*/
>         /* unregister bridge driver */
>         platform_device_unregister(&omap_dspbridge_dev);
>         platform_driver_unregister(&bridge_driver_ldm);
> @@ -738,7 +682,7 @@ static int bridge_ioctl(struct inode *ip, struct file *filp, unsigned int code,
>         union Trapped_Args pBufIn;
> 
>         DBC_Require(filp != NULL);
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>         status = omap34xxbridge_suspend_lockout(&bridge_suspend_data, filp);
>         if (status != 0)
>                 return status;
> @@ -814,7 +758,7 @@ DSP_STATUS DRV_RemoveAllResources(HANDLE hPCtxt)
>  }
>  #endif
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
> 
>  static int bridge_suspend(struct platform_device *pdev, pm_message_t state)
>  {
> diff --git a/drivers/dsp/bridge/rmgr/node.c b/drivers/dsp/bridge/rmgr/node.c
> index db6b287..27ef481 100644
> --- a/drivers/dsp/bridge/rmgr/node.c
> +++ b/drivers/dsp/bridge/rmgr/node.c
> @@ -152,16 +152,6 @@
>  #include <dspbridge/resourcecleanup.h>
>  #endif
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> -#include <mach/board-3430sdp.h>
> -#else
> -#include <mach/resource.h>
> -#endif
> -#endif
> -#endif
> 
>  #define NODE_SIGNATURE      0x45444f4e /* "EDON" */
>  #define NODEMGR_SIGNATURE   0x52474d4e /* "RGMN" */
> @@ -374,13 +364,8 @@ static struct NLDR_FXNS nldrFxns = {
>         NLDR_Load,
>         NLDR_Unload,
>  };
> -
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifdef CONFIG_OMAP3_PM
> -extern struct constraint_handle *mpu_constraint_handle;
> -#endif
> -#endif
> +#ifdef CONFIG_PM
> +extern struct platform_device omap_dspbridge_dev;
>  #endif
> 
>  enum NODE_STATE NODE_GetState(HANDLE hNode)
> @@ -1324,6 +1309,11 @@ DSP_STATUS NODE_Create(struct NODE_OBJECT *hNode)
>         bool bJustWokeDSP = false;
>         struct DSP_CBDATA cbData;
>         u32 procId = 255;
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> +#endif
> +
> 
>         DBC_Require(cRefs > 0);
>         GT_1trace(NODE_debugMask, GT_ENTER, "NODE_Create: hNode: 0x%x\n",
> @@ -1364,24 +1354,18 @@ DSP_STATUS NODE_Create(struct NODE_OBJECT *hNode)
> 
>         if (DSP_SUCCEEDED(status)) {
>                 /* If node's create function is not loaded, load it */
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
>                 /* Boost the OPP level to max level that DSP can be requested */
> -#ifndef CONFIG_OMAP3_PM
> -               omap_pm_cpu_set_freq(vdd1_rate_table[VDD1_OPP3].speed);
> -               GT_1trace(NODE_debugMask, GT_4CLASS, "opp level"
> -               "after setting to VDD1_OPP3 is %d\n",
> -               omap_pm_dsp_get_opp());
> -#else
> -               if (constraint_set(mpu_constraint_handle,
> -                  CO_VDD1_OPP3) != 0)
> -                       GT_1trace(NODE_debugMask, GT_4CLASS, "NODE_Create:"
> -                       "Constraint set of %d failed\n", CO_VDD1_OPP3);
> -               else
> -                       GT_1trace(NODE_debugMask, GT_4CLASS, "NODE_Create:"
> -                                "Constraint set of %d passed\n",
> -                                CO_VDD1_OPP3);
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +#ifndef CONFIG_CPU_FREQ
> +               if (pdata->cpu_set_freq) {
> +                       (*pdata->cpu_set_freq)(pdata->mpu_speed[VDD1_OPP3]);
> +
> +                       if (pdata->dsp_get_opp) {
> +                               GT_1trace(NODE_debugMask, GT_4CLASS, "opp level"
> +                               "after setting to VDD1_OPP3 is %d\n",
> +                               (*pdata->dsp_get_opp)());
> +                       }
> +               }
>  #endif
>  #endif
>                 status = hNodeMgr->nldrFxns.pfnLoad(hNode->hNldrNode,
> @@ -1398,27 +1382,20 @@ DSP_STATUS NODE_Create(struct NODE_OBJECT *hNode)
>                                  "NODE_Create: failed to load"
>                                  " create code: 0x%x\n", status);
>                 }
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
>                 /* Request the lowest OPP level*/
> -#ifndef CONFIG_OMAP3_PM
> -               omap_pm_cpu_set_freq(vdd1_rate_table[VDD1_OPP1].speed);
> -               GT_1trace(NODE_debugMask, GT_4CLASS, "opp level"
> -               "after setting to VDD1_OPP1 is %d\n",
> -               omap_pm_dsp_get_opp());
> -#else
> -               if (constraint_set(mpu_constraint_handle,
> -                  (CO_VDD1_OPP1)) != 0) {
> -                       GT_1trace(NODE_debugMask, GT_4CLASS,
> -                                "NODE_Create: Constraint set of %d "
> -                                "failed\n", CO_VDD1_OPP1);
> -               } else {
> -                       GT_1trace(NODE_debugMask, GT_4CLASS, "NODE_Create:"
> -                       "Constraint set of %d passed\n", CO_VDD1_OPP1);
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +#ifndef CONFIG_CPU_FREQ
> +               if (pdata->cpu_set_freq) {
> +                       (*pdata->cpu_set_freq)(pdata->mpu_speed[VDD1_OPP1]);
> +
> +                       if (pdata->dsp_get_opp) {
> +                               GT_1trace(NODE_debugMask, GT_4CLASS, "opp level"
> +                               "after setting to VDD1_OPP1 is %d\n",
> +                               (*pdata->dsp_get_opp)());
> +                       }
>                 }
>  #endif
>  #endif
> -#endif
>                 /* Get address of iAlg functions, if socket node */
>                 if (DSP_SUCCEEDED(status)) {
>                         if (nodeType == NODE_DAISSOCKET) {
> diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
> index e5bd3e1..c13248c 100644
> --- a/drivers/dsp/bridge/rmgr/proc.c
> +++ b/drivers/dsp/bridge/rmgr/proc.c
> @@ -148,16 +148,6 @@
>  #ifndef RES_CLEANUP_DISABLE
>  #include <dspbridge/resourcecleanup.h>
>  #endif
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> -#include <mach/board-3430sdp.h>
> -#else
> -#include <mach/resource.h>
> -#endif
> -#endif
> -#endif
>  /*  ----------------------------------- Defines, Data Structures, Typedefs */
>  #define PROC_SIGNATURE    0x434F5250   /* "PROC" (in reverse). */
>  #define MAXCMDLINELEN       255
> @@ -199,12 +189,8 @@ static u32 cRefs;
> 
>  struct SYNC_CSOBJECT *hProcLock;       /* For critical sections */
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifdef CONFIG_OMAP3_PM
> -extern struct constraint_handle *mpu_constraint_handle;
> -#endif
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +extern struct platform_device omap_dspbridge_dev;
>  #endif
> 
>  /*  ----------------------------------- Function Prototypes */
> @@ -1053,6 +1039,10 @@ DSP_STATUS PROC_Load(DSP_HPROCESSOR hProcessor, IN CONST s32 iArgc,
>  #ifdef OPT_LOAD_TIME_INSTRUMENTATION
>         do_gettimeofday(&tv1);
>  #endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> +#endif
>         GT_2trace(PROC_DebugMask, GT_ENTER, "Entered PROC_Load, args:\n\t"
>                  "hProcessor:  0x%x\taArgv: 0x%x\n", hProcessor, aArgv[0]);
>         /* Call the WMD_BRD_Load Fxn */
> @@ -1223,19 +1213,11 @@ DSP_STATUS PROC_Load(DSP_HPROCESSOR hProcessor, IN CONST s32 iArgc,
>         if (DSP_SUCCEEDED(status)) {
>                 /* Now, attempt to load an exec: */
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
>         /* Boost the OPP level to Maximum level supported by baseport*/
> -#ifndef CONFIG_OMAP3_PM
> -       omap_pm_cpu_set_freq(vdd1_rate_table[VDD1_OPP5].speed);
> -#else
> -       if (constraint_set(mpu_constraint_handle, CO_VDD1_OPP5) != 0)
> -               GT_1trace(PROC_DebugMask, GT_4CLASS, "PROC_Load:"
> -                         "Constraint set of %d failed\n", CO_VDD1_OPP5);
> -       else
> -               GT_1trace(PROC_DebugMask, GT_4CLASS, "PROC_Load:"
> -                        "Constraint set of %d passed\n", CO_VDD1_OPP5);
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +#ifndef CONFIG_CPU_FREQ
> +       if (pdata->cpu_set_freq)
> +               (*pdata->cpu_set_freq)(pdata->mpu_speed[VDD1_OPP5]);
>  #endif
>  #endif
>                 status = COD_LoadBase(hCodMgr, iArgc, (char **)aArgv,
> @@ -1255,21 +1237,11 @@ DSP_STATUS PROC_Load(DSP_HPROCESSOR hProcessor, IN CONST s32 iArgc,
>                                          "COD_Load  status 0x%x \n", status);
>                         }
>                 }
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -       /* Requesting the lowest opp supported by baseport*/
> -#ifndef CONFIG_OMAP3_PM
> -               omap_pm_cpu_set_freq(vdd1_rate_table[VDD1_OPP1].speed);
> -#else
> -               if (constraint_set(mpu_constraint_handle, CO_VDD1_OPP1) != 0)
> -                       GT_1trace(PROC_DebugMask, GT_4CLASS, "PROC_Load:"
> -                                "Constraint setting of %d failed\n",
> -                                CO_VDD1_OPP1);
> -               else
> -                       GT_1trace(PROC_DebugMask, GT_4CLASS, "PROC_Load:"
> -                                "Constraint setting  of %d passed\n",
> -                                CO_VDD1_OPP1);
> -#endif
> +       /* Requesting the lowest opp supported*/
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +#ifndef CONFIG_CPU_FREQ
> +       if (pdata->cpu_set_freq)
> +               (*pdata->cpu_set_freq)(pdata->mpu_speed[VDD1_OPP1]);
>  #endif
>  #endif
> 
> diff --git a/drivers/dsp/bridge/services/clk.c b/drivers/dsp/bridge/services/clk.c
> index b469509..dacb013 100644
> --- a/drivers/dsp/bridge/services/clk.c
> +++ b/drivers/dsp/bridge/services/clk.c
> @@ -100,9 +100,8 @@ static struct SERVICES_Clk_t SERVICES_Clks[] = {
>         {NULL, ""}
>  };
> 
> -
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -extern struct platform_device dspbridge_device;
> +#ifdef CONFIG_PM
> +extern struct platform_device omap_dspbridge_dev;
>  #endif
> 
> 
> @@ -153,8 +152,8 @@ bool CLK_Init(void)
>         /* Get the clock handles from base port and store locally */
>         while (i < SERVICESCLK_NOT_DEFINED) {
>                 /* get the handle from BP */
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -               clk_handle = clk_get(&dspbridge_device.dev,
> +#ifndef CONFIG_PM
> +               clk_handle = clk_get(&omap_dspbridge_dev.dev,
>                              SERVICES_Clks[i].clk_name);
>  #else
>                 clk_handle = clk_get(NULL, SERVICES_Clks[i].clk_name);
> diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
> index 08bc4d3..576f43f 100644
> --- a/drivers/dsp/bridge/wmd/io_sm.c
> +++ b/drivers/dsp/bridge/wmd/io_sm.c
> @@ -111,15 +111,6 @@
> 
>  /*  ----------------------------------- Host OS */
>  #include <dspbridge/host_os.h>
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> -#else
> -#include <mach/resource.h>
> -#endif
> -#endif
> -#endif
> 
>  /*  ----------------------------------- DSP/BIOS Bridge */
>  #include <dspbridge/std.h>
> @@ -249,19 +240,17 @@ static DSP_STATUS registerSHMSegs(struct IO_MGR *hIOMgr,
> 
>  extern u32 DRV_GetFirstDevExtension();
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifdef CONFIG_OMAP3_PM
> -/* The maximum number of OPPs that are supported by Baseport */
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +/* The maximum number of OPPs that are supported */
>  extern s32 dsp_max_opps;
>  /* The Vdd1 opp table information */
>  extern u32 vdd1_dsp_freq[6][4] ;
> -/* The contraint handle for OPP information */
> -extern struct constraint_handle *dsp_constraint_handle;
> -#endif
> -#endif
> +
> +extern struct platform_device omap_dspbridge_dev;
>  #endif
> 
> +
> +
>  #if GT_TRACE
>  static struct GT_Mask dsp_trace_mask = { NULL, NULL }; /* GT trace variable */
>  #endif
> @@ -1714,9 +1703,10 @@ void IO_IntrDSP2(IN struct IO_MGR *pIOMgr, IN u16 wMbVal)
>  DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr, IN enum SHM_DESCTYPE desc,
>                          IN void *pArgs)
>  {
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
>         u32 i;
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> 
>         switch (desc) {
>         case SHM_CURROPP:
> @@ -1756,11 +1746,8 @@ DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr, IN enum SHM_DESCTYPE desc,
>                 DBG_Trace(DBG_LEVEL5, "OPP shared memory - max OPP number: "
>                          "%d\n", hIOMgr->pSharedMem->oppTableStruct.numOppPts);
>                 /* Update the current OPP number */
> -#ifndef CONFIG_OMAP3_PM
> -               i = omap_pm_dsp_get_opp();
> -#else
> -               i = constraint_get_level(dsp_constraint_handle);
> -#endif
> +               if (pdata->dsp_get_opp)
> +                       i = (*pdata->dsp_get_opp)();
>                 hIOMgr->pSharedMem->oppTableStruct.currOppPt = i;
>                 DBG_Trace(DBG_LEVEL7, "OPP value programmed to shared memory: "
>                          "%d\n", i);
> @@ -1774,7 +1761,6 @@ DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr, IN enum SHM_DESCTYPE desc,
> 
>         }
>  #endif
> -#endif
>         return DSP_SOK;
>  }
> 
> diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c
> index 3fa29c7..92bb00c 100644
> --- a/drivers/dsp/bridge/wmd/tiomap3430.c
> +++ b/drivers/dsp/bridge/wmd/tiomap3430.c
> @@ -1142,8 +1142,6 @@ static DSP_STATUS WMD_DEV_Ctrl(struct WMD_DEV_CONTEXT *pDevContext, u32 dwCmd,
>                 DBG_Trace(DBG_LEVEL5, "WMDIOCTL_PWR_HIBERNATE\n");
>                 status = handle_hibernation_fromDSP(pDevContext);
>                 break;
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
>         case WMDIOCTL_PRESCALE_NOTIFY:
>                 DBG_Trace(DBG_LEVEL5, "WMDIOCTL_PRESCALE_NOTIFY\n");
>                 status = PreScale_DSP(pDevContext, pArgs);
> @@ -1156,8 +1154,6 @@ static DSP_STATUS WMD_DEV_Ctrl(struct WMD_DEV_CONTEXT *pDevContext, u32 dwCmd,
>                 DBG_Trace(DBG_LEVEL5, "WMDIOCTL_CONSTRAINT_REQUEST\n");
>                 status = handle_constraints_set(pDevContext, pArgs);
>                 break;
> -#endif
> -#endif
>         default:
>                 status = DSP_EFAIL;
>                 DBG_Trace(DBG_LEVEL7, "Error in WMD_BRD_Ioctl \n");
> @@ -1292,10 +1288,13 @@ static DSP_STATUS WMD_BRD_MemMap(struct WMD_DEV_CONTEXT *hDevContext,
>         u32 *pPhysAddrPageTbl = NULL;
>         struct vm_area_struct *vma;
>         struct mm_struct *mm = current->mm;
> +       struct CFG_HOSTRES resources;
> 
>         DBG_Trace(DBG_ENTER, "> WMD_BRD_MemMap hDevContext %x, pa %x, va %x, "
>                  "size %x, ulMapAttr %x\n", hDevContext, ulMpuAddr, ulVirtAddr,
>                  ulNumBytes, ulMapAttr);
> +       status = CFG_GetHostResources(
> +                (struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), &resources);
>         if (ulNumBytes == 0)
>                 return DSP_EINVALIDARG;
> 
> @@ -1423,6 +1422,12 @@ func_cont:
>          * This is called from here instead from PteUpdate to avoid unnecessary
>          * repetition while mapping non-contiguous physical regions of a virtual
>          * region */
> +       HW_PWRST_IVA2RegGet(resources.dwPrmBase, &temp);
> +       if ((temp & 0x03) != 0x03 || (temp & 0x03) != 0x02) {
> +               DBG_Trace(DBG_LEVEL7, "temp value is 0x%x\n", temp);
> +               CLK_Enable(SERVICESCLK_iva2_ck);
> +               WakeDSP(pDevContext, NULL);
> +       }
>         HW_MMU_TLBFlushAll(pDevContext->dwDSPMmuBase);
>         DBG_Trace(DBG_ENTER, "< WMD_BRD_MemMap status %x\n", status);
>         return status;
> @@ -1564,6 +1569,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);
>         HW_MMU_TLBFlushAll(pDevContext->dwDSPMmuBase);
>         DBG_Trace(DBG_LEVEL1, "WMD_BRD_MemUnMap vaCurr %x, pteAddrL1 %x "
>                   "pteAddrL2 %x\n", vaCurr, pteAddrL1, pteAddrL2);
> @@ -2048,6 +2054,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);
>         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 cdc2227..8659fda 100644
> --- a/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
> +++ b/drivers/dsp/bridge/wmd/tiomap3430_pwr.c
> @@ -61,24 +61,15 @@
>  #include "_tiomap.h"
>  #include "_tiomap_pwr.h"
>  #include "_tiomap_util.h"
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> +#ifdef CONFIG_PM
>  #include <mach/board-3430sdp.h>
> -#else
> -#include <mach/resource.h>
> -#endif
>  #endif
> +#ifdef CONFIG_PM
> +extern struct platform_device omap_dspbridge_dev;
> +#define VDD1_OPP1 1
> +#define VDD1_OPP5 5
>  #endif
>  extern s32 dsp_test_sleepstate;
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifdef CONFIG_OMAP3_PM
> -extern struct constraint_handle *dsp_constraint_handle;
> -#endif
> -#endif
> -#endif
>  extern struct MAILBOX_CONTEXT mboxsetting;
> 
>  /*
> @@ -88,31 +79,21 @@ extern struct MAILBOX_CONTEXT mboxsetting;
>  DSP_STATUS handle_constraints_set(struct WMD_DEV_CONTEXT *pDevContext,
>                                   IN void *pArgs)
>  {
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
>         u32 *pConstraintVal;
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> 
>         pConstraintVal = (u32 *)(pArgs);
>         /* Read the target value requested by DSP  */
>         DBG_Trace(DBG_LEVEL7, "handle_constraints_set: opp requested = 0x%x\n",
>                                                   (u32)*(pConstraintVal+1));
> 
> -       /* Set the new constraint in resource framework */
> -#ifndef CONFIG_OMAP3_PM
> -       omap_pm_dsp_set_min_opp((u32)*(pConstraintVal+1));
> +       /* Set the new opp value */
> +       if (pdata->dsp_set_min_opp)
> +               (*pdata->dsp_set_min_opp)((u32)*(pConstraintVal+1));
>         return DSP_SOK;
> -#else
> -       if (constraint_set(dsp_constraint_handle,
> -                          (u32)*(pConstraintVal+1)) == 0)
> -               return DSP_SOK;
> -       else {
> -               DBG_Trace(DBG_LEVEL7,
> -                        "handle_constraints_set: Constraint set failed\n");
> -               return DSP_EFAIL;
> -       }
> -#endif /*#ifndef CONFIG_OMAP3_PM*/
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_DVFS */
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_PM */
> +#endif /* #if (defined  CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS) */
>         return DSP_SOK;
>  }
> 
> @@ -122,13 +103,15 @@ DSP_STATUS handle_constraints_set(struct WMD_DEV_CONTEXT *pDevContext,
>   */
>  DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
>  {
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +       DSP_STATUS status = DSP_SOK;
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
>         u16 usCount = TIHELEN_ACKTIMEOUT;
>         struct CFG_HOSTRES resources;
> -       DSP_STATUS status = DSP_SOK;
>         enum HW_PwrState_t pwrState;
>         u32 opplevel;
>         struct IO_MGR *hIOMgr;
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> 
>         status = CFG_GetHostResources(
>                  (struct CFG_DEVNODE *)DRV_GetFirstDevExtension(), &resources);
> @@ -164,40 +147,22 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
>                 if (DSP_SUCCEEDED(status)) {
>                         /* Update the Bridger Driver state */
>                         pDevContext->dwBrdState = BRD_DSP_HIBERNATION;
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
>                         status = DEV_GetIOMgr(pDevContext->hDevObject, &hIOMgr);
>                         if (DSP_FAILED(status))
>                                 return status;
>                         IO_SHMsetting(hIOMgr, SHM_GETOPP, &opplevel);
>                         /* Set the OPP to low level before moving to OFF mode */
> -#ifndef CONFIG_OMAP3_PM
>                         if (opplevel != VDD1_OPP1) {
>                                 DBG_Trace(DBG_LEVEL5,
>                                         "Tiomap_pwr.c - DSP requested"
>                                         " OPP = %d, MPU requesting low"
>                                         " OPP %d instead\n", opplevel,
>                                         VDD1_OPP1);
> -                               omap_pm_dsp_set_min_opp(VDD1_OPP1);
> +                               if (pdata->dsp_set_min_opp)
> +                                       (*pdata->dsp_set_min_opp)(VDD1_OPP1);
>                                 status = DSP_SOK;
>                         }
> 
> -#else
> -                       if (opplevel != CO_VDD1_OPP1) {
> -                               DBG_Trace(DBG_LEVEL5,
> -                                       "Tiomap_pwr.c - DSP requested"
> -                                       " OPP = %d, MPU requesting low"
> -                                       " OPP %d instead\n", opplevel,
> -                                       CO_VDD1_OPP1);
> -                               if (constraint_set(dsp_constraint_handle,
> -                                                 CO_VDD1_OPP1) != 0) {
> -                                       DBG_Trace(DBG_LEVEL7,
> -                                               "handle_hibernation_fromDSP:"
> -                                               "Constraint set failed\n");
> -                                       status = DSP_EFAIL;
> -                               }
> -                       }
> -#endif
> -#endif
>                 } else {
>                         DBG_Trace(DBG_LEVEL7,
>                                  "handle_hibernation_fromDSP- FAILED\n");
> @@ -206,7 +171,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
>         return status;
> 
>  #endif
> -       return DSP_SOK;
> +       return status;
> 
>  }
>  /*
> @@ -217,7 +182,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
>                    IN void *pArgs)
>  {
>         DSP_STATUS status = DSP_SOK;
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>         struct CFG_HOSTRES resources;
>         u16 usCount = TIHELEN_ACKTIMEOUT;
>         enum HW_PwrState_t pwrState;
> @@ -311,7 +276,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
>  DSP_STATUS WakeDSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>  {
>         DSP_STATUS status = DSP_SOK;
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> +#ifdef CONFIG_PM
>         struct CFG_HOSTRES resources;
>         enum HW_PwrState_t pwrState;
> 
> @@ -441,8 +406,7 @@ DSP_STATUS DSPPeripheralClkCtrl(struct WMD_DEV_CONTEXT *pDevContext,
>   */
>  DSP_STATUS PreScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>  {
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
>         u32 level;
>         u32 voltage_domain;
> 
> @@ -468,8 +432,7 @@ DSP_STATUS PreScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>                           " state in wrong state");
>                 return DSP_EFAIL;
>         }
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_DVFS */
> -#endif  /*#ifndef CONFIG_DISABLE_BRIDGE_PM */
> +#endif /* #if (defined CONFIG_PM)&&(CONFIG_BRIDGE_DVFS) */
>         return DSP_SOK;
>  }
> 
> @@ -480,8 +443,7 @@ DSP_STATUS PreScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>   */
>  DSP_STATUS PostScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>  {
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> +#if (defined CONFIG_PM) && (CONFIG_BRIDGE_DVFS)
>         u32 level;
>         u32 voltage_domain;
>         struct IO_MGR *hIOMgr;
> @@ -517,8 +479,7 @@ DSP_STATUS PostScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
>                           "in wrong state");
>                 return DSP_EFAIL;
>         }
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_DVFS*/
> -#endif /*#ifndef CONFIG_DISABLE_BRIDGE_PM*/
> +#endif /* #if (defined CONFIG_PM)&&(CONFIG_BRIDGE_DVFS) */
>         return DSP_SOK;
>  }
> 
> diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
> index 63655d9..d1724e7 100644
> --- a/drivers/dsp/bridge/wmd/tiomap_sm.c
> +++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
> @@ -67,15 +67,8 @@
>  #include <dspbridge/chnl_sm.h>
>  #include "_tiomap_pwr.h"
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -#include <mach/omap-pm.h>
> -#else
> -#include <mach/resource.h>
> -extern struct constraint_handle *dsp_constraint_handle;
> -#endif
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +extern struct platform_device omap_dspbridge_dev;
>  #endif
> 
>  /*  ----------------------------------- Defines, Data Structures, Typedefs */
> @@ -172,10 +165,10 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
>         DSP_STATUS status = DSP_SOK;
>         struct WMD_DEV_CONTEXT *pDevContext = hDevContext;
> 
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -       u32 opplevel;
> -#endif
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +       struct dspbridge_platform_data *pdata =
> +                               omap_dspbridge_dev.dev.platform_data;
> +       u32 opplevel = 0;
>  #endif
>         HW_STATUS hwStatus;
>         u32 mbxFull;
> @@ -187,56 +180,38 @@ DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *hDevContext)
>         status = CFG_GetHostResources(
>                         (struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
>                         &resources);
> +#if (defined CONFIG_PM) && (defined CONFIG_BRIDGE_DVFS)
> +               if (pdata->dsp_get_opp)
> +                       opplevel = (*pdata->dsp_get_opp)();
> 
> -       if  (pDevContext->dwBrdState == BRD_DSP_HIBERNATION ||
> -           pDevContext->dwBrdState == BRD_HIBERNATION) {
> -               pDevContext->dwBrdState = BRD_RUNNING;
> -#ifndef CONFIG_DISABLE_BRIDGE_PM
> -#ifndef CONFIG_DISABLE_BRIDGE_DVFS
> -#ifndef CONFIG_OMAP3_PM
> -               opplevel = omap_pm_dsp_get_opp();
>                 /* If OPP is at minimum level, increase it before waking up
>                 * the DSP */
>                 if (opplevel == 1) {
> -                       omap_pm_dsp_set_min_opp(opplevel+1);
> -                       DBG_Trace(DBG_LEVEL7, "CHNLSM_InterruptDSP:Setting "
> -                       "the vdd1 constraint level to %d before "
> -                       "waking DSP \n", (opplevel + 1));
> -               }
> -
> -#else
> -               opplevel = constraint_get_level(dsp_constraint_handle);
> -               /* If OPP is at minimum level, increase it before waking up
> -                * the DSP */
> -               if (opplevel == 1) {
> -                       if (constraint_set(dsp_constraint_handle,
> -                          (opplevel+1)) != 0) {
> +                       if (pdata->dsp_set_min_opp) {
> +                               (*pdata->dsp_set_min_opp)(opplevel+1);
>                                 DBG_Trace(DBG_LEVEL7, "CHNLSM_InterruptDSP: "
> -                                        "Constraint set failed\n");
> -                               return DSP_EFAIL;
> +                                       "Setting the vdd1 opp level to %d "
> +                                       "before waking DSP \n",
> +                                       (opplevel + 1));
>                         }
> -                       DBG_Trace(DBG_LEVEL7, "CHNLSM_InterruptDSP:Setting "
> -                                "the vdd1 constraint level to %d before "
> -                                "waking DSP \n", (opplevel + 1));
>                 }
> 
>  #endif
> -#endif
> -#endif
> -               /* Read MMU register to invoke short wakeup of DSP */
> +
> +       if  (pDevContext->dwBrdState == BRD_DSP_HIBERNATION ||
> +           pDevContext->dwBrdState == BRD_HIBERNATION) {
> +               pDevContext->dwBrdState = BRD_RUNNING;
> +
>                 temp = (u32) *((REG_UWORD32 *) ((u32)
>                        (resources.dwDmmuBase) + 0x10));
> 
>                 /* Restore mailbox settings */
>                 status = HW_MBOX_restoreSettings(resources.dwMboxBase);
> -               DBG_Trace(DBG_LEVEL6, "MailBoxSettings: SYSCONFIG = 0x%x\n",
> -                         mboxsetting.sysconfig);
> -               DBG_Trace(DBG_LEVEL6, "MailBoxSettings: IRQENABLE0 = 0x%x\n",
> -                         mboxsetting.irqEnable0);
> -               DBG_Trace(DBG_LEVEL6, "MailBoxSettings: IRQENABLE1 = 0x%x\n",
> -                        mboxsetting.irqEnable1);
> -               /* Restart the peripheral clocks that were disabled */
> -               DSP_PeripheralClocks_Enable(hDevContext, NULL);
> +
> +               if (pDevContext->dwBrdState == BRD_DSP_HIBERNATION) {
> +                       /* Restart the peripheral clocks that were disabled */
> +                       DSP_PeripheralClocks_Enable(hDevContext, NULL);
> +               }
> 
>         }
>         while (--cnt) {
> --
> 1.5.6.3

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

* Re: [FYI] TI dspbridge rebase against latest l-o
@ 2008-11-08  3:15 Rick Bronson
  2008-11-08  4:27 ` Hiroshi DOYU
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Bronson @ 2008-11-08  3:15 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: linux-omap

Hi Hiroshi,

  I just tried this on my beagleboard and I'm not sure if it worked.
First, did you forget to add that you need "mem=122m" in the
bootargs?  Also do you need to add in the addresses like:

sudo modprobe bridgedriver phys_mempool_base=0x87a00000 phys_mempool_size=0x600000 base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P

  Anyway, when I followed the instructions (except for above) I get:

> sudo modprobe bridgedriver phys_mempool_base=0x87a00000 phys_mempool_size=0x60
0000 base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P
> lsmod                                                                         
Module                  Size  Used by                                           
bridgedriver          356488  0                                                 
> cat /proc/interrupts | grep Dsp
 26:          3        INTC  DspBridge                                          
 28:          0        INTC  DspBridge                                          
> /home/rick/dspbridge_binaries/ping.out                                        
>
> cat /proc/interrupts | grep Dsp                                               
 26:          4        INTC  DspBridge                                          
 28:          0        INTC  DspBridge                                          

  After this, no matter how many times I run ping, I get the same
number of interrupts.  How do I know ping is really working?

  Thanks,

  Rick

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

* Re: [FYI] TI dspbridge rebase against latest l-o
  2008-11-08  3:15 Rick Bronson
@ 2008-11-08  4:27 ` Hiroshi DOYU
  0 siblings, 0 replies; 9+ messages in thread
From: Hiroshi DOYU @ 2008-11-08  4:27 UTC (permalink / raw)
  To: rick; +Cc: linux-omap, x00omar

Hi Rick, thank you for comments.

From: "ext Rick Bronson" <rick@efn.org>
Subject: Re: [FYI] TI dspbridge rebase against latest l-o
Date: Fri, 07 Nov 2008 19:15:44 -0800

> Hi Hiroshi,
> 
>   I just tried this on my beagleboard and I'm not sure if it worked.
> First, did you forget to add that you need "mem=122m" in the
> bootargs?  Also do you need to add in the addresses like:

I don't think that it's mandatory. Without phys_* parameters, just
dynamic allocation from non-reserved area would be used. This may
sometimes suffer from memory allocation, especially in the case that
the target board has small amount of memory(RAM).

> sudo modprobe bridgedriver phys_mempool_base=0x87a00000 phys_mempool_size=0x600000 base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P
> 
>   Anyway, when I followed the instructions (except for above) I get:
> 
> > sudo modprobe bridgedriver phys_mempool_base=0x87a00000 phys_mempool_size=0x60
> 0000 base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P
> > lsmod                                                                         
> Module                  Size  Used by                                           
> bridgedriver          356488  0                                                 
> > cat /proc/interrupts | grep Dsp
>  26:          3        INTC  DspBridge                                          
>  28:          0        INTC  DspBridge                                          
> > /home/rick/dspbridge_binaries/ping.out                                        
> >
> > cat /proc/interrupts | grep Dsp                                               
>  26:          4        INTC  DspBridge                                          
>  28:          0        INTC  DspBridge                                          
>
>   After this, no matter how many times I run ping, I get the same
> number of interrupts.  How do I know ping is really working?

The above is a bit different from mine as below, where the count of
mailbox interrupt are incremented reasonably.

bridge:~$ modprobe bridgedriver base_img=ddspbase_tiomap3430.dof64P 
bridge:~$ grep DspBridge /proc/interrupts 
 26:          3        INTC  DspBridge  mailbox
 28:          0        INTC  DspBridge  iommu fault
bridge:~$ ./ping.out > /dev/null
bridge:~$ grep DspBridge /proc/interrupts 
 26:        169        INTC  DspBridge  mailbox
 28:          0        INTC  DspBridge  iommu fault
bridge:~$ ./ping.out > /dev/null
bridge:~$ grep DspBridge /proc/interrupts 
 26:        334        INTC  DspBridge  mailbox
 28:          0        INTC  DspBridge  iommu fault
bridge:~$ 

You can see how it's working by appending GT_str="**=01234567" on
module parameter to investigate further.

       Hiroshi DOYU

>From f9331a0c1b04cf812624b0e1d96ce491ddb0d7d1 Mon Sep 17 00:00:00 2001
From: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Date: Sat, 8 Nov 2008 06:17:08 +0200
Subject: [PATCH 1/1] BRIDGE: use more detail name for interrupt claiming device

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
---
 drivers/dsp/bridge/wmd/io_sm.c  |    2 +-
 drivers/dsp/bridge/wmd/ue_deh.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/io_sm.c b/drivers/dsp/bridge/wmd/io_sm.c
index 08bc4d3..6843a42 100644
--- a/drivers/dsp/bridge/wmd/io_sm.c
+++ b/drivers/dsp/bridge/wmd/io_sm.c
@@ -341,7 +341,7 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
 		if (devType == DSP_UNIT) {
 			/* Plug the channel ISR:. */
                        if ((request_irq(INT_MAIL_MPU_IRQ, IO_ISR, 0,
-                                           "DspBridge", (void *)pIOMgr)) == 0)
+                                           "DspBridge\tmailbox", (void *)pIOMgr)) == 0)
                                status = DSP_SOK;
                        else
                                status = DSP_EFAIL;
diff --git a/drivers/dsp/bridge/wmd/ue_deh.c b/drivers/dsp/bridge/wmd/ue_deh.c
index 7e450b3..2110353 100644
--- a/drivers/dsp/bridge/wmd/ue_deh.c
+++ b/drivers/dsp/bridge/wmd/ue_deh.c
@@ -121,7 +121,7 @@ DSP_STATUS WMD_DEH_Create(OUT struct DEH_MGR **phDehMgr,
 			pDehMgr->errInfo.dwVal3 = 0L;
 			/* Install ISR function for DSP MMU fault */
                        if ((request_irq(INT_DSP_MMU_IRQ, MMU_FaultIsr, 0,
-                                           "DspBridge", (void *)pDehMgr)) == 0)
+                                           "DspBridge\tiommu fault", (void *)pDehMgr)) == 0)
                                status = DSP_SOK;
                        else
                                status = DSP_EFAIL;
-- 
1.5.5.1.357.g1af8b


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

* Re: [FYI] TI dspbridge rebase against latest l-o
@ 2008-11-08  6:38 Rick Bronson
  2008-11-08  7:52 ` Hiroshi DOYU
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Bronson @ 2008-11-08  6:38 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: linux-omap

Hi Hiroshi,

  Thanks very much for the help.

  Here is the output from

sudo modprobe bridgedriver base_img=ddspbase_tiomap3430.dof64P GT_str="**=01234567" 

http://www.efn.org/~rick/pub/dsp.txt

  The first failure seems to be:

RG - 0: G CurrentConfig FAILED                                                  
CF - 0: CFG_GetHostResources Failed                                             

  Any ideas what's wrong?

  Thanks much.

  Rick

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

* Re: [FYI] TI dspbridge rebase against latest l-o
  2008-11-08  6:38 Rick Bronson
@ 2008-11-08  7:52 ` Hiroshi DOYU
  0 siblings, 0 replies; 9+ messages in thread
From: Hiroshi DOYU @ 2008-11-08  7:52 UTC (permalink / raw)
  To: rick; +Cc: linux-omap

Hi Rick,

From: "ext Rick Bronson" <rick@efn.org>
Subject: Re: [FYI] TI dspbridge rebase against latest l-o
Date: Fri, 07 Nov 2008 22:38:49 -0800

>   Here is the output from
> 
> sudo modprobe bridgedriver base_img=ddspbase_tiomap3430.dof64P GT_str="**=01234567" 
> 
> http://www.efn.org/~rick/pub/dsp.txt

For me, the following part looks suspicious.

544  KF - 0: KFILE_Open: pszFileName ddspbase_tiomap3430.dof64P, pszMode rb          
545  MM - 0: MEM_Calloc: cBytes 0x20 type 0x1                                        
546  MM - 0: MEM_Free: pMemBufs 0xc68ca1b8                                           
547  KF - 0: KFILE_Tell: hFile 0x0                                                   
548  KF - 0: KFILE_Seek:invalid file handle                                          
                        ^^^^^^^^^^^^^^^^^^^^
549  KF - 0: KFILE_Seek: hFile 0x0, lOffset 0x0, cOrigin 0x0                         
550  KF - 0: KFILE_Seek:invalid file handle                                          
551  MM - 0: MEM_Calloc: cBytes 0x14 type 0x0                                        
552  MM - 0: MEM_Calloc: cBytes 0x34c        type 0x0                                
553  KF - 0: KFILE_Read: buffer 0xc6889a3c, cSize 0x1,cCount 0x38, hFile 0x0         
554  KF - 0: KFILE_Read: invalid file handle                                         
                         ^^^^^^^^^^^^^^^^^^^
555  DL - 0: Error reading File Headers from input stream                            
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
556  DL - 0: DBLL_open: Dynamic_Load_Module failed: 0x1                              
557  DL - 0: DBLL_close: lib: 0xc68879d8                                             

It seems to have failed to open a file, "ddspbase_tiomap3430.dof64P".

   Hiroshi DOYU

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

* Re: [FYI] TI dspbridge rebase against latest l-o
@ 2008-11-08 15:29 Rick Bronson
  2008-11-08 19:57 ` Hiroshi DOYU
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Bronson @ 2008-11-08 15:29 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: linux-omap

Hi Hiroshi,

  Thanks very much for the help.

  I'm getting farther.  It would help to have the right path ;-)

  Now I"m doing:

sudo modprobe bridgedriver base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P GT_str="**=01234567"

  But I still get the same results as far as interrupts.  Here is the
new (very much larger) output:

  http://www.efn.org/~rick/pub/dsp2.txt

  What does your ping.out look like?  Here's mine, it's awfully small:

-rwxr--r-- 1 rick solar 7248 2008-08-21 13:32 ping.out*                         

  What does your ping.out output when you run it?  Mine is absolutely
silent.

  Thanks again.

  Rick

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

* Re: [FYI] TI dspbridge rebase against latest l-o
  2008-11-08 15:29 [FYI] TI dspbridge rebase against latest l-o Rick Bronson
@ 2008-11-08 19:57 ` Hiroshi DOYU
       [not found]   ` <20081108.220531.30268045.Hiroshi.DOYU@nokia.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Hiroshi DOYU @ 2008-11-08 19:57 UTC (permalink / raw)
  To: rick; +Cc: linux-omap

Hi Rick,

The size of binary, "ping.out" looks as same as mine:

bridge:~# ls -al ./ping.out 
-rwxr-xr-x 1 1000 1000 7248 Aug 24  2008 ./ping.out
rx51:~# ./ping.out 3
DSP device detected !! 
DSPNodeCreate succeeded 
DSPNode_registerNotify succeeded 
DSPNode_run succeeded 
Ping: Id 1.000000 Msg 0.000000 Mem 15408.000000
Ping: Id 1.000000 Msg 1.000000 Mem 15408.000000
Ping: Id 1.000000 Msg 2.000000 Mem 15408.000000

Also, I put the whole log on:
  http://4869037.web.fc2.com/minicom-ping-20081108.cap

      Hiroshi DOYU

From: "ext Rick Bronson" <rick@efn.org>
Subject: Re: [FYI] TI dspbridge rebase against latest l-o
Date: Sat, 08 Nov 2008 07:29:25 -0800

> Hi Hiroshi,
> 
>   Thanks very much for the help.
> 
>   I'm getting farther.  It would help to have the right path ;-)
> 
>   Now I"m doing:
> 
> sudo modprobe bridgedriver base_img=/home/rick/dspbridge_binaries/ddspbase_tiomap3430.dof64P GT_str="**=01234567"
> 
>   But I still get the same results as far as interrupts.  Here is the
> new (very much larger) output:
> 
>   http://www.efn.org/~rick/pub/dsp2.txt
> 
>   What does your ping.out look like?  Here's mine, it's awfully small:
> 
> -rwxr--r-- 1 rick solar 7248 2008-08-21 13:32 ping.out*                         
> 
>   What does your ping.out output when you run it?  Mine is absolutely
> silent.
> 
>   Thanks again.
> 
>   Rick

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

* Re: [FYI] TI dspbridge rebase against latest l-o
       [not found]   ` <20081108.220531.30268045.Hiroshi.DOYU@nokia.com>
@ 2008-11-10 17:25     ` Rick Bronson
  0 siblings, 0 replies; 9+ messages in thread
From: Rick Bronson @ 2008-11-10 17:25 UTC (permalink / raw)
  To: Hiroshi DOYU; +Cc: linux-omap

Hiroshi,

  It works!

  I used strace on ping.out and found out you need to be root to run
it.  You might add that to your HOWTO.  See new HOWTO below.

  My device got made but it's 252 instead of 251.  Not sure what
that's about.

> ls -al /dev/DspBridge                                                         
crw-rw---- 1 root root 252, 0 2008-11-10 08:17 /dev/DspBridge                   

  Thanks very much for the help.

  Rick


Updated OMAP3 DspBridge HOWTO:

1. First get the date of the most current patch.
DATE=20081107

2. Do this on your host Linux box:
git clone http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
mkdir -p patches
cd patches
wget http://4869037.web.fc2.com/tidspbridge-$DATE.tgz
tar xvzf tidspbridge-$DATE.tgz
cd ../linux-omap-2.6
git am ../patches/*.patch
make <your omap3 board>_defconfig # eg. omap3_beagle_defconfig
make menuconfig # add the following options in the menuconfig
 ...
 CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
 # CONFIG_CBUS is not set
 CONFIG_MPU_BRIDGE=m
 # CONFIG_BRIDGE_DVFS is not set
 CONFIG_BRIDGE_DEBUG=y

3. You can get bridge sample binaries as below, put these on your
   target file system somewhere. Extract it somewhere on target rootfs.

  https://omapzoom.org/gf/download/frsrelease/132/632/dspbridge_binaries.tar.bz2

4. Make the modules and put them on the target rootfs.  For example,
   on your host box do:

cd linux-omap-2.6; tar czf ../modules.tar.gz `find . -name "*.ko"`

5. Then on the target do:

sudo mkdir -p /lib/modules/`uname -r`/kernel/
sudo tar xzf modules.tar.gz -C /lib/modules/`uname -r`/kernel/
sudo depmod -a

# if you don't have libbridge.so see http://elinux.org/BeagleBoard/gst-openmax
# and do this on the target:
sudo cp libbridge.so /lib
sudo ln -s libbridge.so /lib/libbridge.so.2

# NOTE: set "PATH" below correctly
sudo modprobe bridgedriver base_img=/PATH/ddspbase_tiomap3430.dof64P
ls -al /dev/DspBridge  # check to see that the device got made
  crw-rw---- 1 root root 252, 0 2008-11-10 08:53 /dev/DspBridge                   
sudo /PATH/ping.out
grep DspBridge /proc/interrupts   # check to see that you have gotten some interrupts
 26:        334        INTC  DspBridge                                          
 28:          0        INTC  DspBridge                                          

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

end of thread, other threads:[~2008-11-10 17:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-08 15:29 [FYI] TI dspbridge rebase against latest l-o Rick Bronson
2008-11-08 19:57 ` Hiroshi DOYU
     [not found]   ` <20081108.220531.30268045.Hiroshi.DOYU@nokia.com>
2008-11-10 17:25     ` Rick Bronson
  -- strict thread matches above, loose matches on Subject: below --
2008-11-08  6:38 Rick Bronson
2008-11-08  7:52 ` Hiroshi DOYU
2008-11-08  3:15 Rick Bronson
2008-11-08  4:27 ` Hiroshi DOYU
2008-11-01  1:38 [PATCH] BRIDGE Power Management cleanup Ramirez Luna, Omar
2008-11-07 13:23 ` [FYI] TI dspbridge rebase against latest l-o Hiroshi DOYU
2008-10-08 22:07 [PATCH][omapzoom] BRIDGE Add preemption support to unprotected functions Ramirez Luna, Omar
2008-10-09  4:48 ` Hiroshi DOYU
2008-10-21  9:15   ` [FYI] TI dspbridge rebase against latest l-o Hiroshi DOYU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox