usb gadget mass storage 驱动开发 问题求助?

lion4780 2008-09-25 08:55:11
各位高手:
最近,在做linux usb gadget,编译生成s3c2410_udc.ko 和 g_file_storage.ko后,insmod module
终端打印如下信息:
[root@(none) /]# insmod s3c2410_udc.ko
Using s3c2410_udc.ko
Reading data from NAND FLASH without ECC is not recommended

USB:s3c2410_udc: version 14 Mar 2004

hello Mr. zhao I am in driver_register

bus platform: add driver s3c2410-udc

[root@(none) /]# insmod g_file_storage.ko file=/dev/mtdblock/3 stall=0 removable=1
Using g_file_storage.ko
Reading data from NAND FLASH without ECC is not recommended

g_file_storage gadget: controller 'dummy_udc' not recognized

g_file_storage gadget: File-backed Storage Gadget, version: 20 October 2004

g_file_storage gadget: Number of LUNs=1

g_file_storage gadget-lun0: ro=0, file: /dev/mtdblock/3

hello Mr. zhao I am in driver_register

bus platform: add driver g_file_storage

usb 2-1: new full speed USB device using dummy_hcd and address 2

g_file_storage gadget: full speed config #1

scsi0 : SCSI emulation for USB Mass Storage devices

Vendor: Linux Model: File-Stor Gadget Rev: 0399

Type: Direct-Access ANSI SCSI revision: 02

SCSI device sda: 32768 512-byte hdwr sectors (17 MB)

sda: Write Protect is off

sda: assuming drive cache: write through

SCSI device sda: 32768 512-byte hdwr sectors (17 MB)

sda: Write Protect is off

sda: assuming drive cache: write through

/dev/scsi/host0/bus0/target0/lun0:<4>Reading data from NAND FLASH without ECC is not recommended

unknown partition table

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0

但pc机端,抓不到任何数据,usb_probe 函数也没有被执行什么原因啊?
...全文
1572 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lion4780 2008-12-25
  • 打赏
  • 举报
回复
问题还没解决,继续期待答案
lion4780 2008-09-26
  • 打赏
  • 举报
回复
在高手的指导下,现在probe函数可以执行了,但是又出现了这样的oops:
[root@(none) tmp]# insmod s3c2410_udc.ko
Using s3c2410_udc.ko
hello Mr. zhao I am in driver_register

bus platform: add driver s3c2410_udc

USB:s3c2410_udc_probe

hello Mr. zhao I am in s3c2410_udc_probeUSB:s3c2410_udc_irq

Unable to handle kernel paging request at virtual address f0a00178

pgd = c3758000

[f0a00178] *pgd=00000000

Internal error: Oops: 5 [#1]

Modules linked in: s3c2410_udc

CPU: 0

PC is at s3c2410_udc_irq+0x24/0x138 [s3c2410_udc]

LR is at 0x1

pc : [<bf000bd0>] lr : [<00000001>] Tainted: GF

sp : c3b59c10 ip : 60000093 fp : c3b59c28

r10: c02ae1c4 r9 : c3deabb0 r8 : c3b59ca0

r7 : 00000029 r6 : f0a00158 r5 : 00000000 r4 : bf0028b4

r3 : f0a00178 r2 : 00000000 r1 : 00001d3d r0 : bf00112c

Flags: nZCv IRQs off FIQs on Mode SVC_32 Segment user

Control: C000717F Table: 33758000 DAC: 00000015

Process insmod (pid: 84, stack limit = 0xc3b58194)

Stack: (0xc3b59c10 to 0xc3b5a000)

9c00: c3dd4960 00000000 00000000 c3b59c4c

9c20: c3b59c2c c00219d0 bf000bbc c02aea18 00000029 c3dd4960 c3b59ca0 c3b59ca0

9c40: c3b59c6c c3b59c50 c0021b2c c0021994 ffffffff c3b59cd4 00000001 00000000

9c60: c3b59c9c c3b59c70 c0021cb4 c0021a8c c0150fd4 c0036eac ffffffff c3b59cd4

9c80: 00000001 00000000 bf000cf4 bf0028b4 c3b59d04 c3b59ca0 c0020804 c0021c74

9ca0: 00000019 f0000008 00000001 697f3fff c3dd4960 40000013 00000029 00000000

9cc0: bf000cf4 c3deabb0 bf0028b4 c3b59d04 c3b59ce8 c3b59ce8 c0022108 c002210c

9ce0: 60000013 ffffffff c3dd4960 00000029 20000000 bf000bac c3b59d2c c3b59d08

9d00: c00221d4 c002203c bf002b90 bf0028b4 bf002828 bf002b90 00000000 c3deab7c

9d20: c3b59d48 c3b59d30 bf004064 c0022128 bf0028b4 bf002b90 00000000 c3b59d64

9d40: c3b59d4c c0152a74 bf004010 00000000 c3b59d78 c0152ac0 c3b59d74 c3b59d68

9d60: c0152ad0 c0152a28 c3b59da0 c3b59d78 c0152318 c0152ad0 c0269dc0 c0269dc0

9d80: bf002880 bf002b90 bf002c40 bf002b90 c0269cc8 c3b59db8 c3b59da4 c0152b38

9da0: c01522d8 bf002b90 c0269dec c3b59de0 c3b59dbc c0152380 c0152ae4 bf002b90

9dc0: c0269dec bf002bf8 bf002c2c 00000000 c3deab7c c3b59e04 c3b59de4 c0151484

9de0: c0152364 bf002b90 bf002b88 00000000 00000000 c4918250 c3b59e18 c3b59e08

9e00: c0151504 c0151420 c025f4d4 c3b59e3c c3b59e1c c0154128 c01514f8 c3b59e28

9e20: c025f4d4 bf002c90 00000000 00000000 c3b59e5c c3b59e40 bf0040f8 c0154054

9e40: c025f4d4 bf002c90 00000000 c025f4c4 c3b59fa4 c3b59e60 c005096c bf0040e4

9e60: 00000000 000003e8 bf002c9c 0000037c 00000038 c3b59f6c 00000060 c3b59f68

9e80: 05f5e100 00000020 bf0021e4 00000000 00000095 c3dd49a0 00000064 00000060

9ea0: 0000004c bf004000 00000010 00000000 0000000d 00000000 00000009 00000000

9ec0: 00000013 0000000a 00000000 00000000 00000019 00000018 c4919848 c4918178

9ee0: c4916000 c3b58000 c024b85c 00000000 c024b70c 00000000 c005ef14 c391c55c

9f00: c3b8238c 000000d1 c3b59f70 c3b59f18 c0064f48 c00633dc c391c55c 00000000

9f20: c3de8b20 00000000 00000000 00000000 00000004 00000000 00000000 c391c55c

9f40: c391c564 c391c544 c3b58000 c3b58000 00000001 40015000 c3de8b20 00000000

9f60: 00003e6a c3b59fa4 c3b59f74 c0024f80 c0071c44 00000001 00000000 00000004

9f80: 00000000 00000000 00000080 c0020ec4 c3b58000 00000000 00000000 c3b59fa8

9fa0: c0020d40 c004f4ec 00000000 00000000 00900080 40015000 00003e6a 001cb038

9fc0: 00000004 00000000 00000000 bea00d54 001cb020 001cb008 00000000 00000000

9fe0: be9fe8a4 be9fe898 000444e0 40199ac0 60000010 00900080 69727453 692c676e

Backtrace:

[<bf000bac>] (s3c2410_udc_irq+0x0/0x138 [s3c2410_udc]) from [<c00219d0>] (__do_irq+0x4c/0x88)

r6 = 00000000 r5 = 00000000 r4 = C3DD4960

[<c0021984>] (__do_irq+0x0/0x88) from [<c0021b2c>] (do_edge_IRQ+0xb0/0x12c)

r8 = C3B59CA0 r7 = C3B59CA0 r6 = C3DD4960 r5 = 00000029

r4 = C02AEA18

[<c0021a7c>] (do_edge_IRQ+0x0/0x12c) from [<c0021cb4>] (asm_do_IRQ+0x50/0x13c)

r7 = 00000000 r6 = 00000001 r5 = C3B59CD4 r4 = FFFFFFFF

[<c0021c64>] (asm_do_IRQ+0x0/0x13c) from [<c0020804>] (__irq_svc+0x24/0x160)

[<c002202c>] (setup_irq+0x0/0xec) from [<c00221d4>] (request_irq+0xbc/0xd8)

r7 = BF000BAC r6 = 20000000 r5 = 00000029 r4 = C3DD4960

[<c0022118>] (request_irq+0x0/0xd8) from [<bf004064>] (s3c2410_udc_probe+0x64/0xd4 [s3c2410_udc])

[<bf004000>] (s3c2410_udc_probe+0x0/0xd4 [s3c2410_udc]) from [<c0152a74>] (driver_probe_device+0x5c/0xa8)

r5 = 00000000 r4 = BF002B90

[<c0152a18>] (driver_probe_device+0x0/0xa8) from [<c0152ad0>] (__device_attach+0x10/0x14)

r6 = C0152AC0 r5 = C3B59D78 r4 = 00000000

[<c0152ac0>] (__device_attach+0x0/0x14) from [<c0152318>] (bus_for_each_drv+0x50/0x8c)

[<c01522c8>] (bus_for_each_drv+0x0/0x8c) from [<c0152b38>] (device_attach+0x64/0x98)

r7 = C0269CC8 r6 = BF002B90 r5 = BF002C40 r4 = BF002B90

[<c0152ad4>] (device_attach+0x0/0x98) from [<c0152380>] (bus_add_device+0x2c/0xfc)

r5 = C0269DEC r4 = BF002B90

[<c0152354>] (bus_add_device+0x0/0xfc) from [<c0151484>] (device_add+0x74/0xd8)

[<c0151410>] (device_add+0x0/0xd8) from [<c0151504>] (device_register+0x1c/0x20)

r8 = C4918250 r7 = 00000000 r6 = 00000000 r5 = BF002B88

r4 = BF002B90

[<c01514e8>] (device_register+0x0/0x20) from [<c0154128>] (platform_device_register+0xe4/0x158)

r4 = C025F4D4

[<c0154044>] (platform_device_register+0x0/0x158) from [<bf0040f8>] (udc_init+0x24/0x13c [s3c2410_udc])

r7 = 00000000 r6 = 00000000 r5 = BF002C90 r4 = C025F4D4

[<bf0040d4>] (udc_init+0x0/0x13c [s3c2410_udc]) from [<c005096c>] (sys_init_module+0x1490/0x1614)

r7 = C025F4C4 r6 = 00000000 r5 = BF002C90 r4 = C025F4D4

[<c004f4dc>] (sys_init_module+0x0/0x1614) from [<c0020d40>] (ret_fast_syscall+0x0/0x2c)

Code: eb40d9a2 e59f60fc e59f30fc e59f00fc (e5933000)

<0>Kernel panic - not syncing: Aiee, killing interrupt handler!
还请高手们指点啊?
lion4780 2008-09-26
  • 打赏
  • 举报
回复
usb debug已经打开了,这是所有打印信息了,发现s3c2410_udc_probe() 函数确实没有被执行?
不知道是什么原因啊?
static int __init udc_init(void)
{
int tmp;

dprintk("%s: version %s\n", gadget_name, DRIVER_VERSION);

tmp = __raw_readl(S3C2410_CLKCON);
tmp &= ~S3C2410_CLKCON_USBD;
__raw_writel(tmp, S3C2410_CLKCON);

tmp = __raw_readl(S3C2410_MISCCR);
tmp &= ~S3C2410_MISCCR_USBHOST;
__raw_writel(tmp, S3C2410_MISCCR);

/* UPLLCON */
tmp = (0x78 << S3C2410_PLLCON_MDIVSHIFT)
| (0x02 << S3C2410_PLLCON_PDIVSHIFT)
| (0x03 << S3C2410_PLLCON_SDIVSHIFT);
__raw_writel(tmp, S3C2410_UPLLCON);

tmp = __raw_readl(S3C2410_CLKCON);
tmp |= S3C2410_CLKCON_USBD;
__raw_writel(tmp, S3C2410_CLKCON);

#ifdef MACH_TOMTOMGO
s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_OUTP);
s3c2410_gpio_setpin(S3C2410_GPE13, 1);
dev_info (&dev->dev, "TomTomGo USB device pullup enabled.\n");
#endif

mdelay(10);

return driver_register(&udc_driver);
}


static struct device_driver udc_driver = {
.name = "s3c2410-udc",
.bus = &platform_bus_type,
.probe = s3c2410_udc_probe,
.remove = __exit_p(s3c2410_udc_remove),

// FIXME power management support
// .suspend = ... disable UDC
// .resume = ... re-enable UDC
};
air_snake 2008-09-25
  • 打赏
  • 举报
回复
把usb的debug打开吧

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧