On Thu, Jan 13, 2011 at 7:55 AM, ian <[email protected]> wrote:
> Hi Michael,
>
> I'll send them out for free to urJTAG contributors/developers, it's the
> least I can do to support a great open source project.
>
> It looks like our first small test batch is going to come in around $35
> each (including worldwide shipping).
>
> The patch is inline below. Please note that 'interface' appeared to be a
> reserved keyword in the Windows compile, so we used interfaceb.
>
> Thank you,
>
> Ian
>
> Index: urjtag/include/urjtag/cable.h
> ===================================================================
> --- urjtag/include/urjtag/cable.h    (revision 1869)
> +++ urjtag/include/urjtag/cable.h    (working copy)
> @@ -63,6 +63,7 @@
>      URJ_CABLE_PARAM_KEY_TDO,            /* lu           gpio used as
> TDO */
>      URJ_CABLE_PARAM_KEY_TMS,            /* lu           gpio used as
> TMS */
>      URJ_CABLE_PARAM_KEY_TCK,            /* lu           gpio used as
> TCK */
> +    URJ_CABLE_PARAM_KEY_INTERFACE,      /* lu           ftdi */
>  }
>  urj_cable_param_key_t;
>
> Index: urjtag/src/tap/cable.c
> ===================================================================
> --- urjtag/src/tap/cable.c    (revision 1869)
> +++ urjtag/src/tap/cable.c    (working copy)
> @@ -672,6 +672,7 @@
>      { URJ_CABLE_PARAM_KEY_TDO,          URJ_PARAM_TYPE_LU,      "tdo", },
>      { URJ_CABLE_PARAM_KEY_TMS,          URJ_PARAM_TYPE_LU,      "tms", },
>      { URJ_CABLE_PARAM_KEY_TCK,          URJ_PARAM_TYPE_LU,      "tck", },
> +    { URJ_CABLE_PARAM_KEY_INTERFACE,    URJ_PARAM_TYPE_LU,
> "interface", },
>  };
>
>  const urj_param_list_t urj_cable_param_list =
> Index: urjtag/src/tap/usbconn/libftd2xx.c
> ===================================================================
> --- urjtag/src/tap/usbconn/libftd2xx.c    (revision 1869)
> +++ urjtag/src/tap/usbconn/libftd2xx.c    (working copy)
> @@ -36,6 +36,7 @@
>  #include <urjtag/error.h>
>  #include <urjtag/log.h>
>  #include <urjtag/usbconn.h>
> +#include <urjtag/cable.h>
>  #include "libftdx.h"
>  #include "../usbconn.h"
>
> @@ -50,6 +51,7 @@
>      unsigned int pid;
>      FT_HANDLE fc;
>      char *serial;
> +    unsigned int interfaceb;
>      /* send and receive buffer handling */
>      uint32_t send_buf_len;
>      uint32_t send_buffered;
> @@ -298,6 +300,7 @@
>  {
>      urj_usbconn_t *c = malloc (sizeof (urj_usbconn_t));
>      ftd2xx_param_t *p = malloc (sizeof (ftd2xx_param_t));
> +    int i;
>
>      if (p)
>      {
> @@ -331,9 +334,25 @@
>      p->fc = NULL;
>      p->pid = template->pid;
>      p->vid = template->vid;
> +    p->interfaceb = 0;
>      /* @@@@ RFHH check strdup result */
>      p->serial = template->desc ? strdup (template->desc) : NULL;
>
> +    /* parse params */
> +    if (params != NULL)
> +        /* parse arguments beyond the cable name */
> +        for (i = 0; params[i] != NULL; i++)
> +        {
> +            if (params[i]->key == URJ_CABLE_PARAM_KEY_INTERFACE)
> +            {
> +                if (params[i]->value.lu == 0) {
> +                    p->interfaceb = 0;
> +                } else {
> +                    p->interfaceb = params[i]->value.lu - 1;
> +                }
> +            }
> +        }
> +
>      c->params = p;
>      c->driver = &urj_tap_usbconn_ftd2xx_driver;
>      c->cable = NULL;
> @@ -395,7 +414,7 @@
>      }
>      else
>          /* give it a plain try */
> -        status = FT_Open (0, &p->fc);
> +        status = FT_Open (p->interfaceb, &p->fc);
>
>      if (status != FT_OK)
>      {
> Index: urjtag/src/tap/usbconn/libftdi.c
> ===================================================================
> --- urjtag/src/tap/usbconn/libftdi.c    (revision 1869)
> +++ urjtag/src/tap/usbconn/libftdi.c    (working copy)
> @@ -36,6 +36,7 @@
>  #include <urjtag/error.h>
>  #include <urjtag/log.h>
>  #include <urjtag/usbconn.h>
> +#include <urjtag/cable.h>
>  #include "libftdx.h"
>  #include "../usbconn.h"
>
> @@ -46,6 +47,8 @@
>      unsigned int pid;
>      struct ftdi_context *fc;
>      char *serial;
> +    /* ftdi interface selection */
> +    unsigned int interfaceb;
>      /* send and receive buffer handling */
>      uint32_t send_buf_len;
>      uint32_t send_buffered;
> @@ -273,6 +276,7 @@
>      urj_usbconn_t *c = malloc (sizeof (urj_usbconn_t));
>      ftdi_param_t *p = malloc (sizeof (ftdi_param_t));
>      struct ftdi_context *fc = malloc (sizeof (struct ftdi_context));
> +    int i;
>
>      if (p)
>      {
> @@ -313,6 +317,21 @@
>      /* @@@@ RFHH check strdup result */
>      p->serial = template->desc ? strdup (template->desc) : NULL;
>
> +    /* parse params */
> +    if (params != NULL)
> +        /* parse arguments beyond the cable name */
> +        for (i = 0; params[i] != NULL; i++)
> +        {
> +            if (params[i]->key == URJ_CABLE_PARAM_KEY_INTERFACE)
> +            {
> +                if (ftdi_set_interface(fc, params[i]->value.lu) == -1)
> +                {
> +                    usbconn_ftdi_free(c);
> +                    return NULL;
> +                }
> +            }
> +        }
> +
>      c->params = p;
>      c->driver = &urj_tap_usbconn_ftdi_driver;
>      c->cable = NULL;
>
>
> On 1/13/2011 1:11 PM, Michael Walle wrote:
>> Hi Ian,
>>
>> Am Do, 13.01.2011, 09:50, schrieb ian:
>>> What is the procedure for submitting a patch?
>> Just post the patch inline so it can easily be commented.
>>
>> If you are using a git repository you may have a look at git format-patch
>> and/or git send-email.
>>
>>> Would any urJTAG developers like a Bus Blaster v2 when they are finished
>>> (about 3 weeks)?
>> How much will it cost? This may be a good device to extend the PLD
>> subsystem to Xilinx CPLD devices.
> ------------------------------------------------------------------------------

Hello!
Ian, I am interested. I had hoped to apply the technology first to the
MACH series of devices that first serviced with AMD, then it went to
Lattice, now I'm looking at technology from Atmel. (Still looking at
them as a matter of fact.)

Contact information available when requested.
-----
Gregg C Levine [email protected]
"This signature fought the Time Wars, time and again."

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to