From patchwork Wed Jan 4 05:20: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: 639395 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 20956C53210 for ; Wed, 4 Jan 2023 05:21:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjADFVB (ORCPT ); Wed, 4 Jan 2023 00:21:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjADFU7 (ORCPT ); Wed, 4 Jan 2023 00:20:59 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF46DF7F for ; Tue, 3 Jan 2023 21:20:58 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id z7so16388832pfq.13 for ; Tue, 03 Jan 2023 21:20:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x6YKskugShgNtlmuvZE9iNBLytliO5KXjfz6TB5SwOM=; b=orh+A6fZc5yPKPtF2vxjko56PgjwmGz78OmAhhMOleFKvStI8nhIaX9ktwAWFkzWij y8Jn1VJiqnLpNIfPteyBYWx2v7gBXgtmN+5pmoiGLb9lF/zRboQciSPr6swU572Nco/0 pQRh0uwf/drepMmVCzr3mU1K7chuFBWf18sW69Le10W8c/WejpguHSJ54v3PnUytqese K0ODbmSPwTJnYuZCmgjVWA1hSQzLxVKtz2FQHEglRXirf2ljURiiMgoI9K1Yyq2Wvs2X PHNb774lfXEU5DM87ZjatSLWP0ef9cwcmFTlImNj7EiGNAohO5BrkIyoVMpqIWF3eYoX DL6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x6YKskugShgNtlmuvZE9iNBLytliO5KXjfz6TB5SwOM=; b=CUGnt6Uz1ni8C+jU3hV8QUemDdusJHorhqCRYAyTj4VKc9hk5yZJjBHiSzBxgoMkZz 3IPiBx3bS7R9sUh5Gy9jJ5pHBthzu3m/1Ap3TydlSwphQs7lyxyHWcycmAeP4vUkULFf Ijzzhn00E5abGhSNZFddZMUpKGfi++e6SLcmjzf8pVfvVTA4LyG37d8SUkCLYebwhm0X EFf4b9tiKAvOToI7U6UfJbsCiRbRlZ36ATrPS8z6+PqN06LDB/TXgEeMh+wE983siSLu SYHTv4Z4UxnFAX7vH/knFibu50oLY/4Q0tAU0BKPpxqm2hzowo4ed3tix5++uQOPCQYI JOSg== X-Gm-Message-State: AFqh2kqIiZjHoeVsAV7tlNQEkgQysk4d2TQ4brm+26QnVyMP0xN3YuhV FuBiFT4suDrNNPMdh59jK7Ab5ui3TSYv3UQ2FAI= X-Google-Smtp-Source: AMrXdXtVIrNfQMys15m/cCb4UXCy5JUnkJu/o5G6OM37xIz9aWosUkZtmHzXD0RXJ4xva2o7k1z2cA== X-Received: by 2002:aa7:9559:0:b0:581:7b3a:198c with SMTP id w25-20020aa79559000000b005817b3a198cmr24641166pfq.13.1672809657263; Tue, 03 Jan 2023 21:20:57 -0800 (PST) Received: from localhost.localdomain ([2401:4900:1c5e:e3b5:c341:16de:ce17:b857]) by smtp.gmail.com with ESMTPSA id a1-20020aa78e81000000b005811c4245c7sm16710342pfr.126.2023.01.03.21.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 21:20:56 -0800 (PST) From: Bhupesh Sharma To: linux-arm-msm@vger.kernel.org Cc: quic_schowdhu@quicinc.com, 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, devicetree@vger.kernel.org Subject: [PATCH v2] arm64: dts: qcom: sm6115: Add EUD dt node and dwc3 connector Date: Wed, 4 Jan 2023 10:50:47 +0530 Message-Id: <20230104052047.3945983-1-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 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 and TCSR Check register region along with the interrupt entry. 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 Cc: Souradeep Chowdhury Signed-off-by: Bhupesh Sharma --- - v1 can be viewed here: https://lore.kernel.org/linux-arm-msm/20221231131945.3286639-1-bhupesh.sharma@linaro.org/ - v2 addresses the review comments from Konrad. - This patch is based on my earlier sm6115 usb related changes, which can be seen here: https://lore.kernel.org/linux-arm-msm/20221215094532.589291-1-bhupesh.sharma@linaro.org/ - This patch is also dependent on my sm6115 eud dt-binding and driver changes (v2) sent earlier, which can be seen here: https://lore.kernel.org/linux-arm-msm/20230103150419.3923421-1-bhupesh.sharma@linaro.org/ arch/arm64/boot/dts/qcom/sm6115.dtsi | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 030763187cc3f..8e83bab3ed0f6 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -170,6 +170,18 @@ core3 { }; }; + 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"; @@ -565,6 +577,29 @@ gcc: clock-controller@1400000 { #power-domain-cells = <1>; }; + eud: eud@1610000 { + compatible = "qcom,sm6115-eud", "qcom,eud"; + reg = <0x01610000 0x2000>, + <0x01612000 0x1000>, + <0x003e5018 0x4>; + interrupts = ; + status = "disabled"; + + ports { + port@0 { + eud_ep: endpoint { + remote-endpoint = <&usb2_role_switch>; + }; + }; + + port@1 { + eud_con: endpoint { + remote-endpoint = <&con_eud>; + }; + }; + }; + }; + usb_hsphy: phy@1613000 { compatible = "qcom,sm6115-qusb2-phy"; reg = <0x01613000 0x180>; @@ -1064,6 +1099,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>; + }; + }; }; };