I've been stuck on this for a while now so any help would be greatly appreciated.
I'm trying to configure the MCBSP4 for a simple polled read on a AM3703 running kernel 3.0.0, just to prove that the peripheral is reading things correctly. The problem is that RRDY is never being set and the call to omap_mcbsp_pollread always returns -2. The desired configuration is to have the McBSP4 be a slave device, so I have mcbsp4_clkx, mcbsp4_fsx, and mcbsp4_dr configured as inputs and the correct mode selected for those pins. I've scoped the lines and data, clock and frame sync are all there.
CONTROL_PADCONF_GPMC_NCS3[31:16] => IEN, PTD, DIS, M2 (mcbsp4_clkx) CONTROL_PADCONF_GPMC_NCS5[15:0] => IEN, PTD, DIS, M2 (mcbsp4_dr) CONTROL_PADCONF_GPMC_NCS7[15:0] => IEN, PTD, DIS, M2 (mcbsp4_fsx)
I actually mapped these registers in with my module so that I could confirm that they were set correctly before trying to access the peripheral. Now, from my kernel module I do the following;
omap_mcbsp_set_io_type(OMAP_MCBSP4,OMAP_MCBSP_POLL_IO); nErr=omap_mcbsp_request(OMAP_MCBSP4); if(nErr) { printk("Unable to acquire McBSP4\n"); } else { omap_mcbsp_config(OMAP_MCBSP4, &my_mcbsp_config); omap_mcbsp_start(OMAP_MCBSP4,0,1); for(i=0;i<8;i++) { nErr = omap_mcbsp_pollread(OMAP_MCBSP4, &iTemp); printk("Received 0x%08x, nErr=%d\n",iTemp,nErr); } }
In this code, I acquire the port without error, but receive -2 from omap_mcbsp_pollread() because RRDY is never set.
As specified in section 21.4.2.3 of the TRM to use FSX and CLKX as inputs, I've got CLKXM=1, EXTCLKGATE=1, DLB=0, GSYNC=0, FSRM=0, and CLKRM=0. Actual starting register config is given below.
.spcr2 = 0x00000200 (FREE) .spcr1 = 0x00004000 (RJUST(2)) .rcr2 = 0x000080A1 (RPHASE|RWDLEN2(5)|RDATDLY(1)) .rcr1 = 0x000000A0 (RWDLEN1(5)) .xcr2 = 0x000080A1 (RPHASE|RWDLEN2(5)|RDATDLY(1)) .xcr1 = 0x000000A0 (RWDLEN1(5)) .srgr2 = 0x00002000 (CLKSM) .srgr1 = 0x00001F01 (FWID(1F)|CLKGDV(1)) .mcr2 = 0x00000000 .mcr1 = 0x00000000 .pcr0 = 0x00000081 (SCLKME|CLKRP) .xccr = 0x00009801 (EXTCLKGATE|DXENDLY(1)|XFULL_CYCLE|XDISABLE) .rccr = 0x00000801 (RFULL_CYCLE|RDISABLE)
So, if I have configured this correctly it should be set for dual-phase with both phases having 32-bits of data, no multichannel - basically, standard I2S.
I'm probably overlooking something silly. If someone could point out the problem, I would greatly appreciate it.
Gary