Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1232725pxu; Fri, 16 Oct 2020 07:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW9FrgtMzXLdZlAdvVGqSOgkd0swBEeFp2c/MSNLED0laNQttBqy6mE6bgYrcB0oeWAOc4 X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr4140056edb.335.1602857567866; Fri, 16 Oct 2020 07:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602857567; cv=none; d=google.com; s=arc-20160816; b=pCcIw4PxBjxPsnxSWJwXtfqIFhPEhtRT8hPcmCqm8VNoaMw2X0ZcKHLdDNdwh4ILMr BPulvlp5A6lttvhtLutBfY5x1xvL0kNJuaNYhxBUyYg/I7sTqQOWTKMosRRfdy1SqN5x qcorBU9nlE1ipioyPZQpgGM1dtFVW42gqWNctVFlEF4w6zFlVm+UxGTs1B/XE67nyFXb DFsTaP+cpezYtzjqY0YPzURUlS/1HuAM7r6RfQ2sfHGJPWjxyWfONFEJRrZbed2xVlN+ 6zva+RB8yovpiDZJjUuGH7++w/Cxi2TTE017Vv6Zrb1tW8dQDRKSBIAkvlkbadDBpbbv 7rIw== 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=9fk8rcjVy0twWMtCbRsTg7aiT85JM7h2cuFp1OyxAO0=; b=xoCKJESo51E+lXncSg7OGUtJatZBIhsD+JIeLyx6hchiVbk4ZhQFMgdZdfMoBeaFmy 0/SujLQN6Dxu7AKlefnSMcZfKqfBDil7sigMmFsnm6UFPZMkwn1fTInCWtsmpFwRcYLJ gat51YUye+Bg0qlFAIE0iPPXTFyTfO0BndDtf6mTRNZktqIOcMhZEf9pgHDmpcHUvOUs w/DRomeS+NgaHmGdu6xfmANYuDEdYBnCTiFJBGDjO4DUTN/2urcqAGfiMLsNB8a/Uv12 ZOABg3UOPk51N8spgiPdL8ke4nb/3bboFDPwtJCvB8hoHm07yMb5FKn9pojGIzj/2K+E xIAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SXeQJLYV; 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 m1si1738682edv.507.2020.10.16.07.12.24; Fri, 16 Oct 2020 07:12:47 -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=SXeQJLYV; 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 S2406143AbgJPJPS (ORCPT + 99 others); Fri, 16 Oct 2020 05:15:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:37246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394747AbgJPJJQ (ORCPT ); Fri, 16 Oct 2020 05:09:16 -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 007E0218AC; Fri, 16 Oct 2020 09:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839338; bh=5UdppMz/DH5yVLE6cGd9AeTzfxWdz0PQeRYlkXJIol0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SXeQJLYVCw3N210H3AkyjseZ8spH4GJaOYox3GhPeRzBGrOXFhniRsxyew+DLhiva A8qICqX41f9MK/5DRaMdn5ZLiEkB7XEGIeadNxiEOF9f3z2bYCp+6ijDpA76D/lO/B z9J1bmxn1eLJeUxwRprcK2W4qQb1GWG4u35ONnAQ= 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.14 13/18] USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters Date: Fri, 16 Oct 2020 11:07:23 +0200 Message-Id: <20201016090437.939246342@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.265805669@linuxfoundation.org> References: <20201016090437.265805669@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 @@ -39,6 +39,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