Message ID | 20230717103236.1246771-4-bhupesh.sharma@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1037935vqt; Mon, 17 Jul 2023 04:07:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKv+L1l5XDhOb3XHl+ytQ6b7K7OvMPaC4NgvEae4C6ES3tQzB+i53G/G/v6RGub6RsTUFj X-Received: by 2002:a05:6402:5164:b0:51d:ad2b:3700 with SMTP id d4-20020a056402516400b0051dad2b3700mr10107883ede.26.1689592053468; Mon, 17 Jul 2023 04:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689592053; cv=none; d=google.com; s=arc-20160816; b=DW5fN2M/Vw66JAb+RIQhvwx6kPTC48Q/2VAGLtDh8cP3ZwZiYdOcWwGdODQmh0bSqQ /gZXJvfSZsMbfcuWif4bnPQF2Hm3RS7piaScpi0V5Ut3G2zEUsTVOQpNStpv6MJg7BLm V/rFVHdMjkaeGVkR+SSt+hDET0IK1fDVHuhRnrkyEm+uZopSJgM1OfgnqHg+FUUs8Zr6 O3KgtM4rJ3z/+UmKlm811amzdiph5cwFGm4dndQxo0m0qxAl+3fRS4lAPfIJwpDvLe+e A+VnTe46yeOHhOw3ddAH3bBJFf0E+xIhKrTL1Dsnh/AB8aVlvrQz6wl9keXH9eQSHJIM 9Fzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yr2lhl/TncZ/nmgXyyvgeCSOjpClIkhhe0GOfOLj29s=; fh=EpmhsCJ53Xk7LwEhS9AhHTV+oP3v1t43CrLSIzR2Qco=; b=huaSbcJKrcZFxBAqEQXrzyMl0+4hl5rsAQ/W1jyoZo3eTVhJy+dSdzTPWfTzN1ewXx +nuaZaGoUMVLoTM2CYbWxkrxqu78PjSVMP2hf+3F6EGfQ+NVDtMdpUPJbslY76T4AbI3 zc9mqg0+SEOiXOyf0jNLqLjyUrcpSMFOG/ZAPqoiEvoG1Pe0zJDYQswI4ALU054WpVqG rfPzPVYtjhotH1FDjby0eaZV/D/du3icR9l/hTxmJ4SHSb5T7ZIYoqlyfeuhn5fMJxoD rfZKtur95ERXvhWJ7BvVKZ+Q5rVwwhxvspNxhN2IhqAHVODXF0lUfn++UmgoAUtYLZ0c tkEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SPWBNeop; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z25-20020aa7c659000000b0051d91d3a3f6si13417051edr.428.2023.07.17.04.07.10; Mon, 17 Jul 2023 04:07:33 -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=@linaro.org header.s=google header.b=SPWBNeop; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjGQKd4 (ORCPT <rfc822;daweilics@gmail.com> + 99 others); Mon, 17 Jul 2023 06:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjGQKdd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 06:33:33 -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 4822419BD for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 03:33:13 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-666e97fcc60so2679208b3a.3 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 03:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689589987; x=1692181987; 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=Yr2lhl/TncZ/nmgXyyvgeCSOjpClIkhhe0GOfOLj29s=; b=SPWBNeopaNU3nELTMHts++zOvw/SEcmL1DiqjoGZPEIZjJ86A7udWgCAfjHtR57aOq RkTD8yG/uwBxmXKLLeDheFMRnIhrNmVEv50AJEfWyEXHNDt5LnNpDZFTQehkPREXei1b ylDgqExQtF3sJPXKs41jQz/rfJatp0b11KLJlYp3G7vCTQKkddpSkl6LGwKgOgDvFFYE Ht3nrXp9buuArG8aeDSuNP9Z3nzDk6ZIJeWS3zrQWH7YQPXcRB/Pqx9LoXDBz1Lonbo/ s/UfNDwMHtQrOaVIABMiJFxGXYaDoFDu47ma36eDNNgLyeIaFy7vBL2au5mtBq3FTVst LscQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689589987; x=1692181987; 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=Yr2lhl/TncZ/nmgXyyvgeCSOjpClIkhhe0GOfOLj29s=; b=DxGbU5Zu5k+nkMtmclSZIrw76mnarND/hQWcjGYPy6GXyHYI6k8kS7yB4UAWxQuMml QHzb37C5uepxlgRop5xqwTKBPXbZd0CGUqRNnZKq+JdyMNvJowss2tf4z7m9YULAr+QZ Dk1q11FuPASjF+bq0KGUg72Xalnc2Y7+7GjQk5HY91ozxo0jSzGUwRCV3DyUPMqafgiA bxtRLRpta0+kI/Qp1V8aw8oya8G4nYQdHv4wjg6O3KHBfN16Yc0qc3uQXPBoyI7/igRy 6EHAF5GbISTPyDW2+ocs1YvlyOH4GcnYEH2suYItwkT0S0eJ2/EthB6GtqAACqJK2mub GFTg== X-Gm-Message-State: ABy/qLZ53bm+xu4D4Gm/z3UFQGigRtG4VP4OIJiA8/jGmnxyTWVVeGmW h45P6AET7PmAQZrVwG7nzOkoWNuyTXdX+UJdwTVnPw== X-Received: by 2002:a05:6a20:a109:b0:133:6d89:4d29 with SMTP id q9-20020a056a20a10900b001336d894d29mr12601888pzk.58.1689589987309; Mon, 17 Jul 2023 03:33:07 -0700 (PDT) Received: from localhost.localdomain ([223.233.68.54]) by smtp.gmail.com with ESMTPSA id ij9-20020a170902ab4900b001b9de67285dsm12633616plb.156.2023.07.17.03.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 03:33:07 -0700 (PDT) From: Bhupesh Sharma <bhupesh.sharma@linaro.org> 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 Subject: [PATCH v8 3/4] arm64: dts: qcom: sm6115: Add EUD dt node and dwc3 connector Date: Mon, 17 Jul 2023 16:02:35 +0530 Message-Id: <20230717103236.1246771-4-bhupesh.sharma@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230717103236.1246771-1-bhupesh.sharma@linaro.org> References: <20230717103236.1246771-1-bhupesh.sharma@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771665631033632716 X-GMAIL-MSGID: 1771665676929849000 |
Series |
Add Qualcomm SM6115 / SM4250 EUD dt-bindings & driver support
|
|
Commit Message
Bhupesh Sharma
July 17, 2023, 10:32 a.m. UTC
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 Base 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 Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> --- arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
Comments
On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: > > On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: > > 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 Base register region along with the > > interrupt entry. > > > > [...] > > > > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > > --- > > arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ > > 1 file changed, 50 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > index 839c603512403..db45337c1082c 100644 > > --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > > +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > [...] > > @@ -789,6 +801,37 @@ 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>, > > + <0x0 0x003c0000 0x0 0x40000>; > > + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; > > TCSR is a separate hardware block unrelated to the EUD. IMHO it > shouldn't be listed as "reg" here. > > Typically we describe it as syscon and then reference it from other > nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm > "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the > same use case as you have. It also uses this to write something with > qcom_scm_io_writel() at the end. That was discussed a bit during v1 patchset review. Basically, if we use a tcsr syscon approach here, we will need to define a 'qcom,xx' vendor specific dt-property and use something like this in the eud node: qcom,eud-sec-reg = <&tcsr_reg yyyy> which would be then used by the eud driver (via syscon_regmap_lookup_by_phandle()). But for sm6115 / qcm2290 this would be an over complicated solution as normally the eud driver (say sc7280) doesn't need tcsr based secure mode manager access. So defining a new soc / vendor specific dt-property might be an overkill. Thanks, Bhupesh
On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: > On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: > > > > On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: > > > 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 Base register region along with the > > > interrupt entry. > > > > > > [...] > > > > > > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > > > --- > > > arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ > > > 1 file changed, 50 insertions(+) > > > > > > diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > index 839c603512403..db45337c1082c 100644 > > > --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > [...] > > > @@ -789,6 +801,37 @@ 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>, > > > + <0x0 0x003c0000 0x0 0x40000>; > > > + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; > > > > TCSR is a separate hardware block unrelated to the EUD. IMHO it > > shouldn't be listed as "reg" here. > > > > Typically we describe it as syscon and then reference it from other > > nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm > > "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the > > same use case as you have. It also uses this to write something with > > qcom_scm_io_writel() at the end. > > That was discussed a bit during v1 patchset review. Basically, if we > use a tcsr syscon approach here, we will need to define a 'qcom,xx' > vendor specific dt-property and use something like this in the eud > node: > > qcom,eud-sec-reg = <&tcsr_reg yyyy> > > which would be then used by the eud driver (via > syscon_regmap_lookup_by_phandle()). > > But for sm6115 / qcm2290 this would be an over complicated solution as > normally the eud driver (say sc7280) doesn't need tcsr based secure > mode manager access. So defining a new soc / vendor specific > dt-property might be an overkill. > IMO a vendor-specific DT property is still better than messing up the device separation in the device tree. The same "tcsr-base" reg would also appear on the actual tcsr syscon device tree node. Having two device tree nodes with the same reg region is generally not valid. Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make clear that this points into a region that is shared between multiple different devices, while adding it as reg suggests that TCSR belongs exclusively to EUD. Thanks, Stephan
On Mon, 17 Jul 2023 at 23:58, Stephan Gerhold <stephan@gerhold.net> wrote: > > On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: > > On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: > > > > > > On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: > > > > 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 Base register region along with the > > > > interrupt entry. > > > > > > > > [...] > > > > > > > > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > > > > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > > > > --- > > > > arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ > > > > 1 file changed, 50 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > > index 839c603512403..db45337c1082c 100644 > > > > --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > > +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > > > > [...] > > > > @@ -789,6 +801,37 @@ 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>, > > > > + <0x0 0x003c0000 0x0 0x40000>; > > > > + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; > > > > > > TCSR is a separate hardware block unrelated to the EUD. IMHO it > > > shouldn't be listed as "reg" here. > > > > > > Typically we describe it as syscon and then reference it from other > > > nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm > > > "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the > > > same use case as you have. It also uses this to write something with > > > qcom_scm_io_writel() at the end. > > > > That was discussed a bit during v1 patchset review. Basically, if we > > use a tcsr syscon approach here, we will need to define a 'qcom,xx' > > vendor specific dt-property and use something like this in the eud > > node: > > > > qcom,eud-sec-reg = <&tcsr_reg yyyy> > > > > which would be then used by the eud driver (via > > syscon_regmap_lookup_by_phandle()). > > > > But for sm6115 / qcm2290 this would be an over complicated solution as > > normally the eud driver (say sc7280) doesn't need tcsr based secure > > mode manager access. So defining a new soc / vendor specific > > dt-property might be an overkill. > > > > IMO a vendor-specific DT property is still better than messing up the > device separation in the device tree. The same "tcsr-base" reg would > also appear on the actual tcsr syscon device tree node. Having two > device tree nodes with the same reg region is generally not valid. > > Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make > clear that this points into a region that is shared between multiple > different devices, while adding it as reg suggests that TCSR belongs > exclusively to EUD. I understand your point but since for sm6115 / qcm2290 devices TCSR is not used for any other purpose than EUD, I still think introducing a new soc / vendor specific dt-property might be an overkill for this changeset. Thanks, Bhupesh
On 17.07.2023 22:09, Bhupesh Sharma wrote: > On Mon, 17 Jul 2023 at 23:58, Stephan Gerhold <stephan@gerhold.net> wrote: >> >> On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: >>> On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: >>>> >>>> On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: >>>>> 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 Base register region along with the >>>>> interrupt entry. >>>>> >>>>> [...] >>>>> >>>>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> >>>>> --- >>>>> arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ >>>>> 1 file changed, 50 insertions(+) >>>>> >>>>> diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>> index 839c603512403..db45337c1082c 100644 >>>>> --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>> +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>> [...] >>>>> @@ -789,6 +801,37 @@ 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>, >>>>> + <0x0 0x003c0000 0x0 0x40000>; >>>>> + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; >>>> >>>> TCSR is a separate hardware block unrelated to the EUD. IMHO it >>>> shouldn't be listed as "reg" here. >>>> >>>> Typically we describe it as syscon and then reference it from other >>>> nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm >>>> "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the >>>> same use case as you have. It also uses this to write something with >>>> qcom_scm_io_writel() at the end. >>> >>> That was discussed a bit during v1 patchset review. Basically, if we >>> use a tcsr syscon approach here, we will need to define a 'qcom,xx' >>> vendor specific dt-property and use something like this in the eud >>> node: >>> >>> qcom,eud-sec-reg = <&tcsr_reg yyyy> >>> >>> which would be then used by the eud driver (via >>> syscon_regmap_lookup_by_phandle()). >>> >>> But for sm6115 / qcm2290 this would be an over complicated solution as >>> normally the eud driver (say sc7280) doesn't need tcsr based secure >>> mode manager access. So defining a new soc / vendor specific >>> dt-property might be an overkill. >>> >> >> IMO a vendor-specific DT property is still better than messing up the >> device separation in the device tree. The same "tcsr-base" reg would >> also appear on the actual tcsr syscon device tree node. Having two >> device tree nodes with the same reg region is generally not valid. >> >> Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make >> clear that this points into a region that is shared between multiple >> different devices, while adding it as reg suggests that TCSR belongs >> exclusively to EUD. > > I understand your point but since for sm6115 / qcm2290 devices TCSR is > not used for any other purpose than EUD, I still think introducing a > new soc / vendor specific dt-property might be an overkill for this > changeset. Untrue, there's some mumblings around the PHY properties and PSHOLD. I think Stephan may be correct here. Konrad > > Thanks, > Bhupesh
On Tue, 18 Jul 2023 at 01:49, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > On 17.07.2023 22:09, Bhupesh Sharma wrote: > > On Mon, 17 Jul 2023 at 23:58, Stephan Gerhold <stephan@gerhold.net> wrote: > >> > >> On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: > >>> On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: > >>>> > >>>> On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: > >>>>> 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 Base register region along with the > >>>>> interrupt entry. > >>>>> > >>>>> [...] > >>>>> > >>>>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > >>>>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > >>>>> --- > >>>>> arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ > >>>>> 1 file changed, 50 insertions(+) > >>>>> > >>>>> diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>> index 839c603512403..db45337c1082c 100644 > >>>>> --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>> +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>> [...] > >>>>> @@ -789,6 +801,37 @@ 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>, > >>>>> + <0x0 0x003c0000 0x0 0x40000>; > >>>>> + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; > >>>> > >>>> TCSR is a separate hardware block unrelated to the EUD. IMHO it > >>>> shouldn't be listed as "reg" here. > >>>> > >>>> Typically we describe it as syscon and then reference it from other > >>>> nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm > >>>> "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the > >>>> same use case as you have. It also uses this to write something with > >>>> qcom_scm_io_writel() at the end. > >>> > >>> That was discussed a bit during v1 patchset review. Basically, if we > >>> use a tcsr syscon approach here, we will need to define a 'qcom,xx' > >>> vendor specific dt-property and use something like this in the eud > >>> node: > >>> > >>> qcom,eud-sec-reg = <&tcsr_reg yyyy> > >>> > >>> which would be then used by the eud driver (via > >>> syscon_regmap_lookup_by_phandle()). > >>> > >>> But for sm6115 / qcm2290 this would be an over complicated solution as > >>> normally the eud driver (say sc7280) doesn't need tcsr based secure > >>> mode manager access. So defining a new soc / vendor specific > >>> dt-property might be an overkill. > >>> > >> > >> IMO a vendor-specific DT property is still better than messing up the > >> device separation in the device tree. The same "tcsr-base" reg would > >> also appear on the actual tcsr syscon device tree node. Having two > >> device tree nodes with the same reg region is generally not valid. > >> > >> Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make > >> clear that this points into a region that is shared between multiple > >> different devices, while adding it as reg suggests that TCSR belongs > >> exclusively to EUD. > > > > I understand your point but since for sm6115 / qcm2290 devices TCSR is > > not used for any other purpose than EUD, I still think introducing a > > new soc / vendor specific dt-property might be an overkill for this > > changeset. > Untrue, there's some mumblings around the PHY properties and PSHOLD. > I think Stephan may be correct here. Can you share the links to those discussions? Thanks, Bhupesh
On 17.07.2023 22:22, Bhupesh Sharma wrote: > On Tue, 18 Jul 2023 at 01:49, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: >> >> On 17.07.2023 22:09, Bhupesh Sharma wrote: >>> On Mon, 17 Jul 2023 at 23:58, Stephan Gerhold <stephan@gerhold.net> wrote: >>>> >>>> On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: >>>>> On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: >>>>>> >>>>>> On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: >>>>>>> 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 Base register region along with the >>>>>>> interrupt entry. >>>>>>> >>>>>>> [...] >>>>>>> >>>>>>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> >>>>>>> --- >>>>>>> arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ >>>>>>> 1 file changed, 50 insertions(+) >>>>>>> >>>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>>>> index 839c603512403..db45337c1082c 100644 >>>>>>> --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>>>> +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi >>>>>>> [...] >>>>>>> @@ -789,6 +801,37 @@ 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>, >>>>>>> + <0x0 0x003c0000 0x0 0x40000>; >>>>>>> + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; >>>>>> >>>>>> TCSR is a separate hardware block unrelated to the EUD. IMHO it >>>>>> shouldn't be listed as "reg" here. >>>>>> >>>>>> Typically we describe it as syscon and then reference it from other >>>>>> nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm >>>>>> "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the >>>>>> same use case as you have. It also uses this to write something with >>>>>> qcom_scm_io_writel() at the end. >>>>> >>>>> That was discussed a bit during v1 patchset review. Basically, if we >>>>> use a tcsr syscon approach here, we will need to define a 'qcom,xx' >>>>> vendor specific dt-property and use something like this in the eud >>>>> node: >>>>> >>>>> qcom,eud-sec-reg = <&tcsr_reg yyyy> >>>>> >>>>> which would be then used by the eud driver (via >>>>> syscon_regmap_lookup_by_phandle()). >>>>> >>>>> But for sm6115 / qcm2290 this would be an over complicated solution as >>>>> normally the eud driver (say sc7280) doesn't need tcsr based secure >>>>> mode manager access. So defining a new soc / vendor specific >>>>> dt-property might be an overkill. >>>>> >>>> >>>> IMO a vendor-specific DT property is still better than messing up the >>>> device separation in the device tree. The same "tcsr-base" reg would >>>> also appear on the actual tcsr syscon device tree node. Having two >>>> device tree nodes with the same reg region is generally not valid. >>>> >>>> Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make >>>> clear that this points into a region that is shared between multiple >>>> different devices, while adding it as reg suggests that TCSR belongs >>>> exclusively to EUD. >>> >>> I understand your point but since for sm6115 / qcm2290 devices TCSR is >>> not used for any other purpose than EUD, I still think introducing a >>> new soc / vendor specific dt-property might be an overkill for this >>> changeset. >> Untrue, there's some mumblings around the PHY properties and PSHOLD. >> I think Stephan may be correct here. > > Can you share the links to those discussions? It just seemed off to me that TCSR was not used by anything else (even from Linux, it would obviously be used by something else higher up in the boot chain as it contains various configuration registers), so I took a glance at the downstream device tree and I noticed there are more users. Konrad
On Tue, 18 Jul 2023 at 01:54, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > > On 17.07.2023 22:22, Bhupesh Sharma wrote: > > On Tue, 18 Jul 2023 at 01:49, Konrad Dybcio <konrad.dybcio@linaro.org> wrote: > >> > >> On 17.07.2023 22:09, Bhupesh Sharma wrote: > >>> On Mon, 17 Jul 2023 at 23:58, Stephan Gerhold <stephan@gerhold.net> wrote: > >>>> > >>>> On Mon, Jul 17, 2023 at 11:33:40PM +0530, Bhupesh Sharma wrote: > >>>>> On Mon, 17 Jul 2023 at 16:15, Stephan Gerhold <stephan@gerhold.net> wrote: > >>>>>> > >>>>>> On Mon, Jul 17, 2023 at 04:02:35PM +0530, Bhupesh Sharma wrote: > >>>>>>> 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 Base register region along with the > >>>>>>> interrupt entry. > >>>>>>> > >>>>>>> [...] > >>>>>>> > >>>>>>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > >>>>>>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > >>>>>>> --- > >>>>>>> arch/arm64/boot/dts/qcom/sm6115.dtsi | 50 ++++++++++++++++++++++++++++ > >>>>>>> 1 file changed, 50 insertions(+) > >>>>>>> > >>>>>>> diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>>>> index 839c603512403..db45337c1082c 100644 > >>>>>>> --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>>>> +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > >>>>>>> [...] > >>>>>>> @@ -789,6 +801,37 @@ 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>, > >>>>>>> + <0x0 0x003c0000 0x0 0x40000>; > >>>>>>> + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; > >>>>>> > >>>>>> TCSR is a separate hardware block unrelated to the EUD. IMHO it > >>>>>> shouldn't be listed as "reg" here. > >>>>>> > >>>>>> Typically we describe it as syscon and then reference it from other > >>>>>> nodes. See e.g. sm8450.dtsi "tcsr: syscon@1fc0000" referenced in &scm > >>>>>> "qcom,dload-mode = <&tcsr 0x13000>". This is pretty much exactly the > >>>>>> same use case as you have. It also uses this to write something with > >>>>>> qcom_scm_io_writel() at the end. > >>>>> > >>>>> That was discussed a bit during v1 patchset review. Basically, if we > >>>>> use a tcsr syscon approach here, we will need to define a 'qcom,xx' > >>>>> vendor specific dt-property and use something like this in the eud > >>>>> node: > >>>>> > >>>>> qcom,eud-sec-reg = <&tcsr_reg yyyy> > >>>>> > >>>>> which would be then used by the eud driver (via > >>>>> syscon_regmap_lookup_by_phandle()). > >>>>> > >>>>> But for sm6115 / qcm2290 this would be an over complicated solution as > >>>>> normally the eud driver (say sc7280) doesn't need tcsr based secure > >>>>> mode manager access. So defining a new soc / vendor specific > >>>>> dt-property might be an overkill. > >>>>> > >>>> > >>>> IMO a vendor-specific DT property is still better than messing up the > >>>> device separation in the device tree. The same "tcsr-base" reg would > >>>> also appear on the actual tcsr syscon device tree node. Having two > >>>> device tree nodes with the same reg region is generally not valid. > >>>> > >>>> Something like qcom,eud-sec-reg = <&tcsr_reg yyyy> would at least make > >>>> clear that this points into a region that is shared between multiple > >>>> different devices, while adding it as reg suggests that TCSR belongs > >>>> exclusively to EUD. > >>> > >>> I understand your point but since for sm6115 / qcm2290 devices TCSR is > >>> not used for any other purpose than EUD, I still think introducing a > >>> new soc / vendor specific dt-property might be an overkill for this > >>> changeset. > >> Untrue, there's some mumblings around the PHY properties and PSHOLD. > >> I think Stephan may be correct here. > > > > Can you share the links to those discussions? > It just seemed off to me that TCSR was not used by anything else (even > from Linux, it would obviously be used by something else higher up in > the boot chain as it contains various configuration registers), so I > took a glance at the downstream device tree and I noticed there are > more users. Ok, let me recheck the downstream code and come back. Thanks, Bhupesh
diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index 839c603512403..db45337c1082c 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"; @@ -789,6 +801,37 @@ 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>, + <0x0 0x003c0000 0x0 0x40000>; + reg-names = "eud-base", "eud-mode-mgr", "tcsr-base"; + interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; + 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>; @@ -1322,6 +1365,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>; + }; + }; }; };