Other Parts Discussed in Thread: OMAPL138, PCM1753
Note: This is a modification of the source found at
http://software-dl.ti.com/dsps/dsps_public_sw/c6000/web/c6747_audio_edma_app/latest/index_FDS.html
c6747_audio_edma_v4.zip
modified for use with OMAP_L138 ect.. on our hardware.
Attached are 3 files 1512.xmtadd.zip for referance to the modificiations below.
I'm trying to turn on a second xmt D/A converter and add it to the edma - ping pong system.
The second D/A is connected to AXR[9] and is the same physical part as the first one connected to AXR[8]. Both receive the same F/S, MCLK, and BCLK.
The second D/A does work in polling.
Hear are the changes / additions to add it into the xmt edma system.
-------------------------------------------------------------------
In mcasp.c
change
void *mcasp_xmt0_register = (void *)(MCASP_REG_BASE + 0x2000); // DMA XBUF
void *mcasp_rcv0_register = (void *)(MCASP_REG_BASE + 0x2000); // DMA RBUF
to use DMA T/X buffer instead of the Peripheral Configuration bus
change
MCASP->XFMT = 0x000080F0; // 0 = XBUSEL for DMA
no change MCASP->SRCTL8 = 0x000D; // 8 = xmit
but
added MCASP->SRCTL9 = 0x000D; // 9 = xmit
changed MCASP->PDIR = 0x14000300; // aux 8 and 9 out's
-------------------------------------------------------------------
In audio.c
no changes hear
#define SAMPLES_PER_BUF 16 //3072 //48 //16 //128 // Whatever you want
#define BYTES_PER_SAMPLE 4
#define BUF_LENGTH SAMPLES_PER_BUF
---
added 2 more ping xmit and 2 more pong buffers
xmt_ping_ch3[BUF_LENGTH], xmt_pong_ch3[BUF_LENGTH],
xmt_ping_ch4[BUF_LENGTH], xmt_pong_ch4[BUF_LENGTH];
i.e
volatile Uint32 rcv_ping_ch1[BUF_LENGTH], rcv_pong_ch1[BUF_LENGTH],
rcv_ping_ch2[BUF_LENGTH], rcv_pong_ch2[BUF_LENGTH],
xmt_ping_ch1[BUF_LENGTH], xmt_pong_ch1[BUF_LENGTH],
xmt_ping_ch2[BUF_LENGTH], xmt_pong_ch2[BUF_LENGTH],
xmt_ping_ch3[BUF_LENGTH], xmt_pong_ch3[BUF_LENGTH],
xmt_ping_ch4[BUF_LENGTH], xmt_pong_ch4[BUF_LENGTH];
added 2 more process calls to audio_run
i.e.
process(&rcv_ping_ch1, &xmt_ping_ch1);
process(&rcv_ping_ch2, &xmt_ping_ch2);
process(&rcv_ping_ch1, &xmt_ping_ch3);
process(&rcv_ping_ch2, &xmt_ping_ch4);
---
changed
from
setup_edma_pingpong_xmt(&xmt_ping_ch1, &xmt_pong_ch1,
&xmt_ping_ch2, &xmt_pong_ch2, mcasp_xmt0_register,
BYTES_PER_SAMPLE, SAMPLES_PER_BUF, 2);
to
setup_edma_pingpong_xmt(&xmt_ping_ch1, &xmt_pong_ch1,
&xmt_ping_ch4, &xmt_pong_ch4, mcasp_xmt0_register, <----- mcasp_xmt0_register = DMA XBUF
BYTES_PER_SAMPLE, SAMPLES_PER_BUF, 4);
-------------------------------------------------------------------
no changes to
edma3.c
i.e
void setup_edma_pingpong_xmt(void *src_ping_L, <------------------ &xmt_ping_ch1
void *src_pong_L, <------------------ &xmt_pong_ch1
void *src_ping_R, <------------------ &xmt_ping_ch4
void *src_pong_R, <------------------ &xmt_pong_ch4
void *dst, <---------- mcasp_xmt0_register = DMA XBUF
Uint32 sample_size, Uint32 sample_count, Uint32 num_channels)
| | |
// BYTES_PER_SAMPLE 4, SAMPLES_PER_BUF = SAMPLES_PER_BUF, 4
{
CSL_Edma3ccParamSetRegs param;
Uint32 ping_offset = (Uint32)src_ping_R - (Uint32)src_ping_L,
pong_offset = (Uint32)src_pong_R - (Uint32)src_pong_L;
Int32 ping_c_idx = -ping_offset + sample_size,
pong_c_idx = -pong_offset + sample_size;
// 1. setup channel PaRAM slot
param.OPT = (EDMA_XMT_PING_TCC << 12) | (1 << 20); // transfer complete interrupt enabled
param.SRC = (Uint32)src_ping_L;
param.A_B_CNT = (num_channels << 16) | sample_size; // actual format: BCNT|ACNT
param.DST = (Uint32)dst;
param.SRC_DST_BIDX = (0 << 16) | ping_offset; // actual format: DSTBIDX|SCRBIDX
param.LINK_BCNTRLD = (num_channels << 16) | (EDMA_XMTPONG * 0x20); // actual format: BCNTRLD|LINK
param.SRC_DST_CIDX = (0 << 16) | (ping_c_idx & 0x0000FFFF); // actual format: DSTCIDX|SRCCIDX
param.CCNT = sample_count;
edmaWritePaRAM(EDMA_MCASPTXCH, ¶m);
// 2. setup ping PaRAM set (to be reloaded later)
edmaWritePaRAM(EDMA_XMTPING, ¶m);
// 3. setup pong PaRAM set (to be loaded and reloaded later)
param.OPT = (EDMA_XMT_PONG_TCC << 12) | (1 << 20); // transfer complete interrupt enabled
param.SRC_DST_BIDX = (0 << 16) | pong_offset; // actual format: DSTBIDX|SCRBIDX
param.LINK_BCNTRLD = (num_channels << 16) | (EDMA_XMTPING * 0x20); // actual format: BCNTRLD|LINK
param.SRC_DST_CIDX = (0 << 16) | (pong_c_idx & 0x0000FFFF); // actual format: DSTCIDX|SRCCIDX
param.SRC = (Uint32)src_pong_L;
edmaWritePaRAM(EDMA_XMTPONG, ¶m);
}
same as before
Note: the change to use DMA XBUF instead of Peripheral Configuration bus does work for using a single xmt D/A....
-------------------
What I am observing is there is no interrupt / event happening for the xmt.
As I read from SPRUH77A–October 2011 --- 25.2.4.3.2 Transfers through the DMA Port --- page 1096
"
For transmit operations through the DMA port, the DMA/CPU should write to the same XBUF DMA port
address to service all of the active transmit serializers. In addition, the DMA/CPU should write to the XBUF
for all active transmit serializers in incremental (although not necessarily consecutive) order. For example,
if serializers 0, 4, 5, and 7 are set up as active transmitters, the DMA/CPU should write to the XBUF DMA
port address four times with data for serializers 0, 4, 5, and 7 upon each transmit data ready event. This
exact servicing order must be followed so that data appears in the appropriate serializers.
"
In my case I have serializers
MCASP->SRCTL8 = 0x000D; // 8 = xmit
MCASP->SRCTL9 = 0x000D; // 9 = xmit
i.e. 8 and 9 set as active transmit serializers.
So if my edma is set up correctly i.e
param.DST = mcasp_xmt0_register = DMA XBUF
BCNT| = 4
etc.
Should work, yes?
Is there any thing I could be missing etc. ether in setting up McASP and or the edma PaRAM set's ?
causing no events for xmt?
Thanks
