FreeCalypso > hg > freecalypso-hwlab
diff linux-patch/minpatch-4.4.14/0001-USB-serial-ftdi_sio-add-support-for-FreeCalypso-JTAG.patch @ 83:d7a1e7a6d6ba
linux-patch: current best offering of minpatch-*
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 06 Dec 2020 02:55:40 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux-patch/minpatch-4.4.14/0001-USB-serial-ftdi_sio-add-support-for-FreeCalypso-JTAG.patch Sun Dec 06 02:55:40 2020 +0000 @@ -0,0 +1,78 @@ +From 5af8e2ad7d0295d90cb2bc566f3d935668fb0535 Mon Sep 17 00:00:00 2001 +From: "Mychaela N. Falconia" <falcon@freecalypso.org> +Date: Wed, 16 Sep 2020 01:56:29 +0000 +Subject: [PATCH 1/3] USB: serial: ftdi_sio: add support for FreeCalypso + JTAG+UART adapters + +commit 6cf87e5edd9944e1d3b6efd966ea401effc304ee upstream. + +There exist many FT2232-based JTAG+UART adapter designs in which +FT2232 Channel A is used for JTAG and Channel B is used for UART. +The best way to handle them in Linux is to have the ftdi_sio driver +create a ttyUSB device only for Channel B and not for Channel A: +a ttyUSB device for Channel A would be bogus and will disappear as +soon as the user runs OpenOCD or other applications that access +Channel A for JTAG from userspace, causing undesirable noise for +users. The ftdi_sio driver already has a dedicated quirk for such +JTAG+UART FT2232 adapters, and it requires assigning custom USB IDs +to such adapters and adding these IDs to the driver with the +ftdi_jtag_quirk applied. + +Boutique hardware manufacturer Falconia Partners LLC has created a +couple of JTAG+UART adapter designs (one buffered, one unbuffered) +as part of FreeCalypso project, and this hardware is specifically made +to be used with Linux hosts, with the intent that Channel A will be +accessed only from userspace via appropriate applications, and that +Channel B will be supported by the ftdi_sio kernel driver, presenting +a standard ttyUSB device to userspace. Toward this end the hardware +manufacturer will be programming FT2232 EEPROMs with custom USB IDs, +specifically with the intent that these IDs will be recognized by +the ftdi_sio driver with the ftdi_jtag_quirk applied. + +Signed-off-by: Mychaela N. Falconia <falcon@freecalypso.org> +[johan: insert in PID order and drop unused define] +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold <johan@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/usb/serial/ftdi_sio.c | 5 +++++ + drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ + 2 files changed, 12 insertions(+) + +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c +index b61f12160d37..984a93c38365 100644 +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -1008,6 +1008,11 @@ static const struct usb_device_id id_table_combined[] = { + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, + { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) }, ++ /* FreeCalypso USB adapters */ ++ { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID), ++ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, ++ { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), ++ .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { } /* Terminating entry */ + }; + +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h +index c5d6c1e73e8e..6218f9c45016 100644 +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -38,6 +38,13 @@ + + #define FTDI_LUMEL_PD12_PID 0x6002 + ++/* ++ * Custom USB adapters made by Falconia Partners LLC ++ * for FreeCalypso project, ID codes allocated to Falconia by FTDI. ++ */ ++#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150 ++#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151 ++ + /* Cyber Cortex AV by Fabulous Silicon (http://fabuloussilicon.com) */ + #define CYBER_CORTEX_AV_PID 0x8698 + +-- +2.9.0 +