Hello,
I'm using the OMAPL138 board running Linux with mcbsp_test module.
when I run the:
insmod mcbsp_test.ko buf_size=512 num_pkts=3 master=1 tx_rx=3 dlb=1
its works fine (DLB=1) , I can see the incomming data. I'm using mcbsp1 since mcbsp0 used by LAN
But
when I try to run it with external wire loopback its fails (DR connected to DX ,FSR to FSX,CLKR to CLKX)
For doing this I have modife the mcbsp.c PCR register, so TX side will be master and RX side will be slave , in original mcbsp.c both RX and TX was configure as master.
I can see the DX,CLKX signals on scope but not the FSX ... I think this is why its not works, but I dont know how to make the FSX run
see below the code modification and the running results:
Code:
/**
* davinci_mcbsp_config_pcr: Configure the Port Contorl Register
* @dev: McBSP device pointer
*
* Called by the McBSP configuration fucntion to program the port as
* inputs or outputs for master or slave operation
*/
static void davinci_mcbsp_config_pcr_shaul(struct davinci_mcbsp_dev *dev)
{
u32 val = 0;
if (dev->master == 1) //tx master
val |= (CLKXM | FSXM);
if (dev->master == 2) //rx master
val |= (CLKRM | FSRM);
if (dev->master == 3) //tx & rx master
val |= (CLKXM | CLKRM | FSXM | FSRM);
if (dev->master == 0) //slave
val |= SCLKME;
davinci_mcbsp_write_reg(dev, MCBSP_PCR, val);
if (dev->master == 0) {
/* clock source from CLKR */
val = davinci_mcbsp_read_reg(dev, MCBSP_SRGR);
val &= ~CLKSM;
davinci_mcbsp_write_reg(dev, MCBSP_SRGR, val);
}
}
Monitor results:
(I have added some printk started with "shaul")
root@da850-omapl138-evm:/home/mcbsp# insmod mcbsp_test.ko buf_size=512 num_pkts=
3 master=1 tx_rx=3
Starting McBSP test
Request for McBSP1 sucessful
shaul davinci_mcbsp_config_pcr_shaul:value writen to MCBSP_PCR 2560(0xa00)
shaul davinci_mcbsp_config_clock:Clock rate is 150000000, Freq is 48000
shaul davinci_mcbsp_config_clock:The divider value is 47(0x2f)
value written to SRGR is 303f002f
shaul:before davinci_mcbsp_config_fifo()
shaul:after davinci_mcbsp_config_fifo()
shaul:before davinci_mcbsp_config_multichannel_mode()
shaul:after davinci_mcbsp_config_multichannel_mode()
No DLB mode
Starting McBSP RX
shaul;davinci_mcbsp_start_rx:Configuring RX in master mode master=1
shaul:davinci_mcbsp_start_rx:Configuring RX in master mode
Transmitting Packet 1
Starting McBSP TX
shaul:davinci_mcbsp_start_tx:start master=1
shaul:davinci_mcbsp_start_tx:Configuring TX master mode
McBSP started
Receving data...
shaul:davinci_mcbsp_recv_buf:Triggering the receiver
shaul:davinci_mcbsp_trigger_rx:Configuring RX in master mode
shaul:davinci_mcbsp_recv_buf:--after--Triggering the receiver
Here its stack.
Did someone test the mcbsp_test with external loopback?
How to make FSX run?
Thanks
Shaul