Commit 0165c6cf authored by Ramesh Gupta's avatar Ramesh Gupta Committed by Hari Kanigeri

Bridge changes cleanup prcm Bridge changes cleanup prcm

Signed-off-by: default avatarRamesh Gupta G <grgupta@ti.com>
parent 5af79d13
......@@ -91,5 +91,6 @@ static inline void dspbridge_reserve_sdram(void) {}
#endif
extern unsigned long dspbridge_get_mempool_base(void);
#endif
......@@ -373,7 +373,7 @@ enum PRCMPM_PWSTCTRL_IVA2PowerStateE {
/*BITS MASKS & OFFSETS*/
/******************PM_TESLA_PWRSTCTRL***********/
/*PM_TESLA_PWRSTCTRL*/
#define PM_TESLA_PWRSTCTRL_PowerState_OFFSET (u32)(0x0)
#define PM_TESLA_PWRSTCTRL_PowerState_MASK (u32)(0x3)
#define PM_TESLA_PWRSTCTRL_LogicRetState_OFFSET (u32)(0x2)
......@@ -383,42 +383,42 @@ enum PRCMPM_PWSTCTRL_IVA2PowerStateE {
#define PM_TESLA_PWRSTCTRL_L2RetState_OFFSET (u32)(0x9)
#define PM_TESLA_PWRSTCTRL_L2RetState_MASK (u32)(0x200)
/******************PRM_PM_TESLA_PWRSTST*********/
/*PRM_PM_TESLA_PWRSTST*/
#define PM_TESLA_PWRSTST_PowerState_OFFSET (u32)(0x0)
#define PM_TESLA_PWRSTST_PowerState_MASK (u32)(0x3)
/******************RM_TESLA_RSTCTRL*************/
/*RM_TESLA_RSTCTRL*/
#define RM_TESLA_RSTCTRL_RST1_MASK (u32)(0x1)
#define RM_TESLA_RSTCTRL_RST1_OFFSET (u32)(0x0)
#define RM_TESLA_RSTCTRL_RST2_MASK (u32)(0x2)
#define RM_TESLA_RSTCTRL_RST2_OFFSET (u32)(0x1)
/******************RM_TESLA_RSTST***************/
/*RM_TESLA_RSTST*/
#define RM_TESLA_RSTST_Clear_MASK (u32)(0x0F)
/******************RM_TESLA_TESLA_CONTEXT*******/
/*RM_TESLA_TESLA_CONTEXT*/
#define RM_TESLA_TESLA_CONTEXT_Clear_MASK (u32)(0x701)
/******************PM_CORE_PWRSTCTRL************/
/*PM_CORE_PWRSTCTRL*/
#define PRM_PM_CORE_PWRSTCTRL_PowerControl_OFFSET (u32)(0x0)
#define PRM_PM_CORE_PWRSTCTRL_PowerControl_MASK (u32)(0x3)
/******************PM_ALWON_SR_IVA_WKDEP********/
/*PM_ALWON_SR_IVA_WKDEP*/
#define PM_ALWON_SR_IVA_WKDEP_MPU_OFFSET (u32)(0x0)
#define PM_ALWON_SR_IVA_WKDEP_MPU_MASK (u32)(0x1)
#define PM_ALWON_SR_IVA_WKDEP_DUCATI_OFFSET (u32)(0x1)
#define PM_ALWON_SR_IVA_WKDEP_DUCATI_MASK (u32)(0x2)
/******************CM_TESLA_CLKSTCTRL***********/
/*CM_TESLA_CLKSTCTRL*/
#define CM_TESLA_CLKSTCTRL_Transition_OFFSET (u32)(0x0)
#define CM_TESLA_CLKSTCTRL_Transition_MASK (u32)(0x3)
/******************CM_TESLA_TESLA_CLKCTRL*******/
/*CM_TESLA_TESLA_CLKCTRL*/
#define CM_TESLA_TESLA_CLKCTRL_STBY_MASK (u32)(0x40000)
#define CM_TESLA_TESLA_CLKCTRL_STBY_OFFSET (u32)(0x18)
#define CM_TESLA_TESLA_CLKCTRL_IDLE_MASK (u32)(0x30000)
......@@ -426,33 +426,28 @@ enum PRCMPM_PWSTCTRL_IVA2PowerStateE {
#define CM_TESLA_TESLA_CLKCTRL_MODMODE_OFFSET (u32)(0x0)
#define CM_TESLA_TESLA_CLKCTRL_MODMODE_MASK (u32)(0x03)
/******************CM1_ABE_CLKSTCTRL************/
/*CM1_ABE_CLKSTCTRL*/
#define CM1_ABE_CLKSTCTRL_Transition_OFFSET (u32)(0x0)
#define CM1_ABE_CLKSTCTRL_Transition_MASK (u32)(0x3)
/******************CM1_ABE_MCBSPX&TIMERX_CLKCTRL*/
/*CM1_ABE_MCBSPX&TIMERX_CLKCTRL*/
#define CM1_ABE_CLKCTRL_OFFSET (u32)(0x0)
#define CM1_ABE_CLKCTRL_MASK (u32)(0x3)
/******************CM1_L4PER_CLKSTCTRL************/
/*CM1_L4PER_CLKSTCTRL*/
#define CM1_L4PER_CLKSTCTRL_Transition_OFFSET (u32)(0x0)
#define CM1_L4PER_CLKSTCTRL_Transition_MASK (u32)(0x3)
/******************CM1_L4PER_MCBSPX&DMTIMERX_CLKCTRL*/
/*CM1_L4PER_MCBSPX&DMTIMERX_CLKCTRL*/
#define CM1_L4PER_CLKCTRL_OFFSET (u32)(0x0)
#define CM1_L4PER_CLKCTRL_MASK (u32)(0x3)
/******************CM_IVA_DVFS_PERF*************/
/*CM_IVA_DVFS_PERF*/
#define CM_IVA_DVFS_PERF_OFFSET (u32)(0x0)
#define CM_IVA_DVFS_PERF_MASK (u32)(0xFF)
/*****************************************************************************
* EXPORTED TYPES
******************************************************************************
*/
/* The following type definitions represent the
* enumerated values for each bitfield
*/
......
This diff is collapsed.
......@@ -29,7 +29,7 @@
#include <hw_defs.h>
#include <hw_prcm.h>
#ifdef OMAP_3430
static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
enum HW_RstModule_t r,
......@@ -52,6 +52,14 @@ static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
HW_STATUS status = RET_OK;
switch (r) {
#ifdef OMAP44XX
case HW_RST1_TESLA:
PRM_TESLA_RSTCTRL_RST1_Write32(baseAddress, val);
break;
case HW_RST2_TESLA:
PRM_TESLA_RSTCTRL_RST2_Write32(baseAddress, val);
break;
#else
case HW_RST1_IVA2:
PRM_RSTCTRL_IVA2RST1_DSPWrite32(baseAddress, val);
break;
......@@ -61,6 +69,7 @@ static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
case HW_RST3_IVA2:
PRM_RSTCTRL_IVA2RST3_DSPWrite32(baseAddress, val);
break;
#endif
default:
status = RET_FAIL;
break;
......@@ -68,6 +77,7 @@ static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
return status;
}
#ifdef OMAP_3430
HW_STATUS HW_PWR_IVA2StateGet(const void __iomem *baseAddress,
enum HW_PwrModule_t p, enum HW_PwrState_t *value)
{
......@@ -83,7 +93,6 @@ HW_STATUS HW_PWR_IVA2StateGet(const void __iomem *baseAddress,
(baseAddress);
} while (temp);
temp = PRCMPM_PWSTST_IVA2ReadRegister32(baseAddress);
*value = PRCMPM_PWSTST_IVA2PowerStateStGet32(temp);
break;
......@@ -147,13 +156,18 @@ HW_STATUS HW_PWR_CLKCTRL_IVA2RegSet(const void __iomem *baseAddress,
return status;
}
#endif
HW_STATUS HW_RSTST_RegGet(const void __iomem *baseAddress,
enum HW_RstModule_t m, u32 *value)
{
HW_STATUS status = RET_OK;
#ifdef OMAP44XX
*value = PRM_TESLA_RSTSTReadRegister32(baseAddress);
#else
*value = PRCMRM_RSTST_DSPReadRegister32(baseAddress);
#endif
return status;
}
......@@ -162,21 +176,21 @@ HW_STATUS HW_RSTCTRL_RegGet(const void __iomem *baseAddress,
enum HW_RstModule_t m, u32 *value)
{
HW_STATUS status = RET_OK;
#ifdef OMAP44XX
*value = PRM_TESLA_RSTCTRLReadRegister32(baseAddress);
#else
*value = PRCMRM_RSTCTRL_DSPReadRegister32(baseAddress);
#endif
return status;
}
#else
#ifdef OMAP44XX
static HW_STATUS HW_CLK_WriteVal (const u32 baseAddress, enum HW_ClkModule_t c, enum HW_SetClear_t val);
static HW_STATUS HW_CLK_AutoIdleWriteVal (const u32 baseAddress, enum HW_ClkModule_t c, enum HW_SetClear_t val);
static HW_STATUS HW_RST_WriteVal (const u32 baseAddress, enum HW_RstModule_t r, enum HW_SetClear_t val);
/* ============================================================================
* EXPORTED FUNCTIONS
* =============================================================================
*/
HW_STATUS HW_CLK_Enable(const u32 baseAddress, enum HW_ClkModule_t c)
{
......@@ -196,7 +210,6 @@ static HW_STATUS HW_CLK_WriteVal (const u32 baseAddress, enum HW_ClkModule_t c,
if (val == HW_SET)
val_clk = 0x2;
switch (c) {
case HW_CLK_TESLA:
CM_TESLA_TESLA_CLKCTRLWriteRegister32(baseAddress, val);
......@@ -246,6 +259,33 @@ static HW_STATUS HW_CLK_WriteVal (const u32 baseAddress, enum HW_ClkModule_t c,
case HW_CLK_DMTIMER11:
CM_L4PEREN_DMTIMER11Write32(baseAddress, val_clk);
break;
default:
status = RET_FAIL;
break;
}
return status;
}
HW_STATUS HW_PWRSTCTRL_RegGet(const u32 baseAddress, u32 *value)
{
HW_STATUS status = RET_OK;
*value = PRM_TESLA_PWRSTCTRLReadRegister32(baseAddress);
return status;
}
HW_STATUS HW_PWR_PowerStateGet(const u32 baseAddress,
enum HW_PwrModule_t p, enum HW_PwrState_t *value)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
*value = (enum HW_PwrState_t)PRM_TESLA_PWRSTSTGet32(baseAddress);
break;
default:
status = RET_FAIL;
......@@ -255,8 +295,83 @@ static HW_STATUS HW_CLK_WriteVal (const u32 baseAddress, enum HW_ClkModule_t c,
return status;
}
HW_STATUS HW_PWR_PowerStateSet(const u32 baseAddress,
enum HW_PwrModule_t p, enum HW_PwrState_t value)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
switch (value) {
case HW_PWR_STATE_ON:
PRM_TESLA_PWRSTCTRLWriteON32(baseAddress);
break;
case HW_PWR_STATE_INACT:
PRM_TESLA_PWRSTCTRLWriteINACTIVE32(baseAddress);
break;
case HW_PWR_STATE_RET:
PRM_TESLA_PWRSTCTRLWriteRET32(baseAddress);
break;
case HW_PWR_STATE_OFF:
PRM_TESLA_PWRSTCTRLWriteOFF32(baseAddress);
break;
default:
status = RET_FAIL;
break;
}
break;
case HW_PWR_DOMAIN_CORE:
switch (value) {
case HW_PWR_STATE_ON:
case HW_PWR_STATE_INACT:
case HW_PWR_STATE_RET:
case HW_PWR_STATE_OFF:
PRM_CORE_PWRSTCTRLWrite32(baseAddress, value);
break;
default:
status = RET_FAIL;
break;
}
break;
default:
status = RET_FAIL;
break;
}
return status;
}
HW_STATUS HW_PWR_ForceStateSet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_TransitionState_t value)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
CM_CLKSTCTRL_TESLAWriteRegister32(baseAddress, value);
break;
case HW_PWR_DOMAIN_ABE:
CM_CLKSTCTRL_ABEWriteRegister32(baseAddress, value);
break;
case HW_PWR_DOMAIN_L4PER:
CM_CLKSTCTRL_L4PERWriteRegister32(baseAddress, value);
break;
default:
status = RET_FAIL;
break;
}
return status;
}
#endif
#if 0
HW_STATUS HW_CLK_AutoIdleEnable(const u32 baseAddress, enum HW_ClkModule_t c)
{
return HW_CLK_AutoIdleWriteVal(baseAddress, c, HW_SET);
......@@ -321,6 +436,7 @@ HW_STATUS HW_RSTCTRL_RegGet(const u32 baseAddress, u32 *value)
return status;
}
static HW_STATUS HW_RST_WriteVal(const u32 baseAddress, enum HW_RstModule_t p,
enum HW_SetClear_t value)
{
......@@ -342,97 +458,29 @@ static HW_STATUS HW_RST_WriteVal(const u32 baseAddress, enum HW_RstModule_t p,
return status;
}
HW_STATUS HW_RSTST_RegGet (const u32 baseAddress, u32 *value)
{
HW_STATUS status = RET_OK;
*value = PRM_TESLA_RSTSTReadRegister32(baseAddress);
return status;
}
HW_STATUS HW_RSTST_RegClear (const u32 baseAddress)
{
HW_STATUS status = RET_OK;
PRM_TESLA_RSTST_Clear32(baseAddress);
return status;
}
HW_STATUS HW_PWRSTCTRL_RegGet(const u32 baseAddress, u32 *value)
{
HW_STATUS status = RET_OK;
*value = PRM_TESLA_PWRSTCTRLReadRegister32(baseAddress);
return status;
}
HW_STATUS HW_PWR_PowerStateGet(const u32 baseAddress,
enum HW_PwrModule_t p, enum HW_PwrState_t *value)
HW_STATUS HW_RSTST_RegClear (const u32 baseAddress)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
*value = (enum HW_PwrState_t)PRM_TESLA_PWRSTSTGet32(baseAddress);
break;
default:
status = RET_FAIL;
break;
}
PRM_TESLA_RSTST_Clear32(baseAddress);
return status;
}
HW_STATUS HW_PWR_PowerStateSet(const u32 baseAddress,
enum HW_PwrModule_t p, enum HW_PwrState_t value)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
switch (value) {
case HW_PWR_STATE_ON:
PRM_TESLA_PWRSTCTRLWriteON32(baseAddress);
break;
case HW_PWR_STATE_INACT:
PRM_TESLA_PWRSTCTRLWriteINACTIVE32(baseAddress);
break;
case HW_PWR_STATE_RET:
PRM_TESLA_PWRSTCTRLWriteRET32(baseAddress);
break;
case HW_PWR_STATE_OFF:
PRM_TESLA_PWRSTCTRLWriteOFF32(baseAddress);
break;
default:
status = RET_FAIL;
break;
}
break;
case HW_PWR_DOMAIN_CORE:
switch (value) {
case HW_PWR_STATE_ON:
case HW_PWR_STATE_INACT:
case HW_PWR_STATE_RET:
case HW_PWR_STATE_OFF:
PRM_CORE_PWRSTCTRLWrite32(baseAddress, value);
break;
default:
status = RET_FAIL;
break;
}
break;
default:
status = RET_FAIL;
break;
}
return status;
}
HW_STATUS HW_PWR_RetentionStateSet(const u32 baseAddress,
......@@ -467,6 +515,7 @@ HW_STATUS HW_PWR_RetentionStateSet(const u32 baseAddress,
}
HW_STATUS HW_PWRST_RegGet(const u32 baseAddress, enum HW_PwrModule_t p, u32 *value)
{
HW_STATUS status = RET_OK;
......@@ -492,6 +541,7 @@ HW_STATUS HW_PWR_WkupDependency_RegGet(const u32 baseAddress, u32 *value)
return status;
}
HW_STATUS HW_PWR_WkupDependencySet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_WeakUpDep_t src, enum HW_SetClear_t value)
{
......@@ -519,28 +569,7 @@ HW_STATUS HW_PWR_WkupDependencySet(const u32 baseAddress, enum HW_PwrModule_t p,
return status;
}
HW_STATUS HW_PWR_ForceStateSet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_PWR_TransState_t value)
{
HW_STATUS status = RET_OK;
switch (p) {
case HW_PWR_DOMAIN_TESLA:
CM_CLKSTCTRL_TESLAWriteRegister32(baseAddress, value);
break;
case HW_PWR_DOMAIN_ABE:
CM_CLKSTCTRL_ABEWriteRegister32(baseAddress, value);
break;
case HW_PWR_DOMAIN_L4PER:
CM_CLKSTCTRL_L4PERWriteRegister32(baseAddress, value);
break;
default:
status = RET_FAIL;
break;
}
return status;
}
HW_STATUS HW_TESLA_CONTEXT_RegGet(const u32 baseAddress, u32 *value)
......@@ -562,6 +591,7 @@ HW_STATUS HW_TESLA_CONTEXT_ClrSet(const u32 baseAddress)
}
HW_STATUS HW_ALWON_CONTEXT_RegGet(const u32 baseAddress, u32 *value)
{
HW_STATUS status = RET_OK;
......@@ -572,6 +602,7 @@ HW_STATUS HW_ALWON_CONTEXT_RegGet(const u32 baseAddress, u32 *value)
}
HW_STATUS HW_IVA_DVFSSet(const u32 baseAddress, enum HW_IvaDVFS_t src, u32 value)
{
HW_STATUS status = RET_OK;
......
......@@ -29,15 +29,41 @@
/* HW_ClkModule: Enumerated Type used to specify the clock domain */
#ifdef OMAP_3430
enum HW_ClkModule_t {
/* DSP Domain */
#ifdef OMAP44XX
/*CM1 ABE*/
HW_CLK_TESLA,
HW_CLK_AESS,
HW_CLK_PDM,
HW_CLK_DMIC,
HW_CLK_MCASP,
HW_CLK_MCBSP1,
HW_CLK_MCBSP2,
HW_CLK_MCBSP3,
HW_CLK_SLIMBUS,
HW_CLK_TIMER5,
HW_CLK_TIMER6,
HW_CLK_TIMER7,
HW_CLK_TIMER8,
HW_CLK_WDT3,
/*CM2 L4PER*/
HW_CLK_DMTIMER2,
HW_CLK_DMTIMER3,
HW_CLK_DMTIMER4,
HW_CLK_DMTIMER9,
HW_CLK_DMTIMER10,
HW_CLK_DMTIMER11,
HW_CLK_MCBSP4,
HW_CLK_MCBSP5,
#else
/* DSP Domain */
HW_CLK_DSP_CPU,
HW_CLK_DSP_IPI_MMU,
HW_CLK_IVA_ARM,
HW_CLK_IVA_COP, /* IVA Coprocessor */
/* Core Domain */
/* Core Domain */
HW_CLK_FN_WDT4, /* Functional Clock */
HW_CLK_FN_WDT3,
HW_CLK_FN_UART2,
......@@ -52,7 +78,7 @@ enum HW_ClkModule_t {
HW_CLK_IF_UART2,
HW_CLK_IF_UART1,
HW_CLK_IF_MBOX
#endif
} ;
enum HW_ClkSubsys_t {
......@@ -89,9 +115,14 @@ enum HW_ClkDiv_t {
/* HW_RstModule: Enumerated Type used to specify the module to be reset */
enum HW_RstModule_t {
#ifdef OMAP44XX
HW_RST1_TESLA, /*Reset the DSP*/
HW_RST2_TESLA, /* Reset MMU */
#else
HW_RST1_IVA2, /* Reset the DSP */
HW_RST2_IVA2, /* Reset MMU and LEON HWa */
HW_RST3_IVA2 /* Reset LEON sequencer */
#endif
} ;
/* HW_PwrModule: Enumerated Type used to specify the power domain */
......@@ -100,7 +131,13 @@ enum HW_PwrModule_t {
HW_PWR_DOMAIN_CORE,
HW_PWR_DOMAIN_MPU,
HW_PWR_DOMAIN_WAKEUP,
#ifdef OMAP44XX
HW_PWR_DOMAIN_TESLA,
HW_PWR_DOMAIN_ABE,
HW_PWR_DOMAIN_L4PER,
#else
HW_PWR_DOMAIN_DSP,
#endif
/* Sub-domains */
HW_PWR_DSP_IPI, /* IPI = Intrusive Port Interface */
......@@ -122,7 +159,6 @@ enum HW_ForceState_t {
enum HW_IdleState_t {
HW_ACTIVE,
HW_STANDBY
} ;
enum HW_TransitionState_t {
......@@ -132,6 +168,33 @@ enum HW_TransitionState_t {
HW_AUTOTRANS_EN
} ;
#ifdef OMAP44XX
enum HW_RetState_t {
HW_RETSTATE_LOGIC,
HW_RETSTATE_L1,
HW_RETSTATE_L2
};
enum HW_WeakUpDep_t {
HW_WKUP_IVA_MPU,
HW_WKUP_IVA_DUCATI
};
enum HW_IvaDVFS_t {
HW_DVFS_PERF_TESLA,
HW_DVFS_PERF_IVAHD,
HW_DVFS_PERF_ABE,
HW_DVFS_RESULT,
HW_DVFS_CURRENT
};
enum HW_IdleStatus_t {
HW_TESLA_FULLFUNC = 0x0, /* Module is fully functional, including OCP*/
HW_TESLA_TRANSITIONING, /* Transitioning (weakup, sleep or sleep abortion)*/
HW_TESLA_IDLE,/* Idle mode(only OCP)*/
HW_TESLA_DISABLED/*Module is disabled and cannot be accessed*/
};
#endif
extern HW_STATUS HW_RST_Reset(const void __iomem *baseAddress,
enum HW_RstModule_t r);
......@@ -153,6 +216,7 @@ extern HW_STATUS HW_CLK_SetInputClock(const u32 baseAddress,
enum HW_GPtimer_t gpt,
enum HW_Clocktype_t c);
#ifdef OMAP_3430
extern HW_STATUS HW_PWR_IVA2StateGet(const void __iomem *baseAddress,
enum HW_PwrModule_t p,
enum HW_PwrState_t *value);
......@@ -166,118 +230,9 @@ extern HW_STATUS HW_PWR_IVA2PowerStateSet(const void __iomem *baseAddress,
extern HW_STATUS HW_PWR_CLKCTRL_IVA2RegSet(const void __iomem *baseAddress,
enum HW_TransitionState_t val);
#else
enum HW_ClkModule_t {
/*CM1 ABE*/
HW_CLK_TESLA,
HW_CLK_AESS,
HW_CLK_PDM,
HW_CLK_DMIC,
HW_CLK_MCASP,
HW_CLK_MCBSP1,
HW_CLK_MCBSP2,
HW_CLK_MCBSP3,
HW_CLK_SLIMBUS,
HW_CLK_TIMER5,
HW_CLK_TIMER6,
HW_CLK_TIMER7,
HW_CLK_TIMER8,
HW_CLK_WDT3,
/*CM2 L4PER*/
HW_CLK_DMTIMER2,
HW_CLK_DMTIMER3,
HW_CLK_DMTIMER4,
HW_CLK_DMTIMER9,
HW_CLK_DMTIMER10,
HW_CLK_DMTIMER11,
HW_CLK_MCBSP4,
HW_CLK_MCBSP5,
};
/* ----------------------------------------------------------------------------
* TYPE: HW_RstModule
*
* DESCRIPTION: Enumerated Type used to specify the module to be reset
*
* -----------------------------------------------------------------------------
*/
enum HW_RstModule_t {
HW_RST1_TESLA, /*Reset the DSP*/
HW_RST2_TESLA, /* Reset MMU */
};
/* ----------------------------------------------------------------------------
* TYPE: HW_PwrModule
*
* DESCRIPTION: Enumerated Type used to specify the power domain
*
* -----------------------------------------------------------------------------
*/
enum HW_PwrModule_t {
/* Domains*/
HW_PWR_DOMAIN_CORE,
HW_PWR_DOMAIN_MPU,
HW_PWR_DOMAIN_WAKEUP,
HW_PWR_DOMAIN_TESLA,
HW_PWR_DOMAIN_ABE,
HW_PWR_DOMAIN_L4PER,
/* Sub-domains */
HW_PWR_DSP_IPI, /* IPI = Intrusive Port Interface */
HW_PWR_IVA_ISP /* ISP = Intrusive Slave Port*/
} ;
enum HW_PwrState_t {
HW_PWR_STATE_OFF,
HW_PWR_STATE_RET,
HW_PWR_STATE_INACT,
HW_PWR_STATE_ON = 3
};
enum HW_RetState_t {
HW_RETSTATE_LOGIC,
HW_RETSTATE_L1,
HW_RETSTATE_L2
};
enum HW_WeakUpDep_t {
HW_WKUP_IVA_MPU,
HW_WKUP_IVA_DUCATI
};
enum HW_IvaDVFS_t {
HW_DVFS_PERF_TESLA,
HW_DVFS_PERF_IVAHD,
HW_DVFS_PERF_ABE,
HW_DVFS_RESULT,
HW_DVFS_CURRENT
};
enum HW_PWR_TransState_t {
HW_AUTOTRANS_DIS = 0x0,
HW_SW_SUP_SLEEP,
HW_SW_SUP_WAKEUP,
HW_AUTOTRANS_EN
};
enum HW_IdleStatus_t {
HW_TESLA_FULLFUNC = 0x0, /* Module is fully functional, including OCP*/
HW_TESLA_TRANSITIONING, /* Transitioning (weakup, sleep or sleep abortion)*/
HW_TESLA_IDLE,/* Idle mode(only OCP)*/
HW_TESLA_DISABLED/*Module is disabled and cannot be accessed*/
};
#endif
#ifdef OMAP44XX
extern HW_STATUS HW_CLK_Enable(const u32 baseAddress,
enum HW_ClkModule_t c);
......@@ -289,20 +244,11 @@ extern HW_STATUS HW_CLK_AutoIdleEnable(const u32 baseAddress,
extern HW_STATUS HW_CLK_AutoIdleDisable(const u32 baseAddress,
enum HW_ClkModule_t c);
extern HW_STATUS HW_CLK_StbyStatus(const u32 baseAddress, enum HW_SetClear_t *stbyState);
extern HW_STATUS HW_CLK_IdleStatus(const u32 baseAddress, enum HW_IdleStatus_t *idleState);
extern HW_STATUS HW_RST_Reset(const u32 baseAddress,
enum HW_RstModule_t r);
extern HW_STATUS HW_RST_UnReset (const u32 baseAddress,
enum HW_RstModule_t r);
#if 0
extern HW_STATUS HW_RSTCTRL_RegGet(const u32 baseAddress, u32 *value);
extern HW_STATUS HW_RSTST_RegGet(const u32 baseAddress, u32 *value);
#endif
extern HW_STATUS HW_RSTST_RegClear(const u32 baseAddress);
......@@ -313,33 +259,25 @@ extern HW_STATUS HW_PWR_PowerStateGet(const u32 baseAddress,
extern HW_STATUS HW_PWR_PowerStateSet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_PwrState_t value);
#if 0
extern HW_STATUS HW_PWR_RetentionStateSet(const u32 baseAddress,
enum HW_PwrModule_t p, enum HW_RetState_t src, enum HW_SetClear_t value);
#endif
extern HW_STATUS HW_PWRST_RegGet(const u32 baseAddress, enum HW_PwrModule_t p, u32 *value);
extern HW_STATUS HW_PWR_WkupDependency_RegGet(const u32 baseAddress, u32 *value);
extern HW_STATUS HW_PWR_WkupDependencySet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_WeakUpDep_t src, enum HW_SetClear_t value);
extern HW_STATUS HW_PWR_ForceStateSet(const u32 baseAddress, enum HW_PwrModule_t p,
enum HW_PWR_TransState_t value);
enum HW_TransitionState_t value);
extern HW_STATUS HW_TESLA_RST_WriteVal(const u32 baseAddress, enum HW_RstModule_t p,
enum HW_SetClear_t value);
#if 0
extern HW_STATUS HW_TESLA_CONTEXT_RegGet(const u32 baseAddress, u32 *value);
extern HW_STATUS HW_TESLA_CONTEXT_ClrSet(const u32 baseAddress);
extern HW_STATUS HW_ALWON_CONTEXT_RegGet(const u32 baseAddress, u32 *value);
extern HW_STATUS HW_IVA_DVFSSet(const u32 baseAddress, enum HW_IvaDVFS_t src, u32 value);
extern HW_STATUS HW_IVA_DVFS_RegGet(const u32 baseAddress, enum HW_IvaDVFS_t src, u32 *value);
#endif
#endif
......
......@@ -256,7 +256,7 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
if (DSP_FAILED(status))
goto func_cont;
/*
/*
* Create a Single Threaded Work Queue
*/
......@@ -281,7 +281,7 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
} else
PREPARE_WORK(&pIOMgr->io_workq, (void *)IO_DispatchPM);
/* Initialize CHNL_MGR object: */
/* Initialize CHNL_MGR object:*/
#ifndef DSP_TRACEBUF_DISABLED
pIOMgr->pMsg = NULL;
#endif
......@@ -304,21 +304,27 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
notify_get_config(&ntfy_config);
ntfystatus = notify_setup(&ntfy_config);
if (NOTIFY_FAILED(ntfystatus)) {
DBG_Trace(DBG_LEVEL7, "Failed notify_setup ntfystatus 0x%x \n",
ntfystatus);
} else
printk("%s:%d:PASS\n",__func__,__LINE__);
if (ntfystatus != NOTIFY_SUCCESS) {
pr_err("Failed notify_setup ntfystatus\n");
goto func_cont;
}
notify_tesladrv_getconfig(&tesla_cfg);
ntfystatus = notify_tesladrv_setup(&tesla_cfg);
if (ntfystatus != 0) {
pr_err("Failed notify_tesladrv_setup\n");
goto func_cont;
}
notify_tesladrv_params_init(NULL, &params);
mem_va = dma_alloc_coherent(NULL, 0x4000, &mem_pa,GFP_ATOMIC);
mem_va = dma_alloc_coherent(NULL, 0x4000, &mem_pa, GFP_ATOMIC);
if (mem_va == NULL)
pr_err("Memory allocation for communication failed\n");
params.num_events = 32;
params.num_reserved_events = 0;
params.send_event_poll_count = (int) -1;
......@@ -328,24 +334,23 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
params.shared_addr = mem_va;
params.remote_proc_id = 0;
handle = notify_tesladrv_create(driverName,&params);
if (NOTIFY_FAILED(ntfystatus)) {
DBG_Trace(DBG_LEVEL7, "Failed notify_get_driver_handle ntfystatus 0x%x \n",
ntfystatus);
handle = notify_tesladrv_create(driverName, &params);
if (handle == NULL) {
pr_err("Failed notify_tesladrv_create\n");
goto func_cont;
}
eventNo = ((NOTIFY_SYSTEM_KEY<<16)|NOTIFY_TESLA_EVENTNUMBER);
ntfystatus = notify_register_event(handle, /*PROC_TESLA*/0, eventNo,(void*)IO_ISR, NULL);
ntfystatus = notify_register_event(handle, /*PROC_TESLA*/0,
eventNo, (void *)IO_ISR, NULL);
if (NOTIFY_FAILED(ntfystatus)) {
DBG_Trace(DBG_LEVEL7, "Failed notify_register_event ntfystatus 0x%x \n",
ntfystatus);
if (ntfystatus != NOTIFY_SUCCESS) {
pr_err("Failed notify_register_event\n");
goto func_cont;
}
notify_disable_event(handle, 0, eventNo);
if (DSP_SUCCEEDED(status)) {
status = CFG_GetHostResources((struct CFG_DEVNODE *)
DRV_GetFirstDevExtension() , &hostRes);
......@@ -395,10 +400,11 @@ func_cont:
DSP_STATUS WMD_IO_Destroy(struct IO_MGR *hIOMgr)
{
DSP_STATUS status = DSP_SOK;
u32 notify_status;
#ifdef OMAP44XX
status = notify_tesladrv_delete(&handle);
status = notify_tesladrv_destroy();
status = notify_destroy();
notify_status = notify_tesladrv_delete(&handle);
notify_status = notify_tesladrv_destroy();
notify_status = notify_destroy();
#else
struct WMD_DEV_CONTEXT *hWmdContext;
if (MEM_IsValidHandle(hIOMgr, IO_MGRSIGNATURE)) {
......@@ -409,7 +415,7 @@ DSP_STATUS WMD_IO_Destroy(struct IO_MGR *hIOMgr)
DBC_Assert(hWmdContext);
(void)CHNLSM_DisableInterrupt(hWmdContext);
destroy_workqueue(bridge_workqueue);
/* Linux function to uninstall ISR */
/* uninstall ISR */
free_irq(INT_MAIL_MPU_IRQ, (void *)hIOMgr);
(void)DPC_Destroy(hIOMgr->hDPC);
#ifndef DSP_TRACEBUF_DISABLED
......
......@@ -339,8 +339,6 @@ static DSP_STATUS WMD_BRD_Monitor(struct WMD_DEV_CONTEXT *hDevContext)
HW_RST_Reset(resources.dwPrmBase, HW_RST2_TESLA);/*Just to ensure that the RST's are enabled*/
HW_RST_UnReset(resources.dwPrmBase, HW_RST2_TESLA);
printk("Calling the MMU_LOCK BaseValue");
*((REG_UWORD32 *)((u32)(resources.dwDmmuBase)+0x50)) = 0x400;
#else
......@@ -352,20 +350,12 @@ static DSP_STATUS WMD_BRD_Monitor(struct WMD_DEV_CONTEXT *hDevContext)
if ((temp & 0x03) != 0x03 || (temp & 0x03) != 0x02) {
/* IVA2 is not in ON state */
/* Read and set PM_PWSTCTRL_IVA2 to ON */
HW_PWR_PowerStateGet(resources.dwPrmBase, HW_PWR_DOMAIN_TESLA,
HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
&pwrState);
HW_PWR_PowerStateSet(resources.dwPrmBase,
HW_PWR_DOMAIN_TESLA,
HW_PWR_STATE_ON);
HW_PWR_IVA2PowerStateSet(resources.dwPrmBase,
HW_PWR_DOMAIN_DSP,
HW_PWR_STATE_ON);
/* Set the SW supervised state transition */
HW_PWR_CLKCTRL_IVA2RegSet(resources.dwCmBase, HW_SW_SUP_WAKEUP);
/* Wait until the state has moved to ON */
HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
......@@ -616,6 +606,7 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT *hDevContext,
#endif
/* Let the DSP MMU run */
HW_MMU_Enable(resources.dwDmmuBase);
(void)CHNLSM_EnableInterrupt(pDevContext);
#ifdef OMAP_3430
......@@ -768,8 +759,6 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT *hDevContext,
* stale messages */
(void)CHNLSM_EnableInterrupt(pDevContext);
}
#else
(void)CHNLSM_EnableInterrupt(pDevContext);
#endif
if (DSP_SUCCEEDED(status)) {
#ifdef OMAP_3430
......@@ -780,10 +769,10 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT *hDevContext,
DBG_Trace(DBG_LEVEL7, "BRD_Start0: RM_RSTST_DSP = 0x%x \n",
temp);
#else
HW_RSTCTRL_RegGet(resources.dwPrmBase, &temp);
HW_RSTCTRL_RegGet(resources.dwPrmBase, HW_RST1_TESLA, &temp);
DBG_Trace(DBG_LEVEL7, "BRD_Start: RM_RSTCTRL_DSP = 0x%x \n",
temp);
HW_RSTST_RegGet(resources.dwPrmBase, &temp);
HW_RSTST_RegGet(resources.dwPrmBase, HW_RST1_TESLA, &temp);
DBG_Trace(DBG_LEVEL7, "BRD_Start0: RM_RSTST_DSP = 0x%x \n",
temp);
/* Let DSP go */
......@@ -796,10 +785,10 @@ static DSP_STATUS WMD_BRD_Start(struct WMD_DEV_CONTEXT *hDevContext,
/* release the RST1, DSP starts executing now .. */
#ifdef OMAP44XX
HW_RST_UnReset(resources.dwPrmBase, HW_RST1_TESLA);
HW_RSTST_RegGet(resources.dwPrmBase, &temp);
HW_RSTST_RegGet(resources.dwPrmBase, HW_RST1_TESLA, &temp);
DBG_Trace(DBG_LEVEL7, "BRD_Start: RM_RSTST_DSP = 0x%x \n",
temp);
HW_RSTCTRL_RegGet(resources.dwPrmBase, &temp);
HW_RSTCTRL_RegGet(resources.dwPrmBase, HW_RST1_TESLA, &temp);
#else
HW_RST_UnReset(resources.dwPrmBase, HW_RST1_IVA2);
HW_RSTST_RegGet(resources.dwPrmBase, HW_RST1_IVA2, &temp);
......@@ -890,12 +879,9 @@ static DSP_STATUS WMD_BRD_Stop(struct WMD_DEV_CONTEXT *hDevContext)
#ifdef OMAP44XX
DBG_Trace(DBG_LEVEL7, "Resetting DSP...");
printk("Stop:Disabling Clocks...");
HW_CLK_Disable (resources.dwCm1Base, HW_CLK_TESLA) ;
printk("Stop:Resetting DSP...");
HW_RST_Reset(resources.dwPrmBase, HW_RST1_TESLA);
/* Enable DSP */
printk("Stop:Enabling Clocks...");
HW_CLK_Enable (resources.dwCm1Base, HW_CLK_TESLA) ;
#else
HW_PWRST_IVA2RegGet(resources.dwPrmBase, &dspPwrState);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment