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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Linux driver for USB ISP1161 not working

Altera_Forum
Honored Contributor II
1,474 Views

I have been trying to get the USB HCD driver for the Philips ISP1161 host controller which is on the Microtronix USB-Ethernet board working. According to the wiki, it is supported and should work. 

 

Initially the kernel compile would just fail, with the error that the isp116x_platform_data struct was missing members. I fixed this by replacing the file defining this, include/linux/usb_isp116x.h, with the same file from the Microtronix 1.4 distribution. This led to the kernel compiling successfully. 

 

However, now the kernel just halts when loading this driver. I'm not sure how to go about debugging this without a lot of printks. I would like to use gdb, but have been unsuccessful at building it. 

 

 

So, does anyone know how to get the ISP1161 working?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
634 Views

The ISP116x driver shipped with the kernel works OK for me (tested with 2.6.15, 2.6.16 and 2.6.17). arch/nios2nommu/kernel/usb.c needs patching though: 

 

Index: arch/nios2nommu/kernel/usb.c 

=================================================================== 

--- arch/nios2nommu/kernel/usb.c (revision 92) 

+++ arch/nios2nommu/kernel/usb.c (revision 93) 

@@ -26,6 +26,7 @@ 

# include <linux/init.h> 

# include <linux/device.h> 

# include <linux/delay.h> 

+#include <linux/platform_device.h> 

 

# include <asm/io.h> 

# include <asm/irq.h> 

@@ -139,27 +140,14 @@ 

static struct isp116x_platform_data isp116x_data = { 

// Enable internal resistors on downstream ports 

.sel15Kres = 0, 

- // Clock cannot be stopped 

- .clknotstop = 1, 

// On-chip overcurrent protection 

.oc_enable = 0, 

// INT output polarity 

.int_act_high = 0, 

// INT edge or level triggered 

.int_edge_triggered = 0, 

- // End-of-transfer input polarity 

- .eot_act_high = 0, 

- // DREQ output polarity 

- .dreq_act_high = 1, 

- // WAKEUP pin connected 

- .remote_wakeup_connected= 0, 

// Wakeup by devices on usb bus enabled 

.remote_wakeup_enable = 0, 

- // Switch or not to switch (keep always powered) 

- .no_power_switching = 1, 

- // Ganged port power switching (0) or individual port power switching (1) 

- .power_switching_mode = 0, 

- .reset = NULL /* isp116x_reset */, 

.delay = isp116x_delay, 

}; 

 

The problem with the kernel halting is because an active HIGH level-triggered interrupt is expected, and the 116x default has an active LOW interrupt line (at least it was for me). I tried programming the interrupt polarity in the driver, but that did not help, so I ended up inverting the IRQ signal in my FPGA Image. 

 

- Atle
0 Kudos
Altera_Forum
Honored Contributor II
634 Views

Thanks for this atle. I changed the struct definition in the header file rather than in the source c file. 

 

Unfortunately, while now the kernel boots up fine, it&#39;s still not seeing any devices in /proc/bus/usb/devices. The host controller shows up, but if I plug in another device and try to cat that file, the system hangs. 

 

Just for reference, I have also been trying to get the ISP1161 device/gadget interface working. The only change I have made so far is in /drivers/usb/gadget/isp116x_udc.c . This file will also fail to compile until you add# include <linux/platform_device.h> somewhere at the start of the file. 

 

Again, this doesn&#39;t seem to be working right. Insmod-ing either the gadget serial or gadget ethernet driver modules causes a hang. 

 

Is there anything else that needs doing to get these working? 

 

Thanks, 

Josh
0 Kudos
Altera_Forum
Honored Contributor II
634 Views

I realize this is an old thread but... I've been working on getting the serial gadget driver working with the isp1161 too. I've managed to get it working but it is a little flakey. For example opening /dev/ttyGS0 always succeeds even if the cable is disconnected.. If anyone is still working on this, or has already improved things, I would be interested in working together and/or sharing information. Thanks, Alex

0 Kudos
Reply