Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1040087pxu; Fri, 16 Oct 2020 02:11:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy05857MuAXqSk4bqIG1PQ2g+K1lauhbJfoGrJjV7/PVwi7HMxyyEeXpssR+dwrhMcxcIDx X-Received: by 2002:a50:d696:: with SMTP id r22mr2716745edi.209.1602839498868; Fri, 16 Oct 2020 02:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602839498; cv=none; d=google.com; s=arc-20160816; b=J2lqM2ip83Tvb/eWkwNCboszVt3/kXHBc6MgKXKPOLUCHxHP2D8yVBQJbEgdBph716 eVPmX9BHPFfIsbd0sgpTiE9l4YEPWzasg4CzZwQOPMIAm4Lw2O0V90uc0EvKNwa6fecn Dv7FT+CvvPM40F4W4tfzLOnjUuUL5qtbPsrkLd0kudpyCcY4E9bbqlwldOYpDhR9+8rb tggksAGpGraH5bCH9890S/olwaXjzlNDhy23aKK5zaeDM4+kblmrnSFH3Gb8CqlSQxpa m7t6wsElArwtFQzuLUxr6A9o6KrBx8GAzMBg6smNr8IOfaKMYui3+3jK2Hxj8BWKYQYn T51A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Iaro2pHqiuKOZGLEbOR1ndPsHdEzMW0sCiYg9OkXjEM=; b=sPOas7VZ4+EAEGSnUORoXXEoaA6DZqy9zuABUKt1o1BNzbDyc2ksLL5AwH3u00Wtzg 0g9Q4mngVL5tDqDleEjsY3Vf2b9wysamI8PCMw++f4B4P47ueezHEAmCLZPegny1/BCE Lq5/mnBqyvWnNNXxwLPRTzKsWO2juzQrLbe/1X17H15LVvGVPb4EFiObFuf1fklKse4L VCCDPJQeC3qA112hTanOzPsAPUsqFlHyZW5Gdr8X1au+LzdIxzQbX5mLNyhPeqengGVG EQnBWtslu+LYepvOmhqsPjmDM3o1q7m2BQuX+WvyeOTF8B/4N/gPk8YT3bWOPuelC/cd mZ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l2b2vbhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si1372642edn.177.2020.10.16.02.11.16; Fri, 16 Oct 2020 02:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l2b2vbhM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405517AbgJPJIg (ORCPT + 99 others); Fri, 16 Oct 2020 05:08:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405427AbgJPJHm (ORCPT ); Fri, 16 Oct 2020 05:07:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A501220878; Fri, 16 Oct 2020 09:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839261; bh=ukzwW89ghWFCLaIzcYhBOI+R1oV1C7LDKFoyrtpgwjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l2b2vbhMQPoIz0IplgTQ7fSNmaYiza/C2QrDY4vIKalblWyBLEz51JSHXcoAb/ZFz o1O6BYWAGFTDdKovyfhV6S+C0fHyqG6RLlHI0J9/U+LkRb35BYxDdSed8edwUL1zbF SHrjT0AP6WVezK1pOfPrYuogf3H8OfRhRg0erpYg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Mychaela N. Falconia" , Johan Hovold Subject: [PATCH 4.9 13/16] USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters Date: Fri, 16 Oct 2020 11:07:17 +0200 Message-Id: <20201016090437.868287120@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.205626543@linuxfoundation.org> References: <20201016090437.205626543@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mychaela N. Falconia 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 [johan: insert in PID order and drop unused define] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 5 +++++ drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ 2 files changed, 12 insertions(+) --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1032,6 +1032,11 @@ static const struct usb_device_id id_tab /* U-Blox devices */ { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_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 */ }; --- 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 + /* Sienna Serial Interface by Secyourit GmbH */ #define FTDI_SIENNA_PID 0x8348