Mcbsp error

Hello everybody;

i try to insmod my mcbsp driver but i obtain these errors. Ijust try
to init and exit. What is the reason do you have any idea?

ERROR:
[75640.283355] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[75640.291900] pgd = ce798000
[75640.294891] [00000000] *pgd=8e6c8031, *pte=00000000, *ppte=00000000
[75640.301239] Internal error: Oops: 17 [#6] PREEMPT
[75640.305938] last sysfs file: /sys/devices/platform/i2c_omap.1/
i2c-1/1-0049/twl4030_pwrbutton/input/input1/capabilities/sw
[75640.316955] Modules linked in: mcbsp_start_2_dif1(+)
mcbsp_start_2_dif(+) mcbsp_start_1_req(+) mcbsp_start_1_conf4(+)
mcbsp_start_1_conf3(+) mcbsp_start_]
[75640.346496] CPU: 0 Tainted: G D W (2.6.32 #3)
[75640.351776] PC is at omap_mcbsp_config+0x28/0xb0
[75640.356445] LR is at mcbsp_init+0x18/0x44 [mcbsp_start_2_dif1]
[75640.362304] pc : [<c0055a54>] lr : [<bf17b048>] psr: 80000013
[75640.362304] sp : cdc29f58 ip : 00000000 fp : 00000000
[75640.373840] r10: 00000004 r9 : cdc28000 r8 : c003c144
[75640.379089] r7 : 00000000 r6 : bf17b030 r5 : bf17b0c8 r4 :
00000000
[75640.385650] r3 : c06758a4 r2 : cdc28000 r1 : 00000000 r0 :
00000000
[75640.392211] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment user
[75640.399383] Control: 10c5387d Table: 8e798019 DAC: 00000015
[75640.405151] Process insmod (pid: 4210, stack limit = 0xcdc282f0)
[75640.411193] Stack: (0xcdc29f58 to 0xcdc2a000)
[75640.415588]
9f40: 00000000
c003b384
[75640.423797] 9f60: 00000c74 bf17b0c8 00000000 00012018 c003c144
00000000 bf17b0c8 00000000
[75640.432037] 9f80: 00012018 c00a0214 00000004 cf817980 cdf391c0
4000e920 00004000 00012018
[75640.440246] 9fa0: 00000080 c003bfc0 4000e920 00004000 00012018
00000c74 00012008 00000001
[75640.448486] 9fc0: 4000e920 00004000 00012018 00000080 00012008
00000000 00000004 00000000
[75640.456695] 9fe0: bec97e72 bec97bfc 00008e90 400e9264 60000010
00012018 00000000 00000000
[75640.464935] [<c0055a54>] (omap_mcbsp_config+0x28/0xb0) from
[<bf17b048>] (mcbsp_init+0x18/0x44 [mcbsp_start_2_dif1])
[75640.475555] [<bf17b048>] (mcbsp_init+0x18/0x44
[mcbsp_start_2_dif1]) from [<c003b384>] (do_one_initcall+0x5c/0x1bc)
[75640.486053] [<c003b384>] (do_one_initcall+0x5c/0x1bc) from
[<c00a0214>] (sys_init_module+0xc0/0x1f0)
[75640.495239] [<c00a0214>] (sys_init_module+0xc0/0x1f0) from
[<c003bfc0>] (ret_fast_syscall+0x0/0x2c)
[75640.504364] Code: e59f1084 e59f0084 ea10cf37 e59f3080 (e1d110b0)
[75640.515167] ---[ end trace d622b392ba50038f ]---
Segmentation fault

CODE:

#include <linux/init.h>
#include <linux/module.h>
#include <plat/mcbsp.h>

MODULE_LICENSE("GPL");

const struct omap_mcbsp_reg_cfg *config;

static int mcbsp_init(void)
{
  omap_mcbsp_config(0, config);

  omap_mcbsp_start(0,500,700);
  printk(KERN_INFO "Hello,world\n");
  return 0;
}

static int mcbsp_exit(void)
{

  omap_mcbsp_stop(0,500,500);

  printk(KERN_INFO "goodbye all\n");
  return 0;
}

module_init(mcbsp_init);
module_exit(mcbsp_exit);

#include <linux/init.h>
#include <linux/module.h>
#include <plat/mcbsp.h>

MODULE_LICENSE("GPL");

const struct omap_mcbsp_reg_cfg *config;

static int mcbsp_init(void)
{
  omap_mcbsp_config(0, config);

  omap_mcbsp_start(0,500,700);
  printk(KERN_INFO "Hello,world\n");
  return 0;
}

static int mcbsp_exit(void)
{

  omap_mcbsp_stop(0,500,500);

  printk(KERN_INFO "goodbye all\n");
  return 0;
}

module_init(mcbsp_init);
module_exit(mcbsp_exit);

please refer to arch/arm/plat-omap/mcbsp.c and use the OMAP McBSP APIs
carefully.
about the lsmod runtime error, you had a non-initialised pointer
'config'. You should fill up the struct by yourself.

Thanks a lot for your answer. I did what you said and the new error
appears. Can you enlighten me more ?

CODE:

#include <linux/init.h>
#include <linux/module.h>
#include <plat/mcbsp.h>

#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/wait.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>

#include <plat/dma.h>
#include <plat/mcbsp.h>

#include "../mach-omap2/cm-regbits-34xx.h"
void defining_config_values(struct omap_mcbsp_reg_cfg *config);

MODULE_LICENSE("GPL");

const struct omap_mcbsp_reg_cfg *config;

void defining_config_values(struct omap_mcbsp_reg_cfg *config){
config->spcr2=0x10;
config->spcr1=0x14;
config->rcr2=0x18;
config->rcr1=0x1c;
config->xcr2=0x20;
config->xcr1=0x24;
config->srgr2=0x28;
config->srgr1=0x2c;
config->mcr2=0x30;
config->mcr1=0x34;
config->pcr0=0x48;
config->rcerc=0x4c;
config->rcerd=0x50;
config->xcerc=0x54;
config->rcerd=0x58;
config->rcere=0x5c;
config->rcerf=0x60;
config->xcere=0x64;
config->xcerf=0x68;
config->rcerg=0x6c;
config->rcerh=0x70;
config->xcerg=0x74;
config->xcerh=0x78;
config->xccr=0xac;
config->rccr=0xb0;

}

static int mcbsp_init(void)
{

  const struct omap_mcbsp_reg_cfg *config;

  defining_config_values(config);
  omap_mcbsp_config(0, config);
  omap_mcbsp_start(0,10,20);
  printk(KERN_INFO "Hello,world\n");
  return 0;
}

static int mcbsp_exit(void)
{

  omap_mcbsp_stop(0,10,20);

  printk(KERN_INFO "goodbye all\n");
  return 0;
}

module_init(mcbsp_init);
module_exit(mcbsp_exit);

ERROR:
root@beagleboard:/temp/driver# insmod mcbsp_start_2_dif1.ko
[ 7034.660461] Unable to handle kernel NULL pointer dereference at
virtual address 00000030
[ 7034.669006] pgd = cea5c000
[ 7034.671722] [00000030] *pgd=8ebd2031, *pte=00000000, *ppte=00000000
[ 7034.678314] Internal error: Oops: 817 [#1] PREEMPT
[ 7034.683135] last sysfs file: /sys/devices/platform/i2c_omap.1/
i2c-1/1-0049/twl4030_pwrbutton/input/input1/capabilities/sw
[ 7034.694122] Modules linked in: mcbsp_start_2_dif1(+) mcbsp_short
bufferclass_ti omaplfb pvrsrvkm rfcomm ircomm_tty ircomm irda ipv6
hidp l2cap bluetooth l
[ 7034.708587] CPU: 0 Tainted: G W (2.6.32 #3)
[ 7034.713867] PC is at defining_config_values+0x4/0xc4
[mcbsp_start_2_dif1]
[ 7034.720672] LR is at mcbsp_init+0x10/0x40 [mcbsp_start_2_dif1]
[ 7034.726531] pc : [<bf132004>] lr : [<bf132104>] psr: 60000013
[ 7034.726562] sp : ce8dff58 ip : ce8dff48 fp : 00000000
[ 7034.738098] r10: 00000004 r9 : ce8de000 r8 : c003c144
[ 7034.743347] r7 : 00000000 r6 : bf1320f4 r5 : bf132190 r4 :
00000000
[ 7034.749908] r3 : 000000b0 r2 : ce8de000 r1 : 00000000 r0 :
00000000
[ 7034.756469] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment user
[ 7034.763641] Control: 10c5387d Table: 8ea5c019 DAC: 00000015
[ 7034.769409] Process insmod (pid: 1333, stack limit = 0xce8de2f0)
[ 7034.775451] Stack: (0xce8dff58 to 0xce8e0000)
[ 7034.779815]
ff40: 00000000
c003b384
[ 7034.788055] ff60: 00000d82 bf132190 00000000 00012018 c003c144
00000000 bf132190 00000000
[ 7034.796264] ff80: 00012018 c00a0214 00000004 cdc7ba80 cea5a6c0
4000e920 00004000 00012018
[ 7034.804504] ffa0: 00000080 c003bfc0 4000e920 00004000 00012018
00000d82 00012008 00000001
[ 7034.812713] ffc0: 4000e920 00004000 00012018 00000080 00012008
00000000 00000004 00000000
[ 7034.820953] ffe0: bee40e72 bee40bfc 00008e90 400e9264 60000010
00012018 00000000 00000000
[ 7034.829193] [<bf132004>] (defining_config_values+0x4/0xc4
[mcbsp_start_2_dif1]) from [<bf132104>] (mcbsp_init+0x10/0x40
[mcbsp_start_2_dif1])
[ 7034.841979] [<bf132104>] (mcbsp_init+0x10/0x40
[mcbsp_start_2_dif1]) from [<c003b384>] (do_one_initcall+0x5c/0x1bc)
[ 7034.852508] [<c003b384>] (do_one_initcall+0x5c/0x1bc) from
[<c00a0214>] (sys_init_module+0xc0/0x1f0)
[ 7034.861694] [<c00a0214>] (sys_init_module+0xc0/0x1f0) from
[<c003bfc0>] (ret_fast_syscall+0x0/0x2c)
[ 7034.870788] Code: bad PC value
[ 7034.878509] ---[ end trace 0741c01e9bb90772 ]---
Segmentation fault

ı hope answer me ASAP.

Fatih

I used to use the McBSP port, but failed, unfortunately.

First, you need to REQUEST the McBSP resource, the function is:
int omap_mcbsp_request(unsigned int id)
Dose it match what you have? The range is 1~5.
Second, you need to config the McBSP. use the following function:
void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
Third, you can start the McBSP by using:
void omap_mcbsp_start(unsigned int id)
You used 'omap_mcbsp_start(0,500,700)' which is different from mine.
Then you can use other funcs to transmit the bytes.

all done, then stop and free.
May it helps you.

The previous poster is correct, you need to request a mcbsp
device first.
You can use the typedefs in <plat/mcbsp.h> for the id.

In my case, I was using MCBSP3 (on a gumstix) so

omap_mcbsp_request(OMAP_MCBSP3);

The start/stop calls use the same id. The tx/rx parameters
are just flags to enable the tx or rx channels respectively.

They are used this way in plat-omap/mcbsp.c - omap_mcbsp_start()
...
  /* Enable transmitter and receiver */
  tx &= 1;
  w = MCBSP_READ_CACHE(mcbsp, SPCR2);
  MCBSP_WRITE(mcbsp, SPCR2, w | tx);

  rx &= 1;
  w = MCBSP_READ_CACHE(mcbsp, SPCR1);
  MCBSP_WRITE(mcbsp, SPCR1, w | rx);
..

So you probably want

omap_mcbsp_start(OMAP_MCBSP3, 1, 1);
and
omap_mcbsp_stop(OMAP_MCBSP3, 1, 1);

though that depends on what you are doing.

When you are done, call omap_mcbsp_free to release the device.

omap_mcbsp_free(OMAP_MCBSP3)

When you post your reg_cfg settings, it would be better if you use
the
constants and macros in <plat/mcbsp.h> rather than just numbers. That
way anyone who might help you doesn't have to do as much work.

Thanks a lot for your help. I successfully insmod my mcbsp module with
request, config, start ,stop and free. I write the code below if
someone interested this may help.

The further step is writing read and write but i have no idea for
them. Could you help me for these steps also? Should i make char
device and if yes can you infer me the starting point?

and also if there is a mistake in my code correct me :slight_smile:

CODE:

#include <linux/init.h>
#include <linux/module.h>
#include <plat/mcbsp.h>

#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/wait.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>

#include <plat/dma.h>
#include <plat/mcbsp.h>

#include "../mach-omap2/cm-regbits-34xx.h"

MODULE_LICENSE("GPL");

static int mcbsp_init(void)
{

  struct omap_mcbsp_reg_cfg *config;
  config=kmalloc(sizeof(struct omap_mcbsp_reg_cfg),GFP_KERNEL);

   omap_mcbsp_request(OMAP_MCBSP1);

  config->spcr2=OMAP_MCBSP_REG_SPCR2;
  config->spcr1=OMAP_MCBSP_REG_SPCR1;
  config->rcr2=OMAP_MCBSP_REG_RCR2;
  config->rcr1=OMAP_MCBSP_REG_RCR1;
  config->xcr2=OMAP_MCBSP_REG_XCR2;
  config->xcr1=OMAP_MCBSP_REG_XCR1;
  config->srgr2=OMAP_MCBSP_REG_SRGR2;
  config->srgr1=OMAP_MCBSP_REG_SRGR1;
  config->mcr2=OMAP_MCBSP_REG_MCR2;
  config->mcr1=OMAP_MCBSP_REG_MCR1;
  config->pcr0=OMAP_MCBSP_REG_PCR0;
  config->rcerc=OMAP_MCBSP_REG_RCERC;
  config->rcerd=OMAP_MCBSP_REG_RCERD;
  config->xcerc=OMAP_MCBSP_REG_XCERC;
  config->xcerd=OMAP_MCBSP_REG_XCERD;
  config->rcere=OMAP_MCBSP_REG_RCERE;
  config->rcerf=OMAP_MCBSP_REG_RCERF;
  config->xcere=OMAP_MCBSP_REG_XCERE;
  config->xcerf=OMAP_MCBSP_REG_XCERF;
  config->rcerg=OMAP_MCBSP_REG_RCERG;
  config->rcerh=OMAP_MCBSP_REG_RCERH;
  config->xcerg=OMAP_MCBSP_REG_XCERG;
  config->xcerh=OMAP_MCBSP_REG_XCERH;
  config->xccr=OMAP_MCBSP_REG_XCCR;
  config->rccr=OMAP_MCBSP_REG_RCCR;

  omap_mcbsp_config(OMAP_MCBSP1, config);

  omap_mcbsp_start(OMAP_MCBSP1,1,1);
  printk(KERN_INFO "Hello,world\n");
  return 0;
}

static int mcbsp_exit(void)
{

  omap_mcbsp_stop(OMAP_MCBSP1,1,1);
  omap_mcbsp_free(OMAP_MCBSP1);

  printk(KERN_INFO "goodbye all\n");
  return 0;
}

module_init(mcbsp_init);
module_exit(mcbsp_exit);

Fatih

You just set all the config register values to their offsets.
That's no good.

You need to look at OMAP35x TRM chapter 20 on the McBSP.
Section 20.7 has the register definitions.

For instance, I use settings like this

static struct omap_mcbsp_reg_cfg mcbsp_dma_config = {
        .spcr2 = FREE,
        .spcr1 = RJUST(RIGHT_JUSTIFY_AND_SIGN_EXTEND_MSB) | RINTM(3),
        .rcr2 = RDATDLY(0),
        .rcr1 = RFRLEN1(DEFAULT_NUM_ADC_CHANNELS - 1)
      > RWDLEN1(OMAP_MCBSP_WORD_24),
        .xcr2 = 0,
        .xcr1 = 0,
        .srgr1 = FWID(95) | CLKGDV(56),
        .srgr2 = CLKSM | FSGM | FPER(255),
  .mcr2 = 0,
  .mcr1 = 0,
        .pcr0 = CLKXM | CLKRM | FSXM | FSRM,
  .xccr = 0,
  .rccr = RFULL_CYCLE | RDMAEN | RDISABLE,
};

Those constants like CLKXM or macros like FWID() come from
<plat/mcbsp.h>

The settings I am using will almost certainly not work for you
unless you just happen to be connecting to the same device with
the same operational requirements. Very unlikely.
Mine is a frame-sync slave device so I've configured the McBSP3
as a frame-sync master. You probably don't even want that.

You will have to determine your own settings depending on your
device.

I have a char device driver example here

http://github.com/scottellis/overo-char-dev-template

but you can find generic examples plenty of other places.

hELLO again;

I dont want to open new dicussion for it. For the latest step i
successfully register mcbsp as char device. Now the errors are related
to read and write. I againd sent code and error. I really appreciate
if you can can correct me. Thanks in advance.

CODE:

#include <linux/init.h>
#include <linux/module.h>
#include <plat/mcbsp.h>

#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/wait.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>

#include <plat/dma.h>
#include <plat/mcbsp.h>

#include <asm/uaccess.h>

#include "../mach-omap2/cm-regbits-34xx.h"

#include <linux/fs.h>

MODULE_LICENSE("GPL");

static int mcbsp_open(struct inode *inode, struct file *filep)
{

printk("Device open\n");
return 0;
}
static int mcbsp_release(struct inode *inode, struct file *filep)
{
printk("Device closed\n");
return 0;
}

static ssize_t mcbsp_read(struct file *filep, char *buf, size_t count,
loff_t *f_pos)
{

char user_buf;
dma_addr_t buffer;
u16 max_thresh=omap_mcbsp_get_max_rx_threshold(OMAP_MCBSP1);
omap_mcbsp_set_rx_threshold(OMAP_MCBSP1,max_thresh);

omap_mcbsp_recv_buffer(OMAP_MCBSP1,buffer,128);

omap_mcbsp_recv_word(OMAP_MCBSP1);

copy_to_user(buf,&user_buf,128);

printk("Reading...\n");
return 0;
}

static ssize_t mcbsp_write(struct file *filep, const char *buf, size_t
count, loff_t *f_pos)
{

u32 word;
dma_addr_t buffer;

char *user_buff;

copy_from_user(user_buff, buf, 127);

u16 max_thresh=omap_mcbsp_get_max_tx_threshold(OMAP_MCBSP1);
omap_mcbsp_set_tx_threshold(OMAP_MCBSP1,max_thresh);

omap_mcbsp_xmit_buffer(OMAP_MCBSP1,buffer,128);

omap_mcbsp_xmit_word(OMAP_MCBSP1, word);

printk("Writing...\n");
return 0;
}

struct file_operations mcbsp_fops =
{
owner:THIS_MODULE,
open:mcbsp_open,
release:mcbsp_release,
read:mcbsp_read,
write:mcbsp_write,
};

static int mcbsp_init(void)
{

  int result;

  struct omap_mcbsp_reg_cfg *config;
  config=kmalloc(sizeof(struct omap_mcbsp_reg_cfg),GFP_KERNEL);

   omap_mcbsp_request(OMAP_MCBSP1);

  config->spcr2=OMAP_MCBSP_REG_SPCR2;
  config->spcr1=OMAP_MCBSP_REG_SPCR1;
  config->rcr2=OMAP_MCBSP_REG_RCR2;
  config->rcr1=OMAP_MCBSP_REG_RCR1;
  config->xcr2=OMAP_MCBSP_REG_XCR2;
  config->xcr1=OMAP_MCBSP_REG_XCR1;
  config->srgr2=OMAP_MCBSP_REG_SRGR2;
  config->srgr1=OMAP_MCBSP_REG_SRGR1;
  config->mcr2=OMAP_MCBSP_REG_MCR2;
  config->mcr1=OMAP_MCBSP_REG_MCR1;
  config->pcr0=OMAP_MCBSP_REG_PCR0;
  config->rcerc=OMAP_MCBSP_REG_RCERC;
  config->rcerd=OMAP_MCBSP_REG_RCERD;
  config->xcerc=OMAP_MCBSP_REG_XCERC;
  config->xcerd=OMAP_MCBSP_REG_XCERD;
  config->rcere=OMAP_MCBSP_REG_RCERE;
  config->rcerf=OMAP_MCBSP_REG_RCERF;
  config->xcere=OMAP_MCBSP_REG_XCERE;
  config->xcerf=OMAP_MCBSP_REG_XCERF;
  config->rcerg=OMAP_MCBSP_REG_RCERG;
  config->rcerh=OMAP_MCBSP_REG_RCERH;
  config->xcerg=OMAP_MCBSP_REG_XCERG;
  config->xcerh=OMAP_MCBSP_REG_XCERH;
  config->xccr=OMAP_MCBSP_REG_XCCR;
  config->rccr=OMAP_MCBSP_REG_RCCR;

  omap_mcbsp_config(OMAP_MCBSP1, config);

  omap_mcbsp_start(OMAP_MCBSP1,1,1);

   result = register_chrdev(30, "mcbsp", &mcbsp_fops);
  if (result<0)
  printk(KERN_INFO "device registration failed");

  printk(KERN_INFO "Hello,world\n");
  return 0;
}

static int mcbsp_exit(void)
{

  omap_mcbsp_stop(OMAP_MCBSP1,1,1);
  omap_mcbsp_free(OMAP_MCBSP1);
  unregister_chrdev(30, "mcbsp");

  printk(KERN_INFO "goodbye all\n");
  return 0;
}

module_init(mcbsp_init);
module_exit(mcbsp_exit);

While doing $echo "Something" > /dev/mcbsp

ERROR:

[ 348.954284] Device open
[ 348.956909] omap-mcbsp omap-mcbsp.1: McBSP1 TX DMA on channel 0
[ 348.963745] DMA transaction error with device 31
[ 495.000152] INFO: task sh:1039 blocked for more than 120 seconds.
[ 495.006286] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 495.014190] sh D c0489d74 0 1039 1037 0x00000001
[ 495.020507] [<c0489d74>] (schedule+0x49c/0x534) from [<c048a444>]
(schedule_timeout+0x1c/0x308)
[ 495.029266] [<c048a444>] (schedule_timeout+0x1c/0x308) from
[<c048a2c8>] (wait_for_common+0xf0/0x1a4)
[ 495.039245] [<c048a2c8>] (wait_for_common+0xf0/0x1a4) from
[<c0055d28>] (omap_mcbsp_xmit_word+0x48/0x74)
[ 495.048828] [<c0055d28>] (omap_mcbsp_xmit_word+0x48/0x74) from
[<bf12c078>] (0xbf12c078)

You have to use legitimate values for the McBSP register
configuration.

This stuff doesn't make any sense.

        config->spcr2=OMAP_MCBSP_REG_SPCR2;
        config->spcr1=OMAP_MCBSP_REG_SPCR1;
        config->rcr2=OMAP_MCBSP_REG_RCR2;
        config->rcr1=OMAP_MCBSP_REG_RCR1;
        config->xcr2=OMAP_MCBSP_REG_XCR2;
        config->xcr1=OMAP_MCBSP_REG_XCR1;
        config->srgr2=OMAP_MCBSP_REG_SRGR2;
        config->srgr1=OMAP_MCBSP_REG_SRGR1;
        config->mcr2=OMAP_MCBSP_REG_MCR2;
        config->mcr1=OMAP_MCBSP_REG_MCR1;
        config->pcr0=OMAP_MCBSP_REG_PCR0;
        config->rcerc=OMAP_MCBSP_REG_RCERC;
        config->rcerd=OMAP_MCBSP_REG_RCERD;
        config->xcerc=OMAP_MCBSP_REG_XCERC;
        config->xcerd=OMAP_MCBSP_REG_XCERD;
        config->rcere=OMAP_MCBSP_REG_RCERE;
        config->rcerf=OMAP_MCBSP_REG_RCERF;
        config->xcere=OMAP_MCBSP_REG_XCERE;
        config->xcerf=OMAP_MCBSP_REG_XCERF;
        config->rcerg=OMAP_MCBSP_REG_RCERG;
        config->rcerh=OMAP_MCBSP_REG_RCERH;
        config->xcerg=OMAP_MCBSP_REG_XCERG;
        config->xcerh=OMAP_MCBSP_REG_XCERH;
        config->xccr=OMAP_MCBSP_REG_XCCR;
        config->rccr=OMAP_MCBSP_REG_RCCR;

Sorry about my last post, i have missed your post about
configurations. By the way, i am planning to use mcbsp1 in order to
obtain high speed data with DMA receiver mode. Through the OMAP 3530
TRM i reconfigured MCBSP as below. Could you look at for any
misconfiguration:

conf CODE:
static struct omap_mcbsp_reg_cfg config = {

        .spcr2=XRST | FRST | GRST | XINTM(1),
        .spcr1=RRST | DLB | ALB | RJUST(2),
        .rcr2=RDATDLY(0),
        .rcr1= RFRLEN1(127) | RWDLEN1(OMAP_MCBSP_WORD_32),
        .xcr2=0,
        .xcr1=0,
        .srgr2=GSYNC | FPER(255),
        .srgr1=FWID(128),
        .mcr2=0,
        .mcr1=RMCM,
        .pcr0=CLKXM | CLKRM | FSXM | FSRM | FSRP | CLKRP,
        .xccr=0,
        .rccr=RDMAEN,

};

Now, i have to read data with mcbsp. I open character device with your
template but i dont know how to read data with mcbsp. Could you help
me with it.

Furthermore this is further question. The mcbsp.h and mcbsp.c does not
support multichannel mode as it is written. In the book, there is
multichannel configurations but in the mcbsp codes, they are not. So,
how can i use multichannel mode?

Fatih

Hello,

I know it’s old thread.
But did you resolve it ?

Can you please share the solution if possible ?

Thank you!
Ran