From patchwork Tue Jul 18 06:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 704116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A2D8EB64DA for ; Tue, 18 Jul 2023 06:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbjGRGLO (ORCPT ); Tue, 18 Jul 2023 02:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjGRGLN (ORCPT ); Tue, 18 Jul 2023 02:11:13 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3349F1 for ; Mon, 17 Jul 2023 23:11:11 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6682909acadso3499113b3a.3 for ; Mon, 17 Jul 2023 23:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660671; x=1692252671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tbm/PmLqZ2+dwjBfZP2gF/+K4CifkL2BaQdnSKOCCK0=; b=BSeGvXzyvC6Njh/qw9ahZNPuM34cQGvUmin8yKRTbj91I7yh3LlIMI6go5S5ZIpnnc Ja3acDk5cseN80eW/5ZNMC3mV/cbxkAg2Zhs5GLLYOXCgHluijWVyWQVr80uvMKkVY62 jm+Sf8ew899PkVv3ChO7gTVCDdEP/y/PMpB9BDMEjtd1VSsyZs4ih8eJRDuiPN7uS/do QS1B75/7w5NVkQmEK+erx0Q86bNAK15ud4BeZanqN77vK01ktmAtgtmwQHdbUweAKNXn /RrxHKev7Ggxdbt5GfCvQHAq2510HlGVAfFwEqhKY96JXHSC1BUzRmqN17srj0vBmzYn p+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660671; x=1692252671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tbm/PmLqZ2+dwjBfZP2gF/+K4CifkL2BaQdnSKOCCK0=; b=cGB6p8+P1FL3Y1CdJ0b8UeYydh0o15Zcss7km9nZacSMTyY/MbMtD31kVlrB+OQZgp Lau7vL34YdFsU1W0Bk6vX98Y4ebDSlFbwotSC/6/S59rfQMNXxIZdAmQ/fzOYhTId7KY DQtEn6KsG/KaygCUlTEYWNKUTe7sHdzaRJ4L1S4qEo4P7UXbcVXoRSYXph8eo1NXehuT qVesbLCtUF9eChNyX5ZjB9wJCvwOhTuZvfybY3MIYXkpg38rnxyrmejCgXByCg0iAm1D /8KuFRmWmrSwspU523kI4bv87ts4TqOg4D6ltqo+dgGt9x99B2K0uN99yPeuSYZ1TVr7 gyMQ== X-Gm-Message-State: ABy/qLa5by0JXAn88y+k+bTwctT6fh5mvVQCXKenoVQUCnbxWYk86q9L V0dLOmWo+YWO8gsHr4obDPzzAI/1Btf5OlgR2neKcg== X-Google-Smtp-Source: APBJJlEbQa4WJAeV/iDFQ1B93yQ8Ht2+89O3qS43qIRPmQ5VCEHOyV5NYgUMGjTquA9f+29WMDn//Q== X-Received: by 2002:a05:6a00:22c6:b0:668:69fa:f78f with SMTP id f6-20020a056a0022c600b0066869faf78fmr16312666pfj.1.1689660670763; Mon, 17 Jul 2023 23:11:10 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:10 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 1/7] dt-bindings: mfd: qcom,tcsr: Add the compatible for SM6115 Date: Tue, 18 Jul 2023 11:40:46 +0530 Message-Id: <20230718061052.1332993-2-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Document the qcom,sm6115-tcsr compatible. Signed-off-by: Bhupesh Sharma --- Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml index 5ad9d5deaaf8a..b580398041d87 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml @@ -27,6 +27,7 @@ properties: - qcom,sdm845-tcsr - qcom,sdx55-tcsr - qcom,sdx65-tcsr + - qcom,sm6115-tcsr - qcom,sm8150-tcsr - qcom,sm8450-tcsr - qcom,tcsr-apq8064 From patchwork Tue Jul 18 06:10:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 705461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28243EB64DA for ; Tue, 18 Jul 2023 06:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231232AbjGRGL3 (ORCPT ); Tue, 18 Jul 2023 02:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbjGRGLU (ORCPT ); Tue, 18 Jul 2023 02:11:20 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EBC71709 for ; Mon, 17 Jul 2023 23:11:17 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6687096c6ddso3338272b3a.0 for ; Mon, 17 Jul 2023 23:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660676; x=1692252676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R3U8YGGir0L/mdYZ0L+59VSzteiUJkc0KitjLit6CXs=; b=asFylN+n0kUr9plq5cxM4Pwogu2AbP35sKK923oj7CnWW/DgT7MjZAsGYRthUkBd4d b8Hi3b4raiSvXdLqaqVpkHASKj0XLIIetKlI7q+BvECvA1B+ANvmy6x3WLIlMKxJwiLR IxeDloi3MvSFsCTk/6O4bHX6mqTJuhrN02OLk9442NPyIlMAs5SErx0oetDzzz3a4AwN O6CdOWctwj3IIYCoaNLxVQE13xu0UOfPc/w1I9dSKbhSujiAP4XuDxWvj/eCxshmbUzd qFddJJ/n4iZuwksLcThBDYi9hpPMxtvZOffw2AhgTx8AZm8KIwLdnAjy35lm85+QNyXH TxmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660676; x=1692252676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R3U8YGGir0L/mdYZ0L+59VSzteiUJkc0KitjLit6CXs=; b=KcboUhm6I5tNJ+/3r+spbdpN1TkJLoNeKkQ+97lcB87FtsKQ8TwVYlxy/hqD5xAskc b5Xjiic8KU0MxyXqjGtwOjaQQtoI7f2f9C63BK5gda42HtcUmEjrkCN7repwlu+IbGmf h7J7XQakit+axL3//wAXSM+R3y5VGnfYLrMBTC6zEqFn0LOflfxqPNwAKo5MF32auNDB ytEBNML0MyWBQA1CeQqIbeqIblyWDmaHZ9RV4y4Q5BC8EgvLRgekHtvu412kUS9FXaKg fcJWkbn7g/m/vH8dVCykClXnjgrwqmi/g3SW17NnlX7V6zghMXO16+eiHIZmD7X+fueY dRJQ== X-Gm-Message-State: ABy/qLZWErkT9LIBfYh86tBM983OupPW0mWs0PNTsL9HhPLLeJFWihHy NfCWFJsVRrYYStSdSRZ7zuKXo+Gxv8P3m22kKBTSoQ== X-Google-Smtp-Source: APBJJlEbASCzBW5nny//1cmmMU2YlKnUEAb+V7SgOKcexNMZhmsXJfHXlbCrE+ldrpJWCd/Z6B0BXg== X-Received: by 2002:a05:6a20:12ce:b0:135:4df7:f165 with SMTP id v14-20020a056a2012ce00b001354df7f165mr2429388pzg.21.1689660675802; Mon, 17 Jul 2023 23:11:15 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:15 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 2/7] dt-bindings: soc: qcom: eud: Document vendor-specific 'secure mode' property Date: Tue, 18 Jul 2023 11:40:47 +0530 Message-Id: <20230718061052.1332993-3-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On some SoCs (like the SM6115 / SM4250 SoC), the enable bit inside 'tcsr_check_reg' needs to be set first to 'enable' EUD mode. So introduce a vendor-specific dt-property 'qcom,secure-eud-reg' which specifies the base address of the TCSR reg space and the offset of the 'tcsr_check_reg'. Signed-off-by: Bhupesh Sharma --- Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml index f2c5ec7e6437b..ca38d219e57d5 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml @@ -45,6 +45,14 @@ properties: $ref: /schemas/graph.yaml#/properties/port description: This port is to be attached to the type C connector. + qcom,secure-eud-reg: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to TCSR hardware block + - description: offset of the secure mode manager register + description: TCSR hardware block + required: - compatible - reg From patchwork Tue Jul 18 06:10:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 704115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83C96EB64DD for ; Tue, 18 Jul 2023 06:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbjGRGLz (ORCPT ); Tue, 18 Jul 2023 02:11:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231276AbjGRGLi (ORCPT ); Tue, 18 Jul 2023 02:11:38 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED4371988 for ; Mon, 17 Jul 2023 23:11:22 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-666edfc50deso3254998b3a.0 for ; Mon, 17 Jul 2023 23:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660681; x=1692252681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cj0Kr21fyKMkxAxxSOMwsypaT2zCqEO5kfSgBNpmV4w=; b=E4VIlEjB7OpiaiNfOMe49rriMI65KPRGhRjW+OuN7mBoAE1PhP8mtVQM0a1Dy2bQuX rqb3C7XkjgbyiD/J6t2j/5mUba5DjjyAStOl1ljQlQ288qZboIBUMma6B+1emotmY8EQ H30Q+VKbzduQhblOO0e/J1LJue45zD5H74MlO9uRKcNj5YMWQNY+9+4r/6pZH0Bk0jYy ZL2/TeMnlp8zqh85xhp6ufz9gdCwDf9eHmwV3u33PBTE7mmIv2Iu0eqQxFGim0Oj7i2q NkN4kCnQeBzsi+Q1Nwl091PlAkh8zEds8xPDolZdIf2crsTPbHSV4+WD5EmY48j7GX1e Jzxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660681; x=1692252681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cj0Kr21fyKMkxAxxSOMwsypaT2zCqEO5kfSgBNpmV4w=; b=kZlfFxnagHhHxKX4RiIqDmQ8+KkI9/6Tc++3EJcWMf5r4EeJdbr58qs/QIvstJFEEe dyEqkEo2YWqSeQfUO133TR12i0dO7WK23gF4o7SHDvTZbLKtLQhd/pwqOOU7pQNX1xAR TGicMBfBySudkavPI0vbvb0Oa3TjvdjkoFvXyoi0w/RgxuLlo7281N97cW3YR+zD9t1y VTMF5BsoOgLcgDWEHS2Mc/r9dJAnLew6EGTEMEFEjc76P2op2Z1dvw0EVy9JkDzMB3og wEi9LQmDV8U/B0DHwGaHxMMNIfudE1r4ayyiOLSspCQgE0x/zeOkkJghER/d6g1/Ra7W aXiA== X-Gm-Message-State: ABy/qLbYeYGFnES2spyYui03R721DBuQPLErkIB0NK1fbiS0spvNWR9K JMgrE/G0nG3QM8rbVsOtfGvQMZeevGT16/b4cqlK6Q== X-Google-Smtp-Source: APBJJlHjtWvi6yAFKVFf93mMLqWPNaz5odCz8RCDBsF7Wt8mdjxL4BtqtmP842+6qU6d6uaRCakpwA== X-Received: by 2002:a05:6a00:a1f:b0:676:8fac:37 with SMTP id p31-20020a056a000a1f00b006768fac0037mr14739279pfh.4.1689660680828; Mon, 17 Jul 2023 23:11:20 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:20 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 3/7] dt-bindings: soc: qcom: eud: Add SM6115 / SM4250 support Date: Tue, 18 Jul 2023 11:40:48 +0530 Message-Id: <20230718061052.1332993-4-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add dt-bindings for EUD found on Qualcomm SM6115 / SM4250 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bhupesh Sharma --- Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml index ca38d219e57d5..bb9b97f03585f 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml @@ -18,6 +18,7 @@ properties: items: - enum: - qcom,sc7280-eud + - qcom,sm6115-eud - const: qcom,eud reg: From patchwork Tue Jul 18 06:10:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 705460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4872EEB64DA for ; Tue, 18 Jul 2023 06:12:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231301AbjGRGMG (ORCPT ); Tue, 18 Jul 2023 02:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231302AbjGRGLm (ORCPT ); Tue, 18 Jul 2023 02:11:42 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAAC610E3 for ; Mon, 17 Jul 2023 23:11:27 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6b9c57c4d12so2140573a34.1 for ; Mon, 17 Jul 2023 23:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660686; x=1692252686; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BYiFLzJcgS5ZH0B0OriyMRTUX2STtvU6MnH5HLZczGY=; b=CW+vd5hwuP2riG2Y3RncYwSYFhxK2KZcb+Gb6Z0jNIhq1MULcVgSsylmQdYTC8ki7w F4nDAW4nAcxLKr/WM+5K08RP/qNzDiiDDajh2OVmw+GnT1++zLAg+h5L8vYxizWizTq7 Ruksy/6OVq8dPKAHrzGVtYEjOEcAQdP6MOVsItGF+ebVXQRN4Hzkcttkm4+C6e16lHEw H8cEWzy7oZQP0EaLVXbS+2hecYIZ288y/C3ZGVd9uVW8NQryNuWAb0ChLLPOf9DGSQ3I GDP3loriMXrpeaNQfJYwAu+yp2xI3tcd0nbyr6gujc+T4b/TPIM5IfwAuXGivnvLaROD Zj5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660686; x=1692252686; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BYiFLzJcgS5ZH0B0OriyMRTUX2STtvU6MnH5HLZczGY=; b=HuolLhoqa5KbgX+zRUD6wdDldm6iicQBiCH5O1EL8f5AaNv6+bNp7JCUI+kWmeM/1q zDUCDGfVeHYey638yuS9Zc0j5daiZaC4Um7d6tKJ9UXRyr2tAMy94aPpampbFrY+B8G9 BBO00LHcs/jwFutVcJ1deffmjWNChfoLGUA/Ox3tnNskixJFIB5U+IWx2yag7d0GBnaj Dt2Dvt+bT1b90KKfyD7ro3RkKV5IXcpO/+U5+Ge2ad8rKh3hg8wuEWjsu8kxv/YWwJkb DbpBFTsz2whoLM+wu9zq2gVqPwGoCia2ZT0Dd4aS6PKzRuuqI566CXhZxgORU8kCN0gd napQ== X-Gm-Message-State: ABy/qLYN75Xrv/RfN42bXkuWK2f4+gfK8+iIWXQv5ANiRN5InaDLl7jH oFUAT8PbDODwr/tVMeg7cw31Ft/VmDT5J4pO3fJo4A== X-Google-Smtp-Source: APBJJlGitC/u99kqY0gVhuwzkq5zSgoHAKolJgtP0kHG1YRXPRGYAB8mYprBbArc/l08DTEmTKCY7A== X-Received: by 2002:a05:6358:280d:b0:12f:2573:45b4 with SMTP id k13-20020a056358280d00b0012f257345b4mr10617711rwb.26.1689660685783; Mon, 17 Jul 2023 23:11:25 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:25 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 4/7] usb: misc: eud: Add driver support for SM6115 / SM4250 Date: Tue, 18 Jul 2023 11:40:49 +0530 Message-Id: <20230718061052.1332993-5-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add SM6115 / SM4250 SoC EUD support in qcom_eud driver. On some SoCs (like the SM6115 / SM4250 SoC), the mode manager needs to be accessed only via the secure world (through 'scm' calls). Also, the enable bit inside 'tcsr_check_reg' needs to be set first to set the eud in 'enable' mode on these SoCs. Signed-off-by: Bhupesh Sharma --- drivers/usb/misc/Kconfig | 2 +- drivers/usb/misc/qcom_eud.c | 76 ++++++++++++++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 6 deletions(-) diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig index 99b15b77dfd57..51eb5140caa14 100644 --- a/drivers/usb/misc/Kconfig +++ b/drivers/usb/misc/Kconfig @@ -146,7 +146,7 @@ config USB_APPLEDISPLAY config USB_QCOM_EUD tristate "QCOM Embedded USB Debugger(EUD) Driver" - depends on ARCH_QCOM || COMPILE_TEST + depends on (ARCH_QCOM && QCOM_SCM) || COMPILE_TEST select USB_ROLE_SWITCH help This module enables support for Qualcomm Technologies, Inc. diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 7f371ea1248c3..a5b28fc24116a 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -11,9 +11,12 @@ #include #include #include +#include +#include #include #include #include +#include #include #define EUD_REG_INT1_EN_MASK 0x0024 @@ -30,6 +33,10 @@ #define EUD_INT_SAFE_MODE BIT(4) #define EUD_INT_ALL (EUD_INT_VBUS | EUD_INT_SAFE_MODE) +#define EUD_EN2_EN BIT(0) +#define EUD_EN2_DISABLE (0) +#define TCSR_CHECK_EN BIT(0) + struct eud_chip { struct device *dev; struct usb_role_switch *role_sw; @@ -39,6 +46,7 @@ struct eud_chip { int irq; bool enabled; bool usb_attached; + phys_addr_t secure_mode_mgr; }; static int enable_eud(struct eud_chip *priv) @@ -46,7 +54,11 @@ static int enable_eud(struct eud_chip *priv) writel(EUD_ENABLE, priv->base + EUD_REG_CSR_EUD_EN); writel(EUD_INT_VBUS | EUD_INT_SAFE_MODE, priv->base + EUD_REG_INT1_EN_MASK); - writel(1, priv->mode_mgr + EUD_REG_EUD_EN2); + + if (priv->secure_mode_mgr) + qcom_scm_io_writel(priv->secure_mode_mgr + EUD_REG_EUD_EN2, EUD_EN2_EN); + else + writel(EUD_EN2_EN, priv->mode_mgr + EUD_REG_EUD_EN2); return usb_role_switch_set_role(priv->role_sw, USB_ROLE_DEVICE); } @@ -54,7 +66,11 @@ static int enable_eud(struct eud_chip *priv) static void disable_eud(struct eud_chip *priv) { writel(0, priv->base + EUD_REG_CSR_EUD_EN); - writel(0, priv->mode_mgr + EUD_REG_EUD_EN2); + + if (priv->secure_mode_mgr) + qcom_scm_io_writel(priv->secure_mode_mgr + EUD_REG_EUD_EN2, EUD_EN2_DISABLE); + else + writel(EUD_EN2_DISABLE, priv->mode_mgr + EUD_REG_EUD_EN2); } static ssize_t enable_show(struct device *dev, @@ -175,9 +191,37 @@ static void eud_role_switch_release(void *data) usb_role_switch_put(chip->role_sw); } +static int eud_find_secure_reg_addr(struct device *dev, u64 *addr) +{ + struct device_node *tcsr; + struct device_node *np = dev->of_node; + struct resource res; + u32 offset; + int ret; + + tcsr = of_parse_phandle(np, "qcom,secure-eud-reg", 0); + if (!tcsr) + return 0; + + ret = of_address_to_resource(tcsr, 0, &res); + of_node_put(tcsr); + if (ret) + return ret; + + ret = of_property_read_u32_index(np, "qcom,secure-eud-reg", 1, &offset); + if (ret < 0) + return ret; + + *addr = res.start + offset; + + return 0; +} + static int eud_probe(struct platform_device *pdev) { struct eud_chip *chip; + struct resource *res; + phys_addr_t tcsr_check = 0; int ret; chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); @@ -200,9 +244,30 @@ static int eud_probe(struct platform_device *pdev) if (IS_ERR(chip->base)) return PTR_ERR(chip->base); - chip->mode_mgr = devm_platform_ioremap_resource(pdev, 1); - if (IS_ERR(chip->mode_mgr)) - return PTR_ERR(chip->mode_mgr); + /* + * EUD block on a few Qualcomm SoCs needs secure register access. + * Check for the same via vendor-specific dt property. + */ + ret = eud_find_secure_reg_addr(&pdev->dev, &tcsr_check); + if (ret < 0) + return ret; + + if (tcsr_check) { + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (!res) + return dev_err_probe(chip->dev, -ENODEV, + "failed to get secure_mode_mgr reg base\n"); + + chip->secure_mode_mgr = res->start; + + ret = qcom_scm_io_writel(tcsr_check, TCSR_CHECK_EN); + if (ret) + return dev_err_probe(chip->dev, ret, "failed to write tcsr check reg\n"); + } else { + chip->mode_mgr = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(chip->mode_mgr)) + return PTR_ERR(chip->mode_mgr); + } chip->irq = platform_get_irq(pdev, 0); ret = devm_request_threaded_irq(&pdev->dev, chip->irq, handle_eud_irq, @@ -230,6 +295,7 @@ static void eud_remove(struct platform_device *pdev) static const struct of_device_id eud_dt_match[] = { { .compatible = "qcom,sc7280-eud" }, + { .compatible = "qcom,sm6115-eud" }, { } }; MODULE_DEVICE_TABLE(of, eud_dt_match); From patchwork Tue Jul 18 06:10:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 704114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DEB5C001DC for ; Tue, 18 Jul 2023 06:12:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231421AbjGRGMO (ORCPT ); Tue, 18 Jul 2023 02:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbjGRGLw (ORCPT ); Tue, 18 Jul 2023 02:11:52 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD474170D for ; Mon, 17 Jul 2023 23:11:31 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-6b9cf7e6ab2so1849838a34.1 for ; Mon, 17 Jul 2023 23:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660691; x=1692252691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IAuP6Q6TKNDuCaUlFKpJeNeF9nU9XbWAvICkpXnR+AQ=; b=x+5WymiQZ1UPzI5nXXDnzXCsOpSrsBG4R9eDcI6DvRb2WJ15tRDCs9S86Kz8oK8vBE Qx5/QrJafx9jp8G05QiFzLkFQDD0DKhf1X8or2B11wirOiY+737sixMT4vCx6u7jAq9w rtw5fKXvX5VmALQynVqUhi7Bg3z7a4xH2q58MMkeSlwnXJwt6g3iV5sDGvy1sVzzu+ig cS7qQDUktFv8xCiLuw9Gw/cJm1t8e6BhETmm+Cnth0gxkCXA/BeiKRu9jwu7AToqLO/c X4+1abZeGaHkdCEIeU/duvpeRtM29+o2Mh1kIqATWl6QVOVPszD0DCStRR9GVD5xUn/R idwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660691; x=1692252691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IAuP6Q6TKNDuCaUlFKpJeNeF9nU9XbWAvICkpXnR+AQ=; b=IZoP6aWbKVNjLfWSr18FlhkfKb2SBl/B0EQv7o/jDLbqV4L9NL9+czrRfoVC7PIyKg RVT0ZK47cNdjvfkv7gBq8x7eAfSyraSRRV4iLcuqildqKX9GfvudZwFJYg+NkiC5Cl7Z ppJ3cHnX3ROHaJB1qkLfRRYM9RTujMtWGCA8pj44l3lTrk85kb73gRVCyKSPgl5SLVIR LBFLvU1huwQZEd58K1TXHS/m3O4/nUZbt8h9BQojTjCNA3mFWnBy0IlpAMUCzfRg/p3S i695XuoMEDWSljygDcKmtER6RqI+owjhxORBPqSXCZUE92RQLG+Jo+ok+kbaDSK+dN6K jx6w== X-Gm-Message-State: ABy/qLZGjiTw8qyaXM/sngDQLK3nFsgKJ8F70QPQHBby/r/TSjfQQzz/ gAC3oyjyxd85PdrHgxx71SLI3VTr6InFOzxb4QvIWg== X-Google-Smtp-Source: APBJJlH7RaOvviXR6lEGhQgEPRJzVuo+l7y+KQXufnQRHXmbjIRlVaZORbrJXV3IFdDmRFmV8taEKg== X-Received: by 2002:a05:6358:c02:b0:133:a55:7e26 with SMTP id f2-20020a0563580c0200b001330a557e26mr2150537rwj.7.1689660690682; Mon, 17 Jul 2023 23:11:30 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:30 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 5/7] arm64: dts: qcom: sm6115: Add tcsr syscon node Date: Tue, 18 Jul 2023 11:40:50 +0530 Message-Id: <20230718061052.1332993-6-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the TCSR syscon dt node for SM6115 / SM4250 SoC. Signed-off-by: Bhupesh Sharma Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm6115.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 839c603512403..3be0b54fc3628 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -591,6 +591,11 @@ tcsr_mutex: hwlock@340000 { #hwlock-cells = <1>; }; + tcsr_regs: syscon@3c0000 { + compatible = "qcom,sm6115-tcsr", "syscon"; + reg = <0x0 0x003c0000 0x0 0x40000>; + }; + tlmm: pinctrl@500000 { compatible = "qcom,sm6115-tlmm"; reg = <0x0 0x00500000 0x0 0x400000>, From patchwork Tue Jul 18 06:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 705459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C064EB64DA for ; Tue, 18 Jul 2023 06:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbjGRGMa (ORCPT ); Tue, 18 Jul 2023 02:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbjGRGMH (ORCPT ); Tue, 18 Jul 2023 02:12:07 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086551719 for ; Mon, 17 Jul 2023 23:11:41 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-66f5faba829so3820624b3a.3 for ; Mon, 17 Jul 2023 23:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660695; x=1692252695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KBuW+Z6XAY92SVZQectHpFEOvJKx1OjjfxzUkTjvZPo=; b=HpItcyu7TwZNFo58M81iGHOFCpUHkELtwgFlwcO5K656OeM/KJNbjrS2Ykxk3rclD7 EFTcQWs1yumftqz7D9wuddmT5F74I9bZb4ga3Un4KoQ3ioiHTftVv6Ycs8ORC+nBTdho PS1EqzW0L4mQ9+Y4JYlfwBIIvOiRSMr7B9jPQZA4Qd9Y22PDatnGVZ0aYxH36B3B8aDx G/6m3OewEnFcu78RN68VEccyQjY4t5fYEHltPmRx2k+emafeEVw9bR10Hm22O9pltCoW T5sSofYru55zyyeZNkouZR9A1lsJej+CTIica5m3Fdl+7J4JvleGBA/gt9JhHoxwzg7+ MkeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660695; x=1692252695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KBuW+Z6XAY92SVZQectHpFEOvJKx1OjjfxzUkTjvZPo=; b=QbVIfvOzk31YExKz8b3ZW5AqTgGY9/ANB6puuPH28SQamJKYB+t0wBZbNyWpJOh74c TP9cFl6Hpkbl7PXownDKqoYcRk0HBsVgHyz2VyCbLymYc+E/XPhW2Iq34e9vD9nll3Vi q0XX/Q91vPyH8P8/M3BNWm/+OvaA2HuYMGF0H+C7wH4MIV/epBM9XpjRY0trjVIBzaAY wvhEdegMpaBMVPkWLj9U+NVVyvDgys5SWfwlgdB1MEvPfokRVkdjLgSeg7FioBCtk2Px tfmgMQ8lVASDCePRF3j1LQ+suOMiMf6CERPtTIK4+pD1AePysuggKadCEz83VkqSYiz9 6Wkg== X-Gm-Message-State: ABy/qLbSNN/l5OwUwAlcL3pSnJQpj6NNnQny8ZxNMRc/5shyiGwrLH7I /zUPDrz9rkG4FrYysaBbKxSYSJAtoEJzyVWuzdI= X-Google-Smtp-Source: APBJJlH+DaQe/ju2WQZKWRTQhPO13bSlEIgdpThEmIyQKrkImkT+D5KNj9EzA6R71c4B7ISRyXPYyw== X-Received: by 2002:a05:6a00:3a17:b0:677:c9da:14b0 with SMTP id fj23-20020a056a003a1700b00677c9da14b0mr1550121pfb.32.1689660695495; Mon, 17 Jul 2023 23:11:35 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:35 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 6/7] arm64: dts: qcom: sm6115: Add EUD dt node and dwc3 connector Date: Tue, 18 Jul 2023 11:40:51 +0530 Message-Id: <20230718061052.1332993-7-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the Embedded USB Debugger(EUD) device tree node for SM6115 / SM4250 SoC. The node contains EUD base register region, EUD mode manager register region. The TCSR Base register region is defined via a vendor specific dt-property. Also add the typec connector node for EUD which is attached to EUD node via port. EUD is also attached to DWC3 node via port. To enable the role switch, we need to set dr_mode = "otg" property for 'usb_dwc3' sub-node in the board dts file. Also the EUD device can be enabled on a board once linux is boot'ed by setting: $ echo 1 > /sys/bus/platform/drivers/qcom_eud/../enable Reviewed-by: Konrad Dybcio Signed-off-by: Bhupesh Sharma --- arch/arm64/boot/dts/qcom/sm6115.dtsi | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 3be0b54fc3628..cd5b85b63a9ec 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -260,6 +260,18 @@ CLUSTER_1_SLEEP_1: cluster-sleep-1-1 { }; }; + eud_typec: connector { + compatible = "usb-c-connector"; + + ports { + port@0 { + con_eud: endpoint { + remote-endpoint = <&eud_con>; + }; + }; + }; + }; + firmware { scm: scm { compatible = "qcom,scm-sm6115", "qcom,scm"; @@ -794,6 +806,38 @@ gcc: clock-controller@1400000 { #power-domain-cells = <1>; }; + eud: eud@1610000 { + compatible = "qcom,sm6115-eud", "qcom,eud"; + reg = <0x0 0x01610000 0x0 0x2000>, + <0x0 0x01612000 0x0 0x1000>; + reg-names = "eud-base", "eud-mode-mgr"; + interrupts = ; + + qcom,secure-eud-reg = <&tcsr_regs 0x25018>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + eud_ep: endpoint { + remote-endpoint = <&usb2_role_switch>; + }; + }; + + port@1 { + reg = <1>; + + eud_con: endpoint { + remote-endpoint = <&con_eud>; + }; + }; + }; + }; + usb_hsphy: phy@1613000 { compatible = "qcom,sm6115-qusb2-phy"; reg = <0x0 0x01613000 0x0 0x180>; @@ -1327,6 +1371,13 @@ usb_dwc3: usb@4e00000 { snps,has-lpm-erratum; snps,hird-threshold = /bits/ 8 <0x10>; snps,usb3_lpm_capable; + usb-role-switch; + + port { + usb2_role_switch: endpoint { + remote-endpoint = <&eud_ep>; + }; + }; }; }; From patchwork Tue Jul 18 06:10:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupesh Sharma X-Patchwork-Id: 704113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E095AEB64DA for ; Tue, 18 Jul 2023 06:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231241AbjGRGMo (ORCPT ); Tue, 18 Jul 2023 02:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbjGRGMP (ORCPT ); Tue, 18 Jul 2023 02:12:15 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D6A412A for ; Mon, 17 Jul 2023 23:11:53 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-668711086f4so3253103b3a.1 for ; Mon, 17 Jul 2023 23:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689660700; x=1692252700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aoaxiWdRTQIjlpKBPFLmbhlJ2o+zAdh4av4kyochmEo=; b=sn5U4MWGxnrt7DhiV2WWKv7dD7NLNlyt1BcEtCXTkOw/Uf8oIJ6PwmKIwF6FtLKPhg 8TlIKNSQAyZVe1gfVbgEx2k8bk5LMX+QAuclX+KMIcO0NFJoSrIERmxT118aoGWjIzCc fUmHl4YQZsx/3es7b/IVW1UOf/2CleLxq5vu/8l6FlBARVxbuw+8O7D528NGSBVVihRd Pj7faOnq6na2/+UZbhmoh6Nk4yfgUZ2Qz4qtTekyyv8G6nGfu5sTfSsW2JCbSsqAzq8m +1gff7MypqYM5gumiG3UP0JgnJp+awXH9VN26Zp0jgZTC4al32RLzwDOhW0f4ctfmDwr okbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689660700; x=1692252700; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aoaxiWdRTQIjlpKBPFLmbhlJ2o+zAdh4av4kyochmEo=; b=e8Qd7QyQTSvqw7GgSwNTfgSs3X16DvPl6AP3q8s2+eqXK3kh01z+dIL0DO3QgT/x6o bG3yMm/Rotx5m24pB/B6s8XT8QHU3Ald1Mr75B8BF3po/Nq/7Qrqxl6irA0sifbQTYlZ +mnbvS3f2lHYmY+0VXhJcj3mDGE8BSvI8nYuIx/hAbSZ4q2CHj/W05dMxwOKGY7PLLVI BgGZWue7nmJ+0kmO6S1jrwrY5dbhQAxbj5FNLMAjoSZzAMi4j7eoRFNkdWjQI3njkybL ieBNqNaF+6uOJ3jubFQ+5z2uM5uv0mC+1RWiCpG086wbEsA/yVRKsKpIkI27AA+8TGpo bXLg== X-Gm-Message-State: ABy/qLbu3JZvgUzxm08nlGxZrm56Is0SDlA0EX7nJmejWrKPW1NoCc0S GStdfRCCOMyivpAujGPG51q6VFA+hf+aVsGucZk= X-Google-Smtp-Source: APBJJlEjkKb95SZ3h4MhroX1z4Rb0wFQVD0acfPLpGOo6UMskxiuerWVpHUqtAwqOeu7rT87h9CrJw== X-Received: by 2002:a05:6a20:9189:b0:12f:d350:8a12 with SMTP id v9-20020a056a20918900b0012fd3508a12mr15193455pzd.21.1689660700254; Mon, 17 Jul 2023 23:11:40 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id h21-20020a62b415000000b0067db7c32419sm778106pfn.15.2023.07.17.23.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 23:11:39 -0700 (PDT) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, bhupesh.sharma@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, krzysztof.kozlowski@linaro.org, quic_schowdhu@quicinc.com, gregkh@linuxfoundation.org, stephan@gerhold.net Subject: [PATCH v9 7/7] arm64: dts: qcom: qrb4210-rb2: Enable EUD debug peripheral Date: Tue, 18 Jul 2023 11:40:52 +0530 Message-Id: <20230718061052.1332993-8-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> References: <20230718061052.1332993-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Since the USB-C type port on the Qualcomm QRB4210-RB2 board can be set primarily in a 'device' configuration (with the default DIP switch settings), it makes sense to enable the EUD debug peripheral on the board by default by setting the USB 'dr_mode' property as 'otg'. Now, the EUD debug peripheral can be enabled by executing: $ echo 1 > /sys/bus/platform/drivers/qcom_eud/1610000.eud/enable Reviewed-by: Konrad Dybcio Signed-off-by: Bhupesh Sharma --- arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts index a7278a9472ed9..640668960deb0 100644 --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts @@ -264,6 +264,10 @@ &pon_resin { status = "okay"; }; +&eud { + status = "okay"; +}; + &qupv3_id_0 { status = "okay"; }; @@ -518,7 +522,28 @@ &usb { &usb_dwc3 { maximum-speed = "super-speed"; - dr_mode = "peripheral"; + + /* + * There is only one USB DWC3 controller on QRB4210 board and it is connected + * via a DIP Switch: + * - to either an USB - C type connector or an USB - A type connector + * (via a GL3590-S hub), and + * - to either an USB - A type connector (via a GL3590-S hub) or a connector + * for further connection with a mezzanine board. + * + * All of the above hardware muxes would allow us to hook things up in + * different ways to some potential benefit for static configurations (for e.g. + * on one hand we can have two USB - A type connectors and a USB - Ethernet + * connection available and on the other we can use the USB - C type in + * peripheral mode). + * + * Note that since the USB - C type can be used only in peripehral mode, + * so hardcoding the mode to 'peripheral' here makes sense. + * + * However since we want to use the EUD debug device, we set the mode as + * 'otg' here. + */ + dr_mode = "otg"; }; &usb_hsphy {