Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1158565lqs; Wed, 6 Mar 2024 07:56:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXfnjG/YdEepd9qpTsK8rzKtfyHECpKeTPdSCkKUZJdhMR67YawgI6kmKUSRWGgcLG/7KBz/UMCPsBbVMfKS9p8If34lg2+FC/2zj7Dng== X-Google-Smtp-Source: AGHT+IGUv2mSEnHmWtybjQaNXz4ZOSpjoP6tjQUa+n7ptm6U5AH//Y+FQr1jBm7B//FQda+2CPzq X-Received: by 2002:a05:6a00:a86:b0:6e6:5374:411a with SMTP id b6-20020a056a000a8600b006e65374411amr1127150pfl.18.1709740564118; Wed, 06 Mar 2024 07:56:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709740564; cv=pass; d=google.com; s=arc-20160816; b=vpsP2zIz3v1wj17N1jtKRsEJLqPiZhrViLyiTSBvuEq39DFe+IuaYGXrtWhO/h8krU MYTeJDMQYsXEb6pH8tAqYhtmUMkanbl38NUH+Wps4+/9kHRNEMltdVdjEHwoNSL3fJfu lnswbfparUGiP1gCKXmAkn0Vof29ovPvRf/IxS5Dvv/8AqSkmrRJzTkJ28vAZzPBGEGl o0JRKM7hPZBs1k0J1tniEzfJ0orwhsjF/+BjggFZlZRgk8Od5y6eekThQNqP5fD2dh0f Lo9lOqBa/s4qNfriQGxO72RpgKfe8qVNBXFCyiThQp7KKDkUoLVhTDHccesOYCHsXQeV K0zA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=EEwUSDqGUrVxWiY4NKo3AYm8KZb8/Jtn+tHN0/on6Q4=; fh=FISCUDfpMAsNet6yL/G/MSsrdPbdMp0RX4biE90UPns=; b=qtb+Mixh3A+cXk53mpxleO8YQF6UkTA61yz4lqTCejej56Htv+/kvrSZ5vMbg07+10 Ye8TTBFOo1EJtuvhZJA4mMaIYQMMqhttGNnd9lB1uLUOHw348mU1hR9Ylyzo8DVV+uiZ 5OP5RqX3JO0G6InTBSxynJMCdE5Rubmnl5o9KYpSNqO9uMJB7AeOmFAGYPsFxDpYnXa0 k8rSv/UpwTatEiHy8OQWSy49FSur0Od7aeD+qiKlcKVshHHQab2d1uQ2vd2CkoGYx5zf 4Wr7jPVeM9l1B0/cVun60k+II/B8W/a7FsdEj5HATX8uLW/tszAcAnLqjBfH9nuw0/1L aR7Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UugdDh7A; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-94196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c2-20020a62e802000000b006e39d08cae0si11774391pfi.31.2024.03.06.07.56.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 07:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UugdDh7A; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-94196-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94196-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2194CB230A0 for ; Wed, 6 Mar 2024 15:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11BB6135A7F; Wed, 6 Mar 2024 15:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="UugdDh7A" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 249F51350D2; Wed, 6 Mar 2024 15:52:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709740348; cv=none; b=AEb5q1CW9CqFvA1z4AsjRme5mkSe5T6zl53t1OjNEO0TZZyA+vj9yDUc1jl5D3uvD3QJuxi8KVkSAJ3hzCt/LltITeOUPm9HeMT2NpSgp9NgbFqxFegPbrxhfj9L/TrjuD/T8Ptgz0kFGvMs2Ln1j+9POrHTLZuUqcv3BzDTrtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709740348; c=relaxed/simple; bh=UO5eY6VSEOx0TkkcTXVgv+f4/DcEWgpKkiqEjY2qag0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=EdSG8BP/mVlWw/+aOBtPg3/7ICFAW5hGk6vWRISYsqeFjE4695l00hh15nOQ8t2+jYSBSjfd8rTXKSJvOKIrbY3MvQF7OprlAOHx572vrYpAGyt6+107meptQNjtcsNllAS5E4pP/4rJyI9d9WcdTrhqBSkGkdPm4Maleq4oqZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=UugdDh7A; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426BdF6C001288; Wed, 6 Mar 2024 15:52:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=EEwUSDqGUrVxWiY4NKo3AYm8KZb8/Jtn+tHN0/on6Q4=; b=Uu gdDh7AiMMTB3KHQ4Wmbd1Yfvqu/Os65QE2G6KYPqpszFOyoebr0raaAcZYievj8P Rv0gTLLYo54pj7D/W51B5ixeONm0XR5GuxpMYQIZcR/Ptk5BjrpqDWRxcCUxwV+E /Jb60Oj56RY9f5Gc/pQO8uTqE7/fpxNfvQy7vEuwbpaWeFwss4IOfya7xTDQ30G+ zWD73lF+I1goggtWc7MaYQ1Rb3oeR0pEVbbCDPRrTTVaDA/nJFSXRBXr2JuUWWCX j23P9SqowZfASnRrtP+Gp07XbWky8cRopSVtFJR4kl2OM9ndcWD2pz9bg4/iDUvR e8Q/3HYjLIle3Xp80+dQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpnfvgu5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Mar 2024 15:52:11 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426FpmZT017506 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Mar 2024 15:51:48 GMT Received: from [10.216.51.173] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 07:51:41 -0800 Message-ID: <4f1e4e66-e728-472e-92f4-17c295548a14@quicinc.com> Date: Wed, 6 Mar 2024 21:21:37 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 1/3] dt-bindings: usb: qcom,dwc3: Add support for multiple power-domains Content-Language: en-US To: Dmitry Baryshkov CC: , , , , , , , , , , , , , , , , , , , , , References: <1709657858-8563-1-git-send-email-quic_sriramd@quicinc.com> <1709657858-8563-2-git-send-email-quic_sriramd@quicinc.com> From: Sriram Dash In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: FvTvdKBxiujpedrdN_pduk8dBw_u9XN1 X-Proofpoint-GUID: FvTvdKBxiujpedrdN_pduk8dBw_u9XN1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_10,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 clxscore=1015 bulkscore=0 malwarescore=0 mlxscore=0 impostorscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060128 On 3/6/2024 12:33 AM, Dmitry Baryshkov wrote: > On Tue, 5 Mar 2024 at 18:58, Sriram Dash wrote: >> >> Some target systems allow multiple resources to be managed by firmware. >> On these targets, tasks related to clocks, regulators, resets, and >> interconnects can be delegated to the firmware, while the remaining >> responsibilities are handled by Linux. >> >> To support the management of partial resources in Linux and leave the rest >> to firmware, multiple power domains are introduced. Each power domain can >> manage one or more resources, depending on the specific use case. >> >> These power domains handle SCMI calls to the firmware, enabling the >> activation and deactivation of firmware-managed resources. >> >> Signed-off-by: Sriram Dash >> --- >> .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 74 ++++++++++++++++------ >> .../bindings/phy/qcom,usb-snps-femto-v2.yaml | 49 ++++++++++++-- >> .../devicetree/bindings/usb/qcom,dwc3.yaml | 37 ++++++++++- >> 3 files changed, 130 insertions(+), 30 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml >> index 1e2d4dd..53b9ba9 100644 >> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml >> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml >> @@ -44,7 +44,32 @@ properties: >> maxItems: 5 >> >> power-domains: >> - maxItems: 1 >> + description: specifies a phandle to PM domain provider node >> + minItems: 1 >> + maxItems: 2 >> + >> + power-domain-names: >> + description: >> + A list of power domain name strings sorted in the same order as the >> + power-domains property. >> + >> + For platforms where some resource are firmware managed, the name >> + corresponding to the index of an SCMI domain provider can be >> + "usb_core" or "usb_transfer". >> + items: >> + - const: usb_core >> + - const: usb_transfer >> + >> + qmp,fw-managed: >> + description: >> + Some targets allow multiple resources to be managed by firmware. >> + On these targets, tasks related to clocks, regulators, resets, and >> + interconnects can be delegated to the firmware, while the remaining >> + responsibilities are handled by Linux. >> + >> + Decide if the target resources will be managed by firmware or High level >> + OS. >> + type: boolean >> >> resets: >> maxItems: 2 >> @@ -70,14 +95,6 @@ properties: >> required: >> - compatible >> - reg >> - - clocks >> - - clock-names >> - - resets >> - - reset-names >> - - vdda-phy-supply >> - - vdda-pll-supply >> - - "#clock-cells" >> - - clock-output-names >> - "#phy-cells" >> >> allOf: >> @@ -86,6 +103,33 @@ allOf: >> compatible: >> contains: >> enum: >> + - qcom,sa8775p-qmp-usb3-uni-phy >> + - qcom,sc8280xp-qmp-usb3-uni-phy >> + - qcom,x1e80100-qmp-usb3-uni-phy >> + then: >> + required: >> + - power-domains >> + >> + - if: >> + not: >> + required: >> + - qmp,fw-managed >> + then: >> + required: >> + - clocks >> + - clock-names >> + - resets >> + - reset-names >> + - vdda-phy-supply >> + - vdda-pll-supply >> + - clock-output-names >> + - "#clock-cells" >> + >> + - if: >> + properties: >> + compatible: >> + contains: >> + enum: >> - qcom,ipq6018-qmp-usb3-phy >> - qcom,ipq8074-qmp-usb3-phy >> - qcom,ipq9574-qmp-usb3-phy >> @@ -144,18 +188,6 @@ allOf: >> - const: com_aux >> - const: pipe >> >> - - if: >> - properties: >> - compatible: >> - contains: >> - enum: >> - - qcom,sa8775p-qmp-usb3-uni-phy >> - - qcom,sc8280xp-qmp-usb3-uni-phy >> - - qcom,x1e80100-qmp-usb3-uni-phy >> - then: >> - required: >> - - power-domains >> - >> additionalProperties: false >> >> examples: >> diff --git a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml >> index 0f200e3..ad2f08f 100644 >> --- a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml >> +++ b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml >> @@ -49,6 +49,34 @@ properties: >> items: >> - const: ref >> >> + power-domains: >> + description: specifies a phandle to PM domain provider node >> + minItems: 1 >> + maxItems: 2 >> + >> + power-domain-names: >> + description: >> + A list of power domain name strings sorted in the same order as the >> + power-domains property. >> + >> + For platforms where some resource are firmware managed, the name >> + corresponding to the index of an SCMI domain provider can be >> + "usb_core" or "usb_transfer". >> + items: >> + - const: usb_core >> + - const: usb_transfer >> + >> + hsphy,fw-managed: >> + description: >> + Some targets allow multiple resources to be managed by firmware. >> + On these targets, tasks related to clocks, regulators, resets, and >> + interconnects can be delegated to the firmware, while the remaining >> + responsibilities are handled by Linux. >> + >> + Decide if the target resources will be managed by firmware or High level >> + OS. >> + type: boolean >> + >> resets: >> items: >> - description: PHY core reset >> @@ -154,12 +182,21 @@ required: >> - compatible >> - reg >> - "#phy-cells" >> - - clocks >> - - clock-names >> - - resets >> - - vdda-pll-supply >> - - vdda18-supply >> - - vdda33-supply >> + >> + >> +allOf: >> + - if: >> + not: >> + required: >> + - hsphy,fw-managed >> + then: >> + required: >> + - clocks >> + - clock-names >> + - resets >> + - vdda-pll-supply >> + - vdda18-supply >> + - vdda33-supply >> >> additionalProperties: false >> >> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> index 63d150b..5bf3a29 100644 >> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml >> @@ -64,7 +64,31 @@ properties: >> >> power-domains: >> description: specifies a phandle to PM domain provider node >> - maxItems: 1 >> + minItems: 1 >> + maxItems: 2 >> + >> + power-domain-names: >> + description: >> + A list of power domain name strings sorted in the same order as the >> + power-domains property. >> + >> + For platforms where some resource are firmware managed, the name >> + corresponding to the index of an SCMI domain provider can be >> + "usb_core" or "usb_transfer". >> + items: >> + - const: usb_core >> + - const: usb_transfer >> + >> + qcom,fw-managed: >> + description: >> + Some targets allow multiple resources to be managed by firmware. >> + On these targets, tasks related to clocks, regulators, resets, and >> + interconnects can be delegated to the firmware, while the remaining >> + responsibilities are handled by Linux. >> + >> + Decide if the target resources will be managed by firmware or High level >> + OS. >> + type: boolean > > I think this is an overkill. You know that SA8775 is going to use > SCMI-based clocks / PD management. Thus I'd suggest adding new > bindings file targeting qcom,sa8775-dwc3. Also you can drop the > qcom,fw-managed property at all, let the driver decide basing on the > compat string. > > Thank you for the suggestion Dmitry. I will include new compat string for SA8775 which will decide whether to use scmi based clock/ PD. >> >> required-opps: >> maxItems: 1 >> @@ -148,13 +172,20 @@ required: >> - "#address-cells" >> - "#size-cells" >> - ranges >> - - clocks >> - - clock-names >> - interrupts >> - interrupt-names >> >> allOf: >> - if: >> + not: >> + required: >> + - qcom,fw-managed >> + then: >> + required: >> + - clocks >> + - clock-names >> + >> + - if: >> properties: >> compatible: >> contains: >> -- >> 2.7.4 >> >> > > > -- > With best wishes > Dmitry