Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

IRQ mapping in SOPC builder

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.

19 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 .
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 .
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    try make clean, and rebuild kernel from hwselect again.

    I did try compile with DE2 ptf . there should be the isp1362-hcd.o .
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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