From mboxrd@z Thu Jan 1 00:00:00 1970 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 6E7E4C4708D for ; Mon, 2 Jan 2023 17:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234249AbjABRDm (ORCPT ); Mon, 2 Jan 2023 12:03:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234897AbjABRDS (ORCPT ); Mon, 2 Jan 2023 12:03:18 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72512BCB for ; Mon, 2 Jan 2023 09:03:17 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id v23so19371760ljj.9 for ; Mon, 02 Jan 2023 09:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=XAb11NzFdj96+lfo1VeQmioTPUWCbc0ODMFTO7/S5J0=; b=Hg+EI41mgcDsbbBfYl+TSIpkQFZiYq88kVkHMZdb2twZw6KpWypaVKN333xxa4bOWT uuo6ge7f8pFJHcW0/DNsMjnCosH4+jhNjI7ZPxGBmN72pXbLjRWfAiddIEgi+Zl3Pnx2 YRZ/N0k3CihHyL9bCII3QaE1C5GUBhxoNtEnqjgzaPweU6KIlDa0OY6KKdUtn1jrObVe 6qPpR/kbSgJ7cGEvOQIjYTDDM1cjnoxLESBOInZhTJFWV8AQOjYRLTDHGl9qc7DAAgdZ mSSTAwsCxJlCTKinByq9JUI9INZRMRJ9KiWMsFzQSPp3IDK3+ANxyXflA86eEAEa7foe ET5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XAb11NzFdj96+lfo1VeQmioTPUWCbc0ODMFTO7/S5J0=; b=DWtFenBLXBsnoKcYEsXmv4gq3UqTGa9tfe+0W/yh4f4m/wQSNee5pU222qV2VHI00E JULM2Fw6QDLJx3aFUfQkLUQlo3HI1NlfSsToo+gaqu0hs9WjGCfZ4aruN1RCJPZzMpc5 ANqcatqNDhN4VFmgAuVNCAn0ujQF5mNtUVzTOpF796nj+tXbCjD+eIyrezDDGEfsxo0r 1p1878qS96y33Azeo7T3tXKzTS25PDVWz5GSnUDrbjfLjRzY+QwNlVRqIzrKrCaMGFjy CZ9HiN9r1uwwdZF+Yd5Q2njm8pKau8OU4lbDJ7eTZEjMeZYYCetbL/LJIFYfsmofltnN lEAw== X-Gm-Message-State: AFqh2kp0s8TvizVbEXZ0HLU0EPWnbDt1CNH0nJL9Np7XubJ3+QMw1+2E zRMJtC/EgtX2jyqnQTTBNYQcOA== X-Google-Smtp-Source: AMrXdXuNL9Bem4Nk6LUw8GOS0oXi7frZUgAlWKl7ONHd632dNyN/0Roas1jfPgfWc2fae2QGC7BBHQ== X-Received: by 2002:a2e:8e78:0:b0:27f:afe3:48b0 with SMTP id t24-20020a2e8e78000000b0027fafe348b0mr8194199ljk.48.1672678995669; Mon, 02 Jan 2023 09:03:15 -0800 (PST) Received: from [192.168.1.101] (abxi45.neoplus.adsl.tpnet.pl. [83.9.2.45]) by smtp.gmail.com with ESMTPSA id f1-20020a05651c03c100b0027d75b38fd6sm3303478ljp.43.2023.01.02.09.03.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Jan 2023 09:03:15 -0800 (PST) Message-ID: Date: Mon, 2 Jan 2023 18:03:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] arm64: dts: qcom: sm6115: Add EUD dt node and dwc3 connector Content-Language: en-US To: Bhupesh Sharma , linux-arm-msm@vger.kernel.org Cc: quic_schowdhu@quicinc.com, agross@kernel.org, andersson@kernel.org, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org References: <20221231131945.3286639-1-bhupesh.sharma@linaro.org> <514482a4-614c-d6b8-ec7c-0e69fff72295@linaro.org> <016e9b47-35b4-2110-bbef-ddfd0abc6a8d@linaro.org> From: Konrad Dybcio In-Reply-To: <016e9b47-35b4-2110-bbef-ddfd0abc6a8d@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 2.01.2023 17:54, Bhupesh Sharma wrote: > > On 1/2/23 4:16 PM, Konrad Dybcio wrote: >> >> >> On 31.12.2022 14:19, Bhupesh Sharma wrote: >>> Add the Embedded USB Debugger(EUD) device tree node for >>> SM6115 / SM4250 SoC. >>> >>> The node contains EUD base register region and EUD mode >>> manager register regions 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. >>> >>> Cc: Souradeep Chowdhury >>> Signed-off-by: Bhupesh Sharma >>> --- >>> - 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 >>>    sent earlier, which can be seen here: >>>    https://lore.kernel.org/linux-arm-msm/20221231130743.3285664-1-bhupesh.sharma@linaro.org/ >>> >>>   arch/arm64/boot/dts/qcom/sm6115.dtsi | 37 ++++++++++++++++++++++++++++ >>>   1 file changed, 37 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>> index 030763187cc3f..c775f7fdb7015 100644 >>> --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi >>> +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>> @@ -565,6 +565,37 @@ gcc: clock-controller@1400000 { >>>               #power-domain-cells = <1>; >>>           }; >>>   +        eud: eud@1610000 { >>> +            compatible = "qcom,sm6115-eud","qcom,eud"; >> Missing space between entries. >> >>> +            reg = <0x01610000 0x2000>, >>> +                  <0x01612000 0x1000>, >>> +                  <0x003e5018 0x4>; >>> +            interrupts = ; >>> +            ports { >> Newline before ports {}. >> >> Not sure if debugging hardware should be enabled by default.. >>> +                port@0 { >>> +                    eud_ep: endpoint { >>> +                        remote-endpoint = <&usb2_role_switch>; >>> +                    }; >>> +                }; >> Newline between subsequent nodes. >> >>> +                port@1 { >>> +                    eud_con: endpoint { >>> +                        remote-endpoint = <&con_eud>; >>> +                    }; >>> +                }; >>> +            }; >>> +        }; >>> + >>> +        eud_typec: connector { >> Non-MMIO nodes don't belong under /soc. >> >>> +            compatible = "usb-c-connector"; >> Newline between properties and subnode. >> >> >>> +            ports { >>> +                port@0 { >>> +                    con_eud: endpoint { >>> +                        remote-endpoint = <&eud_con>; >>> +                    }; >>> +                }; >>> +            }; >>> +        }; >>> + >>>           usb_hsphy: phy@1613000 { >>>               compatible = "qcom,sm6115-qusb2-phy"; >>>               reg = <0x01613000 0x180>; >>> @@ -1064,6 +1095,12 @@ usb_dwc3: usb@4e00000 { >>>                   snps,has-lpm-erratum; >>>                   snps,hird-threshold = /bits/ 8 <0x10>; >>>                   snps,usb3_lpm_capable; >>> +                usb-role-switch; >> Same here. > > For all the above points, the format is same as suggested in [1] and already used in existing dts [2]. > > [1]. https://www.kernel.org/doc/Documentation/devicetree/bindings/soc/qcom/qcom%2Ceud.yaml > [2]. https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/sc7280.dtsi#L3587 The fact that it's landed does not necessarily imply it's 100% correct.. That one seems to have slipped through review and could use some fixing up. > >> On a note, this commit + driver-side changes give me a: >> >> 1610000.eud     qcom_eud: failed to get role switch > > You need to set dr_mode = "otg", for 'usb_dwc3' to make the role switch work. Thanks, couldn't find that anywhere. This however kicks me into EDL, so that's one more reason to disable it by default. Konrad> > Thanks, > Bhupesh > >>> +                port { >>> +                    usb2_role_switch: endpoint { >>> +                        remote-endpoint = <&eud_ep>; >>> +                    }; >>> +                }; >>>               }; >>>           }; >>>