From nobody Thu Dec 18 23:24:48 2025 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 214B334C81B for ; Wed, 17 Dec 2025 10:13:01 +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=1765966383; cv=none; b=mAjMFj3Njt0OpmDzXUO7xp4t0f6Rfx1bQ8D6YiBH6pNUBsXNEzM+9rJs5QwO1pP63RJdFac0R1N3nlEzvQ8MDgJIyyfAUDVvuT/WVfICkI0ygPQyC4utr4Kw5SjcwAEgPesoVGh2e78ushWwt+lSwp2y/cFG48+xsw8gqodGi2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765966383; c=relaxed/simple; bh=Gd8++hP+sEHWvYF85wgfzJz3jZqyJIvpMUapV4m5Pxo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CgYjbhVlnVQK5STUgDNjcOFOv0XCyIMtTkCJJK3D6y+T0mFgUIGy22HnQAiz0KJznDrzuKFI9djoMn8Jf394rT6fjk2blBNxkHi7hXK5YOk0K0d7Fai1+wqJhZgBbi6heDi+tM609lrwarhdCrHwgkrUyPCC1fEcCbblRqa+Nrc= 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=OSWqEKgK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Kzk+bn4s; 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="OSWqEKgK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Kzk+bn4s" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BH3oY9P1564838 for ; Wed, 17 Dec 2025 10:13:01 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= DbI9CShYiZaHO+aG40g0unn1VlYN2gjoOtFy3f+ystI=; b=OSWqEKgKxWq67rT/ eZO9/sUXTg04FpMYXivSoo9oCoDEdM1C+OeEd+W1+rR3M3LBuWOopN+UsX222jd+ fNx/qavfCaixCj1/7GjzCfO3eVovnML/48PJGZ0VgrhJHpaQzftkK/+b90hCoZPa nFd+ztJ7ZhKtg2lnFD4x4gYoNUiYb+2AO/l74s1C4RjDTBVQ3vYdskYvYf7PmkQp jncrr4QjN2G+uPx5ULQTefqFZAwF5nzg7spFzl2frQEOc7C7eYPcYj/BNrrUOIZs j0rvXC7ODJaRp4mPqoY/lZpYT5/dEnPt3mB+i4U6TzgDP9/cc96V2qI+AbRY9W2C WFavLw== 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 4b3myj16r3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 17 Dec 2025 10:13:01 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-7d5564057d0so15994006b3a.0 for ; Wed, 17 Dec 2025 02:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765966380; x=1766571180; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DbI9CShYiZaHO+aG40g0unn1VlYN2gjoOtFy3f+ystI=; b=Kzk+bn4slAds7OURaHronG63MWr6WkJ33TbBqB/TH2m0R6v1CFmCj2zJeK7BITBY1+ 8380pMdRGLaxcRTZ2joWJf6iE+hpe8+i7DFu9Skit/9KPYOzp5HSW/jrDCSqo2DR7srT V5+S3QF7GjPVITMsHNqTTKmigyEdIr2Qhtr89osXyKp5QxM3qz6EtLjPlZc1QgPvQNcr Cq+NUMKHDB7qxXu0WRBYrYic/gnbE/+OunHd3C1Fbd/DBACH7smj3lyxXYmwdG8iLXKh APav3FMwKvm+cd4paFv+fBNWoUQlytF1zWDZ9BhUUdf0U3Ji82Dd6f5hKTGuvOhTNeGW fMJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765966380; x=1766571180; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=DbI9CShYiZaHO+aG40g0unn1VlYN2gjoOtFy3f+ystI=; b=k2Wn64H0C9A9ggPSEN3MvvSARVQIdJd6Qo4HsGsNLcgKJXahLsuu0Rx2bPD1VOqnv2 GaTaKqzXhsoLp5WFP7j8ep8Xbav/B5ZTeHI4m7b98vt7FC1U3rPfhqpnjUC25ncykWwN O3WnqxQi5Eo8eop61LCd94cHKWSZjOfdFV0gEzpe1HfQlNdF+SwD8cnVY5JR5UlfY98/ MvF/7wgnbxj7assepfcHyXXSb5CMI73uaXOSuudGVU0ep7293wHoTkufAuoRmIHcQ35T JzjT61LS8TVKavpy//TAlvQLBMCYXpgs/LFQsSQgBew7ybkSgn7AOnyboPh+0vzZfUQo y5UQ== X-Forwarded-Encrypted: i=1; AJvYcCWAElVav5E6zoM7qHmmZVMAre25AkMa4HyvDWWi9E1RsiTwlKYTPwzomQY4WshQkme58Zq8dPoEEK+Ybec=@vger.kernel.org X-Gm-Message-State: AOJu0YxBfYQHrYBqQvSOVkXbGJn4qdWqca0qkwrlqlR4L/5ubLc3BjdL 1cGHz5YVw5zUKFBjVPiZOwE1oMgy7XSlWgLHBvwHWLafkGBjuovtddC9bCu5t/W5VIPPmqLdMM1 is7NuXzqU8zk1alDRI7yREB1hHhBX8NvAuSZV4YwNRCnGkCLit4GBt1Dr9SV7amD5QVo= X-Gm-Gg: AY/fxX6N1xcS5ufaIt/yBROhaqj8H36Em3vZ6PGseEJRgU/nFqABckILy52o8vJP5iP OO3e+P4kGQpULLcNvJtjE0aF4OL2jIU+OQHp+/ylaEPxK3DcuxL7xIKPDxKxF8AYIn+vedBv4qu yldrBpXP7gziqk3kxgIijXuD93InlirmG1xN197s92QdkKy8QKARnxchHL6tRriuUUxKhQBTn1Q 6aBj7NO0eeIfppBRqVBo4X5OEbgavk+tGl/24AdsiPCyuBKK0yiKGtwvOJI+/13E3YZNO7oPPET vwFkC8Ypv4bAF9RuCAfgc5Dti3UDdyEMzJ0BAvJc4Ia9koGmtcMjIQ7aI15SJT1cAQdPZhvJDc2 FGhw+I9+uljjmFupfL/IVIKEcWfnT1oE8oJ08PoMCNfE= X-Received: by 2002:a05:6a00:b904:b0:7b9:d7c2:fdf6 with SMTP id d2e1a72fcca58-7f6679326b4mr17691554b3a.24.1765966380416; Wed, 17 Dec 2025 02:13:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOJPvpJakMrPYx2IILb+C4dmNXB0wX4wECr0TslOuJe0fepiMCqz38r++WcJOhF11beVnBhQ== X-Received: by 2002:a05:6a00:b904:b0:7b9:d7c2:fdf6 with SMTP id d2e1a72fcca58-7f6679326b4mr17691541b3a.24.1765966379974; Wed, 17 Dec 2025 02:12:59 -0800 (PST) Received: from hu-msarkar-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7fcbb11ee42sm2290347b3a.43.2025.12.17.02.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 02:12:59 -0800 (PST) From: Mrinmay Sarkar Date: Wed, 17 Dec 2025 15:42:45 +0530 Subject: [PATCH v3 1/2] dt-bindings: PCI: qcom,pcie-ep-sa8255p: Document firmware managed PCIe endpoint 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: <20251217-firmware_managed_ep-v3-1-ff871ba688fb@oss.qualcomm.com> References: <20251217-firmware_managed_ep-v3-0-ff871ba688fb@oss.qualcomm.com> In-Reply-To: <20251217-firmware_managed_ep-v3-0-ff871ba688fb@oss.qualcomm.com> To: Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Krishna Chaitanya Chundru , quic_vbadigan@quicinc.com, quic_shazhuss@quicinc.com, konrad.dybcio@oss.qualcomm.com, Mrinmay sarkar , Rama Krishna , Ayiluri Naga Rashmi , Nitesh Gupta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765966367; l=3868; i=mrinmay.sarkar@oss.qualcomm.com; s=20250423; h=from:subject:message-id; bh=Gd8++hP+sEHWvYF85wgfzJz3jZqyJIvpMUapV4m5Pxo=; b=16hMd/OgLFc5yC/RDd40+Kanmwb7nY0dMrvfkKkHnIa3sa0fbZqjWPRYMqCq60yhc9r6aAch/ PDcC3wol11vDPpq2pd58hbeI8lPfYOTvxCLiyTC6YKsJ/9Bu3ZkaTJx X-Developer-Key: i=mrinmay.sarkar@oss.qualcomm.com; a=ed25519; pk=5D8s0BEkJAotPyAnJ6/qmJBFhCjti/zUi2OMYoferv4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjE3MDA4MSBTYWx0ZWRfXyiMqqzbPln5u YOyB5S/fG24aiMA0SjmVl3qf+JC8LSMPBOIXwmYc3LMl8cHNHddb8KVtk5cdnyfW/Oim8/YJ1eN kvc7XC96WFih4W8+aJxLF9srD5jNLERx/XzhIHDgyTJDr2UO5jhDIpYaUu/8w0DcWvwb3mGcRNJ e3QZQftk7wLE7KPxgJIuVFVOHEUJCCiYGV0+Xuxj0TG0HsAT1f1Op4Ij8X+ugD0wX5GU/wOfpyL TlIkihjrmQ1YWgsTKcBQe/PlxG+EfYZSmQjg3I5lGvUoDumAtGLX5v2QEGHNs+Qp7GDsXWre1wT bgQpjHnFxSwLK3baSdWIqd5LHXmPdZr/mvkEUJ+h+6oG1wBiiCIdlbzMSdIbKK0TEihh666hOGk Qv+6R8OF2O1VYDx1bY9Ur8t2BG2JtQ== X-Proofpoint-ORIG-GUID: TZgknV5c2kWyObqTKzBmS8gIvVV-mkQH X-Authority-Analysis: v=2.4 cv=CtOys34D c=1 sm=1 tr=0 ts=6942822d cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=avnAaoOVoNrTWVjlPhgA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-GUID: TZgknV5c2kWyObqTKzBmS8gIvVV-mkQH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-17_01,2025-12-16_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 impostorscore=0 spamscore=0 phishscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512170081 Document the required configuration to enable the PCIe Endpoint controller on SA8255p which is managed by firmware using power-domain based handling. Signed-off-by: Mrinmay Sarkar --- .../bindings/pci/qcom,pcie-ep-sa8255p.yaml | 110 +++++++++++++++++= ++++ 1 file changed, 110 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-ep-sa8255p.yam= l b/Documentation/devicetree/bindings/pci/qcom,pcie-ep-sa8255p.yaml new file mode 100644 index 0000000000000000000000000000000000000000..395cd23861ec26c00d51299829f= 1c60116293cae --- /dev/null +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-ep-sa8255p.yaml @@ -0,0 +1,110 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/qcom,pcie-ep-sa8255p.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm firmware managed PCIe Endpoint Controller + +description: + Qualcomm SA8255p SoC PCIe endpoint controller is based on the Synopsys + DesignWare PCIe IP which is managed by firmware. + +maintainers: + - Manivannan Sadhasivam + +properties: + compatible: + const: qcom,pcie-ep-sa8255p + + reg: + items: + - description: Qualcomm-specific PARF configuration registers + - description: DesignWare PCIe registers + - description: External local bus interface registers + - description: Address Translation Unit (ATU) registers + - description: Memory region used to map remote RC address space + - description: BAR memory region + - description: DMA register space + + reg-names: + items: + - const: parf + - const: dbi + - const: elbi + - const: atu + - const: addr_space + - const: mmio + - const: dma + + interrupts: + items: + - description: PCIe Global interrupt + - description: PCIe Doorbell interrupt + - description: DMA interrupt + + interrupt-names: + items: + - const: global + - const: doorbell + - const: dma + + iommus: + maxItems: 1 + + reset-gpios: + description: GPIO used as PERST# input signal + maxItems: 1 + + wake-gpios: + description: GPIO used as WAKE# output signal + maxItems: 1 + + power-domains: + maxItems: 1 + + dma-coherent: true + + num-lanes: + default: 2 + +required: + - compatible + - reg + - reg-names + - interrupts + - interrupt-names + - reset-gpios + - power-domains + +additionalProperties: false + +examples: + - | + #include + #include + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + pcie1_ep: pcie-ep@1c10000 { + compatible =3D "qcom,pcie-ep-sa8255p"; + reg =3D <0x0 0x01c10000 0x0 0x3000>, + <0x0 0x60000000 0x0 0xf20>, + <0x0 0x60000f20 0x0 0xa8>, + <0x0 0x60001000 0x0 0x4000>, + <0x0 0x60200000 0x0 0x100000>, + <0x0 0x01c13000 0x0 0x1000>, + <0x0 0x60005000 0x0 0x2000>; + reg-names =3D "parf", "dbi", "elbi", "atu", "addr_space", "mmi= o", "dma"; + interrupts =3D , + , + ; + interrupt-names =3D "global", "doorbell", "dma"; + reset-gpios =3D <&tlmm 4 GPIO_ACTIVE_LOW>; + wake-gpios =3D <&tlmm 5 GPIO_ACTIVE_LOW>; + dma-coherent; + iommus =3D <&pcie_smmu 0x80 0x7f>; + power-domains =3D <&scmi6_pd 1>; + num-lanes =3D <4>; + }; + }; --=20 2.25.1 From nobody Thu Dec 18 23:24:48 2025 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 45E5634D391 for ; Wed, 17 Dec 2025 10:13:08 +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=1765966389; cv=none; b=B412H7duMExW6j2fE9f8RSV5UOHmfzsSis6Ighx4eixQ6A7+z68bxs0zLyj9ZD5vFmUw67r0smSSEIngDmfWqbXV4AS7jrt4U5avAVjJKKx3bTNirKKQbCgb0uz4veU3vLWyaUF4KPKztXCMDrv42JY+uT3PcNmvXqMmJKFM8DQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765966389; c=relaxed/simple; bh=Fyphgpm9oWKQhl4y6fHTvk81D6ocscTgp2cQazg94DE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R6z925zXZ9AvbycSbDARKmRV+uLGbUAPipgxqNnJyPYO03QP77WDQEqoP9b1/dPoZWGx8JcIfDNMH2JfE54gV5pH8TGv4WCfRR4cEscSLEBaKKzOrnfkaS93h/ildf7NvFsE1fK+HRLMnJLpiVEpBGMckPlLGJo5BMzoHGuBar0= 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=igW2HQdU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Vy4u+CHy; 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="igW2HQdU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Vy4u+CHy" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BHA8fAk1500904 for ; Wed, 17 Dec 2025 10:13:07 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= x7/Mz5RzhnX1QZHAKW86jmwpiy8TOBH4L00hU7AiSmY=; b=igW2HQdUnnq0Uezc CnNeb/mkHttd/mGoapD5vo4iy81tvumIbt0y3nOnzc6X8/usfkBMVJR6y7WRSwrW 7RkbbnRTh/o790IQu9kYn1P4HYscG9e2r7ZvVLXcD/Nneg1ltHzlEmglCc/Hw+Tj yLnj6MRPAblUe6J0dRBaABthd2TZioLXd4YViubfZKUDfoNKRSS9M2z4ZGiNM2oJ XEzTdYnubXWXS67PgpNr64gg5SSr0BYivvYoSRvcYKL2luydvfs9gVJZ0g6m9Mua Bnia7SSQiXSv/PvDSvwh/r0rZij1oigyGAADylB0eq3n/w3WnteZYx/cGiXXCqey 9hA5sw== 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 4b3kkesdc7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 17 Dec 2025 10:13:07 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-7b9321b9312so11364363b3a.1 for ; Wed, 17 Dec 2025 02:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765966387; x=1766571187; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=x7/Mz5RzhnX1QZHAKW86jmwpiy8TOBH4L00hU7AiSmY=; b=Vy4u+CHyLlUBZsh1XJnjplbibgBGix6nP6gn8x0PITZbeOJRESIU+wxD3dfada94/C mAAz5M3zP+qjtth+szV1U83rRnObLeMmVtuDJU/GOwFfiVXHB6TQynku5MFEWCF5R2j0 pqbBMaW8xP3+CIcEIXFxttOKho7GBmvOGJAa80V5BPlmDDBZutK9KKM0pAggcqjtra5q CLlXOn+eRioXYeaWHeaX9Ge7pP/L6JoT5SbhQM5phdGzXh9a3XTIoywWRIyUT2OU/Pdl rC+2lj2dFlrHaeWImnzvoJW8EpFzFC4lQMy638qGs6Q5QSAhx3qupo9WXLVix0TKaBh4 zq/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765966387; x=1766571187; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=x7/Mz5RzhnX1QZHAKW86jmwpiy8TOBH4L00hU7AiSmY=; b=GPFcxrcaXIQCc2jK1m+VcmjgAXxPSrG5W6FTML2Sdg3dpoUTyXgWL+b54HjiqEw9V4 AEejmwBqRnWkd/Yg3VwZvCVrEweKufNSI7aobuLm3WVsuvKYF5rrlo5xVoK8BkMnCsWD quTnjMdD9NW21fjJcf6zPV57ZoficD3iOLfeI8DeF680ZMhisweabLF0Xzk3nijLvd+o IW4RneQTkJygSgt8IMBeHQWZaXub7ZJD/UH1VQ50ydv9MLhQRb3TRXopJYFMKL/bptkX e2XdcAhvfCtfMUoLesAZlfulv/9i9BiEWiPrHa0Z/hTH5EZoUoivJWCNfnledCuTOdEd cyJA== X-Forwarded-Encrypted: i=1; AJvYcCXEnsIvX4jJLm4GPdt9niGJrJEpvZEnEk+zKreRdNUmWulfR49Z+PuHSy1P7o7ocJvSV/ND+/yjOJuP11s=@vger.kernel.org X-Gm-Message-State: AOJu0YxLQphbidIY47q9dnvgUClK5cV5zYuS5Q+E5zmVNF7tdUTqS2Tl jeknkzYIZ5lAI333imCDExNs/CpxmE3I+HB9SAvx0A6YPNK7hl2D1BwC0K/aQBjA3mbsKjA3Niq Vpw5Kra41Kvif1n78bhzBOYQRK6ymrkwx143qDiMPHMrn7k2Sz4k1GsDeprmVMvboxIg= X-Gm-Gg: AY/fxX7yQGa/uXCoftub2FVRevXYhyU5Gz8eoyz5eoztT8tVcxeUhdhJLZWXd24Lnrb OYMv24lFXmEFz2I7gKv5VVSTeeAAsBpIvcvHpD0/RAWTBbe2qeIJQSvkieUOaokbIutdhuAEFF1 pnvTHKgRwFyu59fUTfcVraR/VecSz2Niu5sSsEAj5jdT8RuB1R3ce4rAspI+/27XefrIGdmJ+6s hm+62mpVINxSc/rwh93Nb3+eY41N/vMYNQb742j8eyy/0tBK6hryN4d6NRR9sYkpVdxkeMz/3j2 j4e/dg400AKNDk6JI4xTw2iTL9R7KaHg79jbxtLvYZJk4iR53P00NJ3RZebbUdloyUksg9zL25a pULXgyw7Qx0J2noEJsjg7naw2zhL1fJTuiOSVKKjNr5Y= X-Received: by 2002:a05:6a00:1c83:b0:7a2:84f3:cefc with SMTP id d2e1a72fcca58-7f664a1205fmr16964528b3a.0.1765966386584; Wed, 17 Dec 2025 02:13:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0MZ3nmQGGxhARCP3mAJ2zLafaudmhwrnaWUzuRTwlfzQ6fEEDB4xWkBKl1zkgGoKAjQinWw== X-Received: by 2002:a05:6a00:1c83:b0:7a2:84f3:cefc with SMTP id d2e1a72fcca58-7f664a1205fmr16964486b3a.0.1765966386040; Wed, 17 Dec 2025 02:13:06 -0800 (PST) Received: from hu-msarkar-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7fcbb11ee42sm2290347b3a.43.2025.12.17.02.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 02:13:05 -0800 (PST) From: Mrinmay Sarkar Date: Wed, 17 Dec 2025 15:42:46 +0530 Subject: [PATCH v3 2/2] PCI: qcom-ep: Add support for firmware-managed PCIe Endpoint 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: <20251217-firmware_managed_ep-v3-2-ff871ba688fb@oss.qualcomm.com> References: <20251217-firmware_managed_ep-v3-0-ff871ba688fb@oss.qualcomm.com> In-Reply-To: <20251217-firmware_managed_ep-v3-0-ff871ba688fb@oss.qualcomm.com> To: Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Krishna Chaitanya Chundru , quic_vbadigan@quicinc.com, quic_shazhuss@quicinc.com, konrad.dybcio@oss.qualcomm.com, Mrinmay sarkar , Rama Krishna , Ayiluri Naga Rashmi , Nitesh Gupta X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765966367; l=5973; i=mrinmay.sarkar@oss.qualcomm.com; s=20250423; h=from:subject:message-id; bh=Fyphgpm9oWKQhl4y6fHTvk81D6ocscTgp2cQazg94DE=; b=OFGYAIvri6Zs4REOgRs745u+v9BLBtpIFNaodmrNm3Q3TuXb6/VrXfkrW+4awv5TnQRnnsxdt LH06T9egqRnAmWxHOTOnM+jFO/fVLssAJzodkUMjjyLl7MFVuB7pql+ X-Developer-Key: i=mrinmay.sarkar@oss.qualcomm.com; a=ed25519; pk=5D8s0BEkJAotPyAnJ6/qmJBFhCjti/zUi2OMYoferv4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjE3MDA4MSBTYWx0ZWRfXwCePkqimUsEv dmq5ljqOjZnRBp/obdomLk04penu5pEK4TqLukxLXyPLIiO2iVqTzeeXgJYeE3gD7BvYe0mAwTu qRWPQpD/mRrNA79EDYDVwGk2FFA4kEecDIJQAfLdxFI4e2dDKJe8lEcTFnyWmkxa3Xqmoj31EFZ AmkxYbMDfL5vVF7i3TUyYDld7jBcU30WMG/fRePvWD2oCdUhFQzy1XI/17+6f6lOwGItdoD2hJZ NGp2h5FH8gmMz0lJIQO5yBgJz8uZ6Ocy3Jbp4PIgDOwIzj84JI3Yf/YYM3AxvdnSTktzKCNJ9ue z1pmvQyZ4a6bD04/pFfl+C/W696kxjYQRFzD5y+nG3HFHhxi0Gj3A+SrrYqedpxRcsq2ytE0bzA NnYV/NzmVmG0/DlFgWC9sbsmLHL+LA== X-Proofpoint-GUID: GI0x5e7e6IW1_43ymbOtzBs-2dLasz7r X-Authority-Analysis: v=2.4 cv=Fcw6BZ+6 c=1 sm=1 tr=0 ts=69428233 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=2tdM-IJ1x2Ue4swjlzoA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-ORIG-GUID: GI0x5e7e6IW1_43ymbOtzBs-2dLasz7r X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-17_01,2025-12-16_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 phishscore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512170081 Some Qualcomm platforms use firmware to manage PCIe resources such as clocks, resets, and PHY through the SCMI interface. In these cases, the Linux driver should not perform resource enable or disable operations directly. Additionally, runtime PM support has been enabled to ensure proper power state transitions. This commit introduces a `firmware_managed` flag in the Endpoint configuration structure. When set, the driver skips resource handling and uses generic runtime PM calls to let firmware do resource management. A new compatible string is added for SA8255P platforms where firmware manages resources. Signed-off-by: Mrinmay Sarkar --- drivers/pci/controller/dwc/pcie-qcom-ep.c | 82 +++++++++++++++++++++++----= ---- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/contro= ller/dwc/pcie-qcom-ep.c index f1bc0ac81a928b928ab3f8cc7bf82558fc430474..2de8b48511169a9c836828c2286= 0dba45f6c9db8 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -168,11 +168,13 @@ enum qcom_pcie_ep_link_status { * @hdma_support: HDMA support on this SoC * @override_no_snoop: Override NO_SNOOP attribute in TLP to enable cache = snooping * @disable_mhi_ram_parity_check: Disable MHI RAM data parity error check + * @firmware_managed: Set if the Endpoint controller is firmware managed */ struct qcom_pcie_ep_cfg { bool hdma_support; bool override_no_snoop; bool disable_mhi_ram_parity_check; + bool firmware_managed; }; =20 /** @@ -377,10 +379,17 @@ static int qcom_pcie_enable_resources(struct qcom_pci= e_ep *pcie_ep) =20 static void qcom_pcie_disable_resources(struct qcom_pcie_ep *pcie_ep) { - icc_set_bw(pcie_ep->icc_mem, 0, 0); - phy_power_off(pcie_ep->phy); - phy_exit(pcie_ep->phy); - clk_bulk_disable_unprepare(pcie_ep->num_clks, pcie_ep->clks); + struct device *dev =3D pcie_ep->pci.dev; + int ret; + + pm_runtime_put(dev); + + if (!(pcie_ep->cfg && pcie_ep->cfg->firmware_managed)) { + icc_set_bw(pcie_ep->icc_mem, 0, 0); + phy_power_off(pcie_ep->phy); + phy_exit(pcie_ep->phy); + clk_bulk_disable_unprepare(pcie_ep->num_clks, pcie_ep->clks); + } } =20 static int qcom_pcie_perst_deassert(struct dw_pcie *pci) @@ -390,12 +399,22 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *p= ci) u32 val, offset; int ret; =20 - ret =3D qcom_pcie_enable_resources(pcie_ep); - if (ret) { - dev_err(dev, "Failed to enable resources: %d\n", ret); + ret =3D pm_runtime_resume_and_get(dev); + if (ret < 0) { + dev_err(dev, "Failed to enable endpoint device: %d\n", ret); return ret; } =20 + /* Enable resources if Endpoint controller is not firmware-managed */ + if (!(pcie_ep->cfg && pcie_ep->cfg->firmware_managed)) { + ret =3D qcom_pcie_enable_resources(pcie_ep); + if (ret) { + dev_err(dev, "Failed to enable resources: %d\n", ret); + pm_runtime_put(dev); + return ret; + } + } + /* Perform cleanup that requires refclk */ pci_epc_deinit_notify(pci->ep.epc); dw_pcie_ep_cleanup(&pci->ep); @@ -630,16 +649,6 @@ static int qcom_pcie_ep_get_resources(struct platform_= device *pdev, return ret; } =20 - pcie_ep->num_clks =3D devm_clk_bulk_get_all(dev, &pcie_ep->clks); - if (pcie_ep->num_clks < 0) { - dev_err(dev, "Failed to get clocks\n"); - return pcie_ep->num_clks; - } - - pcie_ep->core_reset =3D devm_reset_control_get_exclusive(dev, "core"); - if (IS_ERR(pcie_ep->core_reset)) - return PTR_ERR(pcie_ep->core_reset); - pcie_ep->reset =3D devm_gpiod_get(dev, "reset", GPIOD_IN); if (IS_ERR(pcie_ep->reset)) return PTR_ERR(pcie_ep->reset); @@ -652,9 +661,22 @@ static int qcom_pcie_ep_get_resources(struct platform_= device *pdev, if (IS_ERR(pcie_ep->phy)) ret =3D PTR_ERR(pcie_ep->phy); =20 - pcie_ep->icc_mem =3D devm_of_icc_get(dev, "pcie-mem"); - if (IS_ERR(pcie_ep->icc_mem)) - ret =3D PTR_ERR(pcie_ep->icc_mem); + /* Populate resources if Endpoint controller is not firmware-managed */ + if (!(pcie_ep->cfg && pcie_ep->cfg->firmware_managed)) { + pcie_ep->num_clks =3D devm_clk_bulk_get_all(dev, &pcie_ep->clks); + if (pcie_ep->num_clks < 0) { + dev_err(dev, "Failed to get clocks\n"); + return pcie_ep->num_clks; + } + + pcie_ep->core_reset =3D devm_reset_control_get_exclusive(dev, "core"); + if (IS_ERR(pcie_ep->core_reset)) + return PTR_ERR(pcie_ep->core_reset); + + pcie_ep->icc_mem =3D devm_of_icc_get(dev, "pcie-mem"); + if (IS_ERR(pcie_ep->icc_mem)) + ret =3D PTR_ERR(pcie_ep->icc_mem); + } =20 return ret; } @@ -874,6 +896,12 @@ static int qcom_pcie_ep_probe(struct platform_device *= pdev) =20 platform_set_drvdata(pdev, pcie_ep); =20 + pm_runtime_get_noresume(dev); + pm_runtime_set_active(dev); + ret =3D devm_pm_runtime_enable(dev); + if (ret) + return ret; + ret =3D qcom_pcie_ep_get_resources(pdev, pcie_ep); if (ret) return ret; @@ -894,6 +922,12 @@ static int qcom_pcie_ep_probe(struct platform_device *= pdev) goto err_disable_irqs; } =20 + ret =3D pm_runtime_put_sync(dev); + if (ret < 0) { + dev_err(dev, "Failed to disable endpoint device: %d\n", ret); + goto err_disable_irqs; + } + pcie_ep->debugfs =3D debugfs_create_dir(name, NULL); qcom_pcie_ep_init_debugfs(pcie_ep); =20 @@ -930,7 +964,15 @@ static const struct qcom_pcie_ep_cfg cfg_1_34_0 =3D { .disable_mhi_ram_parity_check =3D true, }; =20 +static const struct qcom_pcie_ep_cfg cfg_1_34_0_fw_managed =3D { + .hdma_support =3D true, + .override_no_snoop =3D true, + .disable_mhi_ram_parity_check =3D true, + .firmware_managed =3D true, +}; + static const struct of_device_id qcom_pcie_ep_match[] =3D { + { .compatible =3D "qcom,pcie-ep-sa8255p", .data =3D &cfg_1_34_0_fw_manage= d}, { .compatible =3D "qcom,sa8775p-pcie-ep", .data =3D &cfg_1_34_0}, { .compatible =3D "qcom,sdx55-pcie-ep", }, { .compatible =3D "qcom,sm8450-pcie-ep", }, --=20 2.25.1