Hi Olav,

On Mon, 2005-01-03 at 19:26 +0200, Olav Kongas wrote:
> Here comes a new isp116x driver.

When I tried it I found that DEFAULT_FMINTERVAL wasn't defined anywhere,
I tried setting FI=11999,FSMPS=0 as that was what the docs said the
default was but that didn't work.

I found that the old 2.4 driver I was using (bingo, and probably its
predecessors) set FSMPS to:
        ((FI - 210) * 6) / 7
which seems to work, although I haven't a clue what it means :-(. The
datasheet says FSMPS is calculated by the HCD so I am slightly surprised
I needed to write anything at all. I guess you have a definition of
DEFAULT_FMINTERVAL that I don't.

I also copied the sw reset logic from the 2.4 driver, with the current
sw reset I see a hang shortly after the usbstorage driver is finished
initialising but with this change everything is OK.

So I can now see a memory stick, mount it, write to it etc which is
fantastic! A USB serial thing that never worked with the 2.4 driver also
works, which is even better!

A patch for all the above is below. I also needed to add the host
subdirectory to drivers/usb/Makefile when ISP116x_HCD was turned on.

BTW I also remember reading that lowercase is frowned on in CONFIG
options.

FWIW my platform is a pxa255 based board.

Anyway, thanks Olav!

Ian.

Index: 2.6/drivers/usb/Makefile
===================================================================
--- 2.6.orig/drivers/usb/Makefile       2005-01-04 14:11:16.000000000 +0000
+++ 2.6/drivers/usb/Makefile    2005-01-04 14:24:51.000000000 +0000
@@ -11,6 +11,7 @@
 obj-$(CONFIG_USB_UHCI_HCD)     += host/
 obj-$(CONFIG_USB_SL811HS)      += host/
 obj-$(CONFIG_ETRAX_USB_HOST)   += host/
+obj-$(CONFIG_USB_ISP116x_HCD)  += host/
 
 obj-$(CONFIG_USB_ACM)          += class/
 obj-$(CONFIG_USB_AUDIO)                += class/
Index: 2.6/drivers/usb/host/isp116x-hcd.c
===================================================================
--- 2.6.orig/drivers/usb/host/isp116x-hcd.c     2005-01-04 14:24:44.000000000 
+0000
+++ 2.6/drivers/usb/host/isp116x-hcd.c  2005-01-06 15:54:44.721830532 +0000
@@ -61,6 +61,8 @@
 //#define REGISTERS
 //#define PACKET_TRACE
 
+#define DEFAULT_FMINTERVAL 11999 | ((((11999 - 210) * 6) / 7) << 16)
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -1342,17 +1344,15 @@
 
 /*-------------------------------------------------------------------------*/
 
-//#define isp116x_sw_reset(isp116x)  isp116x_write_reg16(isp116x, HCSWRES, 
HCSWRES_MAGIC)
-
-/// FIXME: SW reset is broken
 static void isp116x_sw_reset(struct isp116x *isp116x)
 {
        int tmp = 20;
-       u32 val;
 
-       ERR("SW reset is broken\n");
        spin_lock_irq(&isp116x->lock);
-       isp116x_write_reg32(isp116x, HCCMDSTAT, OHCI_HCR);
+
+       isp116x_write_reg16(isp116x, HCSWRES, HCSWRES_MAGIC);
+       /* HC Reset requires max 10 us delay */
+        isp116x_write_reg32(isp116x, HCCMDSTAT, OHCI_HCR);
        while (--tmp) {
                if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & OHCI_HCR))
                        break;
@@ -1360,11 +1360,7 @@
        }
        if (!tmp)
                ERR("Software reset timeout\n");
-       // USB bus reset
-       val = isp116x_read_reg32(isp116x, HCCONTROL);
-       val &= ~OHCI_CTRL_HCFS;
-       val |= OHCI_USB_RESET;
-       isp116x_write_reg32(isp116x, HCCONTROL, val);
+
        spin_unlock_irq(&isp116x->lock);
 }
 


-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road,                    Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom       Phone:  +44 (0)1223 411 200



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to