summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinthu Raja M2018-02-21 09:46:02 -0600
committerPratap Reddy2018-02-21 14:16:41 -0600
commit983fd7ddcb3b79e426c94763e3be4c0728d3b68b (patch)
tree3404d139b43bab4b8ab6928203e698dc04d55cff
parent332d13116a164cd0120d0362c410f83601bafd1d (diff)
downloadedma3_lld-983fd7ddcb3b79e426c94763e3be4c0728d3b68b.tar.gz
edma3_lld-983fd7ddcb3b79e426c94763e3be4c0728d3b68b.tar.xz
edma3_lld-983fd7ddcb3b79e426c94763e3be4c0728d3b68b.zip
PRSDK-415 Add support to verify allocated PaRAM Id
Add support to verify the requested DMA Channel ID gets the corresponding PaRAM Id. The test can be enabled by adding EDMA3_RES_USER_REQ macro in makefile of driver and AM335x example makefile.
-rw-r--r--examples/edma3_driver/evmAM335x_A8/makefile2
-rw-r--r--examples/edma3_driver/evmAM335x_A8/rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg11
-rw-r--r--examples/edma3_driver/src/dma_poll_test.c17
-rw-r--r--examples/edma3_driver/src/main.c30
-rwxr-xr-xpackages/ti/sdo/edma3/drv/edma3_drv.h21
-rwxr-xr-xpackages/ti/sdo/edma3/drv/src/edma3_drv_basic.c20
6 files changed, 95 insertions, 6 deletions
diff --git a/examples/edma3_driver/evmAM335x_A8/makefile b/examples/edma3_driver/evmAM335x_A8/makefile
index 81f63e1..02bc4bb 100644
--- a/examples/edma3_driver/evmAM335x_A8/makefile
+++ b/examples/edma3_driver/evmAM335x_A8/makefile
@@ -19,7 +19,7 @@ XDC_CFG_FILE_a8host = rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg
19SRCS_COMMON = common.c dma_misc_test.c dma_test.c qdma_test.c dma_chain_test.c \ 19SRCS_COMMON = common.c dma_misc_test.c dma_test.c qdma_test.c dma_chain_test.c \
20 dma_ping_pong_test.c main.c dma_link_test.c dma_poll_test.c \ 20 dma_ping_pong_test.c main.c dma_link_test.c dma_poll_test.c \
21 qdma_link_test.c 21 qdma_link_test.c
22CFLAGS_LOCAL_COMMON = 22CFLAGS_LOCAL_COMMON = -DSOC_AM335x
23 23
24# Core/SoC/platform specific source files and CFLAGS 24# Core/SoC/platform specific source files and CFLAGS
25# Example: 25# Example:
diff --git a/examples/edma3_driver/evmAM335x_A8/rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg b/examples/edma3_driver/evmAM335x_A8/rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg
index a47a178..0825892 100644
--- a/examples/edma3_driver/evmAM335x_A8/rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg
+++ b/examples/edma3_driver/evmAM335x_A8/rtsc_config/edma3_drv_bios6_am335x_a8_st_sample.cfg
@@ -12,7 +12,7 @@ var SemihostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
12var Program = xdc.useModule("xdc.cfg.Program"); 12var Program = xdc.useModule("xdc.cfg.Program");
13 13
14/* Heap used when creating semaphore's, TSK's or malloc() ... */ 14/* Heap used when creating semaphore's, TSK's or malloc() ... */
15Program.heap = 0x1000; 15Program.heap = 0x10000;
16 16
17/* ISR/SWI stack */ 17/* ISR/SWI stack */
18Program.stack = 0x4000; 18Program.stack = 0x4000;
@@ -93,3 +93,12 @@ for (var i= 0x49000000; i < 0x490FFFFF; i = i + 0x100000)
93 Mmu.setFirstLevelDescMeta(i, i, attrs); 93 Mmu.setFirstLevelDescMeta(i, i, attrs);
94} 94}
95 95
96/* configure the Peripheral Clock Module memory range */
97var peripheralBaseAddr = 0x44e00400;
98
99attrs.bufferable = false;
100attrs.cacheable = false;
101/* Configure the corresponding MMU page descriptor for Clock Module */
102Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
103 peripheralBaseAddr,
104 attrs);
diff --git a/examples/edma3_driver/src/dma_poll_test.c b/examples/edma3_driver/src/dma_poll_test.c
index 948dc1a..de65801 100644
--- a/examples/edma3_driver/src/dma_poll_test.c
+++ b/examples/edma3_driver/src/dma_poll_test.c
@@ -7,7 +7,7 @@
7* to check the status of ongoing transfer. Interrupt will NOT occur in this 7* to check the status of ongoing transfer. Interrupt will NOT occur in this
8* case. 8* case.
9* 9*
10* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ 10* Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
11* 11*
12* 12*
13* Redistribution and use in source and binary forms, with or without 13* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,7 @@ extern signed char _dstBuff1[MAX_BUFFER_SIZE];
48extern signed char *srcBuff1; 48extern signed char *srcBuff1;
49extern signed char *dstBuff1; 49extern signed char *dstBuff1;
50 50
51#define EDMA3_DRV_DMA_CHANNEL_USR_REQ (10)
51/** 52/**
52* \brief EDMA3 mem-to-mem data copy test case, using a DMA channel. 53* \brief EDMA3 mem-to-mem data copy test case, using a DMA channel.
53* This test case doesnot rely on the callback mechanism. 54* This test case doesnot rely on the callback mechanism.
@@ -137,7 +138,11 @@ EDMA3_DRV_Result edma3_test_poll_mode(
137 138
138 /* Setup for Channel 1*/ 139 /* Setup for Channel 1*/
139 tcc = EDMA3_DRV_TCC_ANY; 140 tcc = EDMA3_DRV_TCC_ANY;
141#ifdef EDMA3_RES_USER_REQ
142 chId = EDMA3_DRV_DMA_CHANNEL_USR_REQ;
143#else
140 chId = EDMA3_DRV_DMA_CHANNEL_ANY; 144 chId = EDMA3_DRV_DMA_CHANNEL_ANY;
145#endif
141 146
142 147
143 /* Request any DMA channel and any TCC */ 148 /* Request any DMA channel and any TCC */
@@ -146,6 +151,16 @@ EDMA3_DRV_Result edma3_test_poll_mode(
146 result = EDMA3_DRV_requestChannel (hEdma, &chId, &tcc, 151 result = EDMA3_DRV_requestChannel (hEdma, &chId, &tcc,
147 (EDMA3_RM_EventQueue)0, 152 (EDMA3_RM_EventQueue)0,
148 NULL, NULL); 153 NULL, NULL);
154#ifdef EDMA3_RES_USER_REQ
155 printf("\nReserved Channel ID Test\n");
156 printf ("The Requested Channel ID: %d \nThe allocated PARAM Id:%d\n",chId,EDMA3_DRV_getAllocatedPARAMId());
157
158 if (chId == EDMA3_DRV_getAllocatedPARAMId())
159 {
160 printf("The Requested Param ID is allocated for the given Channel\n");
161 }
162 printf("\n");
163#endif
149 } 164 }
150 165
151 if (result == EDMA3_DRV_SOK) 166 if (result == EDMA3_DRV_SOK)
diff --git a/examples/edma3_driver/src/main.c b/examples/edma3_driver/src/main.c
index a6d37c6..a8b8910 100644
--- a/examples/edma3_driver/src/main.c
+++ b/examples/edma3_driver/src/main.c
@@ -4,7 +4,7 @@
4* This file contains the test / demo code to demonstrate the EDMA3 driver 4* This file contains the test / demo code to demonstrate the EDMA3 driver
5* functionality on DSP/BIOS 6. 5* functionality on DSP/BIOS 6.
6* 6*
7* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ 7* Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
8* 8*
9* 9*
10* Redistribution and use in source and binary forms, with or without 10* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,19 @@ extern far const uint32_t numEdma3Instances;
50extern const uint32_t numEdma3Instances; 50extern const uint32_t numEdma3Instances;
51#endif 51#endif
52 52
53#ifdef SOC_AM335x
54#define WR_MEM_32(addr, data) *(unsigned int*)(addr) = (unsigned int)(data)
55
56#define PRCM_BASE_ADDR (0x44E00000)
57#define CM_PER_TPTC0_CLKCTRL (PRCM_BASE_ADDR +0x0024)
58#define CM_PER_TPCC_CLKCTRL (PRCM_BASE_ADDR +0x00BC)
59#define CM_PER_TPTC1_CLKCTRL (PRCM_BASE_ADDR +0x00FC)
60#define CM_PER_TPTC2_CLKCTRL (PRCM_BASE_ADDR +0x0100)
61
62/*To enable EDMA3 Clock Module */
63static void edma3PRCMEnable();
64#endif
65
53/** 66/**
54* DSP instance number on which the executable is running. Its value is 67* DSP instance number on which the executable is running. Its value is
55* determined by reading the processor specific register DNUM. 68* determined by reading the processor specific register DNUM.
@@ -161,6 +174,10 @@ void echo()
161 174
162 memset(hEdma,0,sizeof(hEdma)); 175 memset(hEdma,0,sizeof(hEdma));
163 176
177#ifdef SOC_AM335x
178 edma3PRCMEnable();
179#endif
180
164 /* Print the Welcome Message */ 181 /* Print the Welcome Message */
165 printWelcomeBanner(); 182 printWelcomeBanner();
166 183
@@ -459,3 +476,14 @@ void tskHeartBit()
459 counter++; 476 counter++;
460 } 477 }
461} 478}
479
480#ifdef SOC_AM335x
481/*To enable EDMA3 Clock Module of AM335x*/
482static void edma3PRCMEnable()
483{
484 WR_MEM_32(CM_PER_TPCC_CLKCTRL, 2);
485 WR_MEM_32(CM_PER_TPTC0_CLKCTRL , 2);
486 WR_MEM_32(CM_PER_TPTC1_CLKCTRL , 2);
487 WR_MEM_32(CM_PER_TPTC2_CLKCTRL , 2);
488}
489#endif
diff --git a/packages/ti/sdo/edma3/drv/edma3_drv.h b/packages/ti/sdo/edma3/drv/edma3_drv.h
index 2c77bf8..c6cd53f 100755
--- a/packages/ti/sdo/edma3/drv/edma3_drv.h
+++ b/packages/ti/sdo/edma3/drv/edma3_drv.h
@@ -5,7 +5,7 @@
5 * uses the EDMA3 Resource Manager internally for resource allocation, interrupt 5 * uses the EDMA3 Resource Manager internally for resource allocation, interrupt
6 * handling and EDMA3 registers programming. 6 * handling and EDMA3 registers programming.
7 * 7 *
8 * Copyright (C) 2009-2013 Texas Instruments Incorporated - http://www.ti.com/ 8 * Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
9 * 9 *
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -3152,6 +3152,25 @@ EDMA3_DRV_Result EDMA3_DRV_initXbarEventMap (EDMA3_DRV_Handle hEdma,
3152 EDMA3_DRV_mapXbarEvtToChan mapXbarEvtFunc, 3152 EDMA3_DRV_mapXbarEvtToChan mapXbarEvtFunc,
3153 EDMA3_DRV_xbarConfigScr configXbarScr); 3153 EDMA3_DRV_xbarConfigScr configXbarScr);
3154 3154
3155#ifdef EDMA3_RES_USER_REQ
3156/**
3157 * \brief Return the PARAM ID recently allocated for an EDMA channel
3158 *
3159 * This API will return the PARAM Id recently allocated by the EDMA3
3160 * resource manager for a requested DMA channel
3161 *
3162 * This function will called by the application after
3163 * the EDMA3_DRV_requestChannel() function is invoked.
3164 * \param NULL
3165 *
3166 * \return uint32_t
3167 *
3168 * \note This function is used only for testing purpose to
3169 * check the allcoated PARAM Id.
3170 */
3171uint32_t EDMA3_DRV_getAllocatedPARAMId();
3172#endif
3173
3155 3174
3156 3175
3157/** 3176/**
diff --git a/packages/ti/sdo/edma3/drv/src/edma3_drv_basic.c b/packages/ti/sdo/edma3/drv/src/edma3_drv_basic.c
index 2a6ab6e..ddf40fc 100755
--- a/packages/ti/sdo/edma3/drv/src/edma3_drv_basic.c
+++ b/packages/ti/sdo/edma3/drv/src/edma3_drv_basic.c
@@ -12,7 +12,7 @@
12 * beyond this and have complete control on the EDMA3 hardware are advised 12 * beyond this and have complete control on the EDMA3 hardware are advised
13 * to refer edma3_drv_adv.c source file. 13 * to refer edma3_drv_adv.c source file.
14 * 14 *
15 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ 15 * Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
16 * 16 *
17 * 17 *
18 * Redistribution and use in source and binary forms, with or without 18 * Redistribution and use in source and binary forms, with or without
@@ -169,6 +169,11 @@ static EDMA3_DRV_Result edma3RemoveMapping (EDMA3_DRV_Handle hEdma,
169const char edma3LldVersionStr[] = EDMA3_LLD_DRV_VERSION_STR ":" __DATE__ ":" __TIME__; 169const char edma3LldVersionStr[] = EDMA3_LLD_DRV_VERSION_STR ":" __DATE__ ":" __TIME__;
170/*---------------------------------------------------------------------------*/ 170/*---------------------------------------------------------------------------*/
171 171
172#ifdef EDMA3_RES_USER_REQ
173/*Global variable to hold the recently allocated PARAM ID*/
174uint32_t edma3AllocPaRAMId = 0;
175#endif
176
172EDMA3_DRV_Result EDMA3_DRV_requestChannel (EDMA3_DRV_Handle hEdma, 177EDMA3_DRV_Result EDMA3_DRV_requestChannel (EDMA3_DRV_Handle hEdma,
173 uint32_t *pLCh, 178 uint32_t *pLCh,
174 uint32_t *pTcc, 179 uint32_t *pTcc,
@@ -650,6 +655,10 @@ EDMA3_DRV_Result EDMA3_DRV_requestChannel (EDMA3_DRV_Handle hEdma,
650 EDMA3_DVT_dNONE)); 655 EDMA3_DVT_dNONE));
651#endif /* EDMA3_INSTRUMENTATION_ENABLED */ 656#endif /* EDMA3_INSTRUMENTATION_ENABLED */
652 657
658#ifdef EDMA3_RES_USER_REQ
659/*Assign the PaRAM Id to the gloal variable*/
660 edma3AllocPaRAMId = paRAMId;
661#endif
653 return result; 662 return result;
654} 663}
655 664
@@ -2264,6 +2273,15 @@ EDMA3_DRV_Result EDMA3_DRV_disableLogicalChannel (EDMA3_DRV_Handle hEdma,
2264 return result; 2273 return result;
2265 } 2274 }
2266 2275
2276#ifdef EDMA3_RES_USER_REQ
2277/*Only for Testing purpose*/
2278/** Return the Param ID recently allocated for an EDMA request*/
2279uint32_t EDMA3_DRV_getAllocatedPARAMId()
2280{
2281 return edma3AllocPaRAMId;
2282}
2283#endif
2284
2267/* Definitions of Local functions - Start */ 2285/* Definitions of Local functions - Start */
2268/** Remove various mappings and do cleanup for DMA/QDMA channels */ 2286/** Remove various mappings and do cleanup for DMA/QDMA channels */
2269static EDMA3_DRV_Result edma3RemoveMapping (EDMA3_DRV_Handle hEdma, 2287static EDMA3_DRV_Result edma3RemoveMapping (EDMA3_DRV_Handle hEdma,