summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example/apps/icssg_pwm/firmware/src/iepPwm.c19
-rw-r--r--example/apps/icssg_pwm/firmware/src/iepPwmFwRegs.c36
-rw-r--r--example/apps/icssg_pwm/firmware/src/main.c2
3 files changed, 34 insertions, 23 deletions
diff --git a/example/apps/icssg_pwm/firmware/src/iepPwm.c b/example/apps/icssg_pwm/firmware/src/iepPwm.c
index 91e091b..db7e62f 100644
--- a/example/apps/icssg_pwm/firmware/src/iepPwm.c
+++ b/example/apps/icssg_pwm/firmware/src/iepPwm.c
@@ -32,8 +32,7 @@
32 */ 32 */
33 33
34#include <string.h> 34#include <string.h>
35#include <ti/csl/tistdtypes.h> 35#include <ti/csl/soc.h>
36#include <ti/csl/hw_types.h>
37#include "icssg_iep_pwm.h" 36#include "icssg_iep_pwm.h"
38#include "iepPwmFwRegs.h" 37#include "iepPwmFwRegs.h"
39#include "iepPwmHwRegs.h" 38#include "iepPwmHwRegs.h"
@@ -552,7 +551,9 @@ static Int32 updateIepPwmCmpxShRegDb(
552 IcssgIepPwmObj *pIcssgIepPwmObj 551 IcssgIepPwmObj *pIcssgIepPwmObj
553); 552);
554 553
554#ifdef TX_HOST_INT
555volatile register uint32_t __R31; 555volatile register uint32_t __R31;
556#endif
556 557
557/* ------------------------------------------------------------------------- * 558/* ------------------------------------------------------------------------- *
558 * External Functions * 559 * External Functions *
@@ -737,9 +738,6 @@ Int32 initIepPwm(
737 738
738 /* Clear reconfiguration flags whether set or not */ 739 /* Clear reconfiguration flags whether set or not */
739 pIepPwmFwRegs->IEP_PWM_RECFG = 0; 740 pIepPwmFwRegs->IEP_PWM_RECFG = 0;
740
741 /* Enable IEP Counter */
742 pIcssgIepPwmObj->pIepHwRegs->GLOBAL_CFG_REG |= 0x1;
743 } 741 }
744 742
745 return status; 743 return status;
@@ -789,6 +787,9 @@ void initIepPwmSm(
789) 787)
790{ 788{
791 pIcssgIepPwmObj->iepPwmState = IEP_SM_STATE_INIT; 789 pIcssgIepPwmObj->iepPwmState = IEP_SM_STATE_INIT;
790
791 /* Enable IEP Counter */
792 pIcssgIepPwmObj->pIepHwRegs->GLOBAL_CFG_REG |= 0x1;
792} 793}
793 794
794/* Execute IEP PWM State Machine */ 795/* Execute IEP PWM State Machine */
@@ -1010,7 +1011,7 @@ static Int32 iepPwmConfigLhs(
1010 CSL_icss_g_pr1_iep1_slvRegs *pIepHwRegs = pIcssgIepPwmObj->pIepHwRegs; 1011 CSL_icss_g_pr1_iep1_slvRegs *pIepHwRegs = pIcssgIepPwmObj->pIepHwRegs;
1011 Uint16 iepPwmSnglEn; 1012 Uint16 iepPwmSnglEn;
1012 Uint8 iepPwmDiffEn; 1013 Uint8 iepPwmDiffEn;
1013 Uint32 status = IEP_STS_NERR; 1014 Int32 status = IEP_STS_NERR;
1014 1015
1015 /* Check for Host reconfiguration request. 1016 /* Check for Host reconfiguration request.
1016 Host reconfiguration isn't allowed during Initialization. */ 1017 Host reconfiguration isn't allowed during Initialization. */
@@ -1114,7 +1115,7 @@ static Int32 iepPwmConfigRhs(
1114 IcssgIepPwmObj *pIcssgIepPwmObj 1115 IcssgIepPwmObj *pIcssgIepPwmObj
1115) 1116)
1116{ 1117{
1117 Uint32 status = IEP_STS_NERR; 1118 Int32 status = IEP_STS_NERR;
1118 1119
1119 if (pIcssgIepPwmObj->iepPwmRhsRecfgFlag == TRUE) { 1120 if (pIcssgIepPwmObj->iepPwmRhsRecfgFlag == TRUE) {
1120 /* Perform RHS Reconfiguration for pending Host reconfiguration */ 1121 /* Perform RHS Reconfiguration for pending Host reconfiguration */
@@ -1945,7 +1946,7 @@ static Int32 updateIepPwmCmpxShRegPwmEnDc(
1945 Uint32 iepPwmDcCountLhsNew, iepPwmDcCountRhsNew; 1946 Uint32 iepPwmDcCountLhsNew, iepPwmDcCountRhsNew;
1946 Uint16 iepPwmSnglEn; 1947 Uint16 iepPwmSnglEn;
1947 Uint8 iepPwmDiffEn; 1948 Uint8 iepPwmDiffEn;
1948 Uint32 status = IEP_STS_NERR; 1949 Int32 status = IEP_STS_NERR;
1949 1950
1950 /* Get Duty Cycle reconfiguration */ 1951 /* Get Duty Cycle reconfiguration */
1951 recfgDcCount = (pIepPwmFwRegs->IEP_PWM_RECFG & IEP_PWM_RECFG_RECFG_IEP_PWM_DC_COUNT_MASK) >> IEP_PWM_RECFG_RECFG_IEP_PWM_DC_COUNT_SHIFT; 1952 recfgDcCount = (pIepPwmFwRegs->IEP_PWM_RECFG & IEP_PWM_RECFG_RECFG_IEP_PWM_DC_COUNT_MASK) >> IEP_PWM_RECFG_RECFG_IEP_PWM_DC_COUNT_SHIFT;
@@ -2747,5 +2748,5 @@ static Int32 updateIepPwmCmpxShRegDb(
2747 /* Latch IEP PWM Deadband Count */ 2748 /* Latch IEP PWM Deadband Count */
2748 latchIepPwmDbCount(pIcssgIepPwmObj, TRUE); 2749 latchIepPwmDbCount(pIcssgIepPwmObj, TRUE);
2749 2750
2750 return 0; 2751 return IEP_STS_NERR;
2751} 2752}
diff --git a/example/apps/icssg_pwm/firmware/src/iepPwmFwRegs.c b/example/apps/icssg_pwm/firmware/src/iepPwmFwRegs.c
index cfcc3e0..a8e57ae 100644
--- a/example/apps/icssg_pwm/firmware/src/iepPwmFwRegs.c
+++ b/example/apps/icssg_pwm/firmware/src/iepPwmFwRegs.c
@@ -34,26 +34,36 @@
34#include <ti/csl/tistdtypes.h> 34#include <ti/csl/tistdtypes.h>
35#include "iepPwmFwRegs.h" 35#include "iepPwmFwRegs.h"
36 36
37#define DEF_PWM_RECFG ( 0x00000000 ) /* Default no reconfiguration request */ 37/* PWM Info defaults */
38#define DEF_FW_MAGIC_NUMBER ( 0x4D575047 ) /* Firmware Magic Number - GPWM */
39#define DEF_FW_TYPE ( 0x00000000 ) /* Firmware Type - TBD */
40#define DEF_FW_VERSION ( 0x00000000 ) /* Firmware Version - TBD */
41#define DEF_FW_FEATURE ( 0x00001998 ) /* Firmware Feature - support for 24 PWMs, 12 IEP0 PWMs, 12 IEP1 PWMs */
42#define DEF_FW_EXTENDED_FEATURE ( 0x00000000 ) /* Firmware Extended Feature - TBD */
38 43
39#define DEF_PWM_MODE ( 0x00000000 ) /* Default all PWMs are Single-Ended */ 44/* PWM control defaults */
40#define DEF_PWM_EN ( 0x00000000 ) /* Default all PWMs are disabled */ 45#define DEF_PWM_CTRL ( 0x00000000 ) /* PWM control - IEP0 & IEP1 PWMs disabled */
46#define DEF_PWM_STAT ( 0x00000000 ) /* PWM status - IEP0 & IEP1 PWM ACK disabled, FW initialization flag uninitialized */
47#define DEF_PWM_RECFG ( 0x00000000 ) /* Default no reconfiguration request */
48
49#define DEF_PWM_MODE ( 0x00000000 ) /* Default all PWMs are Single-Ended */
50#define DEF_PWM_EN ( 0x00000000 ) /* Default all PWMs are disabled */
41 51
42/* IEP clock @ 200 MHz */ 52/* IEP clock @ 200 MHz */
43#define DEF_PRD_COUNT ( 0x0007A120 ) /* Default Period Count, PWM freq 1 kHz */ 53#define DEF_PRD_COUNT ( 0x0007A120 ) /* Default Period Count, PWM freq 1 kHz */
44#define DEF_DC_COUNT ( 0x0007A120 ) /* Default DC Count, 50% Duty Cycle PWM freq 1 kHz */ 54#define DEF_DC_COUNT ( 0x0007A120 ) /* Default DC Count, 50% Duty Cycle PWM freq 1 kHz */
45#define DEF_DB_COUNT ( 0x0A00 ) /* Default DB Count, 2.56 usec. */ 55#define DEF_DB_COUNT ( 0x0A00 ) /* Default DB Count, 2.56 usec. */
46 56
47/* FW Info register defaults */ 57/* FW Info register defaults */
48#pragma RETAIN(gIepPwmInfoFwRegs) 58#pragma RETAIN(gIepPwmInfoFwRegs)
49#pragma DATA_SECTION(gIepPwmInfoFwRegs, ".initDataFwRegs") 59#pragma DATA_SECTION(gIepPwmInfoFwRegs, ".initDataFwRegs")
50const IepPwmInfoFwRegs gIepPwmInfoFwRegs = 60const IepPwmInfoFwRegs gIepPwmInfoFwRegs =
51{ 61{
52 0x4D575047, /* FwMagicNumber - GPWM */ 62 DEF_FW_MAGIC_NUMBER, /* FwMagicNumber */
53 0x00000000, /* FwType - TBD */ 63 DEF_FW_TYPE, /* FwType */
54 0x00000000, /* FwVersion - TBD */ 64 DEF_FW_VERSION, /* FwVersion */
55 0x00001998, /* FwFeature */ 65 DEF_FW_FEATURE, /* FwFeature */
56 0x00000000 /* FwExtendedFeature - Reserved for future use */ 66 DEF_FW_EXTENDED_FEATURE /* FwExtendedFeature - Reserved for future use */
57}; 67};
58 68
59/* FW PWM Control/Status register defaults */ 69/* FW PWM Control/Status register defaults */
@@ -61,8 +71,8 @@ const IepPwmInfoFwRegs gIepPwmInfoFwRegs =
61#pragma DATA_SECTION(gIepPwmCtrlFwRegs, ".initDataFwRegs") 71#pragma DATA_SECTION(gIepPwmCtrlFwRegs, ".initDataFwRegs")
62const IepPwmCtrlFwRegs gIepPwmCtrlFwRegs = 72const IepPwmCtrlFwRegs gIepPwmCtrlFwRegs =
63{ 73{
64 0x00000000, /* PWM_CTRL */ 74 DEF_PWM_CTRL, /* PWM_CTRL */
65 0x00000000 /* PWM_STAT */ 75 DEF_PWM_STAT /* PWM_STAT */
66}; 76};
67 77
68/* FW IEP0 PWM register defaults */ 78/* FW IEP0 PWM register defaults */
diff --git a/example/apps/icssg_pwm/firmware/src/main.c b/example/apps/icssg_pwm/firmware/src/main.c
index 6ad1af4..d0183b4 100644
--- a/example/apps/icssg_pwm/firmware/src/main.c
+++ b/example/apps/icssg_pwm/firmware/src/main.c
@@ -38,7 +38,7 @@
38 38
39void main(void) 39void main(void)
40{ 40{
41 Uint32 status; 41 Int32 status;
42 IepSm_Config iepSmConfig; 42 IepSm_Config iepSmConfig;
43 43
44 /* Reset PWM FW control object */ 44 /* Reset PWM FW control object */