From patchwork Fri May 12 13:58:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 93213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5128160vqo; Fri, 12 May 2023 07:01:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6K13jIU4YfYQqYaZMn5FDOGPZ4h0t8W9+6T2jJisd9cApomzHoeE/5hm1gW/RL9BbtKz1y X-Received: by 2002:a17:902:b08c:b0:1a1:ee8c:eef7 with SMTP id p12-20020a170902b08c00b001a1ee8ceef7mr26412863plr.48.1683900078721; Fri, 12 May 2023 07:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683900078; cv=none; d=google.com; s=arc-20160816; b=JMeRfaaSvbdUwm4v+MZWe0nAGn9OJfERJMQWiGYO16UPPbeLv3qozNxwXKjFfdbAX0 iqzVHV6j+/MlTMArUkKo7rzi2xk2ZYzzD13heNZXUqysvyEtpE+xlsDVG8qfTK2phVz6 TzfJQRJCm4zZ1NZtcNmKeQ+vF4tM0JFLtCLPHrJDhDepM72X9KfOE4GCajicCOKq6Jtu p/1iQj9OLeOMuDK6eHtNFTeC0ZIb8vAQ7DAgHwlvkT/DZxq9ocScFjtpZwMlrYOx3JCs 9L7zMwHG1GQKqjefTFeyfWCiux0EetQZKvAiQ0gBxZECFLPZR9ye3TEViFYaL4puZSk2 c8zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=EurCSfvr992X/6Gy0O7JYm3XtzvDHOqQWEeqxrS+tkg=; b=x/CLuq4lmfwPPCIuvqLh5AuRPr9oW8FvZ/Qdl4863++mcA/PAMWKFC4oAm2JKXqgDT APgDtqtIG3Am2KD3u+7EPzEAHbJ7ZvM8p9RirrysaH/gq+4VEQmWSgXuLFhbvqoxytT+ V6hasUpLWCan6Rodo22mIf6rFn83RDeV072CCKsLe5upqA0LxmkfydAsWPCtEXUvGILi chFujnVLnPUxTJXHMq1CWiN634iTMfV0DidEWJescGlmrZnifo9jI+zaGJeu85TwY4Y3 iErIzZZIGygiSsPqLBB+x6Xw5B0ynEZdmu8CU4iYANP5axdEwZPWddHw+KJUvtQnLjKG q8Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MpFaid4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li12-20020a170903294c00b001ac4e2d2b58si8539577plb.112.2023.05.12.07.00.41; Fri, 12 May 2023 07:01:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=MpFaid4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241363AbjELN7H (ORCPT + 99 others); Fri, 12 May 2023 09:59:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240332AbjELN66 (ORCPT ); Fri, 12 May 2023 09:58:58 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D922729 for ; Fri, 12 May 2023 06:58:54 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9659e9bbff5so1830081366b.1 for ; Fri, 12 May 2023 06:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683899933; x=1686491933; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EurCSfvr992X/6Gy0O7JYm3XtzvDHOqQWEeqxrS+tkg=; b=MpFaid4LrmkmpMNIiLRoMm4TkTXzDi5yrI72zQiY/CTDBf6wZnkRzw0ebnE5kU2nC3 CTssnKiroIDezyQIpPCbfqsGVRqgBdNf4IiKZ4JDlecqbg3ibhQsYKR9HT05PBGMu6oZ inazl50xNH67x74+4QDxhGVet6+ez4HZLIhoJ8wZyt8sgLH2Nyn8Fs7ZmL4oMhha3jgH S8Pxw9mH5FdIqai1pv0/GwGdfzurB93XD32hA/xJBPsnb2sii0rq4yrvxq2K/dyO/yhb IqzdIzGovHN+Y46gBxWjdNT63uqVIHP9Jyg9ZG1t4kGqSgRqh0/Vjq5VIoKxS5xhKnOC uVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683899933; x=1686491933; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EurCSfvr992X/6Gy0O7JYm3XtzvDHOqQWEeqxrS+tkg=; b=JS0gT3zb9vozZQA1zt2dm2Oe+0hki7t9S81Zdi0o4OK2KlBFDO7LRKXhLmKE/yVqtX 19GP1uR/558bQ3ftlpalZmeZ9+jItSG3zlsnECzMvckWEcPdnrSxHMJHv2QLUvm487qw QpUYYt5BrMI5AQr6rAloD0eVk/E4WtB3buyHImNU0nhtUdHfj+QE1G5B9gd7TfYUMaYB fIo/ZRjYgK+JSoAypU65RlotC6GPe5s7vmzFXmuEgZNSgMWtRcrX9jOL0WGr3yZ9WkWj FAEgV/U75jTBa9oknvoffrsALTePHwYQ0emsuqABylR5U5+jP3yIXojEDNzv+iZjakdA sJKg== X-Gm-Message-State: AC+VfDyj3aFKPFc7WBXWwYMuVSLAX2XvlBXu26WvStvV/AEXvP0dssLC PkCaMIJGWrwGQfLPon94TMIhmw== X-Received: by 2002:a17:907:6088:b0:949:cb6a:b6f7 with SMTP id ht8-20020a170907608800b00949cb6ab6f7mr24594424ejc.56.1683899933449; Fri, 12 May 2023 06:58:53 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id mc27-20020a170906eb5b00b00966330021e9sm5399061ejb.47.2023.05.12.06.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:58:53 -0700 (PDT) From: Luca Weiss Date: Fri, 12 May 2023 15:58:23 +0200 Subject: [PATCH v2 1/4] dt-bindings: net: qualcomm: Add WCN3988 MIME-Version: 1.0 Message-Id: <20230421-fp4-bluetooth-v2-1-3de840d5483e@fairphone.com> References: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> In-Reply-To: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Gross , Bjorn Andersson , Konrad Dybcio , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss , Krzysztof Kozlowski X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765697209145403117?= X-GMAIL-MSGID: =?utf-8?q?1765697209145403117?= Add the compatible for the Bluetooth part of the Qualcomm WCN3988 chipset. Acked-by: Krzysztof Kozlowski Signed-off-by: Luca Weiss --- Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml index 68f78b90d23a..7a53e05ae50d 100644 --- a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml @@ -18,6 +18,7 @@ properties: enum: - qcom,qca6174-bt - qcom,qca9377-bt + - qcom,wcn3988-bt - qcom,wcn3990-bt - qcom,wcn3991-bt - qcom,wcn3998-bt @@ -106,6 +107,7 @@ allOf: compatible: contains: enum: + - qcom,wcn3988-bt - qcom,wcn3990-bt - qcom,wcn3991-bt - qcom,wcn3998-bt From patchwork Fri May 12 13:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 93216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5141392vqo; Fri, 12 May 2023 07:15:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5S/qh9/SRurat+dmfdyTjuaSSq4LiVWjcKQuIQsj5oPlBz2ks0lQja7DUCGbyGJDSzfzC6 X-Received: by 2002:a05:6a21:78a7:b0:101:2f83:5fba with SMTP id bf39-20020a056a2178a700b001012f835fbamr1550125pzc.31.1683900957337; Fri, 12 May 2023 07:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683900957; cv=none; d=google.com; s=arc-20160816; b=cQkpgL15UzFID8sAKhCYA+rSsgymWPqoYgaP44+ggIJs0AW27Qdq+XM0jeNGzaUyjo Oms9tX7VIxiwxA90Az0ZVwh36ykNuhhxhYfXN0WZznsv1R78cwLnGeUkqMizV0iiTGGj G40hkGoSUzRvHyR1+Mcsx7jmIHv8vQ9INuX02wHkipRFrd0kql7UJSzBra6DVWig8kjF EIGxwN75Udp/3bgJd2Gneh0MF4XGwNy8PoGKnDdaKpHWPQs2AO34iDVMJwnyQ0bhE6Zm RuX8/Vq82wTYxUkPFsIglBQIsJzoOHC6xDLW/PB004dOmKKPRT9CV68+BD4epPliT8vK AA4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=q+GkMxVZ4HN2CQYFsf4cf6CWvTAfmT2XHzodRt50Yo4=; b=IOV7/M+i5/s7rpZ6i+eNLRBCzmbfbKg2DriPIljKgusFVnPNRLWdt/mdCEzCECA1qu TwY0YBDLMw/tsaEj0bJh7VB9N2qsOTdbIuC0+EHhkU8gno3boNvjXAX/YnGYA/IXq9ea RuqDsQP2Q0qTuhtEbUliZEXH/yQkVoIJnqsE5LRiF/akPR+wyIqd325jPaXvhliAEt5X 2uBzgbbGPCT/AF7c8lx+3BXEoK4fcVb0H7n/1hpts4Z5fx2qMWy/Zgl56oZdbNBshVzm JmQh+mR+sEpAxn88NV/nwWs/JIZXp4egP2qIPDX7eszT+LlvBoATzmV8MdaPIqbfZPfl pSdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=eJJyI2Cy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs6-20020a632806000000b0052c885da612si8955906pgb.366.2023.05.12.07.15.42; Fri, 12 May 2023 07:15:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=eJJyI2Cy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241396AbjELN7J (ORCPT + 99 others); Fri, 12 May 2023 09:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241361AbjELN67 (ORCPT ); Fri, 12 May 2023 09:58:59 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54A711DB1 for ; Fri, 12 May 2023 06:58:55 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-9659c5b14d8so1649185066b.3 for ; Fri, 12 May 2023 06:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683899934; x=1686491934; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=q+GkMxVZ4HN2CQYFsf4cf6CWvTAfmT2XHzodRt50Yo4=; b=eJJyI2CyqlEHutKdDkmDy0PqlrFJyKINVnsICnS6tgca6znravmgQfyYRxeeUUPr9/ vFUIQ2usV9FHDP7F8NxK4PpbtsK9OD0Ak//ykd3A01X2/BGNXyk++79qNNckjailXSl9 Eioz35yq7S9T9+/V0RgjtOTkaDk28KVzLs5BSbxDM24yhgdypxLtXaVuOHxSzXlb94PZ WeKReezsLpQeVnUVE/n1MoGKxByqlzDCK962lQNKF5glCha4z2ClA+/aBTFoChRdrbZ9 55QohDxM/e5+EzgKdlKe9LisKyJK8Mdxdd5juzSw0zyIobGheAz9nkX5IFR6YDPA8Qob 0POw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683899934; x=1686491934; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q+GkMxVZ4HN2CQYFsf4cf6CWvTAfmT2XHzodRt50Yo4=; b=H3ewUExV+OiB9NZuNWlT7HL/tuzm3P878QC0BuM8NYRBgkz4D5JjRTdAwpYq06gnkF NJe8Kz7/hQBAZ8wjOHtWqUxwdvkFMU+rVxTGKlcG9hQv0N4WLClt57Pr9ZDLi31uunON QyicHASRGZ9ae+tVzY8OJPnPUpAwpBI1yE7sB5qdwL5n99T+peUOF+Igh6vv5M4basV/ 9fYbQDIHhGDmg1IfbjpDAaRmBxIR6umJKrMNO1rX9PEMGT1LnT86KifXzO68DHLlFK3Z YOuyNdtlEv88gkfdmuJTokPmudtzQjw50ovEA7ZJ9fss9dvuA6RCIWKcgswSxgSIVyD5 c4Bg== X-Gm-Message-State: AC+VfDzxFamAMuTqH4nnldLhmj9G7HHPEKZX0arAAlQoOnWJB6uyMwEg tCsUVm3qCkvkCFxe8Lk6TPmgyQ== X-Received: by 2002:a17:907:1c23:b0:966:2984:3da0 with SMTP id nc35-20020a1709071c2300b0096629843da0mr22045514ejc.63.1683899934309; Fri, 12 May 2023 06:58:54 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id mc27-20020a170906eb5b00b00966330021e9sm5399061ejb.47.2023.05.12.06.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:58:53 -0700 (PDT) From: Luca Weiss Date: Fri, 12 May 2023 15:58:24 +0200 Subject: [PATCH v2 2/4] Bluetooth: btqca: Add WCN3988 support MIME-Version: 1.0 Message-Id: <20230421-fp4-bluetooth-v2-2-3de840d5483e@fairphone.com> References: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> In-Reply-To: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Gross , Bjorn Andersson , Konrad Dybcio , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765698130307656711?= X-GMAIL-MSGID: =?utf-8?q?1765698130307656711?= Add support for the Bluetooth chip codenamed APACHE which is part of WCN3988. The firmware for this chip has a slightly different naming scheme compared to most others. For ROM Version 0x0200 we need to use apbtfw10.tlv + apnv10.bin and for ROM version 0x201 apbtfw11.tlv + apnv11.bin Signed-off-by: Luca Weiss --- drivers/bluetooth/btqca.c | 13 +++++++++++-- drivers/bluetooth/btqca.h | 12 ++++++++++-- drivers/bluetooth/hci_qca.c | 12 ++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index fd0941fe8608..3ee1ef88a640 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -594,14 +594,20 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, /* Firmware files to download are based on ROM version. * ROM version is derived from last two bytes of soc_ver. */ - rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f); + if (soc_type == QCA_WCN3988) + rom_ver = ((soc_ver & 0x00000f00) >> 0x05) | (soc_ver & 0x0000000f); + else + rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f); if (soc_type == QCA_WCN6750) qca_send_patch_config_cmd(hdev); /* Download rampatch file */ config.type = TLV_TYPE_PATCH; - if (qca_is_wcn399x(soc_type)) { + if (soc_type == QCA_WCN3988) { + snprintf(config.fwname, sizeof(config.fwname), + "qca/apbtfw%02x.tlv", rom_ver); + } else if (qca_is_wcn399x(soc_type)) { snprintf(config.fwname, sizeof(config.fwname), "qca/crbtfw%02x.tlv", rom_ver); } else if (soc_type == QCA_QCA6390) { @@ -636,6 +642,9 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, if (firmware_name) snprintf(config.fwname, sizeof(config.fwname), "qca/%s", firmware_name); + else if (soc_type == QCA_WCN3988) + snprintf(config.fwname, sizeof(config.fwname), + "qca/apnv%02x.bin", rom_ver); else if (qca_is_wcn399x(soc_type)) { if (ver.soc_id == QCA_WCN3991_SOC_ID) { snprintf(config.fwname, sizeof(config.fwname), diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h index b884095bcd9d..fc6cf314eb0e 100644 --- a/drivers/bluetooth/btqca.h +++ b/drivers/bluetooth/btqca.h @@ -142,6 +142,7 @@ enum qca_btsoc_type { QCA_INVALID = -1, QCA_AR3002, QCA_ROME, + QCA_WCN3988, QCA_WCN3990, QCA_WCN3998, QCA_WCN3991, @@ -162,8 +163,15 @@ int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); int qca_send_pre_shutdown_cmd(struct hci_dev *hdev); static inline bool qca_is_wcn399x(enum qca_btsoc_type soc_type) { - return soc_type == QCA_WCN3990 || soc_type == QCA_WCN3991 || - soc_type == QCA_WCN3998; + switch (soc_type) { + case QCA_WCN3988: + case QCA_WCN3990: + case QCA_WCN3991: + case QCA_WCN3998: + return true; + default: + return false; + } } static inline bool qca_is_wcn6750(enum qca_btsoc_type soc_type) { diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 1b064504b388..5280236d4b96 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1835,6 +1835,17 @@ static const struct hci_uart_proto qca_proto = { .dequeue = qca_dequeue, }; +static const struct qca_device_data qca_soc_data_wcn3988 __maybe_unused = { + .soc_type = QCA_WCN3988, + .vregs = (struct qca_vreg []) { + { "vddio", 15000 }, + { "vddxo", 80000 }, + { "vddrf", 300000 }, + { "vddch0", 450000 }, + }, + .num_vregs = 4, +}; + static const struct qca_device_data qca_soc_data_wcn3990 __maybe_unused = { .soc_type = QCA_WCN3990, .vregs = (struct qca_vreg []) { @@ -2359,6 +2370,7 @@ static const struct of_device_id qca_bluetooth_of_match[] = { { .compatible = "qcom,qca6174-bt" }, { .compatible = "qcom,qca6390-bt", .data = &qca_soc_data_qca6390}, { .compatible = "qcom,qca9377-bt" }, + { .compatible = "qcom,wcn3988-bt", .data = &qca_soc_data_wcn3988}, { .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}, From patchwork Fri May 12 13:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 93215 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5136041vqo; Fri, 12 May 2023 07:09:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+xvVCOAV6PIkU+nAOMwjhXURirRQ6X6sMfeZnE2Dw81oncAJurj+AnzH6KtVNSrhw/SFF X-Received: by 2002:a05:6870:d4c3:b0:192:ae8a:2f30 with SMTP id l3-20020a056870d4c300b00192ae8a2f30mr13757232oai.6.1683900547362; Fri, 12 May 2023 07:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683900547; cv=none; d=google.com; s=arc-20160816; b=mN17rEt7UJqI655MrigOey8RzGmaACMS33zVDtYiA4SYDeBYdp7/5SimeoFJj2kA8L jLBP87GmQea5S23OafW3RzB9/jba2e8j6GcfHAVzWBEV3BnhpU0JWdYpqpT1fqHBcg9i MRAw4JIq4S8ZaALSOcJn2d65jktdY42qxHqz6Qpeu/TzXTLtnPl950e95Ze23m4LUJN1 mC7OWPvWfJuYKQUdOHkY9UvxCGghcUfjtdWfaWStlMDZVOivj6obmRala9r97mQLC+Wp AVuM9w1bPaCwt+JvtOGfdcg0rT0XJX5cHXNuNXm/KBIK2CDLTxs7zEdJAL1gCjQN8bum Nx4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=zyYcNXudTdGwmmyXYtomjXhMBjfx2oalrvadhl4fK/Y=; b=L6UhKbNN2+BHvaX6bs0Sh1EtUyos8dQLapbt22Ykvq+liVsNmZiQLgg6CwMYIJWkNl eNp8ZpnFqs1TSTG/K+lfJNDF8F7sLu0Nd8GejY/b7i+YL07USygd4kvCZgKRXnkOLhAB C8m5QyeLBKocVP2u0KzYdUpBDBeuSNCTS8KHgqlIuimNgKkju+uU9Lgvcwu9X4xu5wFs FZsZnUpdUJLAVNbSL2gLiYGF9/glGsyA+Ke2Lsz9QrK9OQ9+O4L9Ay1ODPyQvkT+wBuS iKDlC16WILRjr1wZBzMrTNybXkJF1ib6QU2fUeHGRtSLWcsSopGhgHaKWPv4smFf23tn bZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=lfrx+FLu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a9d5788000000b006a5a726c51bsi10076904oth.127.2023.05.12.07.08.53; Fri, 12 May 2023 07:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=lfrx+FLu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241408AbjELN7L (ORCPT + 99 others); Fri, 12 May 2023 09:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241372AbjELN7F (ORCPT ); Fri, 12 May 2023 09:59:05 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C9013860 for ; Fri, 12 May 2023 06:58:56 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-969f90d71d4so767097266b.3 for ; Fri, 12 May 2023 06:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683899935; x=1686491935; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zyYcNXudTdGwmmyXYtomjXhMBjfx2oalrvadhl4fK/Y=; b=lfrx+FLuS5VaSd6DraCCI8ElBa+Sn4/A5AfMpx12ZuyVDis12qMc7okoq3u2PdBp0j c/X678b7wBJdJrS1RCO0IuhNKPUKMuQT/lHS1UCQ+6AS4gQd6RhOMHVk6PV/gshA+UN4 irik+/wlVYZyqr5p6AalGw4eZBZy5/jtOMEkR7sERrsG0NzJW3J70+h5naeqP/Cw8mVl DL7NcPBE7XQ7675EurdzoCMlxN10kDwZb1bipxE8NDMNuZtCoSwXiSOe970xbVK8Ce5S bJerGENqUvVlDLU0/mv85IeVn1F1J2Ly3cLy5M0QRUcoJnSLI9tqx8c9JJ0ci+nL+lfN cCTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683899935; x=1686491935; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zyYcNXudTdGwmmyXYtomjXhMBjfx2oalrvadhl4fK/Y=; b=euUhSxFr5Ht5YKDcjhPenKvGIWeZPombEzjhlv/heWciacCwszgwXkmNhJm9PhsR8P bqopv1OqyjAmqFcEKxoFoFo/Gu1ZV8dN3EJP5bjp3JcCtwH7yqyeigDSSRmPSHIqS5Ug c4hYi9JQlLYI8ueGu9v3jJDkrvrpSwx1OSI8aPsF60umdhLHP6s9/jPRVz7BdGSXANKg fd0gPkXc3j86NPZTsIh/FBL4rLHA4E9LSOGFj7TLONldPTB2GAmU7JKt49O2OeXVv2OA pUCqy1uYJ9YL2ZolOEcLMVHZJgmM5WVcPFA0C/YZc8NDUN7qlFV5iyjFMGQN4gFP4RIr Lw4g== X-Gm-Message-State: AC+VfDxXf7VztPbb0Lm554fCZiBddPhCxzK9pBYWNnlbjZtFZjb1893O HaP6TPYm0bwS4DuTAXj2Niwg0A== X-Received: by 2002:a17:907:9415:b0:94f:395b:df1b with SMTP id dk21-20020a170907941500b0094f395bdf1bmr20606239ejc.21.1683899935213; Fri, 12 May 2023 06:58:55 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id mc27-20020a170906eb5b00b00966330021e9sm5399061ejb.47.2023.05.12.06.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:58:54 -0700 (PDT) From: Luca Weiss Date: Fri, 12 May 2023 15:58:25 +0200 Subject: [PATCH v2 3/4] arm64: dts: qcom: sm6350: add uart1 node MIME-Version: 1.0 Message-Id: <20230421-fp4-bluetooth-v2-3-3de840d5483e@fairphone.com> References: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> In-Reply-To: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Gross , Bjorn Andersson , Konrad Dybcio , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765697700379415388?= X-GMAIL-MSGID: =?utf-8?q?1765697700379415388?= Add the node describing uart1 incl. opp table and pinctrl. Signed-off-by: Luca Weiss --- arch/arm64/boot/dts/qcom/sm6350.dtsi | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi index 18c4616848ce..eb46dc2d969b 100644 --- a/arch/arm64/boot/dts/qcom/sm6350.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi @@ -378,6 +378,25 @@ opp-2073600000 { }; }; + qup_opp_table: opp-table-qup { + compatible = "operating-points-v2"; + + opp-75000000 { + opp-hz = /bits/ 64 <75000000>; + required-opps = <&rpmhpd_opp_low_svs>; + }; + + opp-100000000 { + opp-hz = /bits/ 64 <100000000>; + required-opps = <&rpmhpd_opp_svs>; + }; + + opp-128000000 { + opp-hz = /bits/ 64 <128000000>; + required-opps = <&rpmhpd_opp_nom>; + }; + }; + pmu { compatible = "arm,armv8-pmuv3"; interrupts = ; @@ -741,6 +760,22 @@ i2c0: i2c@880000 { status = "disabled"; }; + uart1: serial@884000 { + compatible = "qcom,geni-uart"; + reg = <0 0x00884000 0 0x4000>; + clock-names = "se"; + clocks = <&gcc GCC_QUPV3_WRAP0_S1_CLK>; + pinctrl-names = "default"; + pinctrl-0 = <&qup_uart1_cts>, <&qup_uart1_rts>, <&qup_uart1_tx>, <&qup_uart1_rx>; + interrupts = ; + power-domains = <&rpmhpd SM6350_CX>; + operating-points-v2 = <&qup_opp_table>; + interconnects = <&clk_virt MASTER_QUP_CORE_0 0 &clk_virt SLAVE_QUP_CORE_0 0>, + <&aggre1_noc MASTER_QUP_0 0 &clk_virt SLAVE_EBI_CH0 0>; + interconnect-names = "qup-core", "qup-config"; + status = "disabled"; + }; + i2c2: i2c@888000 { compatible = "qcom,geni-i2c"; reg = <0 0x00888000 0 0x4000>; @@ -1726,6 +1761,34 @@ qup_i2c10_default: qup-i2c10-default-state { drive-strength = <2>; bias-pull-up; }; + + qup_uart1_cts: qup-uart1-cts-default-state { + pins = "gpio61"; + function = "qup01"; + drive-strength = <2>; + bias-disable; + }; + + qup_uart1_rts: qup-uart1-rts-default-state { + pins = "gpio62"; + function = "qup01"; + drive-strength = <2>; + bias-pull-down; + }; + + qup_uart1_rx: qup-uart1-rx-default-state { + pins = "gpio64"; + function = "qup01"; + drive-strength = <2>; + bias-disable; + }; + + qup_uart1_tx: qup-uart1-tx-default-state { + pins = "gpio63"; + function = "qup01"; + drive-strength = <2>; + bias-pull-up; + }; }; apps_smmu: iommu@15000000 { From patchwork Fri May 12 13:58:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 93214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5134756vqo; Fri, 12 May 2023 07:07:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6o6zd12Zq8Zs5klXECiHsaUU8R14WRRiBk15p5cRuE7OlJl3wHQl9L2ja/JMHrTy+3UqbN X-Received: by 2002:a05:6a00:228e:b0:643:b330:4b78 with SMTP id f14-20020a056a00228e00b00643b3304b78mr33180261pfe.14.1683900460073; Fri, 12 May 2023 07:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683900460; cv=none; d=google.com; s=arc-20160816; b=aviVnEOKjV4TxQxBxWZu8bSAMN4N5b6AW7MZxkemfYdckFTQLwqwKwTZTbHRzlVoLI JV77B0Ytln+I464Rrd0Acp5xPWZ2gHAVhlSH49n6X3/P7YAsLR+hSsyPBQubj6FMliVX P4G1TSqdAJNOt5Vlg2uhgQLAFmHWsklD7oPDmepCpcBuY3oXSYVxwixGuPwTf4F7eJl7 RmrhY5gz1d/8Sh4XoRuLAXFXxxwPaHdN2FpbCKUSlVnJ242vS3zwONq0S6D2wzL/cf3e OsodQJd6+YdNLBnSdtlKmpx0/Gm86DrxwnLwlYbsJEmDVsf6MJe9CMBth9kipgEkCX3q IKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=qOtk/yQVnfEMhiRGI24mR5MwL3LwUjz78NfOcD+mAlo46jGunAgniq/oiyXVr3O1ki NnF5FNLZD5jVQApMi6EMj0AQ6JWVLVLeOVbJLQ9pb67/2I0bRhSzlu9ChODDwv2tcHPv psS09pSW62SzoJsL/Oo3eOhN2HFj//lx7q8ig4QyceCT3o5MqLTMU+UBXWp23TsE2nsg IFfvZ1kMYnyaqnJhxLtymvg/1/voOr3E9SRyxgaDfK2zBqTX19zUVI6qG6UI19BUMEIL bI8pOlnFVTwQ5/DhK3McvpEkRm5cU+evYGStooTMmHP00NIkfl68tljYFJ2ZHVSoLdrL YiIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZPbUlqd5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a620504000000b00646672f2be3si4526626pff.282.2023.05.12.07.07.24; Fri, 12 May 2023 07:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=ZPbUlqd5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241414AbjELN7N (ORCPT + 99 others); Fri, 12 May 2023 09:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241351AbjELN7F (ORCPT ); Fri, 12 May 2023 09:59:05 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2134213C3E for ; Fri, 12 May 2023 06:58:58 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-965ddb2093bso1444984166b.2 for ; Fri, 12 May 2023 06:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683899936; x=1686491936; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=ZPbUlqd510c1ym+w8AeWysEGsU8WE4AvhtiRwFFFnqVDALOh+khbiSvxLg23oSyqZb m23j7QATGuiB4u5f77wUiSITvARRigOD9JS+B/tkoTq68F3Xv8HSx5C+8gufqCGb2jjJ vfVjzyKT6UxdFfWKSp5p+ftUI4XHKVG3wf6dHJVycvhQkMEdGfMDVCKE6Q9hO5a7wwr4 faAyGH3z4UyfAob0fREEEbsUpcUmp5EOxCWdfKQsqY0Pp9kfi8jdZs0uKlY7pUej7IV6 GEgNxH+Bh2Ib7LWsorTTtcuvaEnZz+D04+udrmhsU1TW+sJBVVAmAn82d6dQyBoArZ56 biYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683899936; x=1686491936; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uD3Ipvt0NExfmILEv8OKGxIPIOoFOtued5pY1YUMvaA=; b=fiC6MHHESZdZh20FvcTgDJjlTejSdz9ZtD0JWZ0J0IZ7eA4UaKmb5nlYPpp8fr+WV2 DwfsroJThwmhl1UG78mnIkFMtffMff5DkNYJmFctNDbt1vZCmSdOLfE5xuUcKx07yCmU ev5t1OsUtukPDZiNIQF4+FwOjZ5IyL3t446sftAa40Iz/t8rcMjtsolOrST7PS7qO9VB GkM++XTAcCBxEa7kk2lfKkvLl4F0jr/N/sqd90G+lQfb/LIv7hPmDgwGWHN7t0nBAUVi tPytFjDeruho7q4DJ7ULX4mDZCtJXWjF7yqvYxIhy7BiRVMzgI7tRcvt7GHfKtwD4n2T p4FQ== X-Gm-Message-State: AC+VfDxTt968i/KEEISXDbNgI8HMY4A9mL1lA+IawngLDxO8siBd75/S 9Un2Hpv5ElIDZ5/rZUAgHU8BXw== X-Received: by 2002:a17:907:9347:b0:933:3814:e0f4 with SMTP id bv7-20020a170907934700b009333814e0f4mr23139917ejc.16.1683899936411; Fri, 12 May 2023 06:58:56 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id mc27-20020a170906eb5b00b00966330021e9sm5399061ejb.47.2023.05.12.06.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 06:58:55 -0700 (PDT) From: Luca Weiss Date: Fri, 12 May 2023 15:58:26 +0200 Subject: [PATCH v2 4/4] arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth MIME-Version: 1.0 Message-Id: <20230421-fp4-bluetooth-v2-4-3de840d5483e@fairphone.com> References: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> In-Reply-To: <20230421-fp4-bluetooth-v2-0-3de840d5483e@fairphone.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Andy Gross , Bjorn Andersson , Konrad Dybcio , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765697609265216981?= X-GMAIL-MSGID: =?utf-8?q?1765697609265216981?= The device has a WCN3988 chip for WiFi and Bluetooth. Configure the Bluetooth node and enable the UART it is connected to, plus the necessary pinctrl that has been borrowed with comments from sc7280-idp.dtsi. Signed-off-by: Luca Weiss --- arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts index 7ae6aba5d2ec..e3dc49951523 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -31,6 +31,7 @@ / { aliases { serial0 = &uart9; + serial1 = &uart1; }; chosen { @@ -524,6 +525,39 @@ adc-chan@644 { }; }; +&qup_uart1_cts { + /* + * Configure a bias-bus-hold on CTS to lower power + * usage when Bluetooth is turned off. Bus hold will + * maintain a low power state regardless of whether + * the Bluetooth module drives the pin in either + * direction or leaves the pin fully unpowered. + */ + bias-bus-hold; +}; + +&qup_uart1_rts { + /* We'll drive RTS, so no pull */ + drive-strength = <2>; + bias-disable; +}; + +&qup_uart1_rx { + /* + * Configure a pull-up on RX. This is needed to avoid + * garbage data when the TX pin of the Bluetooth module is + * in tri-state (module powered off or not driving the + * signal yet). + */ + bias-pull-up; +}; + +&qup_uart1_tx { + /* We'll drive TX, so no pull */ + drive-strength = <2>; + bias-disable; +}; + &qupv3_id_0 { status = "okay"; }; @@ -561,6 +595,75 @@ &sdhc_2 { &tlmm { gpio-reserved-ranges = <13 4>, <56 2>; + + qup_uart1_sleep_cts: qup-uart1-sleep-cts-state { + pins = "gpio61"; + function = "gpio"; + /* + * Configure a bias-bus-hold on CTS to lower power + * usage when Bluetooth is turned off. Bus hold will + * maintain a low power state regardless of whether + * the Bluetooth module drives the pin in either + * direction or leaves the pin fully unpowered. + */ + bias-bus-hold; + }; + + qup_uart1_sleep_rts: qup-uart1-sleep-rts-state { + pins = "gpio62"; + function = "gpio"; + /* + * Configure pull-down on RTS. As RTS is active low + * signal, pull it low to indicate the BT SoC that it + * can wakeup the system anytime from suspend state by + * pulling RX low (by sending wakeup bytes). + */ + bias-pull-down; + }; + + qup_uart1_sleep_rx: qup-uart1-sleep-rx-state { + pins = "gpio64"; + function = "gpio"; + /* + * Configure a pull-up on RX. This is needed to avoid + * garbage data when the TX pin of the Bluetooth module + * is floating which may cause spurious wakeups. + */ + bias-pull-up; + }; + + qup_uart1_sleep_tx: qup-uart1-sleep-tx-state { + pins = "gpio63"; + function = "gpio"; + /* + * Configure pull-up on TX when it isn't actively driven + * to prevent BT SoC from receiving garbage during sleep. + */ + bias-pull-up; + }; +}; + +&uart1 { + /delete-property/ interrupts; + interrupts-extended = <&intc GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>, + <&tlmm 64 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default", "sleep"; + pinctrl-1 = <&qup_uart1_sleep_cts>, <&qup_uart1_sleep_rts>, <&qup_uart1_sleep_tx>, <&qup_uart1_sleep_rx>; + + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3988-bt"; + + vddio-supply = <&vreg_l11a>; + vddxo-supply = <&vreg_l7a>; + vddrf-supply = <&vreg_l2e>; + vddch0-supply = <&vreg_l10e>; + swctrl-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>; + + max-speed = <3200000>; + }; }; &uart9 {