# HG changeset patch # User Mychaela Falconia # Date 1602563350 0 # Node ID 1d38af6d7be8b78583fa0e0dda39de201e448322 # Parent 026dd69e4ebbe78b4709d672863eda726d67c4ca 0403:7151 USB ID support in mainline Linux diff -r 026dd69e4ebb -r 1d38af6d7be8 doc/Unbuffered-FT2232x-JTAG --- a/doc/Unbuffered-FT2232x-JTAG Fri Sep 18 02:23:38 2020 +0000 +++ b/doc/Unbuffered-FT2232x-JTAG Tue Oct 13 04:29:10 2020 +0000 @@ -81,15 +81,25 @@ is hereby being donated to the community for use on generic FT2232x boards in the unbuffered JTAG adapter configuration. -As of this writing, this 0403:7151 PID has not been submitted to Linux ftdi_sio -kernel maintainers yet, thus if you program it into your FT2232x EEPROM -following the instructions below, the kernel will leave that FT2232x device -completely alone. If you are interested only in JTAG and don't need an extra -UART on Channel B, this arrangement should be fully sufficient - you simply -configure your OpenOCD in userspace to find your unbuffered and ad-hoc-wired -JTAG adapter at that USB ID. And if you do need the UART on Channel B, you can -trivially patch your ftdi_sio.c kernel driver, adding the new ID to the table -with JTAG quirk (&ftdi_jtag_quirk) specified. +Support for this 0403:7151 USB ID has been added to Linux ftdi_sio driver in +2020-09 with this commit: + +https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/commit/?id=6cf87e5edd9944e1d3b6efd966ea401effc304ee + +This commit is not included in Linux 5.9, but is expected to appear in the +mainline tree as of 5.10-rc1. If your Linux kernel version (or rather ftdi_sio +driver version if it's a module) includes this commit, the ftdi_sio driver will +create a ttyUSB device for Channel B, allowing that channel to function as a +UART if desired, but Channel A will be left alone by the kernel driver, reserved +for userspace applications like OpenOCD. If your kernel/driver version does not +include the newly added commit, both FT2232x channels will be left alone by the +kernel driver, i.e., no ttyUSB devices will be created. If you are interested +only in JTAG and don't need an extra UART on Channel B, it should not matter +whether your ftdi_sio driver knows about the new custom USB ID or not - you +simply configure your OpenOCD in userspace to find your unbuffered and ad-hoc- +wired JTAG adapter at USB ID 0403:7151. If you do need the UART on Channel B +but your Linux kernel version does not include the recent addition, you will +need to manually apply the trivial patch from the commit linked above. Choice of FT2232x breakout board ================================ @@ -100,9 +110,9 @@ http://pldkit.com/other/ft2232d-module These modules were originally made with FT2232D chips, then the vendor found a -stash of old but still good FT2232C chips, so apparently the current ones are -FT2232C, not D - but this distinction makes no difference for the present -purpose. +stash of old but still good FT2232C chips, and some modules were made with these +FT2232C chips. Now it looks like the vendor has gone back to FT2232D - but this +distinction makes no difference for the present purpose. These days FT2232H chips and FT2232H breakout boards are much more popular, but I generally prefer FT2232C/D for classicness and simplicity. Additionally, @@ -138,7 +148,7 @@ fteeprom/ftee-gen2232c eeproms/jtag-unbuf | fteeprom/fteeprom-prog i:0x0403:0x6010 Then unplug and replug the FT2232D board, and it should come back with the new -0403:7151 USD ID. If you wish to bring it back to its original blank-EEPROM +0403:7151 USB ID. If you wish to bring it back to its original blank-EEPROM state, you can do so by erasing the EEPROM: fteeprom-erase i:0x0403:0x7151 diff -r 026dd69e4ebb -r 1d38af6d7be8 eeproms/jtag-unbuf --- a/eeproms/jtag-unbuf Fri Sep 18 02:23:38 2020 +0000 +++ b/eeproms/jtag-unbuf Tue Oct 13 04:29:10 2020 +0000 @@ -5,11 +5,12 @@ # it is used for the present purpose with this full EEPROM configuration. # # The purpose of having a custom USB ID is to prevent the Linux kernel -# from treating this FT2232D instance as a dual UART and creating a -# ttyUSB device for Channel A; if you wish to use Channel B as a UART -# (which is still available for that purpose), you will need to make a -# one-liner patch to the ftdi_sio driver, telling it to treat this USB ID -# like other JTAG+UART adapters, creating a ttyUSB device only for Channel B. +# ftdi_sio driver from treating this FT2232D instance as a dual UART and +# creating a ttyUSB device for Channel A. If you wish to use Channel B +# as a UART (which is still available for that purpose), you will need to use +# a Linux kernel version with commit 6cf87e5edd9944e1d3b6efd966ea401effc304ee +# included, or apply that commit locally if your kernel version does not +# include it. vid 0x0403 # FTDI pid 0x7151 # Allocated by FTDI to Falconia Partners LLC