diff options
author | Tinku Mannan | 2018-02-05 13:23:35 -0600 |
---|---|---|
committer | Tinku Mannan | 2018-02-05 13:23:35 -0600 |
commit | d836b70e5edf61a6ef1819fbb0ee1705f0439f68 (patch) | |
tree | 1e8f10b44b333086958afbcf4b94db53b85d9f7e /src/pruicss_drv.c | |
parent | fb912677d96d43800dbd9bd84c54c9bb8a3e54ef (diff) | |
download | pruss-lld-d836b70e5edf61a6ef1819fbb0ee1705f0439f68.tar.gz pruss-lld-d836b70e5edf61a6ef1819fbb0ee1705f0439f68.tar.xz pruss-lld-d836b70e5edf61a6ef1819fbb0ee1705f0439f68.zip |
Resolve Misra-C issues
Diffstat (limited to 'src/pruicss_drv.c')
-rw-r--r-- | src/pruicss_drv.c | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c index 39cd11a..b203cc3 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 | ||
54 | static 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 | ||
@@ -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 | */ |
861 | int32_t PRUICSS_socSetInitCfg(PRUICSS_Config *cfg) | 853 | int32_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); |