Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUSB device!
I have a usb flash disk, I want to using it on my board, I choose USB Mass storage and SCSI disk and ISA116X driver support in menuconfig. Start uClinux on NIOS II SDK shell, using dmesg, I got these message:
# dmesg Linux version 2.6.11-uc0 ([email protected]) (gcc version 3.4.6)# 11 Sa t Apr 15 17:52:30 CST 2006 uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. setup_arch: No persistant network settings signature at 008F0000 On node 0 totalpages: 2048 DMA zone: 2048 pages, LIFO batch:1 Normal zone: 0 pages, LIFO batch:1 HighMem zone: 0 pages, LIFO batch:1 Built 1 zonelists Kernel command line: PID hash table entries: 64 (order: 6, 1024 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 6188k/8192k RAM, 0k/0k ROM (1334k kernel code, 551k data) Calibrating delay loop... 24.72 BogoMIPS (lpj=123648) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x81004000 (irq = 1) is a jtag_uart io scheduler noop registered io scheduler deadline registered dmfe_probe:eth0, 50000 Khz Nios <DM9000> eth0 I/O: 80900090, VID: 90000a46 ADDR: 00:07:ed:00:00:00 dmfe_probe:eth1, 50000 Khz Nios Linux video capture interface: v1.00 116x: driver isp116x-hcd, 08 Apr 2005 116x: ISP116x Host Controller, irq 4 isp116x-hcd isp116x-hcd: new USB bus registered, assigned bus number 1 116x: Invalid chip ID 3630 isp116x-hcd isp116x-hcd: USB bus 1 deregistered 116x: init error, -19 Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 Freeing unused kernel memory: 436k freed (0x15e000 - 0x1ca000)# I plug my usb flash disk in my board usb host port, there is no message appear! How could I to find the usb disk?43 Replies
- Altera_Forum
Honored Contributor
the usb chip in DE2 is not isp116x, it is isp1362.
reply in new thread, http://forum.niosforum.com/forum/index.php?showtopic=3707 (http://forum.niosforum.com/forum/index.php?showtopic=3707) - Altera_Forum
Honored Contributor
Thanks for your help, I will try it. If have done, I will tell you!
- Altera_Forum
Honored Contributor
hi all
I have the same problem,too. this is my booting messages.................... uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. setup_arch: No persistant network settings signature at 008F0000 Built 1 zonelists Kernel command line: PID hash table entries: 64 (order: 6, 1024 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 5904k/8192k RAM, 0k/0k ROM (1612k kernel code, 580k data) Mount-cache hash table entries: 512 NET: Registered protocol family 16 SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub io scheduler noop registered io scheduler deadline registered (default) Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x81004000 (irq = 1) is a jtag_uart dmfe_probe:eth0, 50000 Khz Nios <DM9000> eth0 I/O: 80900090, VID: 90000a46 ADDR: 00:07:ed:00:00:00 dmfe_probe:eth1, 50000 Khz Nios usbmon: debugfs is not available driver isp1362-hcd, 2005-04-04 isp1362-hcd isp1362-hcd: ISP1362 Host Controller isp1362_hc_reset: Clock not ready after 20ms isp1362-hcd isp1362-hcd: can't reset init error, -19 Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. i2c /dev entries driver NET: Registered protocol family 2 IP route cache hash table entries: 128 (order: -3, 512 bytes) TCP established hash table entries: 512 (order: -1, 2048 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) TCP reno registered TCP bic registered NET: Registered protocol family 1 NET: Registered protocol family 10 IPv6 over IPv4 tunneling driver NET: Registered protocol family 17 Freeing unused kernel memory: 448k freed (0x1a6000 - 0x215000) init started: BusyBox v1.1.1-pre0 (2006.04.14-14:34+0000) multi-call binary BusyBox v1.1.1-pre0 (2006.04.14-14:34+0000) Built-in shell (msh) Enter 'help' for a list of built-in commands. # cd /proc# more mounts rootfs / rootfs rw 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0# mount -t vft /dev/hda /mount mount: Mounting /dev/hda on /mount failed: No such file or directory# when I plug my usb disk on my uClinux then no response . so , i can't mount my usb flash disk.......... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif thank in advance! jay - Altera_Forum
Honored Contributor
The isp1362 is not working. You have to check the regs and irq of the chip. Study the regs map from the data sheet of the chip.
We will debug the driver code. First, you should setup source code version control with subversion. We will have to update or revert the code during debug.
Then in function isp1362_hc_reset() of ~/linux-2.6.x/drivers/usb/host/isp1362_hcd.c add some printk() to display the io ports of data, addr and irq. add a dump_regs() to display the regs. try some write / read compare to the regs. add some dump_regs during the clock test. We have to make sure the chip can be accessed by the driver correctly. Check the clock, data... etc with a scope. Check irq pin during the clokc test.# remove old linux source rm -rf ~/linux-2.6.x ~/mysvn/2.6.11-uc0# kernel 2.6.11-uc0 source ported by microtronix cp -a ~/download/mx140/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x ~ cd ~/linux-2.6.x patch -p0 <~/download/kernel.diff cp ~/download/kernel.config ~/linux-2.6.x/.config cd ~ mkdir mysvn# setup svn svnadmin create mysvn/2.6.11-uc0 svn import linux-2.6.x file:///home/jack/mysvn/2.6.11-uc0/linux-2.6.x -m="initial" rm -rf ~/linux-2.6.x svn co file:///home/jack/mysvn/2.6.11-uc0/linux-2.6.x patch -p0 <~/download/isp1362.diff svn add drivers/usb/host/isp1362.h drivers/usb/host/isp1362-hcd.c include/linux/usb_isp1362.h svn commit -m="add isp1362 hcd" - Altera_Forum
Honored Contributor
hi hippo
Before i was uesd the patch "isp1362-nios2-01.diff" and compiled ok. now,i am using patch "isp1362" and complie ok,but i can't find the "isp1362-hcd.o" in ~/linux2.6.x/drivers/usb/host dir. i find the "(CONFIG_USB_ISP362X_HCD)" at line 14 in ~/linux2.6.x/drivers/usb/makefile and replace it to "(CONFIG_USB_ISP1362_HCD)".. final , when i have rebuild kernel then occur error messages........ CHK include/asm-nios2nommu/asm-offsets.h CHK include/linux/compile.h CHK usr/initramfs_list CC drivers/usb/host/isp1362-hcd.o drivers/usb/host/isp1362-hcd.c:1293: error: syntax error before "gfp_t" drivers/usb/host/isp1362-hcd.c:1294: warning: function declaration isn't a prototype drivers/usb/host/isp1362-hcd.c: In function `isp1362_urb_enqueue': drivers/usb/host/isp1362-hcd.c:1295: error: `hcd' undeclared (first use in this function) drivers/usb/host/isp1362-hcd.c:1295: error: (Each undeclared identifier is reported only once drivers/usb/host/isp1362-hcd.c:1295: error: for each function it appears in.) drivers/usb/host/isp1362-hcd.c:1296: error: `urb' undeclared (first use in this function) drivers/usb/host/isp1362-hcd.c:1333: error: `hep' undeclared (first use in this function) drivers/usb/host/isp1362-hcd.c:1334: error: `mem_flags' undeclared (first use in this function) drivers/usb/host/isp1362-hcd.c:1341: warning: implicit declaration of function `HC_IS_RUNNING' drivers/usb/host/isp1362-hcd.c: In function `isp1362_mem_config': drivers/usb/host/isp1362-hcd.c:2415: warning: int format, long unsigned int arg (arg 5) drivers/usb/host/isp1362-hcd.c:2418: warning: int format, long unsigned int arg (arg 5) drivers/usb/host/isp1362-hcd.c: In function `isp1362_hc_start': drivers/usb/host/isp1362-hcd.c:2776: error: `HC_STATE_RUNNING' undeclared (first use in this function) drivers/usb/host/isp1362-hcd.c: At top level: drivers/usb/host/isp1362-hcd.c:2818: error: unknown field `bus_suspend' specified in initializer drivers/usb/host/isp1362-hcd.c:2819: error: unknown field `bus_resume' specified in initializer drivers/usb/host/isp1362-hcd.c: In function `isp1362_remove': drivers/usb/host/isp1362-hcd.c:2828: warning: implicit declaration of function `platform_get_drvdata' drivers/usb/host/isp1362-hcd.c:2828: warning: initialization makes pointer from integer without a cast drivers/usb/host/isp1362-hcd.c:2834: warning: implicit declaration of function `usb_remove_hcd' drivers/usb/host/isp1362-hcd.c: In function `isp1362_probe': drivers/usb/host/isp1362-hcd.c:2927: error: too many arguments to function `usb_create_hcd' drivers/usb/host/isp1362-hcd.c:2932: error: structure has no member named `rsrc_start' drivers/usb/host/isp1362-hcd.c:2958: warning: implicit declaration of function `usb_add_hcd' drivers/usb/host/isp1362-hcd.c: At top level: drivers/usb/host/isp1362-hcd.c:3043: error: variable `isp1362_driver' has initializer but incomplete type drivers/usb/host/isp1362-hcd.c:3044: error: unknown field `probe' specified in initializer drivers/usb/host/isp1362-hcd.c:3044: warning: excess elements in struct initializer drivers/usb/host/isp1362-hcd.c:3044: warning: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c:3045: error: unknown field `remove' specified in initializer drivers/usb/host/isp1362-hcd.c:3045: warning: excess elements in struct initializer drivers/usb/host/isp1362-hcd.c:3045: warning: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c:3047: error: unknown field `suspend' specified in initializer drivers/usb/host/isp1362-hcd.c:3047: warning: excess elements in struct initializer drivers/usb/host/isp1362-hcd.c:3047: warning: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c:3048: error: unknown field `resume' specified in initializer drivers/usb/host/isp1362-hcd.c:3048: warning: excess elements in struct initializer drivers/usb/host/isp1362-hcd.c:3048: warning: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c:3049: error: unknown field `driver' specified in initializer drivers/usb/host/isp1362-hcd.c:3049: error: extra brace group at end of initializer drivers/usb/host/isp1362-hcd.c:3049: error: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c:3052: warning: excess elements in struct initializer drivers/usb/host/isp1362-hcd.c:3052: warning: (near initialization for `isp1362_driver') drivers/usb/host/isp1362-hcd.c: In function `isp1362_init': drivers/usb/host/isp1362-hcd.c:3063: warning: implicit declaration of function `platform_driver_register' drivers/usb/host/isp1362-hcd.c: In function `isp1362_cleanup': drivers/usb/host/isp1362-hcd.c:3070: warning: implicit declaration of function `platform_driver_unregister' drivers/usb/host/isp1362-hcd.c: At top level: drivers/usb/host/isp1362-hcd.c:3043: error: storage size of `isp1362_driver' isn't known drivers/usb/host/isp1362-hcd.c:1581: warning: 'isp1362_bus_suspend' declared `static' but never defined make[3]: *** [drivers/usb/host/isp1362-hcd.o] Error 1 make[2]: *** [drivers/usb/host] Error 2 make[1]: *** [drivers/usb] Error 2 make: *** [drivers] Error 2 http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif Is diffenence between the isp1362-nios2-01.diff and the isp1362.diff ? thx in advance ! - Altera_Forum
Honored Contributor
It is the trouble of back porting. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif
The driver code is for 2.6.16.1 . The include files and data structures are different between 2.6.11 and 2.6.16.1 . You have to choose to work on either linux-2.6.16.1 or linux-2.6.x (ie 2.6.11-uc0). More works are required to back port to 2.6.11 . I am busy now, and can't help. Sorry. I have updated the steps of svn. You can use svn to track the debuging. - Altera_Forum
Honored Contributor
hi hippo
I have worked on linux-2.6.16.1(using patch isp1362-nios2-01.diff ) that compiled kernel successfully. i can see isp1362 device form booting messages,but usb device don't work on my uClinux. I am working on linux-2.6.x that using patch isp1362.diff right now. i will try your suggestion on linux-2.6.x,again. thx in advance!! jay - Altera_Forum
Honored Contributor
hi hippo
I have installed svn on linux-2.6.x and met a problem. i can't used the patch "isp1362.diff" in ~/ dir. why? [jay@localhost ~]$ patch -p0 <~/download/isp1362.diff patching file include/linux/usb_isp1362.h can't find file to patch at input line 52 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |Index: arch/nios2nommu/kernel/usb.c |=================================================================== |--- arch/nios2nommu/kernel/usb.c (revision 12) |+++ arch/nios2nommu/kernel/usb.c (revision 14) -------------------------- File to patch: how to solve this problem? if i complete the installation of svn. Is the make kernel also in ~/linux-2.6.x? thx - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by jay_1025@Apr 19 2006, 11:00 PM hi hippoi have installed svn on linux-2.6.x and met a problem.
i can't used the patch "isp1362.diff" in ~/ dir. why?
[jay@localhost ~]$ patch -p0 <~/download/isp1362.diff
patching file include/linux/usb_isp1362.h
can't find file to patch at input line 52
perhaps you used the wrong -p or --strip option?
the text leading up to this was:
--------------------------
|index: arch/nios2nommu/kernel/usb.c
|===================================================================
|--- arch/nios2nommu/kernel/usb.c (revision 12)
|+++ arch/nios2nommu/kernel/usb.c (revision 14)
--------------------------
file to patch:
how to solve this problem?
if i complete the installation of svn.
is the make kernel also in ~/linux-2.6.x?
thx
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14482)
--- quote end ---
--- Quote End --- please do the patch in kernel dir, cd ~/linux-2.6.x patch -p0 <....... You should check the header when you received a patch to know the patch point.
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by jay_1025@Apr 19 2006, 04:49 PM hi hippoi have worked on linux-2.6.16.1(using patch isp1362-nios2-01.diff ) that compiled kernel successfully.
i can see isp1362 device form booting messages,but usb device don't work on my uclinux.
i am working on linux-2.6.x that using patch isp1362.diff right now.
i will try your suggestion on linux-2.6.x,again.
thx in advance!!
jay
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14478)
--- quote end ---
--- Quote End --- Maybe you should work on 2.6.16.1 , because the isp1362 driver was fro 2.6.16.1 . Try debug the driver in 2.6.16.1 . It is not easy to back port to 2.6.11 , really.