From patchwork Mon Apr 20 08:51:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Hewitt X-Patchwork-Id: 11498441 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1592B81 for ; Mon, 20 Apr 2020 08:51:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E787B20CC7 for ; Mon, 20 Apr 2020 08:51:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mnHYyhPE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pfSKR5Iw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E787B20CC7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Date:Message-Id:Subject:Mime-Version :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=D3FR/tFYnVWkbypTT9gbwYSQva1TzqeF3NsNEl3Rwgs=; b=mnHYyhPE/7eA+d wQapvm/boOlzG4zzJEjw29gWZpPGqnBSYcgI35O02lH2OZpjFdXoJkmjZTlBHcy4RRb9My/BQzIv1 /Q4WbMaQyr/94FBPiXh4Mbx0ovFn04nmufZFvGNmyzBYxo9ocxAY/J19aDClB3dD+OFYpkV+ykvWA 2uUPhnKjFTa1oJ6QFJORTxadCTAkgaRt2JYBrOltpVLkp6i9xJ4RqY1iACpIeESnMlXiDb2cRg5uB F5xkt2dNH+SwBisgLhswcm8GoB1OcFezmrHezsZkRTRH4I61L6iv0BCK5Cud4Eu4NNcF5+im9Jk6Y UauAPeo8MkRN9MTgGXWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQS90-0000tB-MW; Mon, 20 Apr 2020 08:51:10 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQS8x-0000sL-PN; Mon, 20 Apr 2020 08:51:09 +0000 Received: by mail-lj1-x244.google.com with SMTP id u15so9032455ljd.3; Mon, 20 Apr 2020 01:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=3SQVi3mviWeg4CS1cwBmZBBpKg+8/akNu+v9myGu7iY=; b=pfSKR5IwwyY5eTlx21cr9CVFgg/2tp5X45Q5uU83a6eNO1wBR1ZhbSVvJoGQu+w6T6 gbe9hbXknxGjQxNs3hNXQAa353vErY9Fjwr/23YNbecaMpqR3fn9/NT0k0WzlE2wREUz xVWlJcgonaQZ5tYecx8OrTS3p/c3+qO6rFgDHMIyfECBcSo3BYTKlyvX3+YQPqFSoGhS lrEcoQpHeW52OHqsEVfEley4PD43VsfgrQXSZ7P/llfITN2HO3HRpoWRh/DwvgjVyBmI 7pPpY/U74e8AF4FWrLC/SPuyZPC0Mx6AES8kR/GukT5o3atrQd306DTMwh1xdvmUg7PD 1byQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=3SQVi3mviWeg4CS1cwBmZBBpKg+8/akNu+v9myGu7iY=; b=bR27CHzChM7zBnfv4mBl+4ds7fbw7XOj65K3Z9kVXvkfuQHNzvpA3ETMSInst6JtMb Tn/d5yeGtJ9HwrEKcb6DqiADh/UR4vnmYjOlcUP4TfjjZWQvOIxgGiW7QKS/F5Q5MJed 2A79gNtZN3v1PpN2yqlERgkHgCMshNf83cLN0WVU+jWRUGqf8HKOI3g/QKP/YRXORvnY NCJAwlAUWs0Dwm/RHZFXBcGQpmkdeNiaNgKGeIPpoXCpjSmEWTM6pGsONi4uyGTiREq2 o5jojxU+QaJAnf5nJ5NicInltBDxh+3TxSVK7XYutB5sTlYb8cJCckKt457+G49iEdid O1Qg== X-Gm-Message-State: AGi0PubR656C+lKiKU1Nmm1aAQKUy2H3LrQvZq72SD2Bs7B2MitGQcZc 6a6WFLWQIbg3qW621WugZaY= X-Google-Smtp-Source: APiQypLG8MOu1MOzX5sCFP/mBG9YNnnspTnLAhadXmwEtuT/kuRiMYklHB9w2VlvghfQCoorkmChtg== X-Received: by 2002:a05:651c:30b:: with SMTP id a11mr9387168ljp.164.1587372665259; Mon, 20 Apr 2020 01:51:05 -0700 (PDT) Received: from [172.16.20.20] ([87.200.95.144]) by smtp.gmail.com with ESMTPSA id 73sm479895ljj.72.2020.04.20.01.51.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2020 01:51:04 -0700 (PDT) From: Christian Hewitt Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: How to handle different operating speed for QCA9377 SDIO BT module? Message-Id: Date: Mon, 20 Apr 2020 12:51:01 +0400 To: linux-bluetooth@vger.kernel.org, linux-amlogic@lists.infradead.org, ath10k@lists.infradead.org X-Mailer: Apple Mail (2.3445.104.14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200420_015107_822230_05BFD850 X-CRM114-Status: GOOD ( 10.87 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [christianshewitt[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Resend to expand the audience and include the linux-amlogic and ath10k lists. >>>>> I’m working with a QCA9337 SDIO device on an Android (now Linux) set-top box with an Amlogic S905D SoC. SDIO WiFi (ath10k) is working since 5.7-rc1, but the BT side of the module is still missing. Most Amlogic devices (95%+) use Broadcom SDIO modules with the following device tree content: &uart_A { bluetooth { compatible = "brcm,bcm43438-bt"; shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; max-speed = <2000000>; clocks = <&wifi32k>; clock-names = "lpo"; }; }; I changed the compatible to "qcom,qca9377-bt” and applied the following patch: This results in an attempt to load firmware, see: http://ix.io/2i6Q and using renamed files from https://github.com/boundarydevices/qca-firmware/tree/bd-sdmac-ath10k/qca the module is now otherwise up/working - I can scan/see/pair other BT devices. see: http://ix.io/2i6S and: SML5442TW:~ # bluetoothctl show Controller 91:08:00:00:00:00 (public) Name: SML5442TW Alias: SML5442TW Class: 0x000c0000 Powered: yes Discoverable: no DiscoverableTimeout: 0x000000b4 Pairable: yes UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0536 Discovering: no Advertising Features: ActiveInstances: 0x00 SupportedInstances: 0x05 SupportedIncludes: tx-power SupportedIncludes: appearance SupportedIncludes: local-name So it looks like hci_qca.c needs modification to handle multiple operating speeds, perhaps using the max-speed description from device-tree if available, or defaulting to the current 3000000 value if not. I’m not a coding developer so if someone can suggest a patch - I can test and confirm it works. Or if someone can explain how this should be implemented I will see if I can find someone to help with the task. Christian diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 439392b1c043..6f0350fbdcd6 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2046,6 +2046,7 @@ static SIMPLE_DEV_PM_OPS(qca_pm_ops, qca_suspend, qca_resume); static const struct of_device_id qca_bluetooth_of_match[] = { { .compatible = "qcom,qca6174-bt" }, + { .compatible = "qcom,qca9377-bt" }, { .compatible = "qcom,wcn3990-bt", .data = &qca_soc_data_wcn3990}, { .compatible = "qcom,wcn3991-bt", .data = &qca_soc_data_wcn3991}, { .compatible = "qcom,wcn3998-bt", .data = &qca_soc_data_wcn3998}, This results in probing with errors: http://ix.io/2i6P I noticed "max-speed = <2000000>;” while hci_qca.c sets 3000000. I attempted to set "max-speed = <3000000>;” but this made no difference, so I patched a lower value in hci_qca: diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 6f0350fbdcd6..b7ea1e9f4904 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1678,7 +1678,7 @@ static const struct hci_uart_proto qca_proto = { .name = "QCA", .manufacturer = 29, .init_speed = 115200, - .oper_speed = 3000000, + .oper_speed = 2000000, .open = qca_open, .close = qca_close, .flush = qca_flush,