From nobody Fri Dec 19 12:49:47 2025 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 EF7151A4E70 for ; Mon, 14 Apr 2025 05:39:32 +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=1744609174; cv=none; b=djKN3h7Qmj5UVk1ukApQuvjrPq6ZTJkFWlMHwYQ0RoZ54wUK0c2PHrw9xlE0fLQAiGwTELYLIWmUrLRMHL/Gk4hIPqvLTx5/jVIz3iBRGE1JRkQUk+2h5n5HLiTShbR7UyoMe6v71/sq+suyCH2IuDdfc0S5JaesVhQElqLqKCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744609174; c=relaxed/simple; bh=FMVSfgXqB99+cHL2kSSq0wS1EX1F8w0XxVP3cHPwGl4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cCWqAZFqO7yHfre9aWSAIa08yyPDo9evZwVvalzg8LSNnx+PNT1msJe03TvGNvrV1O3ld74VRmMUwVh0zRV0+GmhG5w4uTAaWxGDN8faE7IwVy0D/tjmLVopd4NCReLObqtUWat6tLIDoG8PEEP+FTqRWPuslCsosePrUsmpq0Q= 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=EtaGVfWX; 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="EtaGVfWX" 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 53DNLnZn025197 for ; Mon, 14 Apr 2025 05:39:31 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= VMxqLj4zU8XGgZpxvgTZGnEdT+gYOvLsWAmxpJOzQK0=; b=EtaGVfWXJZprnKRZ kxEoqM3Kt4FX1uQuXfnh8hRTuJTJj9casRprEQxUkiJqNQal8CIv0w1I2dNM1VzS ndKzZKM0XeveaB+MLYSUy7d+YR9ZLDbUqGA+dUko8RaiREZhCh3y1N/uJihRo3WF eQFhbamMAxykskzh/DIMxpqMLrPZIya/rIOgIQGE/rdzp1KvLDOiznmHMl/KsdrD VTdp0P8vB0txnSWQwLhtQBVrCL1iha1Z5jbeTiVKs7BQ9KmvzajufuomPYxKAAjV vmX2t/etdoGdnOvlxUo8JQrK3lB4V9lzqUTXkXl0KlCHDEC76EWWku+NGz8li13L QrG5jg== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45ygj93d2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 14 Apr 2025 05:39:31 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-736cb72efd5so3427783b3a.3 for ; Sun, 13 Apr 2025 22:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744609170; x=1745213970; 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=VMxqLj4zU8XGgZpxvgTZGnEdT+gYOvLsWAmxpJOzQK0=; b=LrxIwVwxW18t191G9oTkwN0MG+AAxy6BFl/Diw+zLD15xHr+HOhlJJzNorWaj34GK8 vumkEQ8b/ijxN+WrNKP5/TDRZ3y37ulW4mI+iQR9dLonYXj7FNPoorsAYcOLGG5T1B+T miyheO9gjuVUbQzwpXWi8Ftj8wGsSXEv5taEoYJANsiWTYGDi0zSN67EFNgWsPKf1YH9 XLwZrBA9b9H4dzRETE3ai+f9j1kA9ukgMIGnR4j+5Nrt4Ii5henyIBz3UV78fp5j4isl ddkn9rHIZ0dvuwOG7xw5fDyX9m4EAXuVoCMCIxsFAEB7nk3CqvOOVj8Rk9p2+6KRn9L6 T3jA== X-Forwarded-Encrypted: i=1; AJvYcCX0us9Ulyd1l+ifATruCrm13UJYsjDjuJKLYSdHJq3ua94dav5e749BoQzgqnC/wVmD8JlNDXOaP5hSTzQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/PwQOKdfLrWGCD2umcMappnvmaCi5OwVbjicRKKzn857drV46 u5N3aOVCI/nlUYAcQ8XbFCeytNL5KEIj3oU8+z47LTwFyzZR+DjtVCIZmGd/XcTxBg2Kbxm/noB kazTBGmSg7fHOiNJ7i3lV+i1XLb148zk7zDhazN2NPULP/kETKSsWD6PulT06hfM= X-Gm-Gg: ASbGncvc4KZjLZCLVY39D/ovB4pile/PxiaeLHJigXWVo1oDcDBV4SVUaYVoyygyvmT s1aaJESCxB9vL2VMlrZk3z+Ut6/LI5QK/R0KSSreVKouYQbq6nzOEpWcbF4Z7aJyUh6Aio3zZEM rCXgjZ8q+vQRHk5VwlkYgrTjKwT0Ax87Q08xc4vd6cQ01bBspVMr/WSKXNVdIPzr4rhmMIYS+d9 50kBnTbcCX8IIxEWUzWjMW35Xb8JsuMCUhedcJXUrC5g7XKQX/ka2emVJoBsCfiAcyThsbHHYwi 6do8lKrPeacA6rk8uD0S0FbHt4J1vBcMnZX/W8JMC18xSxU= X-Received: by 2002:a05:6a00:3a01:b0:736:69aa:112c with SMTP id d2e1a72fcca58-73bd11e26d6mr13140953b3a.9.1744609170057; Sun, 13 Apr 2025 22:39:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+lYfmeZMaTl0r2O67Ucz8nxsn68aq9IJaHKygatFb1SaohIdf3+BadqPqlWPTBdX0qfzpFQ== X-Received: by 2002:a05:6a00:3a01:b0:736:69aa:112c with SMTP id d2e1a72fcca58-73bd11e26d6mr13140929b3a.9.1744609169438; Sun, 13 Apr 2025 22:39:29 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73bd23332d2sm5824559b3a.159.2025.04.13.22.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Apr 2025 22:39:29 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 14 Apr 2025 11:09:12 +0530 Subject: [PATCH v2 1/3] dt-bindings: PCI: qcom: Move phy, wake & reset gpio's to root port Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250414-perst-v2-1-89247746d755@oss.qualcomm.com> References: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> In-Reply-To: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744609160; l=2982; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=FMVSfgXqB99+cHL2kSSq0wS1EX1F8w0XxVP3cHPwGl4=; b=3C6xcR4XSNkH7x/vws5locFq2tigeUCUHcg4HCvd+X7j6iSUJkkYeER3JLT/ihKKsO+GzRScS hXMo4W+F/l/CFvGQHRJ1qZOjKSwACFoEWOz3kPUYaCgicCtDU/y/02x X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-ORIG-GUID: 886P2PQXeRiNGKtfhNNLkKK_UBGiiODv X-Authority-Analysis: v=2.4 cv=PruTbxM3 c=1 sm=1 tr=0 ts=67fc9f93 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=stmhjgsGwY9JSZftE7EA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 X-Proofpoint-GUID: 886P2PQXeRiNGKtfhNNLkKK_UBGiiODv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-14_01,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504140039 Move the phy, phy-names, wake-gpio's to the pcie root port node instead of the bridge node, as agreed upon in multiple places one instance is[1]. Update the qcom,pcie-common.yaml to include the phy, phy-names, and wake-gpios properties in the root port node. There is already reset-gpio defined for PERST# in pci-bus-common.yaml, start using that property instead of perst-gpio. For backward compatibility, do not remove any existing properties in the bridge node. [1] https://lore.kernel.org/linux-pci/20241211192014.GA3302752@bhelgaas/ Signed-off-by: Krishna Chaitanya Chundru --- .../devicetree/bindings/pci/qcom,pcie-common.yaml | 18 ++++++++++++++= ++++ .../devicetree/bindings/pci/qcom,pcie-sc7280.yaml | 17 +++++++++++++-= --- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml b/= Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml index 0480c58f7d998adbac4c6de20cdaec945b3bab21..16e9acba1559b457da8a8a9dda4= a22b226808f86 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml @@ -85,6 +85,24 @@ properties: opp-table: type: object =20 +patternProperties: + "^pcie@": + type: object + $ref: /schemas/pci/pci-pci-bridge.yaml# + + properties: + reg: + maxItems: 1 + + phys: + maxItems: 1 + + wake-gpios: + description: GPIO controlled connection to WAKE# signal + maxItems: 1 + + unevaluatedProperties: false + required: - reg - reg-names diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml b/= Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml index 76cb9fbfd476fb0412217c68bd8db44a51c7d236..beb092f53019c31861460570cd2= 142506e05d8ef 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml @@ -162,9 +162,6 @@ examples: iommu-map =3D <0x0 &apps_smmu 0x1c80 0x1>, <0x100 &apps_smmu 0x1c81 0x1>; =20 - phys =3D <&pcie1_phy>; - phy-names =3D "pciephy"; - pinctrl-names =3D "default"; pinctrl-0 =3D <&pcie1_clkreq_n>; =20 @@ -173,7 +170,19 @@ examples: resets =3D <&gcc GCC_PCIE_1_BCR>; reset-names =3D "pci"; =20 - perst-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; vddpe-3v3-supply =3D <&pp3300_ssd>; + pcie1_port0: pcie@0 { + device_type =3D "pci"; + reg =3D <0x0 0x0 0x0 0x0 0x0>; + bus-range =3D <0x01 0xff>; + + #address-cells =3D <3>; + #size-cells =3D <2>; + ranges; + phys =3D <&pcie1_phy>; + + reset-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; + }; + }; }; --=20 2.34.1 From nobody Fri Dec 19 12:49:47 2025 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 98BDE1A83E8 for ; Mon, 14 Apr 2025 05:39:37 +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=1744609179; cv=none; b=D5rRzjyKJfRycQLLSfN6L9N61j3gtx3zy1r1Yh5gNmHC15QvXjpA7DxKTldCtP6eRMYD3CofDrVvSteGcap0P+45zx0OS38eEmDQKmvXKiNPQ6GDoQQOkNK24hN/WxMCqkTs8YQ7DMK1vGga8TEmfGMewoHeNpmAIbzkk2Wp7z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744609179; c=relaxed/simple; bh=eIQxpFl/4jEJYQ5b8TemHn6+N37yVxaNtRNfPvJkFrQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gSVJyNNUPS2SiDHuCCKsJOwxuWU5IVpjbfrwodHu3TpwouTi8yWRX3+QGwfMly/aKGa2bSBhHxlT81WfdETlSnImBhApZiFIMOXyqaTH6Ks79yHKSaOFGu+q6n57bblZbbp6ohrSEEx905CqzbS+YVRQgfLpjE0Y0zSf069AvTE= 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=Lz47ESdX; 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="Lz47ESdX" 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 53DLu3wV016578 for ; Mon, 14 Apr 2025 05:39:36 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= n8npninDD5cmC/SL7Qu5sfc1JZFcxO0jTWtoHsJdBUM=; b=Lz47ESdXD+xQ5kWD 33oQObwZooQZVHa8ZELsWxh1hzinzbw0vnBMNwOvwZVwqSX7KUIm4DqQSkmCH5J3 WL4Aznz8/bdjpdFN6TeiekPyeMlM4TvKRYXCadpqXH1LSFypxurlAluX8upfd8hh pPDMadtfsBUJi9gsP4aQWUpQb6ex6nJGZVVtXYm4KIYYdNngmuH+Z3ckUNGp2H8I cNRDunQ1I948ivhvfhF4hiWJtAsiXImAC9gjC8XDdxeL5smIlBEKjPbhWnu7deZD k9zvS7EL+6X5UhBpjuT+aUCr0fKbkXkia5uTt0gED7nQtAelfk2f//IJq4IV59Dw aZrg4Q== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yfgjbej8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 14 Apr 2025 05:39:36 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-739071bdf2eso2712686b3a.2 for ; Sun, 13 Apr 2025 22:39:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744609175; x=1745213975; 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=n8npninDD5cmC/SL7Qu5sfc1JZFcxO0jTWtoHsJdBUM=; b=sYarLtN6wKMVCpcTuewnI0bKKoLeoVP15LxFsfKhkXnUbwLtPhvZXRb9SWA5sxR+5d wk5RfxaUBrx1MUs8CycmId8aJwPz7ThVwARALkRll5IeNY/r99V5F3sh9bo2IT99N8zq qNs6wFkY39MtAenIQZmo22P5gv0LrBN9d7ApyjHqk+lVW1XSvMkytbCQ33vqSQZezn6x rsD3dqI7gPc6bPT6xavfMvOkwr8GxSxWy9o2mLs13qvzGmcvpbF5B2IAlycH587vEUNw OzxUYEOqnL5EjPtewQVu0JQJabebPjYLO6pgqWfi6ia6dDO8j3wU4XHI2PLzesAZb50l GKWw== X-Forwarded-Encrypted: i=1; AJvYcCXaFhPkaANNdQBYMS/4/zxkLD9TRcg9SCIHwaj2RbkRI3/Fx0gU65lABrzsByH0VqParQ+iU/g0pis40zI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3x90EnrYUk1zu6IZlECER+oFjxPJY27I3h+nOv5gTXgn2zUsE 8JSZhLim3FrCFLQ0jrnYs3Tdd3CQz6GLTt0et02LAd7Sn2oo3cXHyUsE9T4ZAm2eLGbokMQJUH5 ANugScVLxBtAuY1tQWCnOli6m1CN/cNVaU0s/wTFmE7Kv14KeyD5tsx6kNO2LPYM= X-Gm-Gg: ASbGncvcb/jcGOfEbU6nzZDAlqBHnNpwIJxraEShBRAIgnjM5MDwJ5oyRyOatf8JGS8 WKtIm104CNGWKMyMDidArbO3Pi+lGG3HA+FyA1Vgmk0bK1Dl1JuvfP6dSUpVyrcHHIVsW1JCgKH EiO//m12iMturev2FZkvqpdPJDgSaSnJx5sHNILzUDBqExohP1yDhrllQDpcDTJ2gAl/2s6+qQ0 UN43GTcmoObxS9+LdrMi8PcqMNMSpKsTktx4uCKjhU0e4xMmFbTByrHv3RnoeMogy87yjGrI99C Kt7RnbEVKFXGCdt2YM2QpGgdwjx97tbOd4WmCROtozvyoto= X-Received: by 2002:a05:6a00:244c:b0:736:32d2:aa8e with SMTP id d2e1a72fcca58-73bd11e2657mr12173766b3a.6.1744609174765; Sun, 13 Apr 2025 22:39:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn7VJ6eIeLIMm9PzLG6hpHl2iAVyV5PK5lxeLcxWcuIBZsDVM2GN9Qa3dCL9OP9GsviIFi2Q== X-Received: by 2002:a05:6a00:244c:b0:736:32d2:aa8e with SMTP id d2e1a72fcca58-73bd11e2657mr12173725b3a.6.1744609174056; Sun, 13 Apr 2025 22:39:34 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73bd23332d2sm5824559b3a.159.2025.04.13.22.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Apr 2025 22:39:33 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 14 Apr 2025 11:09:13 +0530 Subject: [PATCH v2 2/3] arm64: qcom: sc7280: Move phy, perst to root port node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250414-perst-v2-2-89247746d755@oss.qualcomm.com> References: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> In-Reply-To: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744609160; l=3200; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=eIQxpFl/4jEJYQ5b8TemHn6+N37yVxaNtRNfPvJkFrQ=; b=TmOVOGQHnW1iB/u3l2guQlBAN+RZnXJw5PDlGeZ/pDJX5oCW3/ej9dGrZUxKMqJIoLUQBllrW VkZqirJ5H29DJ+NPbOrskMI6D8Wevk9qhM+SMu736Uhrj7O11LcONO4 X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: yHaW9JL1orjMTCGE1UHhVA9jiPBngupf X-Proofpoint-ORIG-GUID: yHaW9JL1orjMTCGE1UHhVA9jiPBngupf X-Authority-Analysis: v=2.4 cv=Cve/cm4D c=1 sm=1 tr=0 ts=67fc9f98 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=qQkGquXN9PvF_GGjQ98A:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-14_01,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504140039 Move phy, perst, to root port from the controller node. Rename perst-gpios to reset-gpios to align with the expected naming convention of pci-bus-common.yaml. Signed-off-by: Krishna Chaitanya Chundru --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 5 ++++- arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 5 ++++- arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 5 ++++- arch/arm64/boot/dts/qcom/sc7280.dtsi | 6 ++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index 7a36c90ad4ec8b52f30b22b1621404857d6ef336..3dd58986ad5da0f898537a51715= bb5d0fecbe100 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -709,8 +709,11 @@ &mdss_edp_phy { status =3D "okay"; }; =20 +&pcie1_port0 { + reset-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; +}; + &pcie1 { - perst-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; =20 pinctrl-0 =3D <&pcie1_reset_n>, <&pcie1_wake_n>; pinctrl-names =3D "default"; diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/bo= ot/dts/qcom/sc7280-herobrine.dtsi index 2ba4ea60cb14736c9cfbf9f4a9048f20a4c921f2..ff11d85d015bdab6a90bd8a0eb9= 113a339866953 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi @@ -472,10 +472,13 @@ &pcie1 { pinctrl-names =3D "default"; pinctrl-0 =3D <&pcie1_clkreq_n>, <&ssd_rst_l>, <&pe_wake_odl>; =20 - perst-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; vddpe-3v3-supply =3D <&pp3300_ssd>; }; =20 +&pcie1_port0 { + reset-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; +}; + &pm8350c_pwm { status =3D "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts= /qcom/sc7280-idp.dtsi index 7370aa0dbf0e3f9e7a3e38c3f00686e1d3dcbc9f..3209bb15dfec36299cabae07d34= f3dc82db6de77 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi @@ -414,9 +414,12 @@ &lpass_va_macro { vdd-micb-supply =3D <&vreg_bob>; }; =20 +&pcie1_port0 { + reset-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; +}; + &pcie1 { status =3D "okay"; - perst-gpios =3D <&tlmm 2 GPIO_ACTIVE_LOW>; =20 vddpe-3v3-supply =3D <&nvme_3v3_regulator>; =20 diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qco= m/sc7280.dtsi index 0f2caf36910b65c398c9e03800a8ce0a8a1f8fc7..376fabf3b4eac34d75bb79ef902= c9d83490c45f7 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -2271,9 +2271,6 @@ pcie1: pcie@1c08000 { =20 power-domains =3D <&gcc GCC_PCIE_1_GDSC>; =20 - phys =3D <&pcie1_phy>; - phy-names =3D "pciephy"; - pinctrl-names =3D "default"; pinctrl-0 =3D <&pcie1_clkreq_n>; =20 @@ -2284,7 +2281,7 @@ pcie1: pcie@1c08000 { =20 status =3D "disabled"; =20 - pcie@0 { + pcie1_port0: pcie@0 { device_type =3D "pci"; reg =3D <0x0 0x0 0x0 0x0 0x0>; bus-range =3D <0x01 0xff>; @@ -2292,6 +2289,7 @@ pcie@0 { #address-cells =3D <3>; #size-cells =3D <2>; ranges; + phys =3D <&pcie1_phy>; }; }; =20 --=20 2.34.1 From nobody Fri Dec 19 12:49:47 2025 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 392CD1A315D for ; Mon, 14 Apr 2025 05:39:41 +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=1744609184; cv=none; b=bYfBI25nsQKt77bEPLNOC9xPK9u/B6kCzaoaiGc6c6V649oqPW1uWoq98j8QXGT2WCfauXJz/teSddIL2JcnLj/YooMz+cnSa73nEqkRatjb+YGdaWyINujw/DPsUmnm25r6t8hskWpq2iWDBSwgzHOKX+qGapnsF4dWuZsk/f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744609184; c=relaxed/simple; bh=WC5wKRvcYuSwXR7Izdx25mVC4LSMyYyIUrLgoxUWBas=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AEk80YsK09bp0AcqCXLnv3fHewP4Zywkhn8cXXmkmgkspFR5Rp4NXO2kSJSWbrxQx+7Gq7qZqBrUeVG9EITWelYb15Ckp3MQb4b4iigob+mjShQ2CkYuFmVppHm5dYZXA2BVLdrsh2sT7YTAZtc0k3lIRaow7KrdyniuZ2/4wt4= 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=LvBqoxuv; 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="LvBqoxuv" 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 53DLZuA3014611 for ; Mon, 14 Apr 2025 05:39:41 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= qG2kUNarrqP9lMavMts7qNZl8UluSE4dZqY7JK6NYfE=; b=LvBqoxuvI8ERBn51 JxfazQMKKM16rrYj1km848N82F8uKd4XyvjKF+TZrNDFu1C4JUTHK8Q5FM4U9u0r glZTk5yZu1e4sIJPS5kMkBhFsUlQgZHLCnEuOQcetGl+StgX/zaPuW7aS85N+MDP TturSPY3D6PSUKnFWuqC+XGrlrTapeXgGZ746f9Sk3x+J0Yy+6W9T8pjFi0KRX3H oXmNRhuO3+L5pCdLoZCCXNlHJ2/t+YGmF0PM+MhB2BTurdotL2ihvEMdmH4ZLi48 vZOJrB6Nb9sQA8AOpLDzbBSj9Iu4aEhQ4I0pP2LFwIB60BUHaifZSHmxX9aGquyu hyF54Q== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45yfgjbejh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 14 Apr 2025 05:39:40 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b048d1abbbfso3296706a12.0 for ; Sun, 13 Apr 2025 22:39:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744609179; x=1745213979; 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=qG2kUNarrqP9lMavMts7qNZl8UluSE4dZqY7JK6NYfE=; b=sMPtyywiSvzA1Cwj+cK36w7nuB2qQReeZcbxbWKhRjPJzu7U4T7RAFHGQrVMo034yB 0lONhz1fR+dvpGF4rnlm1ldCw2fX0gqAiOqaWXr/RH1TPRmeIHT+h87C2PmMUQA64vJz 9Xv8nwYvJDfLSCQzpa0j4BtZgobX+K8+xUhoKQGziOHi/TB1d/tsLOPxMj1cPXb592PE XNAHGWZl0DG0B1uitUlUBWUB9QQq8fTi1Ww4XY9YROzlZDhs8sHPtASQJeW9/au321V5 HAJWRms2EHYyR7yNiepB9RxeDSGIzAbVQ8a4NbcAz6awOJLj+lHEI3V1XdX6wWBaOmND N+5Q== X-Forwarded-Encrypted: i=1; AJvYcCULrd9N8IEkJyFh960Dq30hnlhVzRHuQf2mervCC8/4VeTHxDNosTKZM7+MdG9pPzD7c9q8MbrTkRHMteo=@vger.kernel.org X-Gm-Message-State: AOJu0YwIDU3KBpficiBGP4dbEc6Jk914DjkfV/lGz9o7W1Gp54i+PHJj MO1leLUHwonm/LVEqAFEaRqH/ZX51Ht0EFIeDVj6XqZTGmfs8AZkBvYsrS4uES1v4bH77Ybfw3s dfV9vf/WHBPpHqh+x/Kd/SmAdMORLlnwi67EsolWedeO4v8dCpuQklPcVNd9EdQ8= X-Gm-Gg: ASbGncuRWxQJWtHx8gobCbUdUAELBAdEmE/ChDuia3X74vB4zjhQnkwPTPvv/qjzfSL IxJZx0RflrGmd/pFO/Z4tn3lAUqiVCKYUWmhlvKQmdlo/lrAgcwxWdwXHMffXjLXoa/odZLjX8C CPvIkZOmdfhvnAED76g/MI70uoIReEMDnh3M6BNvEpRjhTZweAmEruI2xopH8hMOM+52Ha/fHAO jyeNHhYUn2GQ2J7B+bHNRIqbLtbfftbKDHLFsVg5+LrwbxEwlwrTd5ZbOGJoeDdxlkNNc+GEAzl aQBndPaUfkYToGTBoVZi7qOyLUa2Ja+3tUDPI45mX23vx/4= X-Received: by 2002:a05:6a20:d525:b0:1f5:7873:304b with SMTP id adf61e73a8af0-2017996fbfdmr14224133637.26.1744609179322; Sun, 13 Apr 2025 22:39:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7i2E+yUtPthN8Zj0a3CulLjT99OAsG6h/Rr0m+qBzSGvFBz+WVcNzfzjKGoti/SP51/cpqw== X-Received: by 2002:a05:6a20:d525:b0:1f5:7873:304b with SMTP id adf61e73a8af0-2017996fbfdmr14224088637.26.1744609178723; Sun, 13 Apr 2025 22:39:38 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73bd23332d2sm5824559b3a.159.2025.04.13.22.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Apr 2025 22:39:38 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 14 Apr 2025 11:09:14 +0530 Subject: [PATCH v2 3/3] PCI: qcom: Add support for multi-root port Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250414-perst-v2-3-89247746d755@oss.qualcomm.com> References: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> In-Reply-To: <20250414-perst-v2-0-89247746d755@oss.qualcomm.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , cros-qcom-dts-watchers@chromium.org Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744609160; l=7942; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=WC5wKRvcYuSwXR7Izdx25mVC4LSMyYyIUrLgoxUWBas=; b=Uh3eu8AQrCP/1w+anhue+7slJ8ehb8F7LfDcOmm4ZnKrm4cfNxd7BXpF8rpedC9vXnlU2iBn8 eDeDzkMnvCCCcbuW3sUij6qLXOxPZWSa3XK/BriuEGupc9KF7d7aZ3y X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: Xa9M1WWalSUMOuPvFuh09L7e4bw1WUtm X-Proofpoint-ORIG-GUID: Xa9M1WWalSUMOuPvFuh09L7e4bw1WUtm X-Authority-Analysis: v=2.4 cv=Cve/cm4D c=1 sm=1 tr=0 ts=67fc9f9c cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=XR8D0OoHHMoA:10 a=EUspDBNiAAAA:8 a=KZ4ZsdeBRq2BojHjq4kA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-14_01,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2504140039 Move phy, perst handling to root port and provide a way to have multi-port logic. Currently, qcom controllers only support single port, and all properties are present in the controller node itself. This is incorrect, as properties like phy, perst, wake, etc. can vary per port and should be present in the root port node. pci-bus-common.yaml uses reset-gpios property for representing PERST, use same property instead of perst-gpios. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 149 +++++++++++++++++++++++++++--= ---- 1 file changed, 123 insertions(+), 26 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controlle= r/dwc/pcie-qcom.c index dc98ae63362db0422384b1879a2b9a7dc564d091..5566c8aa7f9a9928c06aa6284ca= 4de21cc411874 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -262,6 +262,11 @@ struct qcom_pcie_cfg { bool no_l0s; }; =20 +struct qcom_pcie_port { + struct list_head list; + struct gpio_desc *reset; + struct phy *phy; +}; struct qcom_pcie { struct dw_pcie *pci; void __iomem *parf; /* DT parf */ @@ -276,21 +281,36 @@ struct qcom_pcie { struct dentry *debugfs; bool suspended; bool use_pm_opp; + struct list_head ports; }; =20 #define to_qcom_pcie(x) dev_get_drvdata((x)->dev) =20 static void qcom_ep_reset_assert(struct qcom_pcie *pcie) { - gpiod_set_value_cansleep(pcie->reset, 1); + struct qcom_pcie_port *port, *tmp; + + if (list_empty(&pcie->ports)) + gpiod_set_value_cansleep(pcie->reset, 1); + else + list_for_each_entry_safe(port, tmp, &pcie->ports, list) + gpiod_set_value_cansleep(port->reset, 1); + usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500); } =20 static void qcom_ep_reset_deassert(struct qcom_pcie *pcie) { + struct qcom_pcie_port *port, *tmp; + /* Ensure that PERST has been asserted for at least 100 ms */ msleep(100); - gpiod_set_value_cansleep(pcie->reset, 0); + if (list_empty(&pcie->ports)) + gpiod_set_value_cansleep(pcie->reset, 0); + else + list_for_each_entry_safe(port, tmp, &pcie->ports, list) + gpiod_set_value_cansleep(port->reset, 0); + usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500); } =20 @@ -1229,10 +1249,19 @@ static int qcom_pcie_link_up(struct dw_pcie *pci) return !!(val & PCI_EXP_LNKSTA_DLLLA); } =20 +static void qcom_pcie_port_phy_off(struct qcom_pcie *pcie) +{ + struct qcom_pcie_port *port, *tmp; + + list_for_each_entry_safe(port, tmp, &pcie->ports, list) + phy_power_off(port->phy); +} + static int qcom_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); struct qcom_pcie *pcie =3D to_qcom_pcie(pci); + struct qcom_pcie_port *port, *tmp; int ret; =20 qcom_ep_reset_assert(pcie); @@ -1241,13 +1270,27 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *p= p) if (ret) return ret; =20 - ret =3D phy_set_mode_ext(pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); - if (ret) - goto err_deinit; + if (list_empty(&pcie->ports)) { + ret =3D phy_set_mode_ext(pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + if (ret) + goto err_deinit; =20 - ret =3D phy_power_on(pcie->phy); - if (ret) - goto err_deinit; + ret =3D phy_power_on(pcie->phy); + if (ret) + goto err_deinit; + } else { + list_for_each_entry_safe(port, tmp, &pcie->ports, list) { + ret =3D phy_set_mode_ext(port->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + if (ret) + goto err_deinit; + + ret =3D phy_power_on(port->phy); + if (ret) { + qcom_pcie_port_phy_off(pcie); + goto err_deinit; + } + } + } =20 if (pcie->cfg->ops->post_init) { ret =3D pcie->cfg->ops->post_init(pcie); @@ -1268,7 +1311,10 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp) err_assert_reset: qcom_ep_reset_assert(pcie); err_disable_phy: - phy_power_off(pcie->phy); + if (list_empty(&pcie->ports)) + phy_power_off(pcie->phy); + else + qcom_pcie_port_phy_off(pcie); err_deinit: pcie->cfg->ops->deinit(pcie); =20 @@ -1281,7 +1327,10 @@ static void qcom_pcie_host_deinit(struct dw_pcie_rp = *pp) struct qcom_pcie *pcie =3D to_qcom_pcie(pci); =20 qcom_ep_reset_assert(pcie); - phy_power_off(pcie->phy); + if (list_empty(&pcie->ports)) + phy_power_off(pcie->phy); + else + qcom_pcie_port_phy_off(pcie); pcie->cfg->ops->deinit(pcie); } =20 @@ -1579,11 +1628,41 @@ static irqreturn_t qcom_pcie_global_irq_thread(int = irq, void *data) return IRQ_HANDLED; } =20 +static int qcom_pcie_parse_port(struct qcom_pcie *pcie, struct device_node= *node) +{ + struct device *dev =3D pcie->pci->dev; + struct qcom_pcie_port *port; + struct gpio_desc *reset; + struct phy *phy; + + reset =3D devm_fwnode_gpiod_get(dev, of_fwnode_handle(node), + "reset", GPIOD_OUT_HIGH, "PERST#"); + if (IS_ERR(reset)) + return PTR_ERR(reset); + + phy =3D devm_of_phy_get(dev, node, NULL); + if (IS_ERR(phy)) + return PTR_ERR(phy); + + port =3D devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); + if (!port) + return -ENOMEM; + + port->reset =3D reset; + port->phy =3D phy; + INIT_LIST_HEAD(&port->list); + list_add_tail(&port->list, &pcie->ports); + + return 0; +} + static int qcom_pcie_probe(struct platform_device *pdev) { const struct qcom_pcie_cfg *pcie_cfg; unsigned long max_freq =3D ULONG_MAX; + struct qcom_pcie_port *port, *tmp; struct device *dev =3D &pdev->dev; + struct device_node *of_port; struct dev_pm_opp *opp; struct qcom_pcie *pcie; struct dw_pcie_rp *pp; @@ -1611,6 +1690,8 @@ static int qcom_pcie_probe(struct platform_device *pd= ev) if (ret < 0) goto err_pm_runtime_put; =20 + INIT_LIST_HEAD(&pcie->ports); + pci->dev =3D dev; pci->ops =3D &dw_pcie_ops; pp =3D &pci->pp; @@ -1619,12 +1700,6 @@ static int qcom_pcie_probe(struct platform_device *p= dev) =20 pcie->cfg =3D pcie_cfg; =20 - pcie->reset =3D devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_HIGH); - if (IS_ERR(pcie->reset)) { - ret =3D PTR_ERR(pcie->reset); - goto err_pm_runtime_put; - } - pcie->parf =3D devm_platform_ioremap_resource_byname(pdev, "parf"); if (IS_ERR(pcie->parf)) { ret =3D PTR_ERR(pcie->parf); @@ -1647,12 +1722,6 @@ static int qcom_pcie_probe(struct platform_device *p= dev) } } =20 - pcie->phy =3D devm_phy_optional_get(dev, "pciephy"); - if (IS_ERR(pcie->phy)) { - ret =3D PTR_ERR(pcie->phy); - goto err_pm_runtime_put; - } - /* OPP table is optional */ ret =3D devm_pm_opp_of_add_table(dev); if (ret && ret !=3D -ENODEV) { @@ -1699,9 +1768,31 @@ static int qcom_pcie_probe(struct platform_device *p= dev) =20 pp->ops =3D &qcom_pcie_dw_ops; =20 - ret =3D phy_init(pcie->phy); - if (ret) - goto err_pm_runtime_put; + for_each_child_of_node(dev->of_node, of_port) { + ret =3D qcom_pcie_parse_port(pcie, of_port); + of_node_put(of_port); + if (ret) + break; + } + + /* Fallback to previous method */ + if (ret) { + pcie->phy =3D devm_phy_optional_get(dev, "pciephy"); + if (IS_ERR(pcie->phy)) { + ret =3D PTR_ERR(pcie->phy); + goto err_pm_runtime_put; + } + + pcie->reset =3D devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_HIGH); + if (IS_ERR(pcie->reset)) { + ret =3D PTR_ERR(pcie->reset); + goto err_pm_runtime_put; + } + + ret =3D phy_init(pcie->phy); + if (ret) + goto err_pm_runtime_put; + } =20 platform_set_drvdata(pdev, pcie); =20 @@ -1746,10 +1837,16 @@ static int qcom_pcie_probe(struct platform_device *= pdev) err_host_deinit: dw_pcie_host_deinit(pp); err_phy_exit: - phy_exit(pcie->phy); + if (list_empty(&pcie->ports)) + phy_exit(pcie->phy); + else + list_for_each_entry_safe(port, tmp, &pcie->ports, list) + phy_exit(port->phy); err_pm_runtime_put: pm_runtime_put(dev); pm_runtime_disable(dev); + list_for_each_entry_safe(port, tmp, &pcie->ports, list) + list_del(&port->list); =20 return ret; } --=20 2.34.1