tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Forcing a USB device to "ugen"



Robert Swindells <rjs%fdy2.co.uk@localhost> writes:

> Jason Thorpe <thorpej%me.com@localhost> wrote:
>> I have a device based on the FTDI FT2232C:
>>
>> [ 11113285.311079] uftdi1 at uhub1 port 2 configuration 1 interface 0
>> [ 11113285.311079] uftdi1: SecuringHardware.com (0x0403) Tigard V1.1 (0x6010), rev 2.00/7.00, addr 3
>> [ 11113285.311079] ucom1 at uftdi1 portno 1
>> [ 11113285.311079] uftdi2 at uhub1 port 2 configuration 1 interface 1
>> [ 11113285.311079] uftdi2: SecuringHardware.com (0x0403) Tigard V1.1 (0x6010), rev 2.00/7.00, addr 3
>> [ 11113285.311079] ucom2 at uftdi2 portno 2
>>
>> It's a combo device that, in addition to a standard TTL-level UART,
>> has a bunch of break-out headers for doing things like SPI, SWD, and
>> JTAG (in my case, I need to use JTAG for programming some Atmel
>> CPLDs).  I should be able to do this with OpenOCD
>> (pkgsrc/devel/openocd), but libfdti1 fails to find the device because
>> libusb1 only deals in "ugen".
>
> I thought that all FTDI devices provided JTAG etc. functionality, just
> that the pins are not connected to anything in some devices.

I believe that only the ones with the more advanced engine design can do
JTAG (I think that uses the BITBANG mode, which is yet another mode
along side UART and MPSSE, but I don't exactly remember).  FTDI makes a
lot of chip types, and some of them are only UART.

> What would be wrong with attaching an ugen to interface 1 instead of
> an ucom in the ftdi driver itself?

In the FT4232 chip, for example, there are two MPSSE engines attached to
two of the four ports and 4 distinct ports total (the FT2232 has two
MPSSE engines and two ports total, and the FT232H has one MPSSE engine
and two ports, but they are 16 bits and not the usual 8 bits that the
others have).  On the FT4232, the two MPSSE engines can program their
respective ports to be I2C, SPI, GPIO and etc.. and support a BITBANG
mode that can also be used for GPIO and etc...  They also support the
usual UART mode on a port.  The two ports that don't have the MPSSE
engine can do the UART and BITBANG mode.  In general, the chip is more
complicated then simply setting a specific interface to something or
other.  There probably should be a userland utility or a plist file
somewhere that tells uftdi what you want a particular interface / port
to be.  It is entirely reasonable to want to change the personality
without a reboot from userland.  A detach / reattach is acceptable.






-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index