Message ID | 20230208034620.2048744-3-quic_bjorande@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3235715wrn; Tue, 7 Feb 2023 19:55:37 -0800 (PST) X-Google-Smtp-Source: AK7set/ivEPbHd16JIIqO6W24l0OArxth91P+Tj/l2MrUWbcVNs9i8GiARu0uvNX16C8FIoNk2A4 X-Received: by 2002:a17:906:3582:b0:888:1f21:4429 with SMTP id o2-20020a170906358200b008881f214429mr4981672ejb.19.1675828537743; Tue, 07 Feb 2023 19:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675828537; cv=none; d=google.com; s=arc-20160816; b=qfvDDMZ/hruxptODsP6FdFOo4yMoIrezQbBoL/fa6ggyhm9dt8fD4AdzHqvDpBpor1 P+/WAT6BU3tzyEHjcjTDPsTtNS5lHSQcp0NkxHsEktfOqf12xA5+R2MMni0/TY4/2AgX vUW1/jFrGvd/3q7YvMjYddqAyV1ueLwTk3cmuNQ4VUQGcFsMT+IlxPeJaOp3DVCasJyi nyk8MTI6u7+AQ8vvbTvSjkPSPNYcH9V4yyNGmGsvIqJQN9Z3F5VFekefdZoe8E5etO/n 4bR51GwxbXBF7zUcFhCEo6cuakR5/4sRcVpo1X6/EeGySfUOkxagcJGy6y14jMaKVQsm K81g== 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=T/CK6B3XF02b6T5TJNMPZLPeEfR/L8TNxhZNMyPfMjc=; b=wPWdIBbKUcza/PeYjE4DHFBrYnBLLa8BUfvWQ878Vh5eADp+KIzBARUxBPPkjXHV4M hF7VYli+tKYcLFHywn9rp+lPQSMny9/Kuv1j93jnce9NMjLr+vN7sgUPs8DPIhA6Lakg /bhTxnnn2spZW9NzyQLjYB0FegF7N3cFfVaTJcs6K1oGxfVq3TNEurb4pphD52zP9GXf uWj6GFmGfA4hQaqTh72QTwNopxJUb5Zyws2O2EDcJNPtnNiuxx/xOeRW303bGksWerDa PIUDvub4oSYACHI/ckyb4J5DIJpUT1pUQILc6Aj4ymtU8rHkjKSTSdqETTrxjTSXFPME mjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Rd4WgdLE; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 22-20020a170906209600b0086b6a3fd247si26226565ejq.557.2023.02.07.19.55.15; Tue, 07 Feb 2023 19:55:37 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=Rd4WgdLE; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjBHDq6 (ORCPT <rfc822;kmanaouilinux@gmail.com> + 99 others); Tue, 7 Feb 2023 22:46:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbjBHDql (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Feb 2023 22:46:41 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E8A15B84; Tue, 7 Feb 2023 19:46:40 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3183e2MV026414; Wed, 8 Feb 2023 03:46:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=T/CK6B3XF02b6T5TJNMPZLPeEfR/L8TNxhZNMyPfMjc=; b=Rd4WgdLEX5G5nwXvOGs5QvMo7cXYatNtFj9uOdQSiad60gK8ZskjJoDoTnGLX6kNqwk8 rv6Ev0cp1L8c0T/JqYbYiSVg8vOMNcsBw1//VJJQNvaFZy6Dbj1rur1lX0S7/3XBfoJ1 VcQftRcbS6gwxCAYwHT7nmdJpk/QXIHXOfofzkIjxTIS1OfaYf4vUamYQydGihrJYHhZ Sq5GM6xoSYhdSzP27LILiQBtGoHBnLQSH3RigBMe9oBaUC+kgKDG3f04Rti+lVV3DRHA HugWjrew2SMDXvJL1yMcGB6Lb+z2r6akI5COx+Ja2fUX06yxmAT8msf3YLjs3JOmtOSe zA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nm1yf09k9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 03:46:27 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3183kQZs017734 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 8 Feb 2023 03:46:26 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 7 Feb 2023 19:46:26 -0800 From: Bjorn Andersson <quic_bjorande@quicinc.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org> CC: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org> Subject: [PATCH 2/4] arm64: dts: qcom: sc8280xp-crd: Introduce pmic_glink Date: Tue, 7 Feb 2023 19:46:18 -0800 Message-ID: <20230208034620.2048744-3-quic_bjorande@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230208034620.2048744-1-quic_bjorande@quicinc.com> References: <20230208034620.2048744-1-quic_bjorande@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 9Q836JM4B5_f_Y-Z4BFubF5vAYFzh_NG X-Proofpoint-GUID: 9Q836JM4B5_f_Y-Z4BFubF5vAYFzh_NG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-07_15,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 mlxscore=0 phishscore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080032 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757233584632681359?= X-GMAIL-MSGID: =?utf-8?q?1757233584632681359?= |
Series |
arm64: dts: qcom: sc8280xp: Enable external display
|
|
Commit Message
Bjorn Andersson
Feb. 8, 2023, 3:46 a.m. UTC
From: Bjorn Andersson <bjorn.andersson@linaro.org> The SC8280XP CRD control over battery management and its two USB Type-C port using pmic_glink and two GPIO-based SBU muxes. Enable the two DisplayPort instances, GPIO SBU mux instance and pmic_glink with the two connectors on the CRD. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> --- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 191 +++++++++++++++++++++- 1 file changed, 189 insertions(+), 2 deletions(-)
Comments
On 8.02.2023 04:46, Bjorn Andersson wrote: > From: Bjorn Andersson <bjorn.andersson@linaro.org> > > The SC8280XP CRD control over battery management and its two USB Type-C > port using pmic_glink and two GPIO-based SBU muxes. > > Enable the two DisplayPort instances, GPIO SBU mux instance and > pmic_glink with the two connectors on the CRD. > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > --- > arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 191 +++++++++++++++++++++- > 1 file changed, 189 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > index 3f116a879e22..35b63c3962f0 100644 > --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > @@ -36,6 +36,77 @@ chosen { > stdout-path = "serial0:115200n8"; > }; > > + pmic-glink { > + compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink"; > + > + #address-cells = <1>; > + #size-cells = <0>; > + > + connector@0 { > + compatible = "usb-c-connector"; > + reg = <0>; > + power-role = "dual"; > + data-role = "dual"; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; Add a newline between the last propreties and first subnodes, please. > + port@0 { > + reg = <0>; > + pmic_glink_con0_hs: endpoint { > + remote-endpoint = <&usb_0_role_switch>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + pmic_glink_con0_ss: endpoint { > + remote-endpoint = <&mdss0_dp0_out>; > + }; > + }; > + > + port@2 { > + reg = <2>; > + pmic_glink_con0_sbu: endpoint { > + remote-endpoint = <&usb0_sbu_mux>; > + }; > + }; > + }; > + }; > + > + connector@1 { > + compatible = "usb-c-connector"; > + reg = <1>; > + power-role = "dual"; > + data-role = "dual"; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + port@0 { > + reg = <0>; > + pmic_glink_con1_hs: endpoint { > + remote-endpoint = <&usb_1_role_switch>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + pmic_glink_con1_ss: endpoint { > + remote-endpoint = <&mdss0_dp1_out>; > + }; > + }; > + > + port@2 { > + reg = <2>; > + pmic_glink_con1_sbu: endpoint { > + remote-endpoint = <&usb1_sbu_mux>; > + }; > + }; > + }; > + }; > + }; > + > vreg_edp_3p3: regulator-edp-3p3 { > compatible = "regulator-fixed"; > > @@ -139,6 +210,46 @@ linux,cma { > linux,cma-default; > }; > }; > + > + usb0-sbu-mux { > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > + > + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; > + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&usb0_sbu_default>; > + > + mode-switch; > + orientation-switch; > + svid = /bits/ 16 <0xff01>; > + > + port { > + usb0_sbu_mux: endpoint { > + remote-endpoint = <&pmic_glink_con0_sbu>; > + }; > + }; > + }; > + > + usb1-sbu-mux { > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > + > + enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; > + select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&usb1_sbu_default>; > + > + mode-switch; > + orientation-switch; > + svid = /bits/ 16 <0xff01>; > + > + port { > + usb1_sbu_mux: endpoint { > + remote-endpoint = <&pmic_glink_con1_sbu>; > + }; > + }; > + }; > }; > > &apps_rsc { > @@ -262,6 +373,36 @@ &mdss0 { > status = "okay"; > }; > > +&mdss0_dp0 { > + status = "okay"; > + > + data-lanes = <0 1>; Status last; is this really only 2 lanes? > + > + ports { > + port@1 { > + reg = <1>; > + mdss0_dp0_out: endpoint { > + remote-endpoint = <&pmic_glink_con0_ss>; > + }; > + }; > + }; > +}; > + > +&mdss0_dp1 { > + status = "okay"; > + > + data-lanes = <0 1>; Ditto > + > + ports { > + port@1 { > + reg = <1>; > + mdss0_dp1_out: endpoint { > + remote-endpoint = <&pmic_glink_con1_ss>; > + }; > + }; > + }; > +}; > + > &mdss0_dp3 { > compatible = "qcom,sc8280xp-edp"; > /delete-property/ #sound-dai-cells; > @@ -480,8 +621,13 @@ &usb_0 { > }; > > &usb_0_dwc3 { > - /* TODO: Define USB-C connector properly */ > dr_mode = "host"; > + > + port { > + usb_0_role_switch: endpoint { > + remote-endpoint = <&pmic_glink_con0_hs>; > + }; This should be defined in the SoC DTSI, it's a standard dwc3 binding with usb HS / SS / SBU ports. Especially since we can feed the endpoint from any device now, as pmic-glink should work everywhere. Or /omit-if-no-ref/, I suppose. > + }; > }; > > &usb_0_hsphy { > @@ -504,8 +650,13 @@ &usb_1 { > }; > > &usb_1_dwc3 { > - /* TODO: Define USB-C connector properly */ > dr_mode = "host"; > + > + port { > + usb_1_role_switch: endpoint { > + remote-endpoint = <&pmic_glink_con1_hs>; > + }; > + }; > }; > > &usb_1_hsphy { > @@ -709,4 +860,40 @@ reset-n-pins { > drive-strength = <16>; > }; > }; > + > + usb0_sbu_default: usb0-sbu-state { > + oe-n-pins { > + pins = "gpio101"; > + function = "gpio"; No drive-strength/bias/i/o? Konrad > + }; > + > + sel-pins { > + pins = "gpio164"; > + function = "gpio"; > + }; > + > + mode-pins { > + pins = "gpio167"; > + function = "gpio"; > + output-high; > + }; > + }; > + > + usb1_sbu_default: usb1-sbu-state { > + oe-n-pins { > + pins = "gpio48"; > + function = "gpio"; > + }; > + > + sel-pins { > + pins = "gpio47"; > + function = "gpio"; > + }; > + > + mode-pins { > + pins = "gpio50"; > + function = "gpio"; > + output-high; > + }; > + }; > };
On Wed, Feb 08, 2023 at 09:14:46AM +0100, Konrad Dybcio wrote: > > > On 8.02.2023 04:46, Bjorn Andersson wrote: > > From: Bjorn Andersson <bjorn.andersson@linaro.org> > > > > The SC8280XP CRD control over battery management and its two USB Type-C > > port using pmic_glink and two GPIO-based SBU muxes. > > > > Enable the two DisplayPort instances, GPIO SBU mux instance and > > pmic_glink with the two connectors on the CRD. > > > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > > --- > > arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 191 +++++++++++++++++++++- > > 1 file changed, 189 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > > index 3f116a879e22..35b63c3962f0 100644 > > --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > > +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts > > @@ -36,6 +36,77 @@ chosen { > > stdout-path = "serial0:115200n8"; > > }; > > > > + pmic-glink { > > + compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink"; > > + > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + connector@0 { > > + compatible = "usb-c-connector"; > > + reg = <0>; > > + power-role = "dual"; > > + data-role = "dual"; > > + > > + ports { > > + #address-cells = <1>; > > + #size-cells = <0>; > Add a newline between the last propreties and first subnodes, please. > > > + port@0 { > > + reg = <0>; > > + pmic_glink_con0_hs: endpoint { > > + remote-endpoint = <&usb_0_role_switch>; > > + }; > > + }; > > + > > + port@1 { > > + reg = <1>; > > + pmic_glink_con0_ss: endpoint { > > + remote-endpoint = <&mdss0_dp0_out>; > > + }; > > + }; > > + > > + port@2 { > > + reg = <2>; > > + pmic_glink_con0_sbu: endpoint { > > + remote-endpoint = <&usb0_sbu_mux>; > > + }; > > + }; > > + }; > > + }; > > + > > + connector@1 { > > + compatible = "usb-c-connector"; > > + reg = <1>; > > + power-role = "dual"; > > + data-role = "dual"; > > + > > + ports { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + port@0 { > > + reg = <0>; > > + pmic_glink_con1_hs: endpoint { > > + remote-endpoint = <&usb_1_role_switch>; > > + }; > > + }; > > + > > + port@1 { > > + reg = <1>; > > + pmic_glink_con1_ss: endpoint { > > + remote-endpoint = <&mdss0_dp1_out>; > > + }; > > + }; > > + > > + port@2 { > > + reg = <2>; > > + pmic_glink_con1_sbu: endpoint { > > + remote-endpoint = <&usb1_sbu_mux>; > > + }; > > + }; > > + }; > > + }; > > + }; > > + > > vreg_edp_3p3: regulator-edp-3p3 { > > compatible = "regulator-fixed"; > > > > @@ -139,6 +210,46 @@ linux,cma { > > linux,cma-default; > > }; > > }; > > + > > + usb0-sbu-mux { > > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > > + > > + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; > > + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; > > + > > + pinctrl-names = "default"; > > + pinctrl-0 = <&usb0_sbu_default>; > > + > > + mode-switch; > > + orientation-switch; > > + svid = /bits/ 16 <0xff01>; > > + > > + port { > > + usb0_sbu_mux: endpoint { > > + remote-endpoint = <&pmic_glink_con0_sbu>; > > + }; > > + }; > > + }; > > + > > + usb1-sbu-mux { > > + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; > > + > > + enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; > > + select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; > > + > > + pinctrl-names = "default"; > > + pinctrl-0 = <&usb1_sbu_default>; > > + > > + mode-switch; > > + orientation-switch; > > + svid = /bits/ 16 <0xff01>; > > + > > + port { > > + usb1_sbu_mux: endpoint { > > + remote-endpoint = <&pmic_glink_con1_sbu>; > > + }; > > + }; > > + }; > > }; > > > > &apps_rsc { > > @@ -262,6 +373,36 @@ &mdss0 { > > status = "okay"; > > }; > > > > +&mdss0_dp0 { > > + status = "okay"; > > + > > + data-lanes = <0 1>; > Status last; is this really only 2 lanes? > > > + > > + ports { > > + port@1 { > > + reg = <1>; > > + mdss0_dp0_out: endpoint { > > + remote-endpoint = <&pmic_glink_con0_ss>; > > + }; > > + }; > > + }; > > +}; > > + > > +&mdss0_dp1 { > > + status = "okay"; > > + > > + data-lanes = <0 1>; > Ditto > > > + > > + ports { > > + port@1 { > > + reg = <1>; > > + mdss0_dp1_out: endpoint { > > + remote-endpoint = <&pmic_glink_con1_ss>; > > + }; > > + }; > > + }; > > +}; > > + > > &mdss0_dp3 { > > compatible = "qcom,sc8280xp-edp"; > > /delete-property/ #sound-dai-cells; > > @@ -480,8 +621,13 @@ &usb_0 { > > }; > > > > &usb_0_dwc3 { > > - /* TODO: Define USB-C connector properly */ > > dr_mode = "host"; > > + > > + port { > > + usb_0_role_switch: endpoint { > > + remote-endpoint = <&pmic_glink_con0_hs>; > > + }; > This should be defined in the SoC DTSI, it's a standard dwc3 binding > with usb HS / SS / SBU ports. Especially since we can feed the endpoint > from any device now, as pmic-glink should work everywhere. > The sa8295p/sa8540p boards, derived from sc8280xp does not implement pmic_glink, so it seems moving this to the soc.dtsi would be messy. > Or /omit-if-no-ref/, I suppose. > Or you're saying I should put the skeleton of the port definition in the soc.dtsi and then fill it out the remote-endpoint here; and mark it omit-if-no-ref to avoid binding warnings? > > + }; > > }; > > > > &usb_0_hsphy { > > @@ -504,8 +650,13 @@ &usb_1 { > > }; > > > > &usb_1_dwc3 { > > - /* TODO: Define USB-C connector properly */ > > dr_mode = "host"; > > + > > + port { > > + usb_1_role_switch: endpoint { > > + remote-endpoint = <&pmic_glink_con1_hs>; > > + }; > > + }; > > }; > > > > &usb_1_hsphy { > > @@ -709,4 +860,40 @@ reset-n-pins { > > drive-strength = <16>; > > }; > > }; > > + > > + usb0_sbu_default: usb0-sbu-state { > > + oe-n-pins { > > + pins = "gpio101"; > > + function = "gpio"; > No drive-strength/bias/i/o? > Seems like a reasonable ask... Thanks, Bjorn > Konrad > > + }; > > + > > + sel-pins { > > + pins = "gpio164"; > > + function = "gpio"; > > + }; > > + > > + mode-pins { > > + pins = "gpio167"; > > + function = "gpio"; > > + output-high; > > + }; > > + }; > > + > > + usb1_sbu_default: usb1-sbu-state { > > + oe-n-pins { > > + pins = "gpio48"; > > + function = "gpio"; > > + }; > > + > > + sel-pins { > > + pins = "gpio47"; > > + function = "gpio"; > > + }; > > + > > + mode-pins { > > + pins = "gpio50"; > > + function = "gpio"; > > + output-high; > > + }; > > + }; > > };
On 8.02.2023 16:57, Bjorn Andersson wrote: > On Wed, Feb 08, 2023 at 09:14:46AM +0100, Konrad Dybcio wrote: >> >> >> On 8.02.2023 04:46, Bjorn Andersson wrote: >>> From: Bjorn Andersson <bjorn.andersson@linaro.org> >>> >>> The SC8280XP CRD control over battery management and its two USB Type-C >>> port using pmic_glink and two GPIO-based SBU muxes. >>> >>> Enable the two DisplayPort instances, GPIO SBU mux instance and >>> pmic_glink with the two connectors on the CRD. >>> >>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> >>> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> >>> --- >>> arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 191 +++++++++++++++++++++- >>> 1 file changed, 189 insertions(+), 2 deletions(-) >>> >>> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts >>> index 3f116a879e22..35b63c3962f0 100644 >>> --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts >>> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts >>> @@ -36,6 +36,77 @@ chosen { >>> stdout-path = "serial0:115200n8"; >>> }; >>> >>> + pmic-glink { >>> + compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink"; >>> + >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + >>> + connector@0 { >>> + compatible = "usb-c-connector"; >>> + reg = <0>; >>> + power-role = "dual"; >>> + data-role = "dual"; >>> + >>> + ports { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >> Add a newline between the last propreties and first subnodes, please. >> >>> + port@0 { >>> + reg = <0>; >>> + pmic_glink_con0_hs: endpoint { >>> + remote-endpoint = <&usb_0_role_switch>; >>> + }; >>> + }; >>> + >>> + port@1 { >>> + reg = <1>; >>> + pmic_glink_con0_ss: endpoint { >>> + remote-endpoint = <&mdss0_dp0_out>; >>> + }; >>> + }; >>> + >>> + port@2 { >>> + reg = <2>; >>> + pmic_glink_con0_sbu: endpoint { >>> + remote-endpoint = <&usb0_sbu_mux>; >>> + }; >>> + }; >>> + }; >>> + }; >>> + >>> + connector@1 { >>> + compatible = "usb-c-connector"; >>> + reg = <1>; >>> + power-role = "dual"; >>> + data-role = "dual"; >>> + >>> + ports { >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + port@0 { >>> + reg = <0>; >>> + pmic_glink_con1_hs: endpoint { >>> + remote-endpoint = <&usb_1_role_switch>; >>> + }; >>> + }; >>> + >>> + port@1 { >>> + reg = <1>; >>> + pmic_glink_con1_ss: endpoint { >>> + remote-endpoint = <&mdss0_dp1_out>; >>> + }; >>> + }; >>> + >>> + port@2 { >>> + reg = <2>; >>> + pmic_glink_con1_sbu: endpoint { >>> + remote-endpoint = <&usb1_sbu_mux>; >>> + }; >>> + }; >>> + }; >>> + }; >>> + }; >>> + >>> vreg_edp_3p3: regulator-edp-3p3 { >>> compatible = "regulator-fixed"; >>> >>> @@ -139,6 +210,46 @@ linux,cma { >>> linux,cma-default; >>> }; >>> }; >>> + >>> + usb0-sbu-mux { >>> + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; >>> + >>> + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; >>> + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; >>> + >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&usb0_sbu_default>; >>> + >>> + mode-switch; >>> + orientation-switch; >>> + svid = /bits/ 16 <0xff01>; >>> + >>> + port { >>> + usb0_sbu_mux: endpoint { >>> + remote-endpoint = <&pmic_glink_con0_sbu>; >>> + }; >>> + }; >>> + }; >>> + >>> + usb1-sbu-mux { >>> + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; >>> + >>> + enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; >>> + select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; >>> + >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&usb1_sbu_default>; >>> + >>> + mode-switch; >>> + orientation-switch; >>> + svid = /bits/ 16 <0xff01>; >>> + >>> + port { >>> + usb1_sbu_mux: endpoint { >>> + remote-endpoint = <&pmic_glink_con1_sbu>; >>> + }; >>> + }; >>> + }; >>> }; >>> >>> &apps_rsc { >>> @@ -262,6 +373,36 @@ &mdss0 { >>> status = "okay"; >>> }; >>> >>> +&mdss0_dp0 { >>> + status = "okay"; >>> + >>> + data-lanes = <0 1>; >> Status last; is this really only 2 lanes? >> >>> + >>> + ports { >>> + port@1 { >>> + reg = <1>; >>> + mdss0_dp0_out: endpoint { >>> + remote-endpoint = <&pmic_glink_con0_ss>; >>> + }; >>> + }; >>> + }; >>> +}; >>> + >>> +&mdss0_dp1 { >>> + status = "okay"; >>> + >>> + data-lanes = <0 1>; >> Ditto >> >>> + >>> + ports { >>> + port@1 { >>> + reg = <1>; >>> + mdss0_dp1_out: endpoint { >>> + remote-endpoint = <&pmic_glink_con1_ss>; >>> + }; >>> + }; >>> + }; >>> +}; >>> + >>> &mdss0_dp3 { >>> compatible = "qcom,sc8280xp-edp"; >>> /delete-property/ #sound-dai-cells; >>> @@ -480,8 +621,13 @@ &usb_0 { >>> }; >>> >>> &usb_0_dwc3 { >>> - /* TODO: Define USB-C connector properly */ >>> dr_mode = "host"; >>> + >>> + port { >>> + usb_0_role_switch: endpoint { >>> + remote-endpoint = <&pmic_glink_con0_hs>; >>> + }; >> This should be defined in the SoC DTSI, it's a standard dwc3 binding >> with usb HS / SS / SBU ports. Especially since we can feed the endpoint >> from any device now, as pmic-glink should work everywhere. >> > > The sa8295p/sa8540p boards, derived from sc8280xp does not implement > pmic_glink, so it seems moving this to the soc.dtsi would be messy. > >> Or /omit-if-no-ref/, I suppose. >> > > Or you're saying I should put the skeleton of the port definition in the > soc.dtsi and then fill it out the remote-endpoint here; and mark it > omit-if-no-ref to avoid binding warnings? I thought omit-if-no-ref actually omits the node before resolving phandles that it references, but it seems to not be the case.. Still, we can define the ports in the SoC DTSI and assign endpoints per-device (like we do with DSI for example). Konrad > >>> + }; >>> }; >>> >>> &usb_0_hsphy { >>> @@ -504,8 +650,13 @@ &usb_1 { >>> }; >>> >>> &usb_1_dwc3 { >>> - /* TODO: Define USB-C connector properly */ >>> dr_mode = "host"; >>> + >>> + port { >>> + usb_1_role_switch: endpoint { >>> + remote-endpoint = <&pmic_glink_con1_hs>; >>> + }; >>> + }; >>> }; >>> >>> &usb_1_hsphy { >>> @@ -709,4 +860,40 @@ reset-n-pins { >>> drive-strength = <16>; >>> }; >>> }; >>> + >>> + usb0_sbu_default: usb0-sbu-state { >>> + oe-n-pins { >>> + pins = "gpio101"; >>> + function = "gpio"; >> No drive-strength/bias/i/o? >> > > Seems like a reasonable ask... > > Thanks, > Bjorn > >> Konrad >>> + }; >>> + >>> + sel-pins { >>> + pins = "gpio164"; >>> + function = "gpio"; >>> + }; >>> + >>> + mode-pins { >>> + pins = "gpio167"; >>> + function = "gpio"; >>> + output-high; >>> + }; >>> + }; >>> + >>> + usb1_sbu_default: usb1-sbu-state { >>> + oe-n-pins { >>> + pins = "gpio48"; >>> + function = "gpio"; >>> + }; >>> + >>> + sel-pins { >>> + pins = "gpio47"; >>> + function = "gpio"; >>> + }; >>> + >>> + mode-pins { >>> + pins = "gpio50"; >>> + function = "gpio"; >>> + output-high; >>> + }; >>> + }; >>> };
On Wed, Feb 08, 2023 at 05:40:44PM +0100, Konrad Dybcio wrote: > On 8.02.2023 16:57, Bjorn Andersson wrote: > > On Wed, Feb 08, 2023 at 09:14:46AM +0100, Konrad Dybcio wrote: > >> On 8.02.2023 04:46, Bjorn Andersson wrote: [..] > >>> &usb_0_dwc3 { > >>> - /* TODO: Define USB-C connector properly */ > >>> dr_mode = "host"; > >>> + > >>> + port { > >>> + usb_0_role_switch: endpoint { > >>> + remote-endpoint = <&pmic_glink_con0_hs>; > >>> + }; > >> This should be defined in the SoC DTSI, it's a standard dwc3 binding > >> with usb HS / SS / SBU ports. Especially since we can feed the endpoint > >> from any device now, as pmic-glink should work everywhere. > >> > > > > The sa8295p/sa8540p boards, derived from sc8280xp does not implement > > pmic_glink, so it seems moving this to the soc.dtsi would be messy. > > > >> Or /omit-if-no-ref/, I suppose. > >> > > > > Or you're saying I should put the skeleton of the port definition in the > > soc.dtsi and then fill it out the remote-endpoint here; and mark it > > omit-if-no-ref to avoid binding warnings? > I thought omit-if-no-ref actually omits the node before resolving phandles > that it references, but it seems to not be the case.. Still, we can define > the ports in the SoC DTSI and assign endpoints per-device (like we do with > DSI for example). > You mean move the lines: port { usb_0_role_switch: endpoint { }; }; to sc8280xp.dtsi and then do: &usb_0_role_switch { remote-endpoint = <&pmic_glink_con0_hs>; }; here? Regards, Bjorn
On 8.02.2023 19:00, Bjorn Andersson wrote: > On Wed, Feb 08, 2023 at 05:40:44PM +0100, Konrad Dybcio wrote: >> On 8.02.2023 16:57, Bjorn Andersson wrote: >>> On Wed, Feb 08, 2023 at 09:14:46AM +0100, Konrad Dybcio wrote: >>>> On 8.02.2023 04:46, Bjorn Andersson wrote: > [..] >>>>> &usb_0_dwc3 { >>>>> - /* TODO: Define USB-C connector properly */ >>>>> dr_mode = "host"; >>>>> + >>>>> + port { >>>>> + usb_0_role_switch: endpoint { >>>>> + remote-endpoint = <&pmic_glink_con0_hs>; >>>>> + }; >>>> This should be defined in the SoC DTSI, it's a standard dwc3 binding >>>> with usb HS / SS / SBU ports. Especially since we can feed the endpoint >>>> from any device now, as pmic-glink should work everywhere. >>>> >>> >>> The sa8295p/sa8540p boards, derived from sc8280xp does not implement >>> pmic_glink, so it seems moving this to the soc.dtsi would be messy. >>> >>>> Or /omit-if-no-ref/, I suppose. >>>> >>> >>> Or you're saying I should put the skeleton of the port definition in the >>> soc.dtsi and then fill it out the remote-endpoint here; and mark it >>> omit-if-no-ref to avoid binding warnings? >> I thought omit-if-no-ref actually omits the node before resolving phandles >> that it references, but it seems to not be the case.. Still, we can define >> the ports in the SoC DTSI and assign endpoints per-device (like we do with >> DSI for example). >> > > You mean move the lines: > > port { > usb_0_role_switch: endpoint { > }; > }; > > to sc8280xp.dtsi and then do: > > &usb_0_role_switch { > remote-endpoint = <&pmic_glink_con0_hs>; > }; > > here? Correct Konrad > > Regards, > Bjorn
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts index 3f116a879e22..35b63c3962f0 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts @@ -36,6 +36,77 @@ chosen { stdout-path = "serial0:115200n8"; }; + pmic-glink { + compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink"; + + #address-cells = <1>; + #size-cells = <0>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pmic_glink_con0_hs: endpoint { + remote-endpoint = <&usb_0_role_switch>; + }; + }; + + port@1 { + reg = <1>; + pmic_glink_con0_ss: endpoint { + remote-endpoint = <&mdss0_dp0_out>; + }; + }; + + port@2 { + reg = <2>; + pmic_glink_con0_sbu: endpoint { + remote-endpoint = <&usb0_sbu_mux>; + }; + }; + }; + }; + + connector@1 { + compatible = "usb-c-connector"; + reg = <1>; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pmic_glink_con1_hs: endpoint { + remote-endpoint = <&usb_1_role_switch>; + }; + }; + + port@1 { + reg = <1>; + pmic_glink_con1_ss: endpoint { + remote-endpoint = <&mdss0_dp1_out>; + }; + }; + + port@2 { + reg = <2>; + pmic_glink_con1_sbu: endpoint { + remote-endpoint = <&usb1_sbu_mux>; + }; + }; + }; + }; + }; + vreg_edp_3p3: regulator-edp-3p3 { compatible = "regulator-fixed"; @@ -139,6 +210,46 @@ linux,cma { linux,cma-default; }; }; + + usb0-sbu-mux { + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; + + enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>; + select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb0_sbu_default>; + + mode-switch; + orientation-switch; + svid = /bits/ 16 <0xff01>; + + port { + usb0_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_con0_sbu>; + }; + }; + }; + + usb1-sbu-mux { + compatible = "pericom,pi3usb102", "gpio-sbu-mux"; + + enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>; + select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&usb1_sbu_default>; + + mode-switch; + orientation-switch; + svid = /bits/ 16 <0xff01>; + + port { + usb1_sbu_mux: endpoint { + remote-endpoint = <&pmic_glink_con1_sbu>; + }; + }; + }; }; &apps_rsc { @@ -262,6 +373,36 @@ &mdss0 { status = "okay"; }; +&mdss0_dp0 { + status = "okay"; + + data-lanes = <0 1>; + + ports { + port@1 { + reg = <1>; + mdss0_dp0_out: endpoint { + remote-endpoint = <&pmic_glink_con0_ss>; + }; + }; + }; +}; + +&mdss0_dp1 { + status = "okay"; + + data-lanes = <0 1>; + + ports { + port@1 { + reg = <1>; + mdss0_dp1_out: endpoint { + remote-endpoint = <&pmic_glink_con1_ss>; + }; + }; + }; +}; + &mdss0_dp3 { compatible = "qcom,sc8280xp-edp"; /delete-property/ #sound-dai-cells; @@ -480,8 +621,13 @@ &usb_0 { }; &usb_0_dwc3 { - /* TODO: Define USB-C connector properly */ dr_mode = "host"; + + port { + usb_0_role_switch: endpoint { + remote-endpoint = <&pmic_glink_con0_hs>; + }; + }; }; &usb_0_hsphy { @@ -504,8 +650,13 @@ &usb_1 { }; &usb_1_dwc3 { - /* TODO: Define USB-C connector properly */ dr_mode = "host"; + + port { + usb_1_role_switch: endpoint { + remote-endpoint = <&pmic_glink_con1_hs>; + }; + }; }; &usb_1_hsphy { @@ -709,4 +860,40 @@ reset-n-pins { drive-strength = <16>; }; }; + + usb0_sbu_default: usb0-sbu-state { + oe-n-pins { + pins = "gpio101"; + function = "gpio"; + }; + + sel-pins { + pins = "gpio164"; + function = "gpio"; + }; + + mode-pins { + pins = "gpio167"; + function = "gpio"; + output-high; + }; + }; + + usb1_sbu_default: usb1-sbu-state { + oe-n-pins { + pins = "gpio48"; + function = "gpio"; + }; + + sel-pins { + pins = "gpio47"; + function = "gpio"; + }; + + mode-pins { + pins = "gpio50"; + function = "gpio"; + output-high; + }; + }; };