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