summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahesh Radhakrishnan2018-02-09 12:03:47 -0600
committerMahesh Radhakrishnan2018-02-09 12:03:47 -0600
commit081a8bffd4d64b38d66780ba050f8c963fd4b0ed (patch)
treecd2cf0faed1d8c96a1afd421aa29cb240a91e41f
parentfb912677d96d43800dbd9bd84c54c9bb8a3e54ef (diff)
parentf2194d6a4ac9be80bc69c60dc84f9321714605ac (diff)
downloadpruss-lld-081a8bffd4d64b38d66780ba050f8c963fd4b0ed.tar.gz
pruss-lld-081a8bffd4d64b38d66780ba050f8c963fd4b0ed.tar.xz
pruss-lld-081a8bffd4d64b38d66780ba050f8c963fd4b0ed.zip
Merge pull request #40 in PROCESSOR-SDK/pruss-lld from review_PRSDK-3360 to master
* commit 'f2194d6a4ac9be80bc69c60dc84f9321714605ac': Additional updates for Misra-C issues Resolve Misra-C issues
-rw-r--r--pruicss.h6
-rw-r--r--src/pruicss_drv.c106
-rw-r--r--src/pruicss_intc.c26
3 files changed, 75 insertions, 63 deletions
diff --git a/pruicss.h b/pruicss.h
index bd54860..d4557c1 100644
--- a/pruicss.h
+++ b/pruicss.h
@@ -263,7 +263,7 @@ typedef struct PRUICSS_IntrCfg_s
263 263
264typedef enum PRUICSS_Return_e 264typedef enum PRUICSS_Return_e
265{ 265{
266 PRUICSS_RETURN_FAILURE = -1, 266 PRUICSS_RETURN_FAILURE = -(int32_t)1,
267 PRUICSS_RETURN_SUCCESS = 0 267 PRUICSS_RETURN_SUCCESS = 0
268 268
269}PRUICSS_Return; 269}PRUICSS_Return;
@@ -372,7 +372,7 @@ int32_t PRUICSS_registerIrqHandler(PRUICSS_Handle handle,uint32_t pruEvtoutNum,
372 * \return 0 in case of successful registration, -1 otherwise. \n 372 * \return 0 in case of successful registration, -1 otherwise. \n
373 */ 373 */
374int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle, 374int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle,
375 PRUICSS_IntrCfg* intrCfg); 375 PRUICSS_IntrCfg const * intrCfg);
376 376
377 377
378/** 378/**
@@ -560,7 +560,7 @@ int32_t PRUICSS_socGetInitCfg( PRUICSS_Config **cfg);
560 * \return 0 success 560 * \return 0 success
561 * 561 *
562 */ 562 */
563int32_t PRUICSS_socSetInitCfg(PRUICSS_Config *cfg); 563int32_t PRUICSS_socSetInitCfg(PRUICSS_Config const *cfg);
564 564
565/** 565/**
566 * @brief This function clears all Interrupt-Channel-host mapping. 566 * @brief This function clears all Interrupt-Channel-host mapping.
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c
index 39cd11a..ae81a0d 100644
--- a/src/pruicss_drv.c
+++ b/src/pruicss_drv.c
@@ -51,17 +51,6 @@
51#include <ti/osal/SemaphoreP.h> 51#include <ti/osal/SemaphoreP.h>
52 52
53 53
54static uint32_t pruicssConstantIndex[PRUICCSS_ConstTblEntryMax] =
55{
56 CSL_ICSSPRUCTRL_CTBIR0, /*For enry 24, PRU-ICSS PRU0 Data RAM */
57 CSL_ICSSPRUCTRL_CTBIR0, /*For enry 25, PRU-ICSS PRU1 Data RAM */
58 CSL_ICSSPRUCTRL_CTBIR1, /*For enry 26, PRU-ICSS IEP */
59 CSL_ICSSPRUCTRL_CTBIR1, /*For enry 27, PRU-ICSS MII_RT*/
60 CSL_ICSSPRUCTRL_CTPPR0, /*For enry 28, PRU-ICSS Shared RAM*/
61 CSL_ICSSPRUCTRL_CTPPR0, /*For enry 29, TPCC*/
62 CSL_ICSSPRUCTRL_CTPPR1, /*For enry 30, L3 OCMC0 */
63 CSL_ICSSPRUCTRL_CTPPR1 /*For enry 31, EMIF0 DDR Base */
64};
65 54
66/*****************************************************************************/ 55/*****************************************************************************/
67/* INTERNAL MACRO DEFINITIONS */ 56/* INTERNAL MACRO DEFINITIONS */
@@ -88,7 +77,7 @@ PRUICSS_Handle PRUICSS_create(PRUICSS_Config *config ,int32_t instance)
88 uint32_t temp_addr = 0U; 77 uint32_t temp_addr = 0U;
89 78
90 handle = (PRUICSS_Config *)&config[instance-1]; 79 handle = (PRUICSS_Config *)&config[instance-1];
91 hwAttrs = (PRUICSS_HwAttrs *)handle->hwAttrs; 80 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
92 object = (PRUICSS_V1_Object*)handle->object; 81 object = (PRUICSS_V1_Object*)handle->object;
93 object->instance = instance; 82 object->instance = instance;
94 temp_addr = (hwAttrs->prussCfgRegBase + CSL_ICSSCFG_REVID); 83 temp_addr = (hwAttrs->prussCfgRegBase + CSL_ICSSCFG_REVID);
@@ -149,7 +138,7 @@ int32_t PRUICSS_pruReset(PRUICSS_Handle handle,uint8_t pruNum)
149 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 138 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
150 139
151 object = (PRUICSS_V1_Object*)handle->object; 140 object = (PRUICSS_V1_Object*)handle->object;
152 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 141 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
153 142
154 if(pruNum >= PRUICSS_MAX_PRU) 143 if(pruNum >= PRUICSS_MAX_PRU)
155 { 144 {
@@ -215,7 +204,7 @@ int32_t PRUICSS_pruReset(PRUICSS_Handle handle,uint8_t pruNum)
215 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 204 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
216 205
217 object = (PRUICSS_V1_Object*)handle->object; 206 object = (PRUICSS_V1_Object*)handle->object;
218 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 207 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
219 208
220 if(pruNum >= PRUICSS_MAX_PRU) 209 if(pruNum >= PRUICSS_MAX_PRU)
221 { 210 {
@@ -282,7 +271,7 @@ int32_t PRUICSS_pruEnable(PRUICSS_Handle handle,uint8_t pruNum)
282 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 271 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
283 272
284 object = (PRUICSS_V1_Object*)handle->object; 273 object = (PRUICSS_V1_Object*)handle->object;
285 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 274 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
286 275
287 if(pruNum >= PRUICSS_MAX_PRU) 276 if(pruNum >= PRUICSS_MAX_PRU)
288 { 277 {
@@ -364,10 +353,9 @@ int32_t PRUICSS_pruWriteMemory(
364 uint32_t addr; 353 uint32_t addr;
365 PRUICSS_HwAttrs const *hwAttrs; 354 PRUICSS_HwAttrs const *hwAttrs;
366 uint32_t temp_addr = 0U; 355 uint32_t temp_addr = 0U;
367
368 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs;
369 uint32_t i, wordlength; 356 uint32_t i, wordlength;
370 357 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
358 int32_t ret = 0;
371 wordlength = (bytelength + 3U) >> 2U; 359 wordlength = (bytelength + 3U) >> 2U;
372 360
373 if (pruMem == PRU_ICSS_DATARAM(0U)) { 361 if (pruMem == PRU_ICSS_DATARAM(0U)) {
@@ -381,15 +369,19 @@ int32_t PRUICSS_pruWriteMemory(
381 } else if (pruMem == PRU_ICSS_SHARED_RAM) { 369 } else if (pruMem == PRU_ICSS_SHARED_RAM) {
382 addr = hwAttrs->prussSharedDramBase; 370 addr = hwAttrs->prussSharedDramBase;
383 } else { 371 } else {
384 return -1; 372 ret = -(int32_t)1;
373 wordlength = 0U;
385 } 374 }
386 375
387 for (i = 0; i < wordlength; i++) 376 if (ret != -(int32_t)1)
388 { 377 {
389 temp_addr = (addr + (i << 2) + wordoffset); 378 for (i = 0; i < wordlength; i++)
390 HWREG(temp_addr) = source_mem[i]; 379 {
380 temp_addr = (addr + (i << 2) + wordoffset);
381 HWREG(temp_addr) = source_mem[i];
382 }
391 } 383 }
392 return wordlength; 384 return (int32_t)wordlength;
393} 385}
394 386
395 387
@@ -417,10 +409,10 @@ int32_t PRUICSS_pruInitMemory(
417 uint32_t addr = 0U; 409 uint32_t addr = 0U;
418 PRUICSS_HwAttrs const *hwAttrs; 410 PRUICSS_HwAttrs const *hwAttrs;
419 uint32_t temp_addr = 0U; 411 uint32_t temp_addr = 0U;
420 uint32_t size = 0U; 412 int32_t size = 0;
421 int i = 0; 413 int32_t i = 0;
422 414
423 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 415 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
424 416
425 if (pruMem == PRU_ICSS_DATARAM(0U)) { 417 if (pruMem == PRU_ICSS_DATARAM(0U)) {
426 addr = hwAttrs->prussPru0DramBase; 418 addr = hwAttrs->prussPru0DramBase;
@@ -438,14 +430,14 @@ int32_t PRUICSS_pruInitMemory(
438 addr = hwAttrs->prussSharedDramBase; 430 addr = hwAttrs->prussSharedDramBase;
439 size = hwAttrs->prussSharedDramSize; 431 size = hwAttrs->prussSharedDramSize;
440 } else { 432 } else {
441 size = 0U; 433 size = 0;
442 } 434 }
443 435
444 if(size > 0U) 436 if(size > 0)
445 { 437 {
446 for (i = 0U; i < size; i = i+4U) { 438 for (i = 0; i < size; i = i+4) {
447 temp_addr = (addr + i); 439 temp_addr = (addr + (uint32_t)i);
448 HWREG(temp_addr) = 0x00000000U; 440 HWREG(temp_addr) = (uint32_t)0x00000000U;
449 } 441 }
450 } 442 }
451 443
@@ -471,7 +463,7 @@ int32_t PRUICSS_pruSendEvent(PRUICSS_Handle handle,uint32_t eventnum)
471 uint32_t temp_var = 0U; 463 uint32_t temp_var = 0U;
472 464
473 object = (PRUICSS_V1_Object*)handle->object; 465 object = (PRUICSS_V1_Object*)handle->object;
474 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 466 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
475 467
476 if(object->instance == PRUICCSS_INSTANCE_ONE) 468 if(object->instance == PRUICCSS_INSTANCE_ONE)
477 { 469 {
@@ -520,7 +512,7 @@ int32_t PRUICSS_pruClearEvent(PRUICSS_Handle handle,uint32_t eventnum)
520 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 512 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
521 513
522 object = (PRUICSS_V1_Object*)handle->object; 514 object = (PRUICSS_V1_Object*)handle->object;
523 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 515 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
524 516
525 baseaddr = hwAttrs->baseAddr; 517 baseaddr = hwAttrs->baseAddr;
526 if(object->instance == PRUICCSS_INSTANCE_ONE) 518 if(object->instance == PRUICCSS_INSTANCE_ONE)
@@ -590,7 +582,7 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr
590 uint32_t temp_addr = 0U; 582 uint32_t temp_addr = 0U;
591 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 583 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
592 584
593 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 585 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
594 baseaddr = hwAttrs->baseAddr; 586 baseaddr = hwAttrs->baseAddr;
595 587
596 switch (pru_ram_id) { 588 switch (pru_ram_id) {
@@ -634,7 +626,7 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr
634 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 626 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
635 627
636 object = (PRUICSS_V1_Object*)handle->object; 628 object = (PRUICSS_V1_Object*)handle->object;
637 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 629 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
638 630
639 if(object->instance == PRUICCSS_INSTANCE_ONE) { 631 if(object->instance == PRUICCSS_INSTANCE_ONE) {
640 switch (per_id) 632 switch (per_id)
@@ -705,7 +697,7 @@ void PRUICSS_enableOCPMasterAccess(PRUICSS_Handle handle )
705 PRUICSS_HwAttrs const *hwAttrs; 697 PRUICSS_HwAttrs const *hwAttrs;
706 698
707 object = (PRUICSS_V1_Object*)handle->object; 699 object = (PRUICSS_V1_Object*)handle->object;
708 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 700 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
709 701
710 if(object->instance == PRUICCSS_INSTANCE_ONE) 702 if(object->instance == PRUICCSS_INSTANCE_ONE)
711 { 703 {
@@ -819,7 +811,7 @@ void PRUICSS_pinMuxConfig(PRUICSS_Handle handle, uint64_t regVal)
819 PRUICSS_HwAttrs const *hwAttrs; 811 PRUICSS_HwAttrs const *hwAttrs;
820 812
821 object = (PRUICSS_V1_Object*)handle->object; 813 object = (PRUICSS_V1_Object*)handle->object;
822 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 814 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
823 815
824 if(object->instance == PRUICCSS_INSTANCE_ONE) 816 if(object->instance == PRUICCSS_INSTANCE_ONE)
825 { 817 {
@@ -858,10 +850,10 @@ int32_t PRUICSS_socGetInitCfg( PRUICSS_Config **cfg)
858 * \return 0 success 850 * \return 0 success
859 * 851 *
860 */ 852 */
861int32_t PRUICSS_socSetInitCfg(PRUICSS_Config *cfg) 853int32_t PRUICSS_socSetInitCfg(PRUICSS_Config const *cfg)
862{ 854{
863#ifndef __LINUX_USER_SPACE 855#ifndef __LINUX_USER_SPACE
864 uint32_t len = sizeof(PRUICSS_Config) * (PRUICCSS_INSTANCE_MAX -1); 856 uint32_t len = sizeof(PRUICSS_Config) * (PRUICCSS_INSTANCE_MAX -1U);
865 memcpy(&pruss_config, cfg, len); 857 memcpy(&pruss_config, cfg, len);
866#endif 858#endif
867 return PRUICSS_RETURN_SUCCESS; 859 return PRUICSS_RETURN_SUCCESS;
@@ -888,6 +880,20 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
888 uint32_t currentval = 0U; 880 uint32_t currentval = 0U;
889 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 881 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
890 882
883 static uint32_t pruicssConstantIndex[PRUICCSS_ConstTblEntryMax] =
884 {
885 CSL_ICSSPRUCTRL_CTBIR0, /*For enry 24, PRU-ICSS PRU0 Data RAM */
886 CSL_ICSSPRUCTRL_CTBIR0, /*For enry 25, PRU-ICSS PRU1 Data RAM */
887 CSL_ICSSPRUCTRL_CTBIR1, /*For enry 26, PRU-ICSS IEP */
888 CSL_ICSSPRUCTRL_CTBIR1, /*For enry 27, PRU-ICSS MII_RT*/
889 CSL_ICSSPRUCTRL_CTPPR0, /*For enry 28, PRU-ICSS Shared RAM*/
890 CSL_ICSSPRUCTRL_CTPPR0, /*For enry 29, TPCC*/
891 CSL_ICSSPRUCTRL_CTPPR1, /*For enry 30, L3 OCMC0 */
892 CSL_ICSSPRUCTRL_CTPPR1 /*For enry 31, EMIF0 DDR Base */
893 };
894
895
896
891 /* verify constant table index is within valid range */ 897 /* verify constant table index is within valid range */
892 if (((constantTblEntry < 0) || (constantTblEntry >= PRUICCSS_ConstTblEntryMax)) || (pruNum > PRUICSS_MAX_PRU)) 898 if (((constantTblEntry < 0) || (constantTblEntry >= PRUICCSS_ConstTblEntryMax)) || (pruNum > PRUICSS_MAX_PRU))
893 { 899 {
@@ -895,7 +901,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
895 } 901 }
896 else 902 else
897 { 903 {
898 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 904 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
899 if(PRUICCSS_PRU0 == pruNum) 905 if(PRUICCSS_PRU0 == pruNum)
900 { 906 {
901 baseaddr = hwAttrs->prussPru0CtrlRegBase; 907 baseaddr = hwAttrs->prussPru0CtrlRegBase;
@@ -916,7 +922,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
916 case PRUICCSS_ConstTblEntryC24: 922 case PRUICCSS_ConstTblEntryC24:
917 { 923 {
918 currentval = HW_RD_REG32(tempaddr); 924 currentval = HW_RD_REG32(tempaddr);
919 currentval &= (~CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK); 925 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK));
920 tempval = CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK & constantTblVal; 926 tempval = CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK & constantTblVal;
921 HWREG(tempaddr) =currentval |tempval; 927 HWREG(tempaddr) =currentval |tempval;
922 break; 928 break;
@@ -924,7 +930,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
924 case PRUICCSS_ConstTblEntryC25: 930 case PRUICCSS_ConstTblEntryC25:
925 { 931 {
926 currentval = HW_RD_REG32(tempaddr); 932 currentval = HW_RD_REG32(tempaddr);
927 currentval &= (~CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK); 933 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK));
928 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_SHIFT; 934 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_SHIFT;
929 tempval = CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK & tempval; 935 tempval = CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK & tempval;
930 HWREG(tempaddr) =currentval |tempval; 936 HWREG(tempaddr) =currentval |tempval;
@@ -933,7 +939,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
933 case PRUICCSS_ConstTblEntryC26: 939 case PRUICCSS_ConstTblEntryC26:
934 { 940 {
935 currentval = HW_RD_REG32(tempaddr); 941 currentval = HW_RD_REG32(tempaddr);
936 currentval &= (~CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK); 942 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK));
937 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_SHIFT; 943 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_SHIFT;
938 tempval = CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK & tempval; 944 tempval = CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK & tempval;
939 HWREG(tempaddr) =currentval |tempval; 945 HWREG(tempaddr) =currentval |tempval;
@@ -942,7 +948,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
942 case PRUICCSS_ConstTblEntryC27: 948 case PRUICCSS_ConstTblEntryC27:
943 { 949 {
944 currentval = HW_RD_REG32(tempaddr); 950 currentval = HW_RD_REG32(tempaddr);
945 currentval &= (~CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK); 951 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK));
946 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_SHIFT; 952 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_SHIFT;
947 tempval = CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK & tempval; 953 tempval = CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK & tempval;
948 HWREG(tempaddr) =currentval |tempval; 954 HWREG(tempaddr) =currentval |tempval;
@@ -951,7 +957,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
951 case PRUICCSS_ConstTblEntryC28: 957 case PRUICCSS_ConstTblEntryC28:
952 { 958 {
953 currentval = HW_RD_REG32(tempaddr); 959 currentval = HW_RD_REG32(tempaddr);
954 currentval &= (~CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK); 960 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK));
955 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_SHIFT; 961 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_SHIFT;
956 tempval &= CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK; 962 tempval &= CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK;
957 HWREG(tempaddr) =currentval |tempval; 963 HWREG(tempaddr) =currentval |tempval;
@@ -960,7 +966,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
960 case PRUICCSS_ConstTblEntryC29: 966 case PRUICCSS_ConstTblEntryC29:
961 { 967 {
962 currentval = HW_RD_REG32(tempaddr); 968 currentval = HW_RD_REG32(tempaddr);
963 currentval &= (~CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK); 969 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK));
964 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_SHIFT; 970 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_SHIFT;
965 tempval &= CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK; 971 tempval &= CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK;
966 HWREG(tempaddr) =currentval |tempval; 972 HWREG(tempaddr) =currentval |tempval;
@@ -969,7 +975,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
969 case PRUICCSS_ConstTblEntryC30: 975 case PRUICCSS_ConstTblEntryC30:
970 { 976 {
971 currentval = HW_RD_REG32(tempaddr); 977 currentval = HW_RD_REG32(tempaddr);
972 currentval &= (~CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK); 978 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK));
973 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_SHIFT; 979 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_SHIFT;
974 tempval &= CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK; 980 tempval &= CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK;
975 HWREG(tempaddr) =currentval |tempval; 981 HWREG(tempaddr) =currentval |tempval;
@@ -978,7 +984,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32
978 case PRUICCSS_ConstTblEntryC31: 984 case PRUICCSS_ConstTblEntryC31:
979 { 985 {
980 currentval = HW_RD_REG32(tempaddr); 986 currentval = HW_RD_REG32(tempaddr);
981 currentval &= (~CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK); 987 currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK));
982 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_SHIFT; 988 tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_SHIFT;
983 tempval &= CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK; 989 tempval &= CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK;
984 HWREG(tempaddr) =currentval |tempval; 990 HWREG(tempaddr) =currentval |tempval;
@@ -1016,7 +1022,7 @@ int32_t PRUICSS_setGpMuxSel(PRUICSS_Handle handle, uint8_t pruNum, uint32_t mode
1016 } 1022 }
1017 else 1023 else
1018 { 1024 {
1019 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 1025 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
1020 if(PRUICCSS_PRU0 == pruNum) 1026 if(PRUICCSS_PRU0 == pruNum)
1021 { 1027 {
1022 HW_WR_FIELD32((hwAttrs->prussCfgRegBase+CSL_ICSSCFG_GPCFG0), CSL_ICSSCFG_GPCFG0_PRU0_GP_MUX_SEL, mode); 1028 HW_WR_FIELD32((hwAttrs->prussCfgRegBase+CSL_ICSSCFG_GPCFG0), CSL_ICSSCFG_GPCFG0_PRU0_GP_MUX_SEL, mode);
@@ -1061,7 +1067,7 @@ int32_t PRUICSS_setIepClkSrc(PRUICSS_Handle handle, uint32_t source)
1061 /* validate the clk source */ 1067 /* validate the clk source */
1062 if ((source == 1U) || (source == 0U)) 1068 if ((source == 1U) || (source == 0U))
1063 { 1069 {
1064 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 1070 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
1065 HW_WR_FIELD32((hwAttrs->prussCfgRegBase+CSL_ICSSCFG_IEPCLK), CSL_ICSSCFG_IEPCLK_OCP_EN, source); 1071 HW_WR_FIELD32((hwAttrs->prussCfgRegBase+CSL_ICSSCFG_IEPCLK), CSL_ICSSCFG_IEPCLK_OCP_EN, source);
1066 } 1072 }
1067 else 1073 else
diff --git a/src/pruicss_intc.c b/src/pruicss_intc.c
index 8553eda..95a4ac6 100644
--- a/src/pruicss_intc.c
+++ b/src/pruicss_intc.c
@@ -134,7 +134,7 @@ int32_t PRUICSS_pruIntcInit(PRUICSS_Handle handle, const PRUICSS_IntcInitData *
134 int32_t ret_val = PRUICSS_RETURN_SUCCESS; 134 int32_t ret_val = PRUICSS_RETURN_SUCCESS;
135 135
136 object = (PRUICSS_V1_Object*)handle->object; 136 object = (PRUICSS_V1_Object*)handle->object;
137 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 137 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
138 baseaddr = hwAttrs->baseAddr; 138 baseaddr = hwAttrs->baseAddr;
139 139
140 if(object->instance == PRUICCSS_INSTANCE_ONE) 140 if(object->instance == PRUICCSS_INSTANCE_ONE)
@@ -327,7 +327,7 @@ int32_t PRUICSS_registerIrqHandler(PRUICSS_Handle handle,
327 327
328#ifndef __LINUX_USER_SPACE 328#ifndef __LINUX_USER_SPACE
329int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle, 329int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle,
330 PRUICSS_IntrCfg* intrCfg) 330 PRUICSS_IntrCfg const * intrCfg)
331 331
332{ 332{
333 PRUICSS_V1_Object *object; 333 PRUICSS_V1_Object *object;
@@ -389,7 +389,7 @@ int32_t PRUICSS_registerIrqHandler2(PRUICSS_Handle handle,
389 hwiInputParams.name = NULL; 389 hwiInputParams.name = NULL;
390 hwiInputParams.priority = 0x20; 390 hwiInputParams.priority = 0x20;
391 391
392 hwiInputParams.evtId = intrCfg->eventId; // eventNum; 392 hwiInputParams.evtId = intrCfg->eventId; /*eventNum */
393 393
394 394
395#if defined (__ARM_ARCH_7A__) && defined (SOC_K2G) 395#if defined (__ARM_ARCH_7A__) && defined (SOC_K2G)
@@ -499,7 +499,7 @@ int32_t PRUICSS_pruIntcClear(PRUICSS_Handle handle)
499 if (handle != NULL) 499 if (handle != NULL)
500 { 500 {
501 object = (PRUICSS_V1_Object*)handle->object; 501 object = (PRUICSS_V1_Object*)handle->object;
502 hwAttrs = (PRUICSS_HwAttrs*)handle->hwAttrs; 502 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
503 /* verify the instance */ 503 /* verify the instance */
504 if ((object->instance == PRUICCSS_INSTANCE_ONE) || (object->instance == PRUICCSS_INSTANCE_TWO)) 504 if ((object->instance == PRUICCSS_INSTANCE_ONE) || (object->instance == PRUICCSS_INSTANCE_TWO))
505 { 505 {
@@ -524,17 +524,23 @@ int32_t PRUICSS_pruIntcClear(PRUICSS_Handle handle)
524 HWREG(temp_addr) = 0; 524 HWREG(temp_addr) = 0;
525 } 525 }
526 526
527 HWREG(baseaddr + CSL_ICSSINTC_ESR0) = 0; 527 temp_addr = baseaddr + CSL_ICSSINTC_ESR0;
528 HWREG(temp_addr) = 0;
528 529
529 HWREG(baseaddr + CSL_ICSSINTC_SECR0) = 0; 530 temp_addr = baseaddr + CSL_ICSSINTC_SECR0;
531 HWREG(temp_addr) = 0;
530 532
531 HWREG(baseaddr + CSL_ICSSINTC_ERS1) = 0; 533 temp_addr = baseaddr + CSL_ICSSINTC_ERS1;
534 HWREG(temp_addr) = 0;
532 535
533 HWREG(baseaddr + CSL_ICSSINTC_SECR1) = 0; 536 temp_addr = baseaddr + CSL_ICSSINTC_SECR1;
537 HWREG(temp_addr) = 0;
534 538
535 HWREG(baseaddr + CSL_ICSSINTC_HIER) = 0; 539 temp_addr = baseaddr + CSL_ICSSINTC_HIER;
540 HWREG(temp_addr) = 0;
536 541
537 HWREG(baseaddr + CSL_ICSSINTC_GER) = 0; 542 temp_addr = baseaddr + CSL_ICSSINTC_GER;
543 HWREG(temp_addr) = 0;
538 } 544 }
539 else 545 else
540 { 546 {