diff options
author | Aravind Batni | 2019-04-18 15:04:14 -0500 |
---|---|---|
committer | Aravind Batni | 2019-04-18 15:04:14 -0500 |
commit | a4ce7b95d5ba4ef266df210ba7c829cb65d4a35f (patch) | |
tree | 99b23a7db699af61abd451c8ba0188136f26c49f /src/pruicss_drv.c | |
parent | 9e65866250527b5281d3d7f2e7e914fee9b31392 (diff) | |
parent | 658adde37786eef300ed3dec0a89810c250dfa91 (diff) | |
download | pruss-lld-a4ce7b95d5ba4ef266df210ba7c829cb65d4a35f.tar.gz pruss-lld-a4ce7b95d5ba4ef266df210ba7c829cb65d4a35f.tar.xz pruss-lld-a4ce7b95d5ba4ef266df210ba7c829cb65d4a35f.zip |
Merge pull request #59 in PROCESSOR-SDK/pruss-lld from review_PRSDK-5731 to master
* commit '658adde37786eef300ed3dec0a89810c250dfa91':
j721e: pruss driver support
Diffstat (limited to 'src/pruicss_drv.c')
-rw-r--r-- | src/pruicss_drv.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c index b086672..ceeba87 100644 --- a/src/pruicss_drv.c +++ b/src/pruicss_drv.c | |||
@@ -359,7 +359,7 @@ int32_t PRUICSS_pruInitMemory( | |||
359 | { | 359 | { |
360 | uint32_t addr = 0U; | 360 | uint32_t addr = 0U; |
361 | PRUICSS_HwAttrs const *hwAttrs; | 361 | PRUICSS_HwAttrs const *hwAttrs; |
362 | uint32_t temp_addr = 0U; | 362 | uintptr_t temp_addr = 0U; |
363 | int32_t size = 0; | 363 | int32_t size = 0; |
364 | int32_t i = 0; | 364 | int32_t i = 0; |
365 | 365 | ||
@@ -388,7 +388,8 @@ int32_t PRUICSS_pruInitMemory( | |||
388 | { | 388 | { |
389 | for (i = 0; i < size; i = i+4) { | 389 | for (i = 0; i < size; i = i+4) { |
390 | temp_addr = (addr + (uint32_t)i); | 390 | temp_addr = (addr + (uint32_t)i); |
391 | HWREG(temp_addr) = (uint32_t)0x00000000U; | 391 | HW_WR_REG32(temp_addr,(uint32_t)0x00000000U); |
392 | //HWREG(temp_addr) = (uint32_t)0x00000000U; | ||
392 | } | 393 | } |
393 | } | 394 | } |
394 | 395 | ||
@@ -884,7 +885,7 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
884 | { | 885 | { |
885 | PRUICSS_HwAttrs const *hwAttrs = NULL; | 886 | PRUICSS_HwAttrs const *hwAttrs = NULL; |
886 | uint32_t baseaddr = 0U; | 887 | uint32_t baseaddr = 0U; |
887 | uint32_t tempaddr = 0U; | 888 | uintptr_t tempaddr = 0U; |
888 | uint32_t tempval = 0U; | 889 | uint32_t tempval = 0U; |
889 | uint32_t currentval = 0U; | 890 | uint32_t currentval = 0U; |
890 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; | 891 | int32_t ret_val = PRUICSS_RETURN_SUCCESS; |
@@ -933,7 +934,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
933 | currentval = HW_RD_REG32(tempaddr); | 934 | currentval = HW_RD_REG32(tempaddr); |
934 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK)); | 935 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK)); |
935 | tempval = CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK & constantTblVal; | 936 | tempval = CSL_ICSSPRUCTRL_CTBIR0_C24_BLK_INDEX_MASK & constantTblVal; |
936 | HWREG(tempaddr) =currentval |tempval; | 937 | //HWREG(tempaddr) =currentval |tempval; |
938 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
937 | break; | 939 | break; |
938 | } | 940 | } |
939 | case PRUICCSS_ConstTblEntryC25: | 941 | case PRUICCSS_ConstTblEntryC25: |
@@ -942,7 +944,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
942 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK)); | 944 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK)); |
943 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_SHIFT; | 945 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_SHIFT; |
944 | tempval = CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK & tempval; | 946 | tempval = CSL_ICSSPRUCTRL_CTBIR0_C25_BLK_INDEX_MASK & tempval; |
945 | HWREG(tempaddr) =currentval |tempval; | 947 | //HWREG(tempaddr) =currentval |tempval; |
948 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
946 | break; | 949 | break; |
947 | } | 950 | } |
948 | case PRUICCSS_ConstTblEntryC26: | 951 | case PRUICCSS_ConstTblEntryC26: |
@@ -951,7 +954,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
951 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK)); | 954 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK)); |
952 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_SHIFT; | 955 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_SHIFT; |
953 | tempval = CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK & tempval; | 956 | tempval = CSL_ICSSPRUCTRL_CTBIR1_C26_BLK_INDEX_MASK & tempval; |
954 | HWREG(tempaddr) =currentval |tempval; | 957 | //HWREG(tempaddr) =currentval |tempval; |
958 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
955 | break; | 959 | break; |
956 | } | 960 | } |
957 | case PRUICCSS_ConstTblEntryC27: | 961 | case PRUICCSS_ConstTblEntryC27: |
@@ -960,7 +964,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
960 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK)); | 964 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK)); |
961 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_SHIFT; | 965 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_SHIFT; |
962 | tempval = CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK & tempval; | 966 | tempval = CSL_ICSSPRUCTRL_CTBIR1_C27_BLK_INDEX_MASK & tempval; |
963 | HWREG(tempaddr) =currentval |tempval; | 967 | //HWREG(tempaddr) =currentval |tempval; |
968 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
964 | break; | 969 | break; |
965 | } | 970 | } |
966 | case PRUICCSS_ConstTblEntryC28: | 971 | case PRUICCSS_ConstTblEntryC28: |
@@ -969,7 +974,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
969 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK)); | 974 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK)); |
970 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_SHIFT; | 975 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_SHIFT; |
971 | tempval &= CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK; | 976 | tempval &= CSL_ICSSPRUCTRL_CTPPR0_C28_POINTER_MASK; |
972 | HWREG(tempaddr) =currentval |tempval; | 977 | //HWREG(tempaddr) =currentval |tempval; |
978 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
973 | break; | 979 | break; |
974 | } | 980 | } |
975 | case PRUICCSS_ConstTblEntryC29: | 981 | case PRUICCSS_ConstTblEntryC29: |
@@ -978,7 +984,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
978 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK)); | 984 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK)); |
979 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_SHIFT; | 985 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_SHIFT; |
980 | tempval &= CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK; | 986 | tempval &= CSL_ICSSPRUCTRL_CTPPR0_C29_POINTER_MASK; |
981 | HWREG(tempaddr) =currentval |tempval; | 987 | //HWREG(tempaddr) =currentval |tempval; |
988 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
982 | break; | 989 | break; |
983 | } | 990 | } |
984 | case PRUICCSS_ConstTblEntryC30: | 991 | case PRUICCSS_ConstTblEntryC30: |
@@ -987,7 +994,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
987 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK)); | 994 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK)); |
988 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_SHIFT; | 995 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_SHIFT; |
989 | tempval &= CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK; | 996 | tempval &= CSL_ICSSPRUCTRL_CTPPR1_C30_POINTER_MASK; |
990 | HWREG(tempaddr) =currentval |tempval; | 997 | //HWREG(tempaddr) =currentval |tempval; |
998 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
991 | break; | 999 | break; |
992 | } | 1000 | } |
993 | case PRUICCSS_ConstTblEntryC31: | 1001 | case PRUICCSS_ConstTblEntryC31: |
@@ -996,7 +1004,8 @@ int32_t PRUICSS_setConstantTblEntry(PRUICSS_Handle handle, uint8_t pruNum, int32 | |||
996 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK)); | 1004 | currentval &= (~((uint32_t)CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK)); |
997 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_SHIFT; | 1005 | tempval = constantTblVal << CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_SHIFT; |
998 | tempval &= CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK; | 1006 | tempval &= CSL_ICSSPRUCTRL_CTPPR1_C31_POINTER_MASK; |
999 | HWREG(tempaddr) =currentval |tempval; | 1007 | //HWREG(tempaddr) =currentval |tempval; |
1008 | HW_WR_REG32(tempaddr,(uint32_t)(currentval |tempval)); | ||
1000 | break; | 1009 | break; |
1001 | } | 1010 | } |
1002 | default: | 1011 | default: |