Have you checked if this is still necessary? libusb on OpenBSD is now able to 
talk to devices claimed by drivers other than ugen.


Raphael Graf <[email protected]> wrote:

>The diff below makes the jtag and serial interfaces of the beaglebone
>(FT2232H)
>work simultaneously.
>This is how the beaglebone shows up:
>
>uhub8 at uhub0 port 1 "Standard Microsystems product 0x2412" rev
>2.00/b.b2 addr 3
>uftdi0 at uhub8 port 1 configuration 1 interface 1 "FTDI
>BeagleBone/XDS100V2" rev 2.00/7.00 addr 4
>ucom0 at uftdi0 portno 2
>ugen0 at uhub8 port 1 configuration 1 "FTDI BeagleBone/XDS100V2" rev
>2.00/7.00 addr 4
>
>Like this, openocd (using ugen) and cu both work.
>
>It is just assumed that interface 0 is used for jtag, not sure if this
>is
>always true. I'm also unsure if the diff would break other devices.
>Can someone comment on this?
>
>Thanks
>
>
>Index: uftdi.c
>===================================================================
>RCS file: /cvs/src/sys/dev/usb/uftdi.c,v
>retrieving revision 1.63
>diff -u -p -r1.63 uftdi.c
>--- uftdi.c    11 Sep 2012 16:04:44 -0000      1.63
>+++ uftdi.c    27 Jan 2013 13:20:53 -0000
>@@ -748,28 +748,21 @@ int
> uftdi_match(struct device *parent, void *match, void *aux)
> {
>       struct usb_attach_arg *uaa = aux;
>-      usbd_status err;
>       u_int8_t nifaces;
>
>       if (usb_lookup(uftdi_devs, uaa->vendor, uaa->product) == NULL)
>               return (UMATCH_NONE);
>
>       /* Get the number of interfaces. */
>-      if (uaa->iface != NULL) {
>+      if (uaa->iface != NULL)
>               nifaces = uaa->nifaces;
>-      } else {
>-              err = usbd_set_config_index(uaa->device, UFTDI_CONFIG_INDEX, 1);
>-              if (err)
>-                      return (UMATCH_NONE);
>-              err = usbd_interface_count(uaa->device, &nifaces);
>-              if (err)
>-                      return (UMATCH_NONE);
>-              usbd_set_config_index(uaa->device, USB_UNCONFIG_INDEX, 1);
>-      }
>+      else
>+              return UMATCH_NONE;
>
>       /* JTAG on USB interface 0 */
>       if (uaa->vendor == USB_VENDOR_FTDI &&
>-          uaa->product == USB_PRODUCT_FTDI_OPENRD &&
>+          (uaa->product == USB_PRODUCT_FTDI_OPENRD ||
>+          uaa->product == USB_PRODUCT_FTDI_SERIAL_2232C) &&
>           uaa->ifaceno == 0)
>               return (UMATCH_NONE);


Reply via email to