Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

IRQ mapping in SOPC builder

Altera_Forum
Honored Contributor II
1,278 Views

I fixed up the device address (na_usb - to the address assigned to ISP1362 in SOPC builder) and irq (na_usb_irq - IRQ 4 when viewed in SOPC builder) and corrected the chip id so linux recognizes the usb port, but i get the following error about the IRQ after i plug in a USB flash drive. I checked the DE2_NET design I'm using for this experiment in SOPC builder and the IRQ for ISP1362 is 4, or should i instead be using the IRQ for the DMA? 

 

thanks in advance! 

 

io scheduler deadline registered 

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 

hub 1-0:1.0: USB hub found 

hub 1-0:1.0: 2 ports detected 

scheduling while atomic: swapper/0x00000002/1 

Stack from 00187d40:<0> 

<0> 00000002<0> 000d53cc<0> 00000001<0> ffffe000<0> 00002900<0> 001922ec< 

0> 00189b20<0> 00356c00<0> 

<0> 40408180<0> 00000002<0> 000e5504<0> ffff8c59<0> 00000006<0> 000d696c< 

0> 00150020<0> 00150020<0> 

<0> ffff8c59<0> 4b87ad6e<0> 000170f0<0> 00182d60<0> 0014fd50<0> 00000002< 

0> ffffe000<0> 80000080<0> 

<0> 000175bc<0> 001921c0<0> 00192280<0> 000be790<0> 001921c0<0> 00192280< 

0> 000bf130<0> 000df488<0> 

<0> 00000000<0> 00189a20<0> 0000000d<0> 000001f4<0> 00356c04<0> 00357d9c< 

0> 000600fc<0> 00179200<0> 

<0> 0035ada4<0> 00000000<0> 00192294<0> 00356a00<0> 00000001<0> fffffffa< 

0> ffffffed<0> 000ecc94<0> 

Call Trace:<0> 

<0> [<000bcf18>]<0> [<000a1e04>]<0> [<000a1eb8>]<0> [<00000001>]<0> 

<0> [<00000000>]<0> [<00000000>]<0> [<000a20a8>]<0> [<00000000>]<0> 

<0> [<000a0e68>]<0> [<00000000>]<0> [<00000000>]<0> [<000c5c68>]<0> 

<0> [<00000001>]<0> [<00000000>]<0> [<00000000>]<0> [<00000000>]<0> 

<0> [<000001f4>]<0> [<00000001>]<0> [<00000000>]<0> [<000bf95c>]<0> 

<0> [<00000012>]<0> [<00000012>]<0> [<00000012>]<0> [<000c2034>]<0> 

<0> [<00000001>]<0> [<000a1e04>]<0> [<000a1f74>]<0> [<00000000>]<0> 

<0> [<000a22c8>]<0> [<00000001>]<0> [<000a2830>]<0> [<00000000>]<0> 

<0> [<00000000>]<0> [<00000264>]<0> [<00001d64>]<0> [<00006910>]<0> 

<0> [<00006968>]<0> [<0000088c>]<0> [<00000000>]<0> [<00000000>]<0> 

<0> [<00000000>]<0> [<000052a8>]<0> [<00000000>]<0> [<00000001>]<0> 

<0> [<00000b00>]<0> [<00000b00>]<0> [<0000019c>]<0> [<00000000>]<0> 

<0> [<00000120>]<0> [<00000001>]<0> [<00000001>]<0> [<00001d54>]<0> 

drivers/usb/class/bluetty.c: USB Bluetooth support registered 

usbcore: registered new driver bluetty 

drivers/usb/class/bluetty.c: USB Bluetooth tty driver v0.13 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

Freeing unused kernel memory: 348k freed (0xf2000 - 0x148000) 

init started: BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) multi-call binary 

 

 

BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands. 

# usb 1-2: new full speed USB device using isp116x-hcd and address 2 

isp116x-hcd isp116x-hcd: Unlink after no-IRQ? Controller is probably using the 

wrong IRQ.
0 Kudos
19 Replies
Altera_Forum
Honored Contributor II
496 Views

Why do you want bluetty? 

If you want bluetooth support, maybe you should select from top level menuconfig, 

Networking --> [*] Bluetooth subsystem support ---> Bluetooth device drivers ---> [*] HCI USB driver 

 

The isp116x driver does not use DMA. It looks like the hcd driver crashed after detecting port 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

hub 1-0:1.0: 2 ports detected 

scheduling while atomic: swapper/0x00000002/1[/b] 

--- Quote End ---  

 

You should enable DEBUG in your driver, or add some printk() to find out. 

 

You should try out the 2.6.15.6 kernel in the update of the buildroot guide.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

hmm, I don&#39;t see any DEBUG option in the makefile, how do i enable the debug option? 

 

thanks!
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

The problem should be in arch/nios2nommu/kernel/usb.c . 

But you have to enable the DEBUG in drivers/usb/host/isp116x-hcd.c to find out. 

you should use kernel 2.6.16 .
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

thanks, i&#39;ve traced down the problem using the trace and printks to an msleep call in drivers/usb/core/hub.c in the 2.6.x kernel 

 

Just tried compiling 2.6.16 kernel but it seems some of the data structures aren&#39;t complete or don&#39;t match up. 

 

the isp116x_platform_data data structure seems to be missing some things that usb.c assumes are there and is trying to initialize.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Yes, there may be new data structures and api in new kernel, which makes old driver failed.

0 Kudos
Altera_Forum
Honored Contributor II
496 Views

so in that case should i be updating the 2.6.16 kernel with the more complete code from 2.6.x? some of the code in 2.6.16 have data structures which have some data members stripped out for some reason

0 Kudos
Altera_Forum
Honored Contributor II
496 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

some of the code in 2.6.16 have data structures which have some data members stripped out for some reason[/b] 

--- Quote End ---  

 

You should update arch/nios2nommu/usb.c data structure for newer kernel.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

I will try to borrow a DEII board, and I will check it then.

0 Kudos
Altera_Forum
Honored Contributor II
496 Views

After some searching on web, I found this about isp1362 linux stack, 

http://www.semiconductors.philips.com/acro...s/um10012_2.pdf (http://www.semiconductors.philips.com/acrobat/usermanuals/um10012_2.pdf

 

There is isp1362_linux_sw_stack.tar.gz 

http://www.semiconductors.philips.com/prod...ducts/download/ (http://www.semiconductors.philips.com/products/connectivity/usb/products/download/

 

Email authorization 

Software marked "email authorization required" needs prior approval from Philips Marketing for download.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

 

--- Quote Start ---  

originally posted by hippo@Mar 29 2006, 09:17 PM 

after some searching on web, i found this about isp1362 linux stack, 

http://www.semiconductors.philips.com/acro...s/um10012_2.pdf (http://www.semiconductors.philips.com/acrobat/usermanuals/um10012_2.pdf

 

there is isp1362_linux_sw_stack.tar.gz 

http://www.semiconductors.philips.com/prod...ducts/download/ (http://www.semiconductors.philips.com/products/connectivity/usb/products/download/

 

email authorization 

software marked "email authorization required" needs prior approval from philips marketing for download. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13910) 

--- quote end ---  

 

--- Quote End ---  

 

 

Thanks hippo! 

 

while looking for guides about porting over drivers, i found this for the 2.6.x distribution 

 

http://blackfin.uclinux.org/plugins/scmcvs...root=uclinux533 (http://blackfin.uclinux.org/plugins/scmcvs/cvsweb.php/uclinux-dist/linux-2.6.x/drivers/usb/host/?cvsroot=uclinux533

 

not sure if any changes need to be made since the hardware is different from blackfin? (in the header files) 

 

i&#39;ve tried plugging in a usb flash drive but nothing happens after trying: 

 

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

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: 6528k/8192k RAM, 0k/0k ROM (1090k kernel code, 460k data) 

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 

Bluetooth: Core ver 2.7 

NET: Registered protocol family 31 

Bluetooth: HCI device and connection manager initialized 

Bluetooth: HCI socket layer initialized 

devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au

devfs: boot_options: 0x1 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x81004000 (irq = 0) is a jtag_uart 

io scheduler noop registered 

io scheduler deadline registered 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

Freeing unused kernel memory: 352k freed (0x120000 - 0x177000) 

init started: BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) multi-call binary 

 

 

BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands. 

# cd proc# more mounts 

rootfs / rootfs rw 0 0 

/proc /proc proc rw,nodiratime 0 0 

sysfs /sys sysfs rw 0 0 

none /proc/bus/usb usbfs rw 0 0# mount -t vfat /dev/hda1 /mnt 

mount: Mounting /dev/hda1 on /mnt failed: No such device or address# mount -t vfat /dev/hda /mnt 

mount: Mounting /dev/hda on /mnt failed: No such device or address 

 

am i using the wrong mount command? 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

1. in root fs, you need some scsi dev nodes, eg sda, sda1... to use mass storage dev 

you need usbfs, too. I have setup them in the post of buildroot guide, so they are ready. 

 

2. in kernel menuconfig, 

turn on file system support, eg, vfat and native lang codepage 437 

turn on scsi device, scsi disk 

turn on host-side usb, usb dev fs, your hcd, usb device eg mass storage.[/b] 

--- Quote End ---  

 

 

for 1. do i need to do anything else for sda and sda1? - usbfs seems to be registered 

for 2. i&#39;ve enabled all of those options. 

 

sorry about the huge post but thx in advance!
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Shindou, 

Good found, It looks like the piece of driver you need. you have to update your arch/nios2nommu/kerbel/usb.c to prepare for the probing of the 1362 hcd. You should enable the debug message, too. You have to "port" the driver to your nios2 board. (it is not plug-and-play...). 

 

The 1362 hcd should detected first, then the root hub. 

Then when a usb disk inserted it will detect the new usb mas storage device, and display the usb disk info.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

driver isp1362-hcd, 2005-04-04                 

isp1362-hcd isp1362-hcd.0: ISP1362 Host Controller 

isp1362_hc_reset:  

isp1362-hcd isp1362-hcd.0: new USB bus registered, assigned bus number 1 

isp1362-hcd isp1362-hcd.0: irq 28, io mem 0x0c000000                     

isp1362_hc_start:                                 

isp1362-hcd isp1362-hcd.0: ISP1362 Memory usage: 

isp1362-hcd isp1362-hcd.0: ISTL:    2 *  256:      512 @ $0000:$0100 

isp1362-hcd isp1362-hcd.0: INTL: 16 * ( 64+8):  1152 @ $0200       

isp1362-hcd isp1362-hcd.0: ATL : 32 * ( 64+8):  2304 @ $0680 

isp1362-hcd isp1362-hcd.0: USED/FREE: 3968    128         

hub 1-0:1.0: USB hub found                               

hub 1-0:1.0: 2 ports detected 

ISP1362 Host Controller, irq 28 

usbcore: registered new driver cdc_acm 

drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters 

usbcore: registered new driver usblp                                                               

drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver 

Initializing USB Mass Storage driver...                           

usbcore: registered new driver usb-storage 

USB Mass Storage support registered.       

usbcore: registered new driver usbhid 

drivers/usb/input/hid-core.c: v2.01:USB HID core driver 

pegasus: v0.6.12 (2005/01/13), Pegasus/Pegasus II USB Ethernet driver 

usbcore: registered new driver pegasus       [/b] 

--- Quote End ---  

 

 

This is what I found from the net, about the boot log of isp1362 on arm. 

I am trying to add isp1362-hcd to nios2 kernel, and will let you know when I compile through. 

I can not borrow a DEII board, so it is up to you to test them.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Shindou, 

Please find the isp1362.zip attached in post#1 of buildroot guide. 

cd ~/download unzip isp1362.zip cd ~/linux-2.6.16.1 patch -p0 <~/download/isp1362-nios2-01.diff 

rebuild the kernel from hwselect,menuconfig .
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

thanks hippo, just tried it out with the nios_0.ptf 

 

 

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

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: 6508k/8192k RAM, 0k/0k ROM (1136k kernel code, 452k 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 

Bluetooth: Core ver 2.8 

NET: Registered protocol family 31 

Bluetooth: HCI device and connection manager initialized 

Bluetooth: HCI socket layer initialized 

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 

usbmon: debugfs is not available 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

Bluetooth: HCI USB driver ver 2.9 

usbcore: registered new driver hci_usb 

Freeing unused kernel memory: 352k freed (0x12a000 - 0x181000) 

init started: BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) multi-call binary 

 

 

BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands. 

#  

 

didn&#39;t see anything pop up when i plugged in a usb flash drive though. i&#39;ll update the thread as i debug if i find anything or get it to work.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

it didn&#39;t initialize the isp1362-hcd,  

Did you select isp1362 hcd in kernel menuconfig? 

 

Try add some printk and debug to the code, arch/nios2nommu/kernel/usb.c and drivers/usb/host/isp1362-hcd.c .
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

It seems like it&#39;s getting to the usb_hcd_init() call in arch/nios2nommu/kernel/usb.c where platform_device_register(&isp1362_hcd) is called but it seems the init code in drivers/usb/host/isp1362-hcd.c (ie. isp1362_init() is never called) 

 

last edit: 

 

Yep, ISP1362 HCD is selected in the menuconfig - hmm, interesting point tho, there&#39;s no object file after the make (ISP1362-hcd.o) in the drivers/usb/host directory. It&#39;s strange tho, the code in an adjacent directory drivers/usb/core had object files. Probably explains the problem above why that code never got called. Gonna see if i can figure out why this makefile isn&#39;t compiling isp1362-hcd.c.
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

try make clean, and rebuild kernel from hwselect again. 

I did try compile with DE2 ptf . there should be the isp1362-hcd.o .
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

Found the problem, the Makefile in the drivers/usb didn&#39;t point to the drivers/usb/host directory for ISP1362 selection in menuconfig. 

 

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 

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&#39;t reset 

init error, -19 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

Bluetooth: HCI USB driver ver 2.9 

usbcore: registered new driver hci_usb 

Freeing unused kernel memory: 352k freed (0x13c000 - 0x193000) 

init started: BusyBox v1.1.1-pre0 (2006.03.06-00:20+0000) multi-call binary 

 

can start debugging the reset problem now
0 Kudos
Altera_Forum
Honored Contributor II
496 Views

 

--- Quote Start ---  

originally posted by shindou@Apr 6 2006, 09:18 AM 

found the problem, the makefile in the drivers/usb didn&#39;t point to the drivers/usb/host directory for isp1362 selection in menuconfig. 

 

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 

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&#39;t reset 

init error, -19 

initializing usb mass storage driver... 

usbcore: registered new driver usb-storage 

usb mass storage support registered. 

bluetooth: hci usb driver ver 2.9 

usbcore: registered new driver hci_usb 

freeing unused kernel memory: 352k freed (0x13c000 - 0x193000) 

init started:  busybox v1.1.1-pre0 (2006.03.06-00:20+0000) multi-call binary 

 

can start debugging the reset problem now 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14079) 

--- quote end ---  

 

--- Quote End ---  

 

yes, drivers/usb/Makefile line17 should be changed to ISP1362 . 

let me know if you have progress in the debug http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
0 Kudos
Reply