Skip to contentSkip to conversation

DSPBRIDGE: trivial cleanup for enums

PATCH Applied Omar Ramirez Luna 1 participant 5 messages Jan 23, 2010 – Jan 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover DSPBRIDGE: trivial cleanup for enums

Remove unused enums and replace unrelated enum constants with defines.

Shivananda Hebbar (2):
DSPBRIDGE: Remove un-used enums
DSPBRIDGE: Remove enum definitions and replace with macros

 arch/arm/plat-omap/include/dspbridge/_chnl_sm.h |   11 +++++------
 arch/arm/plat-omap/include/dspbridge/cmm.h      |    2 +-
 arch/arm/plat-omap/include/dspbridge/cmmdefs.h  |   18 ++----------------
 arch/arm/plat-omap/include/dspbridge/dbdefs.h   |   10 +++-------
 arch/arm/plat-omap/include/dspbridge/io_sm.h    |    5 ++---
 drivers/dsp/bridge/hw/IPIAccInt.h               |   15 ---------------
 drivers/dsp/bridge/hw/hw_defs.h                 |    8 +++-----
 drivers/dsp/bridge/hw/hw_mmu.c                  |    3 +--
 drivers/dsp/bridge/hw/hw_mmu.h                  |    3 +--
 drivers/dsp/bridge/hw/hw_prcm.c                 |    6 ++----
 drivers/dsp/bridge/pmgr/cmm.c                   |    5 ++---
 drivers/dsp/bridge/wmd/_tiomap.h                |   23 ++---------------------
 drivers/dsp/bridge/wmd/io_sm.c                  |    3 +--
 13 files changed, 25 insertions(+), 87 deletions(-)
#1 lore raw

PATCH 1/2 DSPBRIDGE: Remove un-used enums

From: Shivananda Hebbar <[email protected]>

This patch removes un-used enum definitions from bridge.

---
 arch/arm/plat-omap/include/dspbridge/cmmdefs.h |    8 --------
 drivers/dsp/bridge/hw/IPIAccInt.h              |   15 ---------------
 drivers/dsp/bridge/wmd/_tiomap.h               |   15 ---------------
 3 files changed, 0 insertions(+), 38 deletions(-)
arch/arm/plat-omap/include/dspbridge/cmmdefs.h +0 -8
index 2e7fcf5..91db7a9 100644
@@ -105,14 +105,6 @@
 		CMM_DSPPA2PA = 4,	/* DSP Pa to GPP Pa */
 	} ;
 
-/*
- *  Used to "map" between device process virt addr and dsp addr.
- */
-	enum CMM_KERNMAPTYPE {
-		CMM_KERNVA2DSP = 0, /* Device process context to dsp address. */
-		CMM_DSP2KERNVA = 1, /* Dsp address to device process context. */
-	} ;
-
 	struct CMM_OBJECT;
 	struct CMM_XLATOROBJECT;
 
drivers/dsp/bridge/hw/IPIAccInt.h +0 -15
index b88a58c..dde0ef0 100644
@@ -22,20 +22,5 @@
 #define SYSC_IVA2BOOTADDR_OFFSET                0x400
 #define SYSC_IVA2BOOTADDR_MASK                 0xfffffc00
 
-
-/* The following represent the enumerated values for each bitfield */
-
-enum IPIIPI_SYSCONFIGAutoIdleE {
-	IPIIPI_SYSCONFIGAutoIdleclkfree = 0x0000,
-	IPIIPI_SYSCONFIGAutoIdleautoclkgate = 0x0001
-} ;
-
-enum IPIIPI_ENTRYElemSizeValueE {
-	IPIIPI_ENTRYElemSizeValueElemSz8b = 0x0000,
-	IPIIPI_ENTRYElemSizeValueElemSz16b = 0x0001,
-	IPIIPI_ENTRYElemSizeValueElemSz32b = 0x0002,
-	IPIIPI_ENTRYElemSizeValueReserved = 0x0003
-} ;
-
 #endif				/* _IPI_ACC_INT_H */
 /* EOF */
drivers/dsp/bridge/wmd/_tiomap.h +0 -15
index 4627822..077e693 100644
@@ -270,21 +270,6 @@ static const struct BPWR_Clk_t BPWR_Clks[] = {
 #define INTH_MASK_IT_REG_OFFSET         0x04	/* Mask Interrupt reg offset  */
 
 #define   DSP_MAILBOX1_INT              10
-
-/*
- *  INTH_InterruptKind_t
- *  Identify the kind of interrupt: either FIQ/IRQ
- */
-enum INTH_InterruptKind_t {
-	INTH_IRQ = 0,
-	INTH_FIQ = 1
-} ;
-
-enum INTH_SensitiveEdge_t {
-	FALLING_EDGE_SENSITIVE = 0,
-	LOW_LEVEL_SENSITIVE = 1
-} ;
-
 /*
  *  Bit definition of  Interrupt  Level  Registers
  */
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 2/2 DSPBRIDGE: Remove enum definitions and replace with macros

From: Shivananda Hebbar <[email protected]>

This patch removes unrelated enum constants and replaces it with the macros

---
 arch/arm/plat-omap/include/dspbridge/_chnl_sm.h |   11 +++++------
 arch/arm/plat-omap/include/dspbridge/cmm.h      |    2 +-
 arch/arm/plat-omap/include/dspbridge/cmmdefs.h  |   10 ++--------
 arch/arm/plat-omap/include/dspbridge/dbdefs.h   |   10 +++-------
 arch/arm/plat-omap/include/dspbridge/io_sm.h    |    5 ++---
 drivers/dsp/bridge/hw/hw_defs.h                 |    8 +++-----
 drivers/dsp/bridge/hw/hw_mmu.c                  |    3 +--
 drivers/dsp/bridge/hw/hw_mmu.h                  |    3 +--
 drivers/dsp/bridge/hw/hw_prcm.c                 |    6 ++----
 drivers/dsp/bridge/pmgr/cmm.c                   |    5 ++---
 drivers/dsp/bridge/wmd/_tiomap.h                |    8 ++------
 drivers/dsp/bridge/wmd/io_sm.c                  |    3 +--
 12 files changed, 25 insertions(+), 49 deletions(-)
arch/arm/plat-omap/include/dspbridge/_chnl_sm.h +5 -6
index 6e812b2..b142ede 100644
@@ -45,6 +45,11 @@
 
 #define MAXOPPS 16
 
+/* Shared memory config options */
+#define SHM_CURROPP	0	/* Set current OPP in SHM */
+#define SHM_OPPINFO	1	/* Set dsp voltage and freq table values */
+#define SHM_GETOPP	2	/* Get opp requested by DSP */
+
 struct oppTableEntry {
     u32 voltage;
     u32 frequency;
@@ -72,12 +77,6 @@ struct loadMonStruct {
     u32 predDspFreq;
 };
 
-	enum SHM_DESCTYPE {
-		SHM_CURROPP = 0,
-		SHM_OPPINFO = 1,
-		SHM_GETOPP = 2,		/* Get DSP requested OPP info */
-	} ;
-
 /* Structure in shared between DSP and PC for communication.*/
 	struct SHM {
 		u32 dspFreeMask;	/* Written by DSP, read by PC. */
arch/arm/plat-omap/include/dspbridge/cmm.h +1 -1
index fc2f51e..30402c2 100644
@@ -227,7 +227,7 @@
 					       unsigned int dwGPPBasePA,
 					       u32 ulSize,
 					       u32 dwDSPAddrOffset,
-					       enum CMM_CNVTTYPE cFactor,
+					       s8  cFactor,
 					       unsigned int dwDSPBase,
 					       u32 ulDSPSize,
 					       u32 *pulSegId,
arch/arm/plat-omap/include/dspbridge/cmmdefs.h +2 -8
index 91db7a9..c6eb6dd 100644
@@ -39,15 +39,9 @@
  *  For typical platforms:
  *      converted Address = PaDSP + ( cFactor * addressToConvert).
  */
-	enum CMM_CNVTTYPE {
-		CMM_SUBFROMDSPPA = -1,
-		/* PreOMAP is special case: not simple offset */
-		CMM_POMAPEMIF2DSPBUS = 0,
-		CMM_ADDTODSPPA = 1
-	} ;
+#define CMM_SUBFROMDSPPA	-1
+#define CMM_ADDTODSPPA		1
 
-#define CMM_DEFLTDSPADDROFFSET  0
-#define CMM_DEFLTCONVFACTOR     CMM_POMAPEMIF2DSPBUS /* PreOMAP DSPBUS<->EMIF */
 #define CMM_ALLSEGMENTS         0xFFFFFF	/* All SegIds */
 #define CMM_MAXGPPSEGS          1	/* Maximum # of SM segs */
 
arch/arm/plat-omap/include/dspbridge/dbdefs.h +3 -7
index fc9fdc8..a05d339 100644
@@ -106,6 +106,9 @@
 
 #define    MAX_PROFILES     16
 
+/* DSP chip type */
+#define DSPTYPE_64	0x99
+
 /* Types defined for 'Bridge API */
 	typedef u32 DSP_STATUS;	/* API return code type         */
 
@@ -403,13 +406,6 @@
 		u32 cbStruct;
 		u32 uTimeout;
 	} ;
-
-	enum chipTypes {
-		DSPTYPE_55 = 6,
-		IVA_ARM7 = 0x97,
-		DSPTYPE_64 = 0x99
-	};
-
 /*
  * The DSP_PROCESSORINFO structure describes basic capabilities of a
  * DSP processor
arch/arm/plat-omap/include/dspbridge/io_sm.h +2 -3
index 67e3834..8eae7af 100644
@@ -260,9 +260,8 @@
  *      pArgs != NULL
  *  Ensures:
  */
-	extern DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr,
-					IN enum SHM_DESCTYPE desc,
-					IN void *pArgs);
+	extern DSP_STATUS IO_SHMsetting(struct IO_MGR *hIOMgr,
+					u8 desc, void *pArgs);
 
 /*
  *  Misc functions for the CHNL_IO shared memory library:
drivers/dsp/bridge/hw/hw_defs.h +3 -5
index a7926d4..827fff3 100644
@@ -30,11 +30,9 @@
 /* HW_STATUS:  return type for HW API */
 typedef long HW_STATUS;
 
-/* HW_SetClear_t:  Enumerated Type used to set and clear any bit */
-enum HW_SetClear_t {
-    HW_CLEAR,
-    HW_SET
-} ;
+/*  Macro used to set and clear any bit */
+#define HW_CLEAR	0
+#define HW_SET		1
 
 /* HW_Endianism_t:  Enumerated Type used to specify the endianism
  *		Do NOT change these values. They are used as bit fields. */
drivers/dsp/bridge/hw/hw_mmu.c +1 -2
index c13dfe1..abaf0f6 100644
@@ -337,8 +337,7 @@ HW_STATUS HW_MMU_TLBAdd(const void __iomem *baseAddress,
 			   u32	      pageSize,
 			   u32	      entryNum,
 			   struct HW_MMUMapAttrs_t    *mapAttrs,
-			   enum HW_SetClear_t       preservedBit,
-			   enum HW_SetClear_t       validBit)
+			   s8 preservedBit, s8 validBit)
 {
     HW_STATUS  status = RET_OK;
     u32 lockReg;
drivers/dsp/bridge/hw/hw_mmu.h +1 -2
index b800d15..ddb0843 100644
@@ -87,8 +87,7 @@ extern HW_STATUS HW_MMU_TLBAdd(const void __iomem *baseAddress,
 				  u32	   pageSize,
 				  u32	    entryNum,
 				  struct HW_MMUMapAttrs_t *mapAttrs,
-				  enum HW_SetClear_t    preservedBit,
-				  enum HW_SetClear_t    validBit);
+				  s8 preservedBit, s8 validBit);
 
 
 /* For PTEs */
drivers/dsp/bridge/hw/hw_prcm.c +2 -4
index e5e0bc5..703ca67 100644
@@ -22,8 +22,7 @@
 #include <hw_prcm.h>
 
 static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
-				    enum HW_RstModule_t r,
-				    enum HW_SetClear_t val);
+				    enum HW_RstModule_t r, s8 val);
 
 HW_STATUS HW_RST_Reset(const void __iomem *baseAddress, enum HW_RstModule_t r)
 {
@@ -36,8 +35,7 @@ HW_STATUS HW_RST_UnReset(const void __iomem *baseAddress, enum HW_RstModule_t r)
 }
 
 static HW_STATUS HW_RST_WriteVal(const void __iomem *baseAddress,
-				    enum HW_RstModule_t r,
-				    enum HW_SetClear_t val)
+				    enum HW_RstModule_t r, s8 val)
 {
 	HW_STATUS status = RET_OK;
 
drivers/dsp/bridge/pmgr/cmm.c +2 -3
index 225e5fd..262f087 100644
@@ -79,8 +79,7 @@ struct CMM_ALLOCATOR {	/* sma */
 				 * context for 'sma') */
 	u32 dwDSPPhysAddrOffset;	/* DSP PA to GPP PA offset for this
 					 * SM space */
-	/* CMM_ADDTO[SUBFROM]DSPPA, _POMAPEMIF2DSPBUS */
-	enum CMM_CNVTTYPE cFactor;
+	s8 cFactor;			/* DSPPa to GPPPa Conversion Factor */
 	unsigned int dwDSPBase;	/* DSP virt base byte address */
 	u32 ulDSPSize;	/* DSP seg size in bytes */
 	struct CMM_OBJECT *hCmmMgr;	/* back ref to parent mgr */
@@ -571,7 +570,7 @@ bool CMM_Init(void)
  */
 DSP_STATUS CMM_RegisterGPPSMSeg(struct CMM_OBJECT *hCmmMgr, u32 dwGPPBasePA,
 				u32 ulSize, u32 dwDSPAddrOffset,
-				enum CMM_CNVTTYPE cFactor, u32 dwDSPBase,
+				s8 cFactor, u32 dwDSPBase,
 				u32 ulDSPSize, u32 *pulSegId,
 				u32 dwGPPBaseVA)
 {
drivers/dsp/bridge/wmd/_tiomap.h +2 -6
index 077e693..6ea9ec9 100644
@@ -209,12 +209,8 @@ static const struct MAP_L4PERIPHERAL L4PeripheralTable[] = {
 #define MBX_PM_MAX_RESOURCES 11
 
 /*  Power Management Commands */
-enum BPWR_ExtClockCmd {
-	BPWR_DisableClock = 0,
-	BPWR_EnableClock,
-	BPWR_DisableAutoIdle,
-	BPWR_EnableAutoIdle
-} ;
+#define BPWR_DisableClock	0
+#define BPWR_EnableClock	1
 
 /* OMAP242x specific resources */
 enum BPWR_ExtClockId {
drivers/dsp/bridge/wmd/io_sm.c +1 -2
index b86e498..5991d85 100644
@@ -1791,8 +1791,7 @@ void IO_IntrDSP2(IN struct IO_MGR *pIOMgr, IN u16 wMbVal)
  *  ======== IO_SHMcontrol ========
  *      Sets the requested SHM setting.
  */
-DSP_STATUS IO_SHMsetting(IN struct IO_MGR *hIOMgr, IN enum SHM_DESCTYPE desc,
-			 IN void *pArgs)
+DSP_STATUS IO_SHMsetting(struct IO_MGR *hIOMgr, u8 desc, void *pArgs)
 {
 #ifdef CONFIG_BRIDGE_DVFS
 	u32 i;
Signature · 1 line
1.6.2.4
author Applied
#3 lore raw

Re: [PATCH 2/2] DSPBRIDGE: Remove enum definitions and replace with macros

Quoted 6 lines · Omar Ramirez Luna

From: Shivananda Hebbar<[email protected]>

This patch removes unrelated enum constants and replaces it with the macros

Quoted 15 lines
---
  arch/arm/plat-omap/include/dspbridge/_chnl_sm.h |   11 +++++------
  arch/arm/plat-omap/include/dspbridge/cmm.h      |    2 +-
  arch/arm/plat-omap/include/dspbridge/cmmdefs.h  |   10 ++--------
  arch/arm/plat-omap/include/dspbridge/dbdefs.h   |   10 +++-------
  arch/arm/plat-omap/include/dspbridge/io_sm.h    |    5 ++---
  drivers/dsp/bridge/hw/hw_defs.h                 |    8 +++-----
  drivers/dsp/bridge/hw/hw_mmu.c                  |    3 +--
  drivers/dsp/bridge/hw/hw_mmu.h                  |    3 +--
  drivers/dsp/bridge/hw/hw_prcm.c                 |    6 ++----
  drivers/dsp/bridge/pmgr/cmm.c                   |    5 ++---
  drivers/dsp/bridge/wmd/_tiomap.h                |    8 ++------
  drivers/dsp/bridge/wmd/io_sm.c                  |    3 +--
  12 files changed, 25 insertions(+), 49 deletions(-)

Pushed to dspbridge.

- omar

author Applied
#4 lore raw

Re: [PATCH 1/2] DSPBRIDGE: Remove un-used enums

In reply to Omar Ramirez Luna
Quoted 11 lines · Omar

From: Shivananda Hebbar<[email protected]>

This patch removes un-used enum definitions from bridge.

---
  arch/arm/plat-omap/include/dspbridge/cmmdefs.h |    8 --------
  drivers/dsp/bridge/hw/IPIAccInt.h              |   15 ---------------
  drivers/dsp/bridge/wmd/_tiomap.h               |   15 ---------------
  3 files changed, 0 insertions(+), 38 deletions(-)

Pushed to dspbridge.

- omar