From patchwork Thu Feb 27 00:17:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 868926 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 EFE841FC8 for ; Thu, 27 Feb 2025 00:11:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615111; cv=none; b=G1Fph59/IDHaUZgSfXc+d2svtwUHI6xVvMp2L150sOHytvQvtsN295sR47UHvu2DbpSsCtbYeu46jrlOhnmjdylFwBA1WCYK7wFERufinsdFqgLfrkZm5JuKs0MZxCWGUFwyX24g7IIXuCr90x50JxTD44aSdC6OMkcN7aGu8aM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615111; c=relaxed/simple; bh=NY6q0RklBTW1DFQ11MvB1hWCU0MKqqj+mmVufAIP3j8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KNFJwoOCDVl5BtliJ9fYixAH96k6dmThsfKO6Nc3ZIRyPFbYgSbHTU2Y3W3x8lW7YNwxxztaXfltIpgwSzc7J9F9hYJh1MaTATGPWRc9T9ZvJ0A/KfC7OAMIMfkOy246NEpGmPrMvxabhKfIqzvszTX5J4ugr4/QC73Tou9crBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jbjZqZ2g; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jbjZqZ2g" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QJtjTm015684 for ; Thu, 27 Feb 2025 00:11:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= HhnNU//Z0QVpICTnI2AsRyugIObg7UO7vAC1/hup27w=; b=jbjZqZ2gEgo6/p2Z ds7dNKYtNolT9+XmjxmDjJZW1fDiuMcenSpy52I2ggiLs3D3dgSIDO0HLiQrx00r gV/9I2YMyUEc7lAQAaF4MOfF5Lay5xPNTF+kzhFicJeBLeTwba1pWiCt1fHc7W2m KQPNuzxQoNoaALR029Zwb83OcBpuvICIb9O7ogCRcaQ1fuDqCWkXr9hjhi4gxgTE hh2uGX2ezNS9yiCRmWJN92jAGX04Rcq1vnJpdM2AvR3NP9ks7tohoIrVq20sptiw HiO4Khz3LDrw2fUQZj/gPw7hydJMpzToz+bvhtVaYqrbi+nsuiIVvwXm6h1v0MRB 1Fc6/w== Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 451prnkpqc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Feb 2025 00:11:47 +0000 (GMT) Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3f4165b5849so371940b6e.2 for ; Wed, 26 Feb 2025 16:11:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740615107; x=1741219907; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HhnNU//Z0QVpICTnI2AsRyugIObg7UO7vAC1/hup27w=; b=MGvk/iQNjpVSWQtnQ7x1d9d9WOFcsdj2BLaMCKXBaYjJdN9OHxPdQNVIM/qA1gw1HE n7phccK4iWJaYjcbxJ7cvc50VabHmMPzPEag6kiAjoNyvQ+M7R84JWkQ3rMuYi0sUPqX mP3X8eLMWW5GWuanzxjCHiIJzHbWfKrmSbvTJo5VyWwjWM3Qj2b6/2X51yIcYyS2HRN4 j414pcL0HyaWkk5FVORST0xEoEZvgMNxjjq3CoGLEUHJeW7VtnQHUJowofHtuQVjyC5E hIS61QPQqhDzBc6IzrwLTxTSW6B+ecXyIseOOvRb1lBKjPHTzQwnL/Oe7un7jmAQo39R j3zw== X-Forwarded-Encrypted: i=1; AJvYcCVLYlxp2eHmSk+L9fdlox3MVQssjEkwAQ0i+f7PSmNBykJTnZJHQExoMC7dudLqenzyRkF6vmzJBH8=@vger.kernel.org X-Gm-Message-State: AOJu0YwfOqVVVauNhI6eBXj8S1gEeuS/c1amMozhPfySJAVthsoYkE+k aeee6PAOEIBxgVWMq49eijhueVYgTbqEdY9Gx2ac1017gydzHtPKRlav5LgJMtc/OMxAtdkFLuE BMcOSssT8RZkY53W/uJ6/7bGf+osShqG9+OkfIAyKYn9h++0VoWJAFGhJD90= X-Gm-Gg: ASbGncsoMJw6BpmVnYkKedVVOKvFlSiqkzflfIY5mpKq5z8Fy/x1MVqMB9+U5+SFrFB qOevtIvmVYnwoklom+JQqO+b5BnjLyUOPXH2Qpalb5IvnxheqSjTI8zIctgt2EghoLjt/PwCJVT hUxr28mVFf7RcxWGOtKxyOvGwsgOSytrP2PczNZuulcKS5OA2syVN9HyaQznkJVlAG659geNRCO 8RM84cDgqbJDAx+S+JLMxrDaoNoO0yOFdGjbJGmlJ8DDGveYnK+txdpW2MjYJrShCd+TSHwGqvy d6xdoVKfZkhs0VJjDkvWI0kof7gKEIlxop5LbVPx1CJa1SvdgHoOqNLgNbrp0J8PRdd6kIOmAeQ 6agMLsDMNxk4Cnfc= X-Received: by 2002:a05:6808:634c:b0:3f5:505c:42b4 with SMTP id 5614622812f47-3f5505c43e3mr166294b6e.2.1740615106556; Wed, 26 Feb 2025 16:11:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIz3PhfTQ8trw45/Hg7ib0OGOdAf0FZIp5F7yCFN2NUXMO3o0AdgsE/cojmHcTVANmOIrQ1g== X-Received: by 2002:a05:6808:634c:b0:3f5:505c:42b4 with SMTP id 5614622812f47-3f5505c43e3mr166269b6e.2.1740615106149; Wed, 26 Feb 2025 16:11:46 -0800 (PST) Received: from [192.168.86.65] (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f5507c40c6sm33988b6e.45.2025.02.26.16.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 16:11:45 -0800 (PST) From: Bjorn Andersson Date: Wed, 26 Feb 2025 16:17:48 -0800 Subject: [PATCH v4 1/7] dt-bindings: usb: Introduce qcom,snps-dwc3 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250226-dwc3-refactor-v4-1-4415e7111e49@oss.qualcomm.com> References: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> In-Reply-To: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Wesley Cheng , Saravana Kannan , Thinh Nguyen , Philipp Zabel , Bjorn Andersson , Konrad Dybcio , Frank Li Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=19806; i=bjorn.andersson@oss.qualcomm.com; h=from:subject:message-id; bh=NY6q0RklBTW1DFQ11MvB1hWCU0MKqqj+mmVufAIP3j8=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBnv684yeDODheDdv3y6tYmZKLsafd5FARDd3bP7 5/dE/PCc5SJAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZ7+vOBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcWsUBAAzgsDxzWGJiOj6V7uyqNsa2QVS8A50Ew87tfjodA 2zfGuer2Nm3LwITmALzBwKIMvplFTIwQa108ha4/hczLofKAtOmmkOt2Bn5Fr0P9WaHcvo2TjQy H+QLmAZdCZhlEI120Gf4CMEnsRsSVFYVIkw4IfyUOjq8dasNUuAo2BSYt/17esvjke2EBPl8fP3 IWEdDl+iXxDiMyrjE+Gefwun1dUvQ56KUYmg7LRRy+tpyvj5b9cPyGiKMNt/99+bvHRCJlekBOY aOE33h087kED1R31q0sW4Gvu62fiV22r/4UW9oxMgmJqAf2aGC3qgPS2xH3y4R6MNrnHUHaUKc0 ScDtmyXx/p/btxGo1LMsT5rTPxU83RJla+C1ht6ykGIJNzE6OdPo0vsdeYhtkX0g7TwDISZb90k lfPD1gRtBCjmJstOVECExsin3NAHJC/v63r98RzEbFwnnOf4byw7g2hWSxIBCzqLqfGCkTn4/Gs K2KnsXbsG+ShTydZ0T0Cak1BGcWMaZvI2S5an4JVGdeo7p5cn20pa9Dy0+5s0mHyhX3JViCHAnQ SWBsSidtCZ1ab2vTECJB9g3rHWXpQRaQqELvOCCLJcSv1LAo1ASmGPg3ru6PX852bme9ldxbO9/ Vw3Q/p9Gnmaci4jI1BuXLKs7lZ7WO/bGErTCN/eyopEM= X-Developer-Key: i=bjorn.andersson@oss.qualcomm.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 X-Proofpoint-GUID: gyf3yqg6FmBFAzn-axZtYfDHetDdrGk3 X-Proofpoint-ORIG-GUID: gyf3yqg6FmBFAzn-axZtYfDHetDdrGk3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_07,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502270000 The Qualcomm USB glue is not separate of the Synopsys DWC3 core and several of the snps,dwc3 properties (such as clocks and reset) conflicts in expectation with the Qualcomm integration. Using the newly split out Synopsys DWC3 core properties, describe the Qualcomm USB block in a single block. The new binding is a copy of qcom,dwc3 with the needed modifications. It would have been convenient to retain the two structures with the same compatibles, but as there exist no way to select a binding based on the absence of a subnode/patternProperty, a new generic compatible is introduced to describe this binding. To avoid redefining all the platform-specific compatibles, "select" is used to tell the DeviceTree validator which binding to use solely on the generic compatible. (Otherwise if the specific compatible matches during validation, the generic one must match as well) Mark qcom,dwc3 deprecated, to favor expressing future platforms using the new combined binding. Signed-off-by: Bjorn Andersson --- .../devicetree/bindings/usb/qcom,dwc3.yaml | 13 +- .../devicetree/bindings/usb/qcom,snps-dwc3.yaml | 619 +++++++++++++++++++++ 2 files changed, 631 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml index a2b3cf625e5b..6d818e6dddbc 100644 --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml @@ -4,11 +4,22 @@ $id: http://devicetree.org/schemas/usb/qcom,dwc3.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Qualcomm SuperSpeed DWC3 USB SoC controller +title: Legacy Qualcomm SuperSpeed DWC3 USB SoC controller maintainers: - Wesley Cheng +# Use the combined qcom,snps-dwc3 instead +deprecated: true + +select: + properties: + compatible: + contains: + const: qcom,dwc3 + required: + - compatible + properties: compatible: items: diff --git a/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml new file mode 100644 index 000000000000..37af52e01803 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/qcom,snps-dwc3.yaml @@ -0,0 +1,619 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/qcom,snps-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SuperSpeed DWC3 USB SoC controller + +maintainers: + - Wesley Cheng + +description: + Describes the Qualcomm USB block, based on Synopsys DWC3. + +select: + properties: + compatible: + contains: + const: qcom,snps-dwc3 + required: + - compatible + +properties: + compatible: + items: + - enum: + - qcom,ipq4019-dwc3 + - qcom,ipq5018-dwc3 + - qcom,ipq5332-dwc3 + - qcom,ipq5424-dwc3 + - qcom,ipq6018-dwc3 + - qcom,ipq8064-dwc3 + - qcom,ipq8074-dwc3 + - qcom,ipq9574-dwc3 + - qcom,msm8953-dwc3 + - qcom,msm8994-dwc3 + - qcom,msm8996-dwc3 + - qcom,msm8998-dwc3 + - qcom,qcm2290-dwc3 + - qcom,qcs404-dwc3 + - qcom,qcs615-dwc3 + - qcom,qcs8300-dwc3 + - qcom,qdu1000-dwc3 + - qcom,sa8775p-dwc3 + - qcom,sar2130p-dwc3 + - qcom,sc7180-dwc3 + - qcom,sc7280-dwc3 + - qcom,sc8180x-dwc3 + - qcom,sc8180x-dwc3-mp + - qcom,sc8280xp-dwc3 + - qcom,sc8280xp-dwc3-mp + - qcom,sdm660-dwc3 + - qcom,sdm670-dwc3 + - qcom,sdm845-dwc3 + - qcom,sdx55-dwc3 + - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 + - qcom,sm4250-dwc3 + - qcom,sm6115-dwc3 + - qcom,sm6125-dwc3 + - qcom,sm6350-dwc3 + - qcom,sm6375-dwc3 + - qcom,sm8150-dwc3 + - qcom,sm8250-dwc3 + - qcom,sm8350-dwc3 + - qcom,sm8450-dwc3 + - qcom,sm8550-dwc3 + - qcom,sm8650-dwc3 + - qcom,x1e80100-dwc3 + - const: qcom,snps-dwc3 + + reg: + description: Offset and length of register set for QSCRATCH wrapper + maxItems: 1 + + power-domains: + description: specifies a phandle to PM domain provider node + maxItems: 1 + + required-opps: + maxItems: 1 + + clocks: + description: | + Several clocks are used, depending on the variant. Typical ones are:: + - cfg_noc:: System Config NOC clock. + - core:: Master/Core clock, has to be >= 125 MHz for SS operation and >= + 60MHz for HS operation. + - iface:: System bus AXI clock. + - sleep:: Sleep clock, used for wakeup when USB3 core goes into low + power mode (U3). + - mock_utmi:: Mock utmi clock needed for ITP/SOF generation in host + mode. Its frequency should be 19.2MHz. + minItems: 1 + maxItems: 9 + + clock-names: + minItems: 1 + maxItems: 9 + + iommus: + maxItems: 1 + + resets: + maxItems: 1 + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: usb-ddr + - const: apps-usb + + interrupts: + description: | + Different types of interrupts are used based on HS PHY used on target: + - dwc_usb3: Core DWC3 interrupt + - pwr_event: Used for wakeup based on other power events. + - hs_phy_irq: Apart from DP/DM/QUSB2 PHY interrupts, there is + hs_phy_irq which is not triggered by default and its + functionality is mutually exclusive to that of + {dp/dm}_hs_phy_irq and qusb2_phy_irq. + - qusb2_phy: SoCs with QUSB2 PHY do not have separate DP/DM IRQs and + expose only a single IRQ whose behavior can be modified + by the QUSB2PHY_INTR_CTRL register. The required DPSE/ + DMSE configuration is done in QUSB2PHY_INTR_CTRL register + of PHY address space. + - {dp/dm}_hs_phy_irq: These IRQ's directly reflect changes on the DP/ + DM pads of the SoC. These are used for wakeup + only on SoCs with non-QUSB2 targets with + exception of SDM670/SDM845/SM6350. + - ss_phy_irq: Used for remote wakeup in Super Speed mode of operation. + minItems: 3 + maxItems: 19 + + interrupt-names: + minItems: 3 + maxItems: 19 + + qcom,select-utmi-as-pipe-clk: + description: + If present, disable USB3 pipe_clk requirement. + Used when dwc3 operates without SSPHY and only + HS/FS/LS modes are supported. + type: boolean + + wakeup-source: true + +# Required child node: + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - interrupt-names + +allOf: + - $ref: snps,dwc3-common.yaml# + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq4019-dwc3 + - qcom,ipq5332-dwc3 + then: + properties: + clocks: + maxItems: 3 + clock-names: + items: + - const: core + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq8064-dwc3 + then: + properties: + clocks: + items: + - description: Master/Core clock, has to be >= 125 MHz + for SS operation and >= 60MHz for HS operation. + clock-names: + items: + - const: core + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq9574-dwc3 + - qcom,msm8953-dwc3 + - qcom,msm8996-dwc3 + - qcom,msm8998-dwc3 + - qcom,qcs8300-dwc3 + - qcom,sa8775p-dwc3 + - qcom,sc7180-dwc3 + - qcom,sc7280-dwc3 + - qcom,sdm670-dwc3 + - qcom,sdm845-dwc3 + - qcom,sdx55-dwc3 + - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 + - qcom,sm6350-dwc3 + then: + properties: + clocks: + maxItems: 5 + clock-names: + items: + - const: cfg_noc + - const: core + - const: iface + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq6018-dwc3 + then: + properties: + clocks: + minItems: 3 + maxItems: 4 + clock-names: + oneOf: + - items: + - const: core + - const: sleep + - const: mock_utmi + - items: + - const: cfg_noc + - const: core + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq8074-dwc3 + - qcom,qdu1000-dwc3 + then: + properties: + clocks: + maxItems: 4 + clock-names: + items: + - const: cfg_noc + - const: core + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq5018-dwc3 + - qcom,msm8994-dwc3 + - qcom,qcs404-dwc3 + then: + properties: + clocks: + maxItems: 4 + clock-names: + items: + - const: core + - const: iface + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8280xp-dwc3 + - qcom,sc8280xp-dwc3-mp + - qcom,x1e80100-dwc3 + - qcom,x1e80100-dwc3-mp + then: + properties: + clocks: + maxItems: 9 + clock-names: + items: + - const: cfg_noc + - const: core + - const: iface + - const: sleep + - const: mock_utmi + - const: noc_aggr + - const: noc_aggr_north + - const: noc_aggr_south + - const: noc_sys + + - if: + properties: + compatible: + contains: + enum: + - qcom,sdm660-dwc3 + then: + properties: + clocks: + minItems: 4 + maxItems: 5 + clock-names: + oneOf: + - items: + - const: cfg_noc + - const: core + - const: iface + - const: sleep + - const: mock_utmi + - items: + - const: cfg_noc + - const: core + - const: sleep + - const: mock_utmi + + - if: + properties: + compatible: + contains: + enum: + - qcom,qcm2290-dwc3 + - qcom,qcs615-dwc3 + - qcom,sar2130p-dwc3 + - qcom,sc8180x-dwc3 + - qcom,sc8180x-dwc3-mp + - qcom,sm6115-dwc3 + - qcom,sm6125-dwc3 + - qcom,sm8150-dwc3 + - qcom,sm8250-dwc3 + - qcom,sm8450-dwc3 + - qcom,sm8550-dwc3 + - qcom,sm8650-dwc3 + then: + properties: + clocks: + minItems: 6 + clock-names: + items: + - const: cfg_noc + - const: core + - const: iface + - const: sleep + - const: mock_utmi + - const: xo + + - if: + properties: + compatible: + contains: + enum: + - qcom,sm8350-dwc3 + then: + properties: + clocks: + minItems: 5 + maxItems: 6 + clock-names: + minItems: 5 + items: + - const: cfg_noc + - const: core + - const: iface + - const: sleep + - const: mock_utmi + - const: xo + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq5018-dwc3 + - qcom,ipq6018-dwc3 + - qcom,ipq8074-dwc3 + - qcom,msm8953-dwc3 + - qcom,msm8998-dwc3 + then: + properties: + interrupts: + minItems: 3 + maxItems: 4 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event + - const: qusb2_phy + - const: ss_phy_irq + + - if: + properties: + compatible: + contains: + enum: + - qcom,msm8996-dwc3 + - qcom,qcs404-dwc3 + - qcom,sdm660-dwc3 + - qcom,sm6115-dwc3 + - qcom,sm6125-dwc3 + then: + properties: + interrupts: + minItems: 4 + maxItems: 5 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event + - const: qusb2_phy + - const: hs_phy_irq + - const: ss_phy_irq + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq5332-dwc3 + then: + properties: + interrupts: + maxItems: 4 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event + - const: dp_hs_phy_irq + - const: dm_hs_phy_irq + + - if: + properties: + compatible: + contains: + enum: + - qcom,x1e80100-dwc3 + then: + properties: + interrupts: + maxItems: 5 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event + - const: dp_hs_phy_irq + - const: dm_hs_phy_irq + - const: ss_phy_irq + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq4019-dwc3 + - qcom,ipq8064-dwc3 + - qcom,msm8994-dwc3 + - qcom,qcs615-dwc3 + - qcom,qcs8300-dwc3 + - qcom,qdu1000-dwc3 + - qcom,sa8775p-dwc3 + - qcom,sc7180-dwc3 + - qcom,sc7280-dwc3 + - qcom,sc8180x-dwc3 + - qcom,sc8280xp-dwc3 + - qcom,sdm670-dwc3 + - qcom,sdm845-dwc3 + - qcom,sdx55-dwc3 + - qcom,sdx65-dwc3 + - qcom,sdx75-dwc3 + - qcom,sm4250-dwc3 + - qcom,sm6350-dwc3 + - qcom,sm8150-dwc3 + - qcom,sm8250-dwc3 + - qcom,sm8350-dwc3 + - qcom,sm8450-dwc3 + - qcom,sm8550-dwc3 + - qcom,sm8650-dwc3 + then: + properties: + interrupts: + minItems: 5 + maxItems: 6 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event + - const: hs_phy_irq + - const: dp_hs_phy_irq + - const: dm_hs_phy_irq + - const: ss_phy_irq + + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8180x-dwc3-mp + - qcom,x1e80100-dwc3-mp + then: + properties: + interrupts: + minItems: 11 + maxItems: 11 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event_1 + - const: pwr_event_2 + - const: hs_phy_1 + - const: hs_phy_2 + - const: dp_hs_phy_1 + - const: dm_hs_phy_1 + - const: dp_hs_phy_2 + - const: dm_hs_phy_2 + - const: ss_phy_1 + - const: ss_phy_2 + + - if: + properties: + compatible: + contains: + enum: + - qcom,sc8280xp-dwc3-mp + then: + properties: + interrupts: + minItems: 19 + maxItems: 19 + interrupt-names: + items: + - const: dwc_usb3 + - const: pwr_event_1 + - const: pwr_event_2 + - const: pwr_event_3 + - const: pwr_event_4 + - const: hs_phy_1 + - const: hs_phy_2 + - const: hs_phy_3 + - const: hs_phy_4 + - const: dp_hs_phy_1 + - const: dm_hs_phy_1 + - const: dp_hs_phy_2 + - const: dm_hs_phy_2 + - const: dp_hs_phy_3 + - const: dm_hs_phy_3 + - const: dp_hs_phy_4 + - const: dm_hs_phy_4 + - const: ss_phy_1 + - const: ss_phy_2 + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + soc { + #address-cells = <2>; + #size-cells = <2>; + + usb@a600000 { + compatible = "qcom,sdm845-dwc3", "qcom,snps-dwc3"; + reg = <0 0x0a600000 0 0x100000>; + + clocks = <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>, + <&gcc GCC_USB30_PRIM_MASTER_CLK>, + <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>, + <&gcc GCC_USB30_PRIM_SLEEP_CLK>, + <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>; + clock-names = "cfg_noc", + "core", + "iface", + "sleep", + "mock_utmi"; + + assigned-clocks = <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>, + <&gcc GCC_USB30_PRIM_MASTER_CLK>; + assigned-clock-rates = <19200000>, <150000000>; + + interrupts = , + , + , + , + , + ; + interrupt-names = "dwc_usb3", "pwr_event", "hs_phy_irq", + "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq"; + + power-domains = <&gcc USB30_PRIM_GDSC>; + + resets = <&gcc GCC_USB30_PRIM_BCR>; + + iommus = <&apps_smmu 0x740 0>; + snps,dis_u2_susphy_quirk; + snps,dis_enblslpm_quirk; + phys = <&usb_1_hsphy>, <&usb_1_ssphy>; + phy-names = "usb2-phy", "usb3-phy"; + }; + }; +... From patchwork Thu Feb 27 00:17:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 868925 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 C23A14C62 for ; Thu, 27 Feb 2025 00:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615112; cv=none; b=dtBD6FIsdgJqFnA5gZ/y1TqSiC34MqL9PQumJ95v02XPuzcKwRlwNquidT2ql9PH/Q31bDmvqXwvZBYnhqADy8Jeslz6eB0s4jMDsVY7IwO7bDcYO4DksZN19MNZMnReYGIVTbItzDHLY31trshJzLW1p14qTP7eBW01eiG5g7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615112; c=relaxed/simple; bh=OYiQ0Ca9ME8RsPSmprTC2XbZ0QI0xz6X7pxB3R5yxGk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dcGU6QYUQTBkoX7QgPGlqMLEex7qMHa5ocEi3NZMhQSm4feFnZuYxTPi7wKZBBSTquNBEI+Ccxg6WbuBWvKhpc5Wz+3Ql01ntn4wMlOhoOWDafIFO0wywtOZhn5rMQbMNkP4D0F3ZrpHu6uK+b/VVkIU+TVrVUoxTnx6VQ7V3Hs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FX40ak52; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FX40ak52" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QKenvI011930 for ; Thu, 27 Feb 2025 00:11:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= D0nqxAOKrAWpmrpIRkIYOJ+sLGDjdQ9XNnKAOzfYCy4=; b=FX40ak52QUKzGWB/ Wj8X24gIiTMLsquJujJyP54NH6jHwfSDGiJqhwh1t1INTivjvGBCJikLs2rhPFwJ CBpbA0K0AqGO5qjGkSEOggge8ZuHuq6bsHXmL6zKuTFVi7OM5qHtm4nJ3SI3f06r T+37Qz/cXIQXNxqPHp2awVwjd/r2JviTCDC+O+R+C5AOhZk5u7LgPwLmuFHHudx5 UiEgpg/oGQHCDeBi64VnTlvfd23qavx+C40FXRfCZgAyAifCswvGVJK8hjQl3pr4 EGPJA17wK65oEPoxD0mutfysYuHQVSoyp5GKvFPp2O1ukOOx1V1uaZgKh+b8TgGb soUCoQ== Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 451prkbp48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Feb 2025 00:11:49 +0000 (GMT) Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3f40bc5d597so370313b6e.2 for ; Wed, 26 Feb 2025 16:11:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740615108; x=1741219908; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D0nqxAOKrAWpmrpIRkIYOJ+sLGDjdQ9XNnKAOzfYCy4=; b=GVvLYkl2aTPlbl5eIDnWhDK2BUyEuCVRuTq4cbnEcVt4uGkzIfDn65E21ZYPWP6mTe dRH+yEofHpv/VNMhQDyXdZye03cBtooHF1ufu7Zya2QUlCfeBF6iMIy+XM3FyTtzAPCI QQphwVU26ha40Yurs1m6TwoWpO7RRBDXKzJVaefpzG4vS7+MU0/nuzuug9GtmCgH5YPI HgFjTOPqdfnBff5fW+Dda+Y4rxOHe6qDV1oGdz7P2a00LYkb2K+rN7/8Gtl9onxn16xd RmVpdCv7ojwe0q2IIJowF/2lilt2Zzxg394ydbi1uF9Bwlc9t+jP2VaB67n6lBmGAej2 XUXg== X-Forwarded-Encrypted: i=1; AJvYcCXQXzh87R5yngfHn63Qp4P8gjzmJUt5MmX8qNo/pcf5f9HSsrbj1yx4/pPLJkGzwsLZCnINkxG1/x4=@vger.kernel.org X-Gm-Message-State: AOJu0Yyj3HnzdTUxbM8hV3RXE/ZR2JxXMu5Wd6rMq+gjFJZGiBHgD0Ez HOAzc7HY2pnjjRXs+i85cY+94hVluRukxEHAMiqoBAmpxYiq50UzHik1hbKOKs88a2FMM2mVqV6 r4ukMr7fcgIcK8Zozeuj+oAVsMDhrdJWXpANMtndOClKxaNm9m4cVBYlKwBE= X-Gm-Gg: ASbGncv8n0o0eDlPAKVAmim+1L6vfdQ4TiCOe33CkGQRKN+7u+YCLQ+Fqtd3VbkSJDL 8v9VPX/qRNxY5KdzvfeLvlCliO7Dcdl0qPNhhuPfsNzcZqT16xzSFELKFDggrvfndHQvzUkwTc+ 3CLarodv13zTsFSpvoSBgg9oacCVJHeFcVLrTb5WAzNXBlU5/4ve5EbObugAmZnb0S5h8TU4YPW Q51TpRX6pYBmtEFpkO5uy19LmCoRiMCS8+9abpttwUfEX1ko3heuRLtTFN3mZeXMxMfCuTmjqn8 vgARMw1pWWqkq7PH2Hu4dOP445w9Az0C++yKJ5HI6zd3VBILN6N+Alqh1Q3Si24Snzkg/UXUPmY ROtUwJqmm8RESemI= X-Received: by 2002:a05:6808:181e:b0:3f4:21af:6d41 with SMTP id 5614622812f47-3f540eb869emr6260223b6e.5.1740615108592; Wed, 26 Feb 2025 16:11:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYeujuv9HGY3xF86xZeLEyuamPIoi2+t9FGjgAHmcb8mwvWLMDC351/1jXItvtKtUMmC/nzA== X-Received: by 2002:a05:6808:181e:b0:3f4:21af:6d41 with SMTP id 5614622812f47-3f540eb869emr6260215b6e.5.1740615108334; Wed, 26 Feb 2025 16:11:48 -0800 (PST) Received: from [192.168.86.65] (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f5507c40c6sm33988b6e.45.2025.02.26.16.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 16:11:47 -0800 (PST) From: Bjorn Andersson Date: Wed, 26 Feb 2025 16:17:50 -0800 Subject: [PATCH v4 3/7] usb: dwc3: core: Don't touch resets and clocks Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250226-dwc3-refactor-v4-3-4415e7111e49@oss.qualcomm.com> References: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> In-Reply-To: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Wesley Cheng , Saravana Kannan , Thinh Nguyen , Philipp Zabel , Bjorn Andersson , Konrad Dybcio , Frank Li Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2145; i=bjorn.andersson@oss.qualcomm.com; h=from:subject:message-id; bh=OYiQ0Ca9ME8RsPSmprTC2XbZ0QI0xz6X7pxB3R5yxGk=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBnv684JIqAG+aDaAtycXjkjs8bkeGgpw3vx1dp7 GzgJbk0peiJAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZ7+vOBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcWxPw/7BMkIW4vn+n0J7TfHzu4gw5wac/OEbJWiiacLun4 aaHMCQjWc9W5FQ4/dcGEnlUkG/9JGzmeFhFBrFIfhkTAb/WqvYp2NzIqGPicMdumR6sDl3nN+BZ PGA+2VS66R1fxD38h+wLKicCV5e7RNRuogbLEbDe46d+bgCWaL/XZsRaKSJMyw54A8GTs+DHnhm /ocOr8sEMIVSjVXQIiDQXgStvZchoPQ55BJsJu/jj0longO+P8taArxEcjAyuqVbS2OZS51YI2A ac2/mh3xIQT5aMEXxrOE3M286f0hr3hJhdAgSmWMSneZDCI1zMu8g7c8JpJShqZ4cZID+/20hSA EgSdrzA+Jzy2ePLx4bCK/elJXkr3mSA1Tvpnp4eS0JDRcTdp3LjtPG2nNaDjMUgQ1vmBpKKoib4 agOj5pwT+2Ykvv//ii1t083Gyjr5t4yfXL2fxeJYwVqlt5+g81YzS3YZNyR7TzyNJKNouUL/+gb WV6SDnXDAaxmADEDUxV5MP26phTQPehxbC4kp8S9zcsIB1Xdayqqoov84Nk2c0ArjtS3XlLCqjy dK4b8JEPyohXiosCwrPMe/ttHCBu6/qAuiFEV9HHJZ4hu2amFKkO3In5Y5lx0pH9TJme2w7v0Lq Z7P09tpwJ5+bjZtEzj2G27/GqKqNlC3p8JSbN/EcKasE= X-Developer-Key: i=bjorn.andersson@oss.qualcomm.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 X-Proofpoint-GUID: Y1pM5-czqRteFUwS3Nv8E3tv7MRDae6S X-Proofpoint-ORIG-GUID: Y1pM5-czqRteFUwS3Nv8E3tv7MRDae6S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_07,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 priorityscore=1501 spamscore=0 mlxlogscore=991 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502270000 When the core is integrated with glue, it's reasonable to assume that the glue driver will have to touch the IP before/after the core takes the hardware out and into reset. As such the glue must own these resources and be allowed to turn them on/off outside the core's handling. Allow the platform or glue layer to indicate if the core logic for clocks and resets should be skipped to deal with this. Signed-off-by: Bjorn Andersson --- drivers/usb/dwc3/core.c | 19 +++++++++++-------- drivers/usb/dwc3/glue.h | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index d9f0a6782d36..aecdde8dc999 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -2187,15 +2187,17 @@ int dwc3_core_probe(const struct dwc3_probe_data *data) if (IS_ERR(dwc->usb_psy)) return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n"); - dwc->reset = devm_reset_control_array_get_optional_shared(dev); - if (IS_ERR(dwc->reset)) { - ret = PTR_ERR(dwc->reset); - goto err_put_psy; - } + if (!data->ignore_clocks_and_resets) { + dwc->reset = devm_reset_control_array_get_optional_shared(dev); + if (IS_ERR(dwc->reset)) { + ret = PTR_ERR(dwc->reset); + goto err_put_psy; + } - ret = dwc3_get_clocks(dwc); - if (ret) - goto err_put_psy; + ret = dwc3_get_clocks(dwc); + if (ret) + goto err_put_psy; + } ret = reset_control_deassert(dwc->reset); if (ret) @@ -2328,6 +2330,7 @@ static int dwc3_probe(struct platform_device *pdev) probe_data.dwc = dwc; probe_data.res = res; + probe_data.ignore_clocks_and_resets = false; return dwc3_core_probe(&probe_data); } diff --git a/drivers/usb/dwc3/glue.h b/drivers/usb/dwc3/glue.h index e73cfc466012..1ddb451bdbd0 100644 --- a/drivers/usb/dwc3/glue.h +++ b/drivers/usb/dwc3/glue.h @@ -17,6 +17,7 @@ struct dwc3_probe_data { struct dwc3 *dwc; struct resource *res; + bool ignore_clocks_and_resets; }; int dwc3_core_probe(const struct dwc3_probe_data *data); From patchwork Thu Feb 27 00:17:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 868924 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 393A6EACD for ; Thu, 27 Feb 2025 00:11:54 +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=1740615116; cv=none; b=q0rqG0wz7cuYQrWC08tR4fV0QFOcGisLfm+wG/lUEqN0yPDCKQif3tBFEGO7DSoV+vy+hNguD/jfSX8O5SxIxRm0VPvu41jtO3l1GcdP+Mb7vRW+VPMyQtwJsv8xvN1TN8lwWDdi2IqeWSfKNg2wPPlMKEQUPVEfnUgBgSTLepA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615116; c=relaxed/simple; bh=KgorRMYeXfmBlN3TG9gPoCwE8xu1HNu35qYk/aakkpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ADaPxdPEf/rhROvpaRz2OqFfTDWNdehNv6RijfFTrznusOY/dbjb+fSqc/DKks2DLOcT4HFlfIyY0SczFYiQiSw1DF5hqvqvoGRerc/SbJm1jneDRmkoNYgn6GG8Efio0rqYcy0iOiJ5RtYSYP3IFWgt3ofUh55EDuTTUtBAYaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=X9sUzF7a; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="X9sUzF7a" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QJeM2n011845 for ; Thu, 27 Feb 2025 00:11:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 5EHku4COqLSS7IJRemxzqqTYLSKg3b1Wo5rUYOTIWqk=; b=X9sUzF7afnuISUW4 3tV7dq/C77Phhd3XJ2c59ska+iq7zXb4qN4s0bXKIMAdSYpl6PR/DXwrOa5zzH1u 9c7ah3o0sAYQVyyVsz14+WcvRfrtlIslmgFQhfouF/Dr9JlSE70BI0XIZzQs1aQr SLj1dUkVd7ODh1Ua+RgktQ1qYc8SFimpsSenl5PuwKC6UhJXxmID6On/yv/A+15D pDi4N4nstg3t9LyjVmzuuymKvwpu1C5dLYqBLSbcZbkcUrZoRnK0lcJQANAWs/cC 61nNe4HkvkgNkHdNp6e5bd/YceiGrH5Kl+qVhdRb0TnCBJ/TF7OoMk426tJ6dEU8 ZtZgYg== Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 451prmkq6h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Feb 2025 00:11:53 +0000 (GMT) Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3f41be6ae50so292648b6e.2 for ; Wed, 26 Feb 2025 16:11:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740615112; x=1741219912; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5EHku4COqLSS7IJRemxzqqTYLSKg3b1Wo5rUYOTIWqk=; b=UavTJfYRR6Pc+PG1uN7Lhg1kHMPS9PJOxv9w2Qu1YpekEmg51Kp8NlFgm4yaIDD7LC 2F8GKN8HSsH4ioxsfU565JasRrOldLytdkFSQjNrg9o9GTk9nFZqih7Qj5NfyhglNB5D KEBWVC7ZpN3YrEuhT+2sIRVIpvQ5Rh2A0Xh/pAco1uzzDBqu7vBGei/duVb9XJlPG+91 ItRm0Df3ozLs0etRpQoUqU02jhzXkx5fBNeFxI3BRfPgMRSLg6Iz5MOODoWOkSGJFAUd 14DJgIQn09cOkuaPDeJAoSsfgAdEyJm5urqrIU5ZbAq01H1bjrE3sfzQQzrQP2bPnhJy 9wag== X-Forwarded-Encrypted: i=1; AJvYcCWrwQMwV3yZobL5kPvDyg/ypJnczktj44NEHUE+3ivYeRxuVc/H5TYhie530IbIWuZvxRlCqlIPbmM=@vger.kernel.org X-Gm-Message-State: AOJu0YxGfEbyb0+gFrK96/m25X9RnjWuxImzYiLkwQestIWuqCtuZ0HC LzTvjmr7CMs6MG6eLkvhDV3hxYIkP8t/vtMcfW+r2r6Cdme6iY6c6RTnkgF04vaTrEw9F201QrX SyMIu5INVyoZ+hFU/TQJ0KjFleSELtnpOnifiFc7960PT3t9O1NahKir1MqQ= X-Gm-Gg: ASbGncs3wurEZeCQRhaAdLBkIoHVlWg5r07V8g4FG5NyCBQ9mtf4krGC38uLPxRK/w9 bm9l5XlPmrj5WzVWJgRc57auHnV9SmXjUd4+SGJBCUbOgioph4r6CDj6V6M+qI160cMfjGaVFuC 94jwFqnzC4cDs5N1mT1Uuz/wb4XiVkThTxXRgv6Z+XQxqI8o3WSBJSYuAjwFzbGaueeZLv7Qpg1 ayZVSj+pciO9XL4XieNO3YSBI/lB3HqQ41rJITCtP8UtghGfKQ3yLYXRg6a+2jH+CtEtmvTQvDw 7ko1lxF7aZVMo0l40AyPpD+ztkr1p013P2dXMBcphDn5i4i57MuUz4Zl15FUUKmPNT3RMtetc/5 KcsNYWmWZvZQIeNY= X-Received: by 2002:a05:6808:3507:b0:3f4:1879:2af6 with SMTP id 5614622812f47-3f425c0a825mr12950247b6e.34.1740615112222; Wed, 26 Feb 2025 16:11:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYyWforakDsfP6Ccc0h2wwXtypBZ/iJf68rRAL9DRTdguQaObti+g32f3/TVVA1pHp2B7fMg== X-Received: by 2002:a05:6808:3507:b0:3f4:1879:2af6 with SMTP id 5614622812f47-3f425c0a825mr12950231b6e.34.1740615111841; Wed, 26 Feb 2025 16:11:51 -0800 (PST) Received: from [192.168.86.65] (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f5507c40c6sm33988b6e.45.2025.02.26.16.11.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 16:11:51 -0800 (PST) From: Bjorn Andersson Date: Wed, 26 Feb 2025 16:17:53 -0800 Subject: [PATCH v4 6/7] usb: dwc3: qcom: Transition to flattened model Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250226-dwc3-refactor-v4-6-4415e7111e49@oss.qualcomm.com> References: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> In-Reply-To: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Wesley Cheng , Saravana Kannan , Thinh Nguyen , Philipp Zabel , Bjorn Andersson , Konrad Dybcio , Frank Li Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=11411; i=bjorn.andersson@oss.qualcomm.com; h=from:subject:message-id; bh=KgorRMYeXfmBlN3TG9gPoCwE8xu1HNu35qYk/aakkpk=; b=kA0DAAgBCx85Pw2ZrcUByyZiAGe/rzigwDYC9/4ZNZvaj0odxr8Vdz9GGRT8IWWg2s0I0+lK9 4kCSQQAAQgAMxYhBAXeA8xfNepPCWbVJQsfOT8Nma3FBQJnv684FRxhbmRlcnNzb25Aa2VybmVs Lm9yZwAKCRALHzk/DZmtxYCCD/0X3U5jInVt8RluV7Nx8W6HaJ3B0cvce3R4XErbXLeh8pUaq54 tkZfncMi3GMVwhqjXOviPdsDtiV8QuDzHHzZYGWYoROhZpBHsfpcEF7XTcOT34LjwroUnNV1sX8 /KMLbg4WoQVMCQmgStbnryPHFJQc4rr/3e1HMVROkKPnz3LWLUj30u4eCntwRjXNg4VenAQN4J6 b6RFfuxuKlirdoKGs73lX8D0sDwQQO30B3vvdQfxGTKVissDzAtlzqee/McgYzgvPxk1V74nHxa f7fkTQ1sF0uUabJxScI9JlHBf0TYemUMCdLaUqPCFEt5tydaiqVMdGozLNZmS6ZhNjIC2hQci1z HllY0rEpKcymv+loHZ5c6vd+eLQMGt4CBSjxpfBF0vcqce20kT87YNVT+5YyeYoRX/XvXksmkmM JTceQCP80TCJGHKTudAxCHYCHzAJ73PgrRyEWpX5xcIdAMKGhR5hRd8pPGelikiWWhuPVTnr4Pf sxgMkyoK1D2GVoYWmf0JAW07nb7dAt7K7NclV2gvmA1BtNcfENbrNjkkwhFPqG3pf1xLWuQ/D2d J6SulTbq47v+bfHwGQY2Ts6wv9VdsmguecJEnkK3veU+9OlmVuQ0oKRvzELa6DmfkqzLnR4vC7O fhJhE0StI4IHRuxiCvqmSLr10+Po+9rJUvQ== X-Developer-Key: i=bjorn.andersson@oss.qualcomm.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 X-Proofpoint-ORIG-GUID: gtV3W5loEa_05yxpfEXecOUyuMutKyuk X-Proofpoint-GUID: gtV3W5loEa_05yxpfEXecOUyuMutKyuk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_07,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 impostorscore=0 adultscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502270000 The USB IP-block found in most Qualcomm platforms is modelled in the Linux kernel as 3 different independent device drivers, but as shown by the already existing layering violations in the Qualcomm glue driver they can not be operated independently. With the current implementation, the glue driver registers the core and has no way to know when this is done. As a result, e.g. the suspend callbacks needs to guard against NULL pointer dereferences when trying to peek into the struct dwc3 found in the drvdata of the child. Even with these checks, there are no way to fully protect ourselves from the race conditions that occur if the DWC3 is unbound. Missing from the upstream Qualcomm USB support is handling of role switching, in which the glue needs to be notified upon DRD mode changes. Several attempts has been made through the years to register callbacks etc, but they always fall short when it comes to handling of the core's probe deferral on resources etc. Moving to a model where the DWC3 core is instantiated in a synchronous fashion avoids above described race conditions. It is however not feasible to do so without also flattening the DeviceTree binding, as assumptions are made in the DWC3 core and frameworks used that the device's associated of_node will the that of the core. Furthermore, the DeviceTree binding is a direct representation of the Linux driver model, and doesn't necessarily describe "the USB IP-block". The Qualcomm DWC3 glue driver is therefor transitioned to initialize and operate the DWC3 within the one device context, in synchronous fashion. To provide a limited time backwards compatibility, a snapshot of the driver is retained in a previous commit. As such no care is taken in the dwc3-qcom driver for the qcom,dwc3 backwards compatibility. Signed-off-by: Bjorn Andersson --- drivers/usb/dwc3/dwc3-qcom.c | 138 +++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 9d04c2457433..63e60f15ceaa 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -4,7 +4,6 @@ * Inspired by dwc3-of-simple.c */ -#include #include #include #include @@ -14,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -23,6 +21,7 @@ #include #include #include "core.h" +#include "glue.h" /* USB QSCRATCH Hardware registers */ #define QSCRATCH_HS_PHY_CTRL 0x10 @@ -73,7 +72,7 @@ struct dwc3_qcom_port { struct dwc3_qcom { struct device *dev; void __iomem *qscratch_base; - struct platform_device *dwc3; + struct dwc3 dwc; struct clk **clks; int num_clocks; struct reset_control *resets; @@ -92,6 +91,8 @@ struct dwc3_qcom { struct icc_path *icc_path_apps; }; +#define to_dwc3_qcom(d) container_of((d), struct dwc3_qcom, dwc) + static inline void dwc3_qcom_setbits(void __iomem *base, u32 offset, u32 val) { u32 reg; @@ -260,7 +261,7 @@ static int dwc3_qcom_interconnect_init(struct dwc3_qcom *qcom) goto put_path_ddr; } - max_speed = usb_get_maximum_speed(&qcom->dwc3->dev); + max_speed = usb_get_maximum_speed(qcom->dwc.dev); if (max_speed >= USB_SPEED_SUPER || max_speed == USB_SPEED_UNKNOWN) { ret = icc_set_bw(qcom->icc_path_ddr, USB_MEMORY_AVG_SS_BW, USB_MEMORY_PEAK_SS_BW); @@ -303,25 +304,14 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom) /* Only usable in contexts where the role can not change. */ static bool dwc3_qcom_is_host(struct dwc3_qcom *qcom) { - struct dwc3 *dwc; - - /* - * FIXME: Fix this layering violation. - */ - dwc = platform_get_drvdata(qcom->dwc3); - - /* Core driver may not have probed yet. */ - if (!dwc) - return false; - - return dwc->xhci; + return qcom->dwc.xhci; } static enum usb_device_speed dwc3_qcom_read_usb2_speed(struct dwc3_qcom *qcom, int port_index) { - struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); struct usb_device *udev; struct usb_hcd __maybe_unused *hcd; + struct dwc3 *dwc = &qcom->dwc; /* * FIXME: Fix this layering violation. @@ -498,7 +488,7 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom, bool wakeup) static irqreturn_t qcom_dwc3_resume_irq(int irq, void *data) { struct dwc3_qcom *qcom = data; - struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); + struct dwc3 *dwc = &qcom->dwc; /* If pm_suspended then let pm_resume take care of resuming h/w */ if (qcom->pm_suspended) @@ -700,40 +690,14 @@ static int dwc3_qcom_clk_init(struct dwc3_qcom *qcom, int count) return 0; } -static int dwc3_qcom_of_register_core(struct dwc3_qcom *qcom, struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - struct device *dev = &pdev->dev; - int ret; - - struct device_node *dwc3_np __free(device_node) = of_get_compatible_child(np, - "snps,dwc3"); - if (!dwc3_np) { - dev_err(dev, "failed to find dwc3 core child\n"); - return -ENODEV; - } - - ret = of_platform_populate(np, NULL, NULL, dev); - if (ret) { - dev_err(dev, "failed to register dwc3 core - %d\n", ret); - return ret; - } - - qcom->dwc3 = of_find_device_by_node(dwc3_np); - if (!qcom->dwc3) { - ret = -ENODEV; - dev_err(dev, "failed to get dwc3 platform device\n"); - of_platform_depopulate(dev); - } - - return ret; -} - static int dwc3_qcom_probe(struct platform_device *pdev) { + struct dwc3_probe_data probe_data = {}; struct device_node *np = pdev->dev.of_node; struct device *dev = &pdev->dev; struct dwc3_qcom *qcom; + struct resource res; + struct resource *r; int ret, i; bool ignore_pipe_clk; bool wakeup_source; @@ -742,7 +706,6 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (!qcom) return -ENOMEM; - platform_set_drvdata(pdev, qcom); qcom->dev = &pdev->dev; qcom->resets = devm_reset_control_array_get_optional_exclusive(dev); @@ -771,8 +734,15 @@ static int dwc3_qcom_probe(struct platform_device *pdev) goto reset_assert; } - qcom->qscratch_base = devm_platform_ioremap_resource(pdev, 0); + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!r) + goto clk_disable; + res = *r; + res.end = res.start + SDM845_QSCRATCH_BASE_OFFSET; + + qcom->qscratch_base = devm_ioremap(dev, res.end, SDM845_QSCRATCH_SIZE); if (IS_ERR(qcom->qscratch_base)) { + dev_err(dev, "failed to map qscratch region: %pe\n", qcom->qscratch_base); ret = PTR_ERR(qcom->qscratch_base); goto clk_disable; } @@ -792,17 +762,21 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (ignore_pipe_clk) dwc3_qcom_select_utmi_clk(qcom); - ret = dwc3_qcom_of_register_core(qcom, pdev); - if (ret) { - dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret); + qcom->dwc.dev = dev; + probe_data.dwc = &qcom->dwc; + probe_data.res = &res; + probe_data.ignore_clocks_and_resets = true; + ret = dwc3_core_probe(&probe_data); + if (ret) { + ret = dev_err_probe(dev, ret, "failed to register DWC3 Core\n"); goto clk_disable; } ret = dwc3_qcom_interconnect_init(qcom); if (ret) - goto depopulate; + goto remove_core; - qcom->mode = usb_get_dr_mode(&qcom->dwc3->dev); + qcom->mode = usb_get_dr_mode(dev); /* enable vbus override for device mode */ if (qcom->mode != USB_DR_MODE_HOST) @@ -815,20 +789,15 @@ static int dwc3_qcom_probe(struct platform_device *pdev) wakeup_source = of_property_read_bool(dev->of_node, "wakeup-source"); device_init_wakeup(&pdev->dev, wakeup_source); - device_init_wakeup(&qcom->dwc3->dev, wakeup_source); qcom->is_suspended = false; - pm_runtime_set_active(dev); - pm_runtime_enable(dev); - pm_runtime_forbid(dev); return 0; interconnect_exit: dwc3_qcom_interconnect_exit(qcom); -depopulate: - of_platform_depopulate(&pdev->dev); - platform_device_put(qcom->dwc3); +remove_core: + dwc3_core_remove(&qcom->dwc); clk_disable: for (i = qcom->num_clocks - 1; i >= 0; i--) { clk_disable_unprepare(qcom->clks[i]); @@ -842,12 +811,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) static void dwc3_qcom_remove(struct platform_device *pdev) { - struct dwc3_qcom *qcom = platform_get_drvdata(pdev); + struct dwc3 *dwc = platform_get_drvdata(pdev); + struct dwc3_qcom *qcom = to_dwc3_qcom(dwc); struct device *dev = &pdev->dev; int i; - of_platform_depopulate(&pdev->dev); - platform_device_put(qcom->dwc3); + dwc3_core_remove(&qcom->dwc); for (i = qcom->num_clocks - 1; i >= 0; i--) { clk_disable_unprepare(qcom->clks[i]); @@ -864,10 +833,15 @@ static void dwc3_qcom_remove(struct platform_device *pdev) static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) { - struct dwc3_qcom *qcom = dev_get_drvdata(dev); + struct dwc3 *dwc = dev_get_drvdata(dev); + struct dwc3_qcom *qcom = to_dwc3_qcom(dwc); bool wakeup = device_may_wakeup(dev); int ret; + ret = dwc3_pm_suspend(&qcom->dwc); + if (ret) + return ret; + ret = dwc3_qcom_suspend(qcom, wakeup); if (ret) return ret; @@ -879,7 +853,8 @@ static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) { - struct dwc3_qcom *qcom = dev_get_drvdata(dev); + struct dwc3 *dwc = dev_get_drvdata(dev); + struct dwc3_qcom *qcom = to_dwc3_qcom(dwc); bool wakeup = device_may_wakeup(dev); int ret; @@ -889,30 +864,55 @@ static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) qcom->pm_suspended = false; + ret = dwc3_pm_resume(&qcom->dwc); + if (ret) + return ret; + return 0; } static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) { - struct dwc3_qcom *qcom = dev_get_drvdata(dev); + struct dwc3 *dwc = dev_get_drvdata(dev); + struct dwc3_qcom *qcom = to_dwc3_qcom(dwc); + int ret; + + ret = dwc3_runtime_suspend(&qcom->dwc); + if (ret) + return ret; return dwc3_qcom_suspend(qcom, true); } +static void __maybe_unused dwc3_qcom_complete(struct device *dev) +{ + struct dwc3 *dwc = dev_get_drvdata(dev); + + dwc3_pm_complete(dwc); +} + static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev) { - struct dwc3_qcom *qcom = dev_get_drvdata(dev); + struct dwc3 *dwc = dev_get_drvdata(dev); + struct dwc3_qcom *qcom = to_dwc3_qcom(dwc); + int ret; + + ret = dwc3_qcom_resume(qcom, true); + if (ret) + return ret; - return dwc3_qcom_resume(qcom, true); + return dwc3_runtime_resume(&qcom->dwc); } static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume) SET_RUNTIME_PM_OPS(dwc3_qcom_runtime_suspend, dwc3_qcom_runtime_resume, NULL) + .complete = dwc3_qcom_complete, }; static const struct of_device_id dwc3_qcom_of_match[] = { + { .compatible = "qcom,snps-dwc3" }, { } }; MODULE_DEVICE_TABLE(of, dwc3_qcom_of_match); From patchwork Thu Feb 27 00:17:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 868923 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 9358A5A79B for ; Thu, 27 Feb 2025 00:11:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615118; cv=none; b=GOi/o10kv5kYMKZ8Nsat+dwR53lnYLFv6m76LWtdsMXpo5yvCMHqvTCkV0wZTZeioIrAngVf6ziJUf/32z/hC2VQ05z0TzERI0ojLGnsuvD1BTLoenjQKknpSkrzkvBYn8FvcsliLIY/lV2rQ6DiTC8F387Ukzr1yHVJbBydOfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740615118; c=relaxed/simple; bh=QZCpZlu53quw6nL6TnKxy5fmS1nRzhqSoUP2GUKX9/c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P6JU1jcDP81Q9Mx/KANAU3wCQsi15AgeuMZ175EVdIWj5NLH9Ce2IIHos32PDogXtSx7dj6S4iH1PycrKr3gTTUjqst6/OGDnb+7Hza5MUcQhh/02x7BIs7iPmEWE6yh7OqHL4r8wnkg7Jzl9nlIOnXi1HCFasUg28K2pCw7DHI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=j3l93BQs; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="j3l93BQs" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QLF6Xb012055 for ; Thu, 27 Feb 2025 00:11:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 7sVaiMs2t/yghLl4ZXum6gfPzebES0AYVlGI7YtV98s=; b=j3l93BQsPmbKgFo8 yXqGtSddVGsD3+Stq+UeW0xH4AKzvjwA4bdIfSWE6zbZUL0gwx915eoV2KtYNSuo jXSIl0bkL2+Af50RjhkVJ+DycC/hGN4T7gxs/+FQlnBKeAe4JWVELod8X1+ZtWtI qOZSPYR9aGMIStZh9dIznfdKKcVO0w2CZKKyLdQW8bMRCyj15NBSg32IbzLbE3nR HfHbNtDOcXpQ/2orUSvShYze+OXYE7rdJG9r0Mt93UmJ1jqqAOYEpQO1rw8BRN36 JptxV6cGBRO96m/1LucfmdIYqMkaHOG5QXabwHQnxgGNsmyngzN+Pe/03rQfx/pi m/5DIA== Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 451prkbp4g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Feb 2025 00:11:54 +0000 (GMT) Received: by mail-oi1-f198.google.com with SMTP id 5614622812f47-3f40d3bee5eso456112b6e.1 for ; Wed, 26 Feb 2025 16:11:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740615113; x=1741219913; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7sVaiMs2t/yghLl4ZXum6gfPzebES0AYVlGI7YtV98s=; b=HZ8SfDMZ82MoU+vKVdUlFBt5SKDYET0Pgmwmx/kwRUxWzniZTgBGPzLoxG98aEgk7X HKD6LyTq5UbcuD4ceSgi12uBixNvhI07yLWaUhB1BWhaNd0BnA9Ng3u7quESRrdury+W ZlWhHxm9Xgl3e7dmokr4teU5wCd7f3vgMLgwdjJmVjXeWwTi7ZdA89q7xj0+irNrnFRp HVgI4A/4sDhgxXt9dB2bS9ygH52g+8uwpksuevIlJ5AR4uy3Xopa7vxRzru7Wvv+q5t9 hjdGhKMfc7ZHmyvTtbvdwJQnBQed+XZAuOazbV9HrytvgBX2LKRY3t8oDIfYFW1UT0Tu m4tA== X-Forwarded-Encrypted: i=1; AJvYcCUN8eylyhCLNel0e7b2+zDKIuMzFVoMTGBr42sqDcyOl82OtVTjYXX08UHMSwaOJW42cqqvybyZEpI=@vger.kernel.org X-Gm-Message-State: AOJu0YyqAFWvuUZIjb/CrToPJrOb9FthQlXwVrh8AwNa50NqDqgs15wu 3du51Yw8OmUyp4NBez0IEexzEXAG71MKfHoAJwEeT1Zs468GpkS7MK5y/eEOQc2O0Wh2Q1KOjEA j8IxqcC6pBdYIoBXh7Nsym9t2ctVKuW8cicI46ghtxjN2I4bfY630GO+CEyw= X-Gm-Gg: ASbGncu2p4wKA4XgTSq6r0eoVVS4/laNxwJo7RNfPusfzmhAtAiYfz5hoZ1VG+VOzFC unXmgD9pTW5OZSB3NBEqwoDRDfzp/EECNMO6eese4p1iMt84BtTXFAX/wm/cFbEypGFt0nC7O0w ix9twSTsiL4dqb2yZplrcBTWHFfbOc9LXdRFkrm7Jb18isTIv9I/T+kDHgyYMwuvozmJZKFUHJS 01y6cXNPkOOcVi340B4RQFq9/g8Rzc8TJpJBe/Fdn7ogfI4hXUxiobS4BZBztJfSZpjzUgw4Tw1 3RUYiSZCjyBKH/2tA64KA9fG+WwKKFExATi4FR/QCi0dz0EIAN4sU7DFFQOl2j0RoSZ1VvDBbFP kJmXsLKBSjUb65MM= X-Received: by 2002:a05:6808:2f1b:b0:3f4:1d3:b64e with SMTP id 5614622812f47-3f547e3a51cmr3153547b6e.28.1740615113496; Wed, 26 Feb 2025 16:11:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEz12bIBQsr4nK93FSyPKMSCUl2KIJYpv2rvkY4dotioPJA0yGhdMzQznWTdCf6EYAGzyKhQQ== X-Received: by 2002:a05:6808:2f1b:b0:3f4:1d3:b64e with SMTP id 5614622812f47-3f547e3a51cmr3153538b6e.28.1740615113147; Wed, 26 Feb 2025 16:11:53 -0800 (PST) Received: from [192.168.86.65] (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f5507c40c6sm33988b6e.45.2025.02.26.16.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2025 16:11:52 -0800 (PST) From: Bjorn Andersson Date: Wed, 26 Feb 2025 16:17:54 -0800 Subject: [PATCH v4 7/7] arm64: dts: qcom: sc8280x: Flatten the USB nodes Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250226-dwc3-refactor-v4-7-4415e7111e49@oss.qualcomm.com> References: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> In-Reply-To: <20250226-dwc3-refactor-v4-0-4415e7111e49@oss.qualcomm.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Wesley Cheng , Saravana Kannan , Thinh Nguyen , Philipp Zabel , Bjorn Andersson , Konrad Dybcio , Frank Li Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=13628; i=bjorn.andersson@oss.qualcomm.com; h=from:subject:message-id; bh=QZCpZlu53quw6nL6TnKxy5fmS1nRzhqSoUP2GUKX9/c=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBnv684HKcj/LU0YRimWXlZfb1oENn1uGyR9QiHP XsReIu6WwaJAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZ7+vOBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcVggg/9HcXAYm1W+vm4lNilU8Ehnfpa4mENzQW+vaCfJrp 3QjWETR5BVYQEDD34Jwi4gn05OeV8r/m4M174d7ZZITe40/q+4LOy3cYOkGWtGimmCJ5R3hiOnf caCg1TxsSFiwUbDgJxwFswATsFiRR/D9vOFq2slk6npxEFpBRzQIsyMJAh8YAH8JCpg1KeOFpGt dpIkd6guBufBtB5251JjHPBYMOHSILvKFlq5fiBsMSOGCKueC9Rszdll3kEWy6suyDEgEhmzXg0 n9agYZjKa/qTG/VmfOJZFpBYawTQZZS/5suPBnC5RsEBND9eybeHbSScP8GD7L6PNElNPk5WRbG roM/uz9Ua2wiRBSU2liyPiHPLZtDP76nEMOA4lieRJSRk2F1PSdGezK5RHOSRI5fMO4A/xC7AXr SZRkQHELwVUQbuSZSRrIQOHvkr3mV79CkSSyyxbfkZ8A3bqQR47d2oyhFOJ16Kf2F5FG8sbkt/1 oymLVDaejE68XudZqMwv4mUZe40QUls52jcpNbtE3GoHDcPOMIe9wMshFB+cAWPjHljurqIxPI/ ISy1Tv/wOh/m9kG7/Ar6lDELOeQSNV1fstKbAxMCZXvH1g0ckAQh17KrBtlPLhXrQZKnbCw7dEd BX7mTtua7Hs9+m4Pm1ZadQjISFom5xvS+qtQkhTS3fm4= X-Developer-Key: i=bjorn.andersson@oss.qualcomm.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 X-Proofpoint-GUID: W1JuXx3DJkS2qcsEz9NFFEGtzUnOn367 X-Proofpoint-ORIG-GUID: W1JuXx3DJkS2qcsEz9NFFEGtzUnOn367 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_07,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 priorityscore=1501 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502270000 Transition the three USB controllers found in sc8280xp to the newly introduced, flattened representation of the Qualcomm USB block, i.e. qcom,snps-dwc3, to show the end result. The reg and interrupts properties from the usb child node are merged with their counterpart in the outer node, remaining properties and child nodes are simply moved. Signed-off-by: Bjorn Andersson --- arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 12 +- arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 5 +- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 12 +- .../boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 10 +- .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 11 +- .../boot/dts/qcom/sc8280xp-microsoft-arcata.dts | 10 +- .../boot/dts/qcom/sc8280xp-microsoft-blackrock.dts | 18 +-- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 157 ++++++++++----------- 8 files changed, 95 insertions(+), 140 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts index 2fd1dafe63ce..3d84cbf5af31 100644 --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts @@ -631,12 +631,10 @@ &ufs_card_phy { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { /* TODO: Define USB-C connector properly */ dr_mode = "peripheral"; + + status = "okay"; }; &usb_0_hsphy { @@ -655,12 +653,10 @@ &usb_0_qmpphy { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { /* TODO: Define USB-C connector properly */ dr_mode = "host"; + + status = "okay"; }; &usb_1_hsphy { diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index 177b9dad6ff7..7be803fb7cbe 100644 --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts @@ -466,11 +466,8 @@ &ufs_mem_phy { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "peripheral"; + status = "okay"; }; &usb_0_hsphy { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts index 75adaa19d1c3..05fe5793f1f1 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts @@ -795,11 +795,9 @@ &ufs_mem_phy { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "host"; + + status = "okay"; }; &usb_0_dwc3_hs { @@ -832,11 +830,9 @@ &usb_0_qmpphy_out { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { dr_mode = "host"; + + status = "okay"; }; &usb_1_dwc3_hs { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts index 09b95f89ee58..300c7dc999a4 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts @@ -997,11 +997,8 @@ bluetooth { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "host"; + status = "okay"; }; &usb_0_hsphy { @@ -1026,11 +1023,8 @@ &usb_0_qmpphy_dp_in { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { dr_mode = "host"; + status = "okay"; }; &usb_1_hsphy { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index f3190f408f4b..1b9501cc82f4 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -1343,11 +1343,9 @@ bluetooth { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "host"; + + status = "okay"; }; &usb_0_dwc3_hs { @@ -1380,11 +1378,8 @@ &usb_0_qmpphy_out { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { dr_mode = "host"; + status = "okay"; }; &usb_1_dwc3_hs { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts b/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts index ae5daeac8fe2..82672f441ea2 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-arcata.dts @@ -749,11 +749,8 @@ embedded-controller { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "host"; + status = "okay"; }; &usb_0_dwc3_hs { @@ -786,11 +783,8 @@ &usb_0_qmpphy_out { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { dr_mode = "host"; + status = "okay"; }; &usb_1_dwc3_hs { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-blackrock.dts b/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-blackrock.dts index fa9d94105052..eeb69cfd4422 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-blackrock.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-microsoft-blackrock.dts @@ -982,11 +982,9 @@ bluetooth { }; &usb_0 { - status = "okay"; -}; - -&usb_0_dwc3 { dr_mode = "host"; + + status = "okay"; }; &usb_0_dwc3_hs { @@ -1019,11 +1017,9 @@ &usb_0_qmpphy_out { }; &usb_1 { - status = "okay"; -}; - -&usb_1_dwc3 { dr_mode = "host"; + + status = "okay"; }; &usb_1_dwc3_hs { @@ -1059,12 +1055,10 @@ &usb_2 { pinctrl-0 = <&usb2_en_state>; pinctrl-names = "default"; - status = "okay"; -}; - -&usb_2_dwc3 { phys = <&usb_2_hsphy0>, <&usb_2_qmpphy0>; phy-names = "usb2-0", "usb3-0"; + + status = "okay"; }; &usb_2_hsphy0 { diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi index 01501acb1790..3dea86b0e13d 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -3457,12 +3457,9 @@ system-cache-controller@9200000 { interrupts = ; }; - usb_2: usb@a4f8800 { - compatible = "qcom,sc8280xp-dwc3-mp", "qcom,dwc3"; - reg = <0 0x0a4f8800 0 0x400>; - #address-cells = <2>; - #size-cells = <2>; - ranges; + usb_2: usb@a400000 { + compatible = "qcom,sc8280xp-dwc3-mp", "qcom,snps-dwc3"; + reg = <0 0x0a400000 0 0x10000>; clocks = <&gcc GCC_CFG_NOC_USB3_MP_AXI_CLK>, <&gcc GCC_USB30_MP_MASTER_CLK>, @@ -3480,7 +3477,8 @@ usb_2: usb@a4f8800 { <&gcc GCC_USB30_MP_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 857 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 856 IRQ_TYPE_LEVEL_HIGH>, @@ -3499,7 +3497,8 @@ usb_2: usb@a4f8800 { <&pdc 16 IRQ_TYPE_LEVEL_HIGH>, <&pdc 17 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "pwr_event_1", "pwr_event_2", + interrupt-names = "dwc_usb3", + "pwr_event_1", "pwr_event_2", "pwr_event_3", "pwr_event_4", "hs_phy_1", "hs_phy_2", "hs_phy_3", "hs_phy_4", @@ -3509,6 +3508,7 @@ usb_2: usb@a4f8800 { "dp_hs_phy_4", "dm_hs_phy_4", "ss_phy_1", "ss_phy_2"; + iommus = <&apps_smmu 0x800 0x0>; power-domains = <&gcc USB30_MP_GDSC>; required-opps = <&rpmhpd_opp_nom>; @@ -3518,35 +3518,28 @@ usb_2: usb@a4f8800 { <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_MP 0>; interconnect-names = "usb-ddr", "apps-usb"; + phys = <&usb_2_hsphy0>, <&usb_2_qmpphy0>, + <&usb_2_hsphy1>, <&usb_2_qmpphy1>, + <&usb_2_hsphy2>, + <&usb_2_hsphy3>; + phy-names = "usb2-0", "usb3-0", + "usb2-1", "usb3-1", + "usb2-2", + "usb2-3"; + wakeup-source; + dr_mode = "host"; + + snps,dis-u1-entry-quirk; + snps,dis-u2-entry-quirk; + status = "disabled"; + }; - usb_2_dwc3: usb@a400000 { - compatible = "snps,dwc3"; - reg = <0 0x0a400000 0 0xcd00>; - interrupts = ; - iommus = <&apps_smmu 0x800 0x0>; - phys = <&usb_2_hsphy0>, <&usb_2_qmpphy0>, - <&usb_2_hsphy1>, <&usb_2_qmpphy1>, - <&usb_2_hsphy2>, - <&usb_2_hsphy3>; - phy-names = "usb2-0", "usb3-0", - "usb2-1", "usb3-1", - "usb2-2", - "usb2-3"; - dr_mode = "host"; - snps,dis-u1-entry-quirk; - snps,dis-u2-entry-quirk; - }; - }; - - usb_0: usb@a6f8800 { - compatible = "qcom,sc8280xp-dwc3", "qcom,dwc3"; - reg = <0 0x0a6f8800 0 0x400>; - #address-cells = <2>; - #size-cells = <2>; - ranges; + usb_0: usb@a600000 { + compatible = "qcom,sc8280xp-dwc3", "qcom,snps-dwc3"; + reg = <0 0x0a600000 0 0x20000>; clocks = <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>, <&gcc GCC_USB30_PRIM_MASTER_CLK>, @@ -3564,17 +3557,20 @@ usb_0: usb@a6f8800 { <&gcc GCC_USB30_PRIM_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts-extended = <&intc GIC_SPI 804 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 803 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 804 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 805 IRQ_TYPE_LEVEL_HIGH>, <&pdc 14 IRQ_TYPE_EDGE_BOTH>, <&pdc 15 IRQ_TYPE_EDGE_BOTH>, <&pdc 138 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "pwr_event", + interrupt-names = "dwc_usb3", + "pwr_event", "hs_phy_irq", "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq"; + iommus = <&apps_smmu 0x820 0x0>; power-domains = <&gcc USB30_PRIM_GDSC>; required-opps = <&rpmhpd_opp_nom>; @@ -3584,45 +3580,40 @@ usb_0: usb@a6f8800 { <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_0 0>; interconnect-names = "usb-ddr", "apps-usb"; + phys = <&usb_0_hsphy>, <&usb_0_qmpphy QMP_USB43DP_USB3_PHY>; + phy-names = "usb2-phy", "usb3-phy"; + wakeup-source; - status = "disabled"; + snps,dis-u1-entry-quirk; + snps,dis-u2-entry-quirk; - usb_0_dwc3: usb@a600000 { - compatible = "snps,dwc3"; - reg = <0 0x0a600000 0 0xcd00>; - interrupts = ; - iommus = <&apps_smmu 0x820 0x0>; - phys = <&usb_0_hsphy>, <&usb_0_qmpphy QMP_USB43DP_USB3_PHY>; - phy-names = "usb2-phy", "usb3-phy"; - snps,dis-u1-entry-quirk; - snps,dis-u2-entry-quirk; + status = "disabled"; - ports { - #address-cells = <1>; - #size-cells = <0>; + ports { + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - usb_0_dwc3_hs: endpoint { - }; + usb_0_dwc3_hs: endpoint { }; + }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - usb_0_dwc3_ss: endpoint { - remote-endpoint = <&usb_0_qmpphy_usb_ss_in>; - }; + usb_0_dwc3_ss: endpoint { + remote-endpoint = <&usb_0_qmpphy_usb_ss_in>; }; }; }; }; - usb_1: usb@a8f8800 { - compatible = "qcom,sc8280xp-dwc3", "qcom,dwc3"; - reg = <0 0x0a8f8800 0 0x400>; + usb_1: usb@a800000 { + compatible = "qcom,sc8280xp-dwc3", "qcom,snps-dwc3"; + reg = <0 0x0a800000 0 0x10000>; #address-cells = <2>; #size-cells = <2>; ranges; @@ -3643,17 +3634,20 @@ usb_1: usb@a8f8800 { <&gcc GCC_USB30_SEC_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts-extended = <&intc GIC_SPI 811 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 810 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 811 IRQ_TYPE_LEVEL_HIGH>, <&intc GIC_SPI 790 IRQ_TYPE_LEVEL_HIGH>, <&pdc 12 IRQ_TYPE_EDGE_BOTH>, <&pdc 13 IRQ_TYPE_EDGE_BOTH>, <&pdc 136 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "pwr_event", + interrupt-names = "dwc_usb3", + "pwr_event", "hs_phy_irq", "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq"; + iommus = <&apps_smmu 0x860 0x0>; power-domains = <&gcc USB30_SEC_GDSC>; required-opps = <&rpmhpd_opp_nom>; @@ -3663,37 +3657,32 @@ usb_1: usb@a8f8800 { <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_1 0>; interconnect-names = "usb-ddr", "apps-usb"; + phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>; + phy-names = "usb2-phy", "usb3-phy"; + wakeup-source; - status = "disabled"; + snps,dis-u1-entry-quirk; + snps,dis-u2-entry-quirk; - usb_1_dwc3: usb@a800000 { - compatible = "snps,dwc3"; - reg = <0 0x0a800000 0 0xcd00>; - interrupts = ; - iommus = <&apps_smmu 0x860 0x0>; - phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>; - phy-names = "usb2-phy", "usb3-phy"; - snps,dis-u1-entry-quirk; - snps,dis-u2-entry-quirk; + status = "disabled"; - ports { - #address-cells = <1>; - #size-cells = <0>; + ports { + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - usb_1_dwc3_hs: endpoint { - }; + usb_1_dwc3_hs: endpoint { }; + }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - usb_1_dwc3_ss: endpoint { - remote-endpoint = <&usb_1_qmpphy_usb_ss_in>; - }; + usb_1_dwc3_ss: endpoint { + remote-endpoint = <&usb_1_qmpphy_usb_ss_in>; }; }; };