Hi,
I have port pspdrivers for C6748 from pdk_C6748_2_0_0_0 to DM8168 C674x DSP core.
I only use mcasp driver and audio sample.
In our case , we use two serializers for Recv(each has 16TDM slots) and two serializers for Xfer(each has 16 TDM slots).
Both of them work as slave.
We have done it on A8 linux alsa, now we want to move all audio processing to DSP side
to decrease performance consumption on A8 and improve realtime performance.
I made some changes to the pspdriver:
1. EDMA event number
On C6748, the mcasp0 RX EDMA event is 0 and mcasp0 TX EDMA event is 1.
I changed mcasp0 RX EDMA event to 9 and mcasp0 TX EDMA event to 8 according DM8168 TRM.
2. mcasp0 registers offset
On C6748, the relative registers offset are:
----------
#define CSL_MCASP_0_CTRL_REGS (0x01D00000u)
#define CSL_MCASP_0_FIFO_REGS (0x01D01000u)
#define CSL_MCASP_0_DATA_REGS (0x01D02000u)
----------
while in DM8168 with enable mcasp edma accessing,they must be these:
----------
#define CSL_MCASP_0_CTRL_REGS (0x48038000u)
#define CSL_MCASP_0_FIFO_REGS (0x48039000u)
#define CSL_MCASP_0_DATA_REGS (0x46000000u)
----------
3. mcasp DSP cpu interrupt number
On C6748, there is only one cpu interrupt number 61 for both mcasp0 rx and tx while
there are two interrupts for mcasp0 on DM8168 DSP core.
70 is for mcasp0 tx and 71 is for mcasp0 rx.
So I changed them in pspdriver.
4. HwiNumber
In function audioUserMcaspInit in file audioSample_main.c.
audioMcaspParams.hwiNumber = 8;
I found 8 is the EDMA3_0_CC0_INT1, so I changed it to 20 for DM8168.
5. mcasp register configuration.
I had made the registers configurration and EDMA configuration are the same to those in configuration in Linux ALSA.
I also know that mcasp must be setup with strict order.
I enable sysclk for mcasp0 and init codec in A8 Linux side.
I am sure all of them are correct before I run my Audio testing on DM8168 C674x DSP core.
If sysclk for mcasp0 is disable, we couldn't access mcasp register correctly on DSP core.
I also add dependent modules and initialization for DM8168 C674x DSP core in mcfw/src_bios6/cfg/ti816x/BIOS_c6xdsp.cfg.
---------------
var ECM = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
ECM.eventGroupHwiNum[0] = 7;
ECM.eventGroupHwiNum[1] = 8;
ECM.eventGroupHwiNum[2] = 9;
ECM.eventGroupHwiNum[3] = 10;
var edma_drv_sample = xdc.loadPackage('ti.sdo.edma3.drv.sample');
edma_drv_sample.profile = "release"; //Use release version
var Memory = xdc.useModule('xdc.runtime.Memory');
var GIO = xdc.useModule('ti.sysbios.io.GIO');
/* allocate a config-params object */
var HeapParam = new HeapMem.Params;
/* optionally assign per-instance configs */
HeapParam.size = 180000;
/* create an instance-object */
Program.global.myHeap = HeapMem.create(HeapParam);
var iomFxns = "Mcasp_IOMFXNS";
var initFxn = "audioUserMcaspInit";
var deviceParams = "audioMcaspParams";
var deviceId = 0;
GIO.addDeviceMeta("/mcasp0", iomFxns, initFxn, deviceId, deviceParams);
var iomFxns = "Audio_IOMFXNS";
var initFxn = "audioUserAudioInit";
var deviceParams = "audioParams";
var deviceId = 0;
GIO.addDeviceMeta("/audio0", iomFxns, initFxn, deviceId, deviceParams);
var task0Params = new Task.Params();
task0Params.priority = 5;
task0Params.instance.name = "task_aud";
Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);
--------------
But when I start audio capture and/or playing, the mcaspIsr is calling all the time.
It seems that RX with error 'RCKFAIL' and/or 'RSYNCERR' and/or 'ROVRN' while
TX with error 'XCKFAIL' and/or 'XSYNCERR' and/or 'XUNDRN'.
There is no EDMA callback all the time.
If I disable interrupts for RX and TX and keep Mcasp_LOOPJOB_ENABLED on,
There is no EDMA callback all the time.
But when I check RX buffer which is set to EDMA destAddr,
the buffer contains data from EDMA(When I set them to 0, they will be changed to audio data again).
If I disable interrupts for RX and TX and remove Mcasp_LOOPJOB_ENABLED,
There will ony one EDMA callback for TX, but the EDMA result is failed.
I had no idea on these issue.
Is there anybody know how to get mcasp sys/bios driver work on DM8168?
Any help will be great appreciated.