From patchwork Sun Mar 9 05:45:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008068 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 3562B155393 for ; Sun, 9 Mar 2025 05:46:13 +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=1741499175; cv=none; b=pFJxAa7CniiEgVBpNswXWKDs+oyVXg5tULK2QhfG/CJtVf2ypjspJKkQX4OUiu0PkgcZHILveSbB2/wsgOfKZa9I2LCHg6V76pWRdSw/YdgzN9sHf3RX9ppYtnpg7oG4tSn0LNrIei4IN6SaVyRYyq576wP+lQ0GkzsVZ+/tdsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499175; c=relaxed/simple; bh=s3bIi9NJPl7GvWtItHLAYMBhKKwwbJNGn6/L6WX4Qbc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WezydxuCX/7G1ZvoG4+zeKXpAW2BOahgvyaLlU3D3Vyry3vd0bnG0i/SKmMmxCpHSqepvh6UeoM0ctYr2wRTzKsSoB0ni3YwV/KcnajjeKB1vBia7TOUCllCSEKVSb4U7nEPZrfAQy3Gbw5YLvKd79815jVCcQ0hCUW205E3Zcc= 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=Vl3U9mCf; 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="Vl3U9mCf" 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 5295GhIK001478 for ; Sun, 9 Mar 2025 05:46:13 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= XzVhPReZf2sVqu2mJY4+qLpMOX5OmiFM5s04YydtgQI=; b=Vl3U9mCfzSixJZV8 kR4jnHrcp8gWec++MJIW106LNOzBsk//1OBS7FDHsBrn9/bfsgc41OdOvUIcJ4tt pDP5OVCzvLu6l4r8VdwLUnen6X0q91liAAaL2DQbIKit4JwgMmlEmObTLOZsm4fQ 8pcn5ZvgEU1lq/U+y0gj6hKaHPHgJ8E8kAg0654F5PPskMfcMB5vhhkuXbPzJJdL VDMUbjRK/pyaC3iH+g4kbLBmVaGwRcHJBUO8+xitZFPbmNo8zZ3cDmrZ3TF4/Ecu zslgnNWTHKHd8pUaub5RP+/hQ5SDKhcfSQd4d0nisF2PithZQX5E+m5JN6+o8dGU oaxJOQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f0psp1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:12 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-225429696a9so27412055ad.1 for ; Sat, 08 Mar 2025 21:46:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499171; x=1742103971; 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=XzVhPReZf2sVqu2mJY4+qLpMOX5OmiFM5s04YydtgQI=; b=Oj5jM3tAyMelYeMosB0UJ3LZOI2SJILwhFJG8hJ+dRqZ+ZZ7C0RzVIPbblccpuuNfL AMwZny6zqWZYOY7AJ98Cki7oKyahXy+K3Tv0yp+7Wm1I9ITB3674FEOsa1MGCsh3/909 cXIz2ICssHOvJl7BZsFRzFzUXoXoflxkEKI1yNAcQcKqHpKylrOFOcJGLBQu0n+EKlVh vroZZ21ibVMGnrcHWMJBQYNMPPX/lA5tHc8HcNEtGJ8M8Oh4uPorkriPG5vBiRIPYnKr Itmnw7d1UqWAkGUMVcF6qsRelnhEonhJN8neEQ5tqPD+y/d5Ooy0kZUaVBu8gPq86xZ8 XNSw== X-Gm-Message-State: AOJu0Yz29kPz6CQX0uqsi4+pwQpsUD6R50kksrGHXODsdRCqAyuRd1Sn jiSJOOcymAXG4+VPcZI3rZZWR5/eXzXYs0Vw1gezYy/Rv+7yrhHGR32c8ki5AsD+0UvT4p85xqf nX8irbvZ37NkgJjKSza93Rpu4mlLnASlvLLodDIzrffF7HMU++rnQWOYVjCE0AcR/ X-Gm-Gg: ASbGncsfkWo2X8gW1/o6X1ZlBCo4x+CNwjdUvPw8SfplegBbmsQcbFuXlqF2HKuoJCG ZHd6UxUf9ePpEWcaaOFP7tI2w6rG6A0VFkph9JPkzA7h7r6HIRJOppYnadzo3DEhKZkq1Zy4H7r h0M5FhCADR0snGc971QDU5VE2jaWljXIZLoKpn03Uzkksk1MIyFeXTsrBEs4F/uqpWyQ/J+9uyT ZBnOPyrkdG5fqbZkRNYA1gSbev3I/oB078yWIbKCL9CkM688rO0y48+exW4LSrsM1/E/q0sqgM9 GHqZUj3ONfSk/y7tJ/h6SOKFIm9OEX59iwssOLjTW7gmdR8QoXc= X-Received: by 2002:a17:902:f54e:b0:224:7a4:b32 with SMTP id d9443c01a7336-2242888b350mr136722075ad.20.1741499171544; Sat, 08 Mar 2025 21:46:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3bg0rW7rtDWMCRe7tmBqrbNnxpZ6tLtGVRRwzQJbS3AtIPLP74RL7wxV0A3XhS7GK8/O6SA== X-Received: by 2002:a17:902:f54e:b0:224:7a4:b32 with SMTP id d9443c01a7336-2242888b350mr136721835ad.20.1741499171165; Sat, 08 Mar 2025 21:46:11 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:10 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:23 +0530 Subject: [PATCH v5 1/7] arm64: dts: qcom: sc7280: Increase config size to 256MB for ECAM feature Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-1-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=2049; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=s3bIi9NJPl7GvWtItHLAYMBhKKwwbJNGn6/L6WX4Qbc=; b=D5d0uujyVuCC5S5h345Cga8/2HZHU6ubamWgpIroAAj/12dVHqTSHFlUihS3mr6t/tD0bJZaZ EHJVPUsgseAB3dBrih5xvJCxwABnWKNSX2aXGojz+k6jh9+TT5RzUrB X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: gD5JVXZrz2xe3cY9uZ6wgGyGIPxYKxGN X-Authority-Analysis: v=2.4 cv=KK2gDEFo c=1 sm=1 tr=0 ts=67cd2b24 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=3vADZrDGUz89oz24Pk8A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: gD5JVXZrz2xe3cY9uZ6wgGyGIPxYKxGN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=711 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 PCIe ECAM(Enhanced Configuration Access Mechanism) feature requires maximum of 256MB configuration space. To enable this feature increase configuration space size to 256MB. If the config space is increased, the BAR space needs to be truncated as it resides in the same location. To avoid the bar space truncation move config space, DBI, ELBI, iATU to upper PCIe region and use lower PCIe iregion entirely for BAR region. This depends on the commit: '10ba0854c5e6 ("PCI: qcom: Disable mirroring of DBI and iATU register space in BAR region")' Signed-off-by: Krishna Chaitanya Chundru Reviewed-by: Manivannan Sadhasivam Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sc7280.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi index 0f2caf36910b..64c46221d8bf 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -2201,10 +2201,10 @@ wifi: wifi@17a10040 { pcie1: pcie@1c08000 { compatible = "qcom,pcie-sc7280"; reg = <0 0x01c08000 0 0x3000>, - <0 0x40000000 0 0xf1d>, - <0 0x40000f20 0 0xa8>, - <0 0x40001000 0 0x1000>, - <0 0x40100000 0 0x100000>; + <4 0x00000000 0 0xf1d>, + <4 0x00000f20 0 0xa8>, + <4 0x10000000 0 0x1000>, + <4 0x00000000 0 0x10000000>; reg-names = "parf", "dbi", "elbi", "atu", "config"; device_type = "pci"; @@ -2215,8 +2215,8 @@ pcie1: pcie@1c08000 { #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40000000 0x0 0x100000>, + <0x02000000 0x0 0x40100000 0x0 0x40100000 0x0 0x1ff00000>; interrupts = , , From patchwork Sun Mar 9 05:45:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008069 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 0763216A959 for ; Sun, 9 Mar 2025 05:46:19 +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=1741499181; cv=none; b=EOfkIGW+PJjJaBOuOe7Kyc7poKf5FDfDnHPQv4UPqcgQ0zd05Mwz2JpcCMQYRyl3VqPVMo07u/YzV+BGqS7lzdI/RXkrvFPMHNPHqu0e/L+G1hh3h5MP7EcKPpU5WBMzMNHehFejs9xuhDb59V8GIPd1Y8jjy+G4gtXCgzTePl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499181; c=relaxed/simple; bh=6JdyMzO3Asj5w7yUT2KkJzLVL1A/xKSGY1cxjeq4fyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uvb3ZLD9S7wWOqULaffGHo5FPvdFqonwd40MkeeHX+HMwNsOEAgdXj3jCqGMXzdeivSiRCYv6sh2xnrLviDxSzo6RhrWssOEicyXWvyF6vGejWq263V+y2FXXDX5cwHbK31kOrKrlVOV9vk2vjU2+vNrJHanpClPeQeo9Nt3cHk= 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=SwSgHKhB; 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="SwSgHKhB" 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 5292P1GZ022175 for ; Sun, 9 Mar 2025 05:46:19 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= rQFIRDu578o2U4xSBMhmEMESao5IR5GCeI1b9BmxNfc=; b=SwSgHKhBxmllAZ/3 8xUDBFWIrxxp2oC8mrMMIMyfRh/Z8pKiBiG35FKT9T0gWtXowpWNgdmxRYJU6lIi 18nbzLtQkTzVo7ot2aU73wZWp3732EY0RBSEEi09UC8V9lcyqgfXsnyEDelv5Nzn tWGD61Dy+LvWjOKp5RVpUuaiK7qaD7KdjOGdMBZP3a95kLB86bWSVP9PhWhn0Qxb VHPBW47/r7m0ehxe63WtZIWZkwclh/D8IIvMM9L5kjIMVb0J3R/dIwXzMO9da8Nl LfJBEQCuMz1ShKIj7z7gG5bnpmmdEnHWsR9au8IJJIIwyOxmXKIoINJAPNx7JgMx esJXCw== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458ewk1pau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:18 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-2feded265deso5485414a91.2 for ; Sat, 08 Mar 2025 21:46:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499177; x=1742103977; 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=rQFIRDu578o2U4xSBMhmEMESao5IR5GCeI1b9BmxNfc=; b=sHxWx6ndKSm3DU6pmGxeS0vD3NgnAfnYI3F7L5W+uUPRmEil7XWLgAcek0P5mHyz9S tD4vAKhiyuhB8vviTLr9uDmmZRgYRqxLs/vWJjdqpLaJ+pYvw5TQ4ochHg2BYk3oZ8AI AKTfrgP9a8yGIWsIj6wJzqsqE+hVDXJVdCX4JTKApajNSt5lV0JDLfhnVdYBLhv6JiMm uII9CNOmT4+SDLnR0dKDaMNBakKAgEx67trd/M7pXTZBziiUFAvCdIpYs9w5qFBv0jHw LPMv5euky30QgMaNwXLnS0I/4gETbWiq2oAb3caREncopVP60VAmzXPc1TrtF0p/vRm0 u4Mw== X-Gm-Message-State: AOJu0YxgfzTa/0Nqvh5m2zdHwyBG5eIYLW3XyKOSB1I8WGLeSKsH5ZF+ TUPG7IRxqANnQ9aWJ1XHXID9SpXNg63tUz6ZJjG7PDjTax7uPNrAJsAo7v5q9xDvyn0Sjb9sKem LqE4vauKqwdE7xbzgOLGx4E+KPBi8KeH6MeyQZRsQ2pknQWnMeEGjRri6aISQR67g X-Gm-Gg: ASbGncuDBLjCNkWzVWvscyvQGIevBo+8Ea8lV0u5LRatLq9EBDaaOsH1gG4NF8jn4PR RDi6paMnGOH0ZNQ9pBeUAH7KpOs8qs+4sPM4tF3IBfxfSWJPXAGr4sHR3thUjBKJpfCelM8xTvr Vo6DYDcR8yF+/zM6N1w4tgQmYsbtxwjkMeiASM09nchY7MTpwZ6MvoA6aFnJkK74i4kw//9GsO5 X+fTZs+KNq1Gm72yKBoh08qnxeBX50KigLBwaBBRpVzS0v6QLecYn14UGmQobZyZ4//eIqNlqmM YH0j8R4GHmnrSexxeN0yAM5Veoj7nUACZm5FRBryRdeGAJpg7qs= X-Received: by 2002:a17:90b:38c8:b0:2f4:434d:c7f0 with SMTP id 98e67ed59e1d1-2ff7ce6f953mr18165042a91.12.1741499177454; Sat, 08 Mar 2025 21:46:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpXqA038rP5Ggw9FlFgm2R1a8pt/wT19XpVDrbhWVSi8/6/02dn0OjIxmQlm1MEEX4hHMNXg== X-Received: by 2002:a17:90b:38c8:b0:2f4:434d:c7f0 with SMTP id 98e67ed59e1d1-2ff7ce6f953mr18165010a91.12.1741499177081; Sat, 08 Mar 2025 21:46:17 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:16 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:24 +0530 Subject: [PATCH v5 2/7] dt-bindings: PCI: qcom,pcie-sc7280: Make elbi register as an optional Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-2-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=2186; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=6JdyMzO3Asj5w7yUT2KkJzLVL1A/xKSGY1cxjeq4fyQ=; b=wz1RB9CXvA8FGeEILDGOtYlFi4p2TQya48Fiatx6S46kOpMoDY1ohGf+sdniCzvoZ2ws8OA/k hSP+7NLXgblDQqH1P4Qrrnfs+nYUCwlZ/IZcFXRdsO5ve/HfIVR5Zim X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=Tr8chCXh c=1 sm=1 tr=0 ts=67cd2b2a cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=0GabsJuRgD0JYX3L1DcA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: EZtRjuxABiQpdL7MyPcgUf4W2tu4hCyX X-Proofpoint-ORIG-GUID: EZtRjuxABiQpdL7MyPcgUf4W2tu4hCyX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 mlxlogscore=909 spamscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 phishscore=0 malwarescore=0 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 ELBI regitsers are optional registers and not been using in this platform. Having this register as required is not allowing to enable ECAM feature of the PCIe cleanly. ECAM feature needs to do single remap of entire 256MB which includes DBI and ELBI. Having optional ELBI registers in the devicetree and binding is causing resorce conflicts when enabling ECAM feature. So, make ELBI registers as optional one. Suggested-by: Manivannan Sadhasivam Signed-off-by: Krishna Chaitanya Chundru --- Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml index 76cb9fbfd476..326059a59b61 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-sc7280.yaml @@ -19,17 +19,17 @@ properties: const: qcom,pcie-sc7280 reg: - minItems: 5 + minItems: 4 maxItems: 6 reg-names: - minItems: 5 + minItems: 4 items: - const: parf # Qualcomm specific registers - const: dbi # DesignWare PCIe registers - - const: elbi # External local bus interface registers - const: atu # ATU address space - const: config # PCIe configuration space + - const: elbi # External local bus interface registers - const: mhi # MHI registers clocks: @@ -94,10 +94,9 @@ examples: compatible = "qcom,pcie-sc7280"; reg = <0 0x01c08000 0 0x3000>, <0 0x40000000 0 0xf1d>, - <0 0x40000f20 0 0xa8>, <0 0x40001000 0 0x1000>, <0 0x40100000 0 0x100000>; - reg-names = "parf", "dbi", "elbi", "atu", "config"; + reg-names = "parf", "dbi", "atu", "config"; ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; From patchwork Sun Mar 9 05:45:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008070 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 257DF14B092 for ; Sun, 9 Mar 2025 05:46:24 +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=1741499186; cv=none; b=Av6Hwh53Izlkb/TWJPivSFMYl8/jck5XbThFP7mrUasP6Vy0kLamy0kIqajIMeHiYBFXLnPAAo2PfURuqdhYNlki+ix3C/ZdGYI6WEP0UlkNoSFfxNkUL6bp4U9R4Jy8Z/wxDLaxPpTVoLONrZqQV4+v79H0oKuQM/cepKyW5Ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499186; c=relaxed/simple; bh=yzvYS+vDkvHU/sbyPg2yR5foiv1dbD+/nutD89aVNFA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GDXM/TloSyO5i5Nco1s+a+zWuSOFm7m8ZWM6LJH3cdQCoM9rfmtoxvz7lBB79p96jbbp95EJ+GD6BMtjOE74970L5UqJ1D92JHFh7It7tuKmDp1KB+tpKDN1TfSLt7CEncO7uKUAPo68M7emH/OP264NyJGjgdKHpe4Xis0Hu/0= 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=RBwFGUOD; 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="RBwFGUOD" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5294htaj025958 for ; Sun, 9 Mar 2025 05:46:24 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= Xd5/NY/AbI/ojxPiTnWZDegzzMxF2ObPIkWgoHjce9E=; b=RBwFGUODwevnW+uu Rho/gnIs/l+x2KSBcECGgreHHLXiBd51X9KyswSeE8Y9kfZ7jVguE5cCVUxEhWZc h4FtQ/ir/zAoc7Ec8fC683uh0eOKtCrtlkYyP01mNAF8c6ZKue0tMoOS/pA800UX FrF9BuENDn0OWfilECnVVbCjyqTxGlCbrti8efhP3hAla4fJd8z3ILAGgizmmjV2 nyLi2kJXADbGvc4iD8V0TxYcoaIbxzb2zH6tag/Grs0Zc4Il9akjF23E4ZfWzzIb C0kpRBWhngdn2uDzMAVqRSReB0a4VCE+TBrQGVG4C7QGbMe8LJo6+3Gtpy5meirc RaZ4JQ== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f2m9pgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:24 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-224347aef79so40966785ad.2 for ; Sat, 08 Mar 2025 21:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499183; x=1742103983; 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=Xd5/NY/AbI/ojxPiTnWZDegzzMxF2ObPIkWgoHjce9E=; b=P97eOUlktiLYSfycexbpVyXhfYv9Mwc62z6xFoAzNBPcUAiWbiMzqXUKn1TDybu3H4 501rXO3UEkzpUoecURZ3IEodMopDv22AVqvR48PfsiezZvCXVkO6fY6/eOJI2es4eZ4u eGYDX/8V/QMdG9w4Vnyk5lV6LJ1qrs+Vz/Lm2jJ7aiJg/GzXC8tkwrQj9tliXTpJTYHZ i6+3IIOgo9vZEpK6/NJehGcpETGYm0m5S5Ly7evqBFxr+4vS3jpVkSi2EqNXG5iTp6tQ yazMQDhp11vPt2haPHvSFirX0ViMy7Pwe7JIEHIGnjtYBr9Nf6BUjyItC2JbqXCWarCS KKlA== X-Gm-Message-State: AOJu0YwP5lDLyEGysgt1B9g8xHRjuxUvCOQvHze4hA2cfkdr1LxiN5xE noVxhwd5yVkYmbRDDAfQ5CKmngURbYKbbYoaZ3K9Aai+uW3DzWR9GbFKmYFt+0sptbiivaQz5sL AtXa3OJcRf55CvZyJSR+4c6kJe0qKfhZWr5tYxV6/oOfbjkGA2Ao0IDGZOAZBHP6z X-Gm-Gg: ASbGncukRFQjMAnCs3Du3J4TyUfYUSSA79SUA7+NULEIK3SXju83Mb6zYyI5JTKQs4H fRdWAlNASR/eBjRnBuTCIASLWvohubmw3Ftq7cch3m1l6mH8GH2adeq5AmSh76ls7+dCBASgnkv q7Bsf+hn2T8zS+wx8oHjRJEZ/c4oKdkMq+/p+pt2Fia7gy0ViWrpwqTKA01vFglkZcTTsiEF12d vfTdoadvlO+6gmu2YeugU3AoyEZF/55hx9oLMYYMhbXkPfUQKOVwRvIWvoR/+I/++HpYIg+APc6 MxpJfNBE/un1U2UWtswvgbnMPSFWozQ6vo5bu4QctjG1QQMSn+Q= X-Received: by 2002:a17:902:e80a:b0:224:1074:63a0 with SMTP id d9443c01a7336-22428ab7313mr144081915ad.34.1741499183145; Sat, 08 Mar 2025 21:46:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8jQ41ewm8mRMToOvvbPTBKa6DdkpK8KF4isFprAHrCTfOwjmsi4gJjMmDCobS1C6QBUqZ8w== X-Received: by 2002:a17:902:e80a:b0:224:1074:63a0 with SMTP id d9443c01a7336-22428ab7313mr144081455ad.34.1741499182676; Sat, 08 Mar 2025 21:46:22 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:22 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:25 +0530 Subject: [PATCH v5 3/7] arch: arm64: qcom: sc7280: Remove optional elbi register Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-3-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=1000; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=yzvYS+vDkvHU/sbyPg2yR5foiv1dbD+/nutD89aVNFA=; b=8Jt0eDX2uQWxV+tx6Vb6Uv/IKPa3yVlq2Br+SVVptGCggq25ML51gwaCZysbJxBqI6kKh9z6v jaSwx0UM+oNC/wgb374BOelNO2/DLenm+S+c2em+fVjMbatR84eyUZU X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: oIds5T3LBGqkGX-sJmMF0kxWi_KPHpdD X-Proofpoint-ORIG-GUID: oIds5T3LBGqkGX-sJmMF0kxWi_KPHpdD X-Authority-Analysis: v=2.4 cv=ab+bnQot c=1 sm=1 tr=0 ts=67cd2b30 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=bu6UjZ7a5GH_BZZocUYA:9 a=QEXdDO2ut3YA:10 a=DLZpj_5H-hTUFZwOGiJR:22 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=744 priorityscore=1501 lowpriorityscore=0 bulkscore=0 mlxscore=0 impostorscore=0 phishscore=0 clxscore=1015 spamscore=0 adultscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 ELBI registers are optional registers which are not used by this platform. So removing the elbi registers from PCIe node. Signed-off-by: Krishna Chaitanya Chundru --- arch/arm64/boot/dts/qcom/sc7280.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi index 64c46221d8bf..e556285d6b75 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -2202,11 +2202,10 @@ pcie1: pcie@1c08000 { compatible = "qcom,pcie-sc7280"; reg = <0 0x01c08000 0 0x3000>, <4 0x00000000 0 0xf1d>, - <4 0x00000f20 0 0xa8>, <4 0x10000000 0 0x1000>, <4 0x00000000 0 0x10000000>; - reg-names = "parf", "dbi", "elbi", "atu", "config"; + reg-names = "parf", "dbi", "atu", "config"; device_type = "pci"; linux,pci-domain = <1>; bus-range = <0x00 0xff>; From patchwork Sun Mar 9 05:45:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008071 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 8E84B1552FD for ; Sun, 9 Mar 2025 05:46:31 +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=1741499193; cv=none; b=PdFAW6XkoaU3DsU+jtKOjSv8Yw4uxYXkY2ShrSBKBmnjZeUYLa3wRYzZ+CB/egnsUwKSti6He/D4hVzbenhIcBHKJZU6/4YwLFmmDEYpPUPXi6h44X7mb/Ycu5h+BsK7YkD20zimsutkfsrlOBDpGhCvRINw52hUqIEe9ayZaTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499193; c=relaxed/simple; bh=wsREze9ZB4TFdyowJtOMq8dXoF2NzkSuE4x5ZRpejYQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JbFCs3RUFuzsDUloGnjyrDCWN4M4jrTasE8b613Xgk2NJ3YoTc5t/CxAWABvORCWPzO2ziP0bB8cvCLyurc9IFl0CCnilyGN93OOxgfam8oiEYyC68QcTLoMgylKH/xvk//3y+pGQ+rtcqftDzIjQzRUKLb9YMenKEQ1YGGvIyc= 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=DE73tUri; 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="DE73tUri" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5290tgfE020983 for ; Sun, 9 Mar 2025 05:46:30 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= 3EfkY4Hv452ybIcZQDu1ZsQhrhBGarKIBNj23RcC4To=; b=DE73tUriRr7ieO+e 0LOTqB5TJiLyk9/UKDDnNJW3hKcXiA5T2AgjRJOj/gtQLeIwA/D9UVb42fHRz5dW FY18BhoAzbd4a9i9eELK+4H4nMsaMBE3hKGDBYnyNHcoge0uvOZwZNOz6tj1iCWJ ZCAYWWvwfehLclpTzj15+KebIrr1GEpK7xWs6Wjrv5JWNeFXR3L3uKP5tGf87rQ5 n8jLOKzAr/U3lBpMAubhlcaWnqtch9NRJGjF+6bYciIs/OD2mGJR9w+goYUZTtcw /DSttw+Z0N7tKO8tOCH5nBAKPUh8TvehS6wa4R9bzHmiXkW8z7d6eE4oeg2NNPWq TQZuJg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f1jsp9k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:30 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2242f3fd213so27461625ad.1 for ; Sat, 08 Mar 2025 21:46:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499189; x=1742103989; 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=3EfkY4Hv452ybIcZQDu1ZsQhrhBGarKIBNj23RcC4To=; b=aqh2r8IYOsnCWj0nLoor8JGyY5XaumJ5pLtoQRTSK5XSePF2jPnjouuk2xIVz60Svw +rPP0T9qUxZL1kCQsVSIEXvWTN3oIyGiJQddPN8jPdaOgbRmB9kOEks1k/YuN1JIVnWC GMSfyynrpetpa3nHH513YU8wvWysA/zKfPtRM4U/yd3WWdv5bsV7EWkfx1skMS1+f7oF ord0BokK7FymwTz7g/aRrTOKRKnzeh7rJ+faA8rXLqQnm+9oKs7P3HSUziIp1lmYVWSf vHoGlEAUl3FX/9aJ/48YseUmc9oS/woPCbDg039ZpBFfdqAX8rkyMgxnhqlBeE+DmGFx YuNg== X-Gm-Message-State: AOJu0YwhLg+VEgpWbzJ1HhS+tjxyLbfA2k5h7cHHgWAo6KSX2NKlLvWE +er3t9dPMgbfATmZbq7S/perQ1r1O9KSJ6mmIE+/xdpVPAdvHcOOtrinzA+R4ZMC5jmFltRHrQe tbk9jMTpNAf+VZQTyMISjMkKxRk7ML5tsxrSxNM8/3bLan3pVUi2LB2KndpJmlNa4Rmaa7HXN X-Gm-Gg: ASbGncuFUystwXGxbfq/5QhcZSCAB3sYinPOGeEZDqd6IOPCFZyRbAIdTd0ysidBzpq OKkgozvbPbPZ30qCPYIwQMH0XW6u/vzgbfsdppV/0UJ4qonrxphmPVS9hyC4bHqS1X0lKsT+qJl 5eBxRpQF3rszjDLgY8O7uVGCNUCZ6Xm9s2fccNjZIwOzsE2qwjxdrG/ZI3vNv47K3EsuHdvwm6h vHEZ+BiT6RmrEUnBwKxHW6SO4PF8gZjXmBAw917KnvJm8dQhlo+/IE2RN3CIFlMsb6Qz52K/h20 2EUZEfDIVjGqYGqi2uk5LJyVM8gfXKZuVccdjIQiZK6lwi8H8pc= X-Received: by 2002:a17:902:ef48:b0:223:4e54:d2c8 with SMTP id d9443c01a7336-22428a8d1damr159377705ad.21.1741499188767; Sat, 08 Mar 2025 21:46:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtcdtKDb+nmzTQePtl4xsTUPi4gRGltswejf9cFXfLAFAd/iJir52Hd6AeQw6W6iDiwcL4YQ== X-Received: by 2002:a17:902:ef48:b0:223:4e54:d2c8 with SMTP id d9443c01a7336-22428a8d1damr159377425ad.21.1741499188425; Sat, 08 Mar 2025 21:46:28 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:28 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:26 +0530 Subject: [PATCH v5 4/7] PCI: dwc: Add support for ELBI resource mapping Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-4-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=1733; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=wsREze9ZB4TFdyowJtOMq8dXoF2NzkSuE4x5ZRpejYQ=; b=3crrTkeeu1lFVP3OJpn9vRcbyNPD+fSlBlxCr4aL6Y2A/R7na9mB0h3h1kD+h5ws1pvISIKPL UNzx3N5eygBBUkBGfbMjBG0MBfXMZ67rKTYQ2f080kHpXbyfhO8X/XU X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=ctthk04i c=1 sm=1 tr=0 ts=67cd2b36 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=Py5lcOcq67Lbq8UMOfUA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: OVZU0lBzfLKbm5CvUTotzJggG_TcJeCb X-Proofpoint-GUID: OVZU0lBzfLKbm5CvUTotzJggG_TcJeCb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 External Local Bus Interface(ELBI) registers are optional registers in dwc which has vendor specific registers. As these are part of dwc add the mapping support in dwc itself. Suggested-by: Manivannan Sadhasivam Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-designware.c | 9 +++++++++ drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 145e7f579072..874fd31a6079 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -157,6 +157,15 @@ int dw_pcie_get_resources(struct dw_pcie *pci) } } + if (!pci->elbi_base) { + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi"); + if (res) { + pci->elbi_base = devm_ioremap_resource(pci->dev, res); + if (IS_ERR(pci->elbi_base)) + return PTR_ERR(pci->elbi_base); + } + } + /* LLDD is supposed to manually switch the clocks and resets state */ if (dw_pcie_cap_is(pci, REQ_RES)) { ret = dw_pcie_get_clocks(pci); diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 501d9ddfea16..3248318d3edd 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -443,6 +443,7 @@ struct dw_pcie { resource_size_t dbi_phys_addr; void __iomem *dbi_base2; void __iomem *atu_base; + void __iomem *elbi_base; resource_size_t atu_phys_addr; size_t atu_size; u32 num_ib_windows; From patchwork Sun Mar 9 05:45:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008072 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 D5AE918BB8E for ; Sun, 9 Mar 2025 05:46:36 +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=1741499198; cv=none; b=ZqtzerLVz5Roc6pUVwHcfthw34LyQIPbXODi0cgomNMhPj9mXrNfBY4GvhCGXicbUkmrzzeLxQfRHvRjHn7dwaz6OKw+K0xSrKtsXGu9uiJO8F1tJEMHDr9UamrrdUu5tzK5i44SjPSzwSbTbKh38UICvpBMxJvWSJwEfksNcRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499198; c=relaxed/simple; bh=81/vVwFxL0jzMog/n4d85Jse8xDYPZwtnQhVNyZfnLc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Onq8Yj4vDQqzUQCWkjuO/dg8fwEC+kyG/phzTCWq2B08YAxtOjUTnmY2V8qdz/CP8w3qxXMEc33LOswZllS8V74VCXrTorrPfkHcpQmYSKwahoyR8XA7ZKSzhKMcxL0er4pk3+uVHaNu/aRzBf0mIZYZThyDbFHWTWJEDZlKIhc= 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=bPEvttyp; 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="bPEvttyp" 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 5293ptx6002001 for ; Sun, 9 Mar 2025 05:46: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= pmJu0qd08g3DmrbnDHL60bg166tlYVZOyOZzOELvrUY=; b=bPEvttypITU2sbnz JIcS2RnAb7WUN1GaR1VXM33i2zhll4shSM+YY6W8FdSqViQdckFITAaVyNad4g4s 3ey5/FGPKqUtTuGSSccqLRjLiZYSPZYLCVMsMl+WZfHwOz0Vl5XIJuj96GvcN20J XZb8Gw2OjTl8id9F4cx1f9ZS3QSNkc2yu2WUUyCWnyGiChpvdhhDdWNy+x8uLCd1 2ltaDSoL0J3Ufo3JIfURsaCtzLaadoqsBMjsQjmOITJGHLNwLMt4hzhQsUS3BbmS v9xB20QmUZ2kVbhWTtqRldqHVL06VU5yoMbYeCxRy4kVRuzGUQit0b/QML+Na42L NH3KMg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458ewk1pbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:35 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2240a96112fso97278605ad.2 for ; Sat, 08 Mar 2025 21:46:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499194; x=1742103994; 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=pmJu0qd08g3DmrbnDHL60bg166tlYVZOyOZzOELvrUY=; b=GnmKBF1UKCKixXKGCcVJiVmw8gkrCofKXTq0hispRBeK3MsF+r9m9A/RQ1xy5NsicO pEe17tLVDnzeBLfgMJy9jEUh4fsxaQ6Z1rCL8BM4VKvhO/8d2RD/P/ZXS7vcXJiSK0CP MNVFZFeZtdi5Zx6aNttk+x6M0JV6WmpWueeboeiVNOrTlYyknOLqn/NSHiGRwyzdA2L7 mrJ3wos9iJ66am2z4spiq4s6PHcYFJ/1snzjJ3h6G5IGjUcVlP0dvQclopdTaXi8CRWl 13jUmiu0ryc3ig2/RfN/BU8pLdCyc2NKNd/WcHzlHspsoM7cOhtv9ZO6KMMvAYvBJD2G tqAg== X-Gm-Message-State: AOJu0YxaZdXI0qoDbiuBh+H8YWmMkVq28KKqsDtymOSU+bEk3JDu0DuQ FnuB++TvUkIPpyq6k/5XiRB/816uAC3hw1RR4GbJI+LEB7YiaTYtXmKgFNgTq8enmDjn3/p/9gq EXjhjbNR427yBuZGGgeWWtR3EZfrLxN9CdbfDIsD8Lkk5n99+It45gmVrjRK/brdF X-Gm-Gg: ASbGncuf8DGkwEc2U3gG5tDkpFmzMXRaAQU9ZoHbiQ0h96PxjPUxjmGF2SqAOKg/lcx sfNRMWwYRzp6Xq3ZXkLtWBOZ6NQlBvMQ54Se8S15CKc4oWFjYEIjYFAl7dww9HZVe4N1U4f1cZt K6ot2YE5ymHISj87Y7dBI6aH1z4uNRTh8IaIbEshO1rTr2tDEAr+zjiwDZZ38ma9Z24dZKWMyik 6msphHR9LJCw69ZKe/v5Aik4o6JocNDKfu+7/olWDSQqP7/v9ZXZjFc7ZP30kp/f6gqDuCNygVw sh/Kt7SNWgRz8R8896q3RjEmli/wd+jSNU3F9bcxVlla8eOqd70= X-Received: by 2002:a17:902:db10:b0:224:1781:a947 with SMTP id d9443c01a7336-2242888b368mr147417025ad.21.1741499194488; Sat, 08 Mar 2025 21:46:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7EqKmUifl9FiLpfhqKC/uUfxlqltaoAzqT42NnpiPzcFpgEY/tC7+mzwKbOuhT/JXR1Txmg== X-Received: by 2002:a17:902:db10:b0:224:1781:a947 with SMTP id d9443c01a7336-2242888b368mr147416695ad.21.1741499194106; Sat, 08 Mar 2025 21:46:34 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:33 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:27 +0530 Subject: [PATCH v5 5/7] PCI: dwc: qcom: Switch to dwc ELBI resource mapping Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-5-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=1711; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=81/vVwFxL0jzMog/n4d85Jse8xDYPZwtnQhVNyZfnLc=; b=5Nj3POrnmw0KGBcZAiS3fq/7pcfbYlbtjwpf+jPF6NHYKQNPqP+dHtc2CB5cHGdYhEE42fYWe UyHf/UoRTsdBTT3x1jjF+JoBsUpnFzFcM6+/qekAiSV/7DuiWjZ87VP X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=Tr8chCXh c=1 sm=1 tr=0 ts=67cd2b3b cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=Py5lcOcq67Lbq8UMOfUA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-GUID: Ca1ysoXE74beo6poS_YdVMwMkQiz0S2m X-Proofpoint-ORIG-GUID: Ca1ysoXE74beo6poS_YdVMwMkQiz0S2m X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 phishscore=0 malwarescore=0 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 Instead of using qcom ELBI resources mapping use dwc mapping as this ELBI is dwc specific. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index e4d3366ead1f..258b2d615080 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -265,7 +265,6 @@ struct qcom_pcie_cfg { struct qcom_pcie { struct dw_pcie *pci; void __iomem *parf; /* DT parf */ - void __iomem *elbi; /* DT elbi */ void __iomem *mhi; union qcom_pcie_resources res; struct phy *phy; @@ -390,12 +389,13 @@ static void qcom_pcie_configure_dbi_atu_base(struct qcom_pcie *pcie) static void qcom_pcie_2_1_0_ltssm_enable(struct qcom_pcie *pcie) { + struct dw_pcie *pci = pcie->pci; u32 val; /* enable link training */ - val = readl(pcie->elbi + ELBI_SYS_CTRL); + val = readl(pci->elbi_base + ELBI_SYS_CTRL); val |= ELBI_SYS_CTRL_LT_ENABLE; - writel(val, pcie->elbi + ELBI_SYS_CTRL); + writel(val, pci->elbi_base + ELBI_SYS_CTRL); } static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie) @@ -1631,12 +1631,6 @@ static int qcom_pcie_probe(struct platform_device *pdev) goto err_pm_runtime_put; } - pcie->elbi = devm_platform_ioremap_resource_byname(pdev, "elbi"); - if (IS_ERR(pcie->elbi)) { - ret = PTR_ERR(pcie->elbi); - goto err_pm_runtime_put; - } - /* MHI region is optional */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mhi"); if (res) { From patchwork Sun Mar 9 05:45:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008073 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 D67B815749F for ; Sun, 9 Mar 2025 05:46:41 +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=1741499204; cv=none; b=X0UmooPnTz9rSYExopAjop4u22V7pv5qRhTYQwBfnMdNNTIs0p/MJlhxNl/U//NI+LucSRALmEh8rdpdMqh/EU5Vw+9nZTJol6xmeuCe4+g41FlDI7B7kg1aDaa3QKP391YTF5xcSxKNp94lQ+uumXsUgfq0nN7j46n4YfGhrww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499204; c=relaxed/simple; bh=Bx1t0hfsGiAmrm8Fa7aaRx3xbxwLUMJF01etPMnFL30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ajGoOnLC3Y3oG5J3HwiEmDll2Lqo9K0VIMpYnyC0V/yGo+7R8QgxnTqTvwdwcp8vEUY/pCXVJv4PrMndgum/9g+pKn9Nn5TwAfWNwpfnnWmT7if4snqjPlD59YEzPBLC0ZrROvNSBOKYphHSRmpqp0asQ88Jot6tKeZKgvuH/gI= 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=BJu5Or+T; 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="BJu5Or+T" 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 5294ocBx030515 for ; Sun, 9 Mar 2025 05:46: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= ysw+/4cUgDm4Un26mav5TFbRZXEfDz+iSejLiz1ojR8=; b=BJu5Or+TdkDUYlrU u7rm7rJnYlt+hA9RDsAempitukSGLrJP6hcRxthvrzSnJZz6vsQ+1B3zBOr0lYIO uJpAIf8x2cxgw34B85nz+ZYeRyzbJr9sW7oJKbosznixYkC2uCJcD2jTqf5vC3tf 3b42y0/bPJOSZaZepCM7ZiAhwowRRlewgA6wDLcr90NCX12Ch4x75BsXII+flAUD m0HaiKEwNufFH8D4+pMkr+sngSkd6YMkMPKNtehg4yXefijkSwzLHL2nW//VS83z GnQmjdN9Gg46uvQF7WnFnzJf+aU3xUL4nwMS+p5A2wdRpFlfLxtI3/LpTKNhzGNs a/l6gw== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458eyp9p6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:41 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-22410b910b0so43042785ad.2 for ; Sat, 08 Mar 2025 21:46:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499200; x=1742104000; 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=ysw+/4cUgDm4Un26mav5TFbRZXEfDz+iSejLiz1ojR8=; b=snpim+YdKaWlwUcnToaw1M4nExxYX9Gg6Mx4m6nfE1EwhFojxRyVDCm0+Dx0nSmgL2 VQROOz+j5O6h1BeH23ijec/UBL/NGlgvFHQrc7XktLOqeTgJpVPmiwFXycOIRJhD77GW RgkdmGiZXINF9cva6y2cbCzD/6X2lZeR8SUR1ooDssXTzyPvfP8gCnmS5FfEJNJExFBZ 66NjofYXmImjZfWm19Yyk+Xw467LxXke96q8rpqPpibSpCatyhkkXKyfhNIffpjZjWMK u84r5Rx2xvKFBr0oXkKLD4THYKfnFNE9RrbLKaZ+RypQXjuwVADAzSdGsmiaXFfF4/3a 7ukQ== X-Gm-Message-State: AOJu0Yw9XCBMPEWtSMcNfNyHfnLFgKGRtCaTOmrHTf8bjJ4YXp/Vg5uX cwyWsvsDq5GP0y8uA8A6oM6c2PsMNxPJiGZokWtqJRCxXgJG4OP2xTjr6MLlokxbYUrWx9ixj3A aOAsQ/QBANCZj/H7AP40zpKM9KyEgLpu1c6jeYJymN+X7DMtMRWIPOvDWuZ+TWhIz X-Gm-Gg: ASbGncvw1jNSqht4Z0+ci1RIvEiNCvOprS/D4W27XT9MjpYhpjrXbhyALH++4wS3LMg bUiJHaYMN8pUoInlBQe1+gW0VBARyY5CDqh6vtfZIiX60dJ7+MOrONNi2Ch2DSAlaxnCFhN13pM xmwO5otCKmgOgxSrpYhbKIA05kY2550ibMuYGNaU2DHljYBvNLqGxms2Eh1ZXicTTf2pHcgDjzz zZldG+nyoPve1RcIUzZ62vBVl6Oena1vcsL4agZAoAoPrSEXlm4OpD4qBwW9iinrMnJXaS+7zFI XsWu+MvXEfC16hY45yU/IGFr/KvOBQ0l1hHurX7Xy7xoVDug3dE= X-Received: by 2002:a17:902:d488:b0:21f:45d:21fb with SMTP id d9443c01a7336-22428881ee4mr135683645ad.3.1741499200106; Sat, 08 Mar 2025 21:46:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnyZN5VF7RcK4zybJvdGFZyYz3lOgTxL2YII1Ju6xlSqSAKMx97LQuwVDQJlMHh/criQJoMQ== X-Received: by 2002:a17:902:d488:b0:21f:45d:21fb with SMTP id d9443c01a7336-22428881ee4mr135683455ad.3.1741499199685; Sat, 08 Mar 2025 21:46:39 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:39 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:28 +0530 Subject: [PATCH v5 6/7] PCI: dwc: Add ECAM support with iATU configuration Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-6-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=9239; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=Bx1t0hfsGiAmrm8Fa7aaRx3xbxwLUMJF01etPMnFL30=; b=qWQ5Pex/vR+t1LH4r7N0A7IOcpK6WPN87zPPAVGK6r0BXePVxRVzuuRDFkmFlHUzLrgWJj/AD AtThaqwVgZQAfMgYb+JMAQ2TE18b2obmUhUZdhT3pEaUsGOIxZcFGt2 X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=A9yWP7WG c=1 sm=1 tr=0 ts=67cd2b41 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=d_4vt3V0DEEF9yyfqS0A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: KpnbZErxNDBF2zcA9KVNhGeoOrxVghFd X-Proofpoint-GUID: KpnbZErxNDBF2zcA9KVNhGeoOrxVghFd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 impostorscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 The current implementation requires iATU for every configuration space access which increases latency & cpu utilization. Designware databook 5.20a, section 3.10.10.3 says about CFG Shift Feature, which shifts/maps the BDF (bits [31:16] of the third header DWORD, which would be matched against the Base and Limit addresses) of the incoming CfgRd0/CfgWr0 down to bits[27:12]of the translated address. Configuring iATU in config shift feature enables ECAM feature to access the config space, which avoids iATU configuration for every config access. Add "ctrl2" into struct dw_pcie_ob_atu_cfg to enable config shift feature. As DBI comes under config space, this avoids remapping of DBI space separately. Instead, it uses the mapped config space address returned from ECAM initialization. Change the order of dw_pcie_get_resources() execution to achieve this. Enable the ECAM feature if the config space size is equal to size required to represent number of buses in the bus range property. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/Kconfig | 1 + drivers/pci/controller/dwc/pcie-designware-host.c | 134 +++++++++++++++++++--- drivers/pci/controller/dwc/pcie-designware.c | 2 +- drivers/pci/controller/dwc/pcie-designware.h | 5 + 4 files changed, 124 insertions(+), 18 deletions(-) diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig index b6d6778b0698..73c3aed6b60a 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig @@ -9,6 +9,7 @@ config PCIE_DW config PCIE_DW_HOST bool select PCIE_DW + select PCI_HOST_COMMON config PCIE_DW_EP bool diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index ffaded8f2df7..4433ae3a0dfa 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -418,6 +418,81 @@ static void dw_pcie_host_request_msg_tlp_res(struct dw_pcie_rp *pp) } } +static int dw_pcie_config_ecam_iatu(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct dw_pcie_ob_atu_cfg atu = {0}; + resource_size_t bus_range_max; + struct resource_entry *bus; + int ret; + + bus = resource_list_first_type(&pp->bridge->windows, IORESOURCE_BUS); + + /* + * Root bus under the host bridge doesn't require any iATU configuration + * as DBI region will be used to access root bus config space. + * Immediate bus under Root Bus, needs type 0 iATU configuration and + * remaining buses need type 1 iATU configuration. + */ + atu.index = 0; + atu.type = PCIE_ATU_TYPE_CFG0; + atu.cpu_addr = pp->cfg0_base + SZ_1M; + /* 1MiB is to cover 1 (bus) * 32 (devices) * 8 (functions) */ + atu.size = SZ_1M; + atu.ctrl2 = PCIE_ATU_CFG_SHIFT_MODE_ENABLE; + ret = dw_pcie_prog_outbound_atu(pci, &atu); + if (ret) + return ret; + + bus_range_max = resource_size(bus->res); + + if (bus_range_max < 2) + return 0; + + /* Configure remaining buses in type 1 iATU configuration */ + atu.index = 1; + atu.type = PCIE_ATU_TYPE_CFG1; + atu.cpu_addr = pp->cfg0_base + SZ_2M; + atu.size = (SZ_1M * bus_range_max) - SZ_2M; + atu.ctrl2 = PCIE_ATU_CFG_SHIFT_MODE_ENABLE; + + return dw_pcie_prog_outbound_atu(pci, &atu); +} + +static int dw_pcie_create_ecam_window(struct dw_pcie_rp *pp, struct resource *res) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct device *dev = pci->dev; + struct resource_entry *bus; + + bus = resource_list_first_type(&pp->bridge->windows, IORESOURCE_BUS); + if (!bus) + return -ENODEV; + + pp->cfg = pci_ecam_create(dev, res, bus->res, &pci_generic_ecam_ops); + if (IS_ERR(pp->cfg)) + return PTR_ERR(pp->cfg); + + pci->dbi_base = pp->cfg->win; + pci->dbi_phys_addr = res->start; + + return 0; +} + +static bool dw_pcie_ecam_supported(struct dw_pcie_rp *pp, struct resource *config_res) +{ + struct resource *bus_range; + u64 nr_buses; + + bus_range = resource_list_first_type(&pp->bridge->windows, IORESOURCE_BUS)->res; + if (!bus_range) + return false; + + nr_buses = resource_size(config_res) >> PCIE_ECAM_BUS_SHIFT; + + return !!(nr_buses >= resource_size(bus_range)); +} + int dw_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); @@ -431,9 +506,11 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) raw_spin_lock_init(&pp->lock); - ret = dw_pcie_get_resources(pci); - if (ret) - return ret; + bridge = devm_pci_alloc_host_bridge(dev, 0); + if (!bridge) + return -ENOMEM; + + pp->bridge = bridge; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "config"); if (!res) { @@ -444,15 +521,29 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) pp->cfg0_size = resource_size(res); pp->cfg0_base = res->start; - pp->va_cfg0_base = devm_pci_remap_cfg_resource(dev, res); - if (IS_ERR(pp->va_cfg0_base)) - return PTR_ERR(pp->va_cfg0_base); + pp->ecam_mode = dw_pcie_ecam_supported(pp, res); + if (pp->ecam_mode) { + ret = dw_pcie_create_ecam_window(pp, res); + if (ret) + return ret; - bridge = devm_pci_alloc_host_bridge(dev, 0); - if (!bridge) - return -ENOMEM; + bridge->ops = (struct pci_ops *)&pci_generic_ecam_ops.pci_ops; + pp->bridge->sysdata = pp->cfg; + pp->cfg->priv = pp; + } else { + pp->va_cfg0_base = devm_pci_remap_cfg_resource(dev, res); + if (IS_ERR(pp->va_cfg0_base)) + return PTR_ERR(pp->va_cfg0_base); + + /* Set default bus ops */ + bridge->ops = &dw_pcie_ops; + bridge->child_ops = &dw_child_pcie_ops; + bridge->sysdata = pp; + } - pp->bridge = bridge; + ret = dw_pcie_get_resources(pci); + if (ret) + return ret; /* Get the I/O range from DT */ win = resource_list_first_type(&bridge->windows, IORESOURCE_IO); @@ -462,14 +553,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) pp->io_base = pci_pio_to_address(win->res->start); } - /* Set default bus ops */ - bridge->ops = &dw_pcie_ops; - bridge->child_ops = &dw_child_pcie_ops; - if (pp->ops->init) { ret = pp->ops->init(pp); if (ret) - return ret; + goto err_free_ecam; } if (pci_msi_enabled()) { @@ -504,6 +591,14 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) dw_pcie_iatu_detect(pci); + if (pp->ecam_mode) { + ret = dw_pcie_config_ecam_iatu(pp); + if (ret) { + dev_err(dev, "Failed to configure iATU in ECAM mode\n"); + goto err_free_msi; + } + } + /* * Allocate the resource for MSG TLP before programming the iATU * outbound window in dw_pcie_setup_rc(). Since the allocation depends @@ -539,8 +634,6 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) /* Ignore errors, the link may come up later */ dw_pcie_wait_for_link(pci); - bridge->sysdata = pp; - ret = pci_host_probe(bridge); if (ret) goto err_stop_link; @@ -564,6 +657,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) if (pp->ops->deinit) pp->ops->deinit(pp); +err_free_ecam: + if (pp->cfg) + pci_ecam_free(pp->cfg); + return ret; } EXPORT_SYMBOL_GPL(dw_pcie_host_init); @@ -584,6 +681,9 @@ void dw_pcie_host_deinit(struct dw_pcie_rp *pp) if (pp->ops->deinit) pp->ops->deinit(pp); + + if (pp->cfg) + pci_ecam_free(pp->cfg); } EXPORT_SYMBOL_GPL(dw_pcie_host_deinit); diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 874fd31a6079..3dd9406edce4 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -518,7 +518,7 @@ int dw_pcie_prog_outbound_atu(struct dw_pcie *pci, val = dw_pcie_enable_ecrc(val); dw_pcie_writel_atu_ob(pci, atu->index, PCIE_ATU_REGION_CTRL1, val); - val = PCIE_ATU_ENABLE; + val = PCIE_ATU_ENABLE | atu->ctrl2; if (atu->type == PCIE_ATU_TYPE_MSG) { /* The data-less messages only for now */ val |= PCIE_ATU_INHIBIT_PAYLOAD | atu->code; diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 3248318d3edd..6c95c36e3b0b 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -171,6 +172,7 @@ #define PCIE_ATU_REGION_CTRL2 0x004 #define PCIE_ATU_ENABLE BIT(31) #define PCIE_ATU_BAR_MODE_ENABLE BIT(30) +#define PCIE_ATU_CFG_SHIFT_MODE_ENABLE BIT(28) #define PCIE_ATU_INHIBIT_PAYLOAD BIT(22) #define PCIE_ATU_FUNC_NUM_MATCH_EN BIT(19) #define PCIE_ATU_LOWER_BASE 0x008 @@ -343,6 +345,7 @@ struct dw_pcie_ob_atu_cfg { u8 func_no; u8 code; u8 routing; + u32 ctrl2; u64 cpu_addr; u64 pci_addr; u64 size; @@ -381,6 +384,8 @@ struct dw_pcie_rp { int msg_atu_index; struct resource *msg_res; bool use_linkup_irq; + bool ecam_mode; + struct pci_config_window *cfg; }; struct dw_pcie_ep_ops { From patchwork Sun Mar 9 05:45:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Chaitanya Chundru X-Patchwork-Id: 14008074 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 89A2B1624C3 for ; Sun, 9 Mar 2025 05:46:47 +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=1741499209; cv=none; b=KqRux0jcbJcnoGtCULIYZj8CiWRX9k51tX3aoC9/SK+p7XL63cGn2B7PwPhcv/lSUdhzHTgv1uS/2NxzJbUgeLhYrXm9TJQA5G8nV5O/r0w0E2++6L1l+9idXw6WwqjnLSab11ZTFlrOOMDmpdO2yk90QFtHNaLoqtjJH43evfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741499209; c=relaxed/simple; bh=sEcZFHTUzdOTAZzu2vqRCbTaZ+x+54x0/4maTU/qWnM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WIoRBWvkUbIv4riztA2grJ9vQP7ApXoAvvB0Bvi/A2ygO1Kx9SSxWl2N0kghEycnpFrgzXtUARAJPpTFbB3j9XaG5Rro7FlaVNKcOsNirKtEIbxrUGKq6/kWN0F0ZHO7hufP0q/xZTRctzRDhsrjakQZCw3AZf6yBpa7dfVjiGk= 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=JwBv9OAw; 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="JwBv9OAw" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5294mqP9027967 for ; Sun, 9 Mar 2025 05:46:46 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= bQX8qVQEqQwhroXZXpd1fC1SeUQiRpTsY8ImuDvpfek=; b=JwBv9OAwYBqAbAXa J9ik5yUQYDWMdb4cRB6P2s5sr2MvIq3R/W5pXLC6VXunW48SNK6AjMQ0mp92CJuD t1Rv8UFLgAfdH6NgYL/C/CZ0i2XeRa5XZapC5oC48/oR3a4GyQX57QA5CtgNmmW0 WPOZaKL56znzmzjmCwY4JBS84N1RwP0Sfx2sbbRzyFcYekoTRvV2OQsmXF6pPUAB BYxgEROR6KHE2Gok7dYnVzg3Y7f9ifRCoUNeTJ6wesC7IOYGhDNn8+Pf5fW+rBlq eTqxVdUPbHCDe4w17tXG9T+DkaAjQwjahRnJ/wKInZxvWaR9xaOe23P37U7igyc3 XxEzYQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f0w1pcr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 09 Mar 2025 05:46:46 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-22410b910b0so43043445ad.2 for ; Sat, 08 Mar 2025 21:46:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741499206; x=1742104006; 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=bQX8qVQEqQwhroXZXpd1fC1SeUQiRpTsY8ImuDvpfek=; b=p49jCA+aiehjeqb3cfyvxiFd1JJT68/wvWEMKC3GCWwgSoIvPOw3Y7ygmH61/gj/UQ jbdFDI4OYXqfx19u9CZpPy8NIdbkdkyxGeGKW9JYG4r7Yn6JT9RiO0SJ6HLtD0iuZSqp yk8N03ChcJTqQr4f5ByGMGD7w5AfOrSLP1Fau/4WRJzXhLvbE6I8KSdEoZQVGPE36TkP +3XxbDhq6xcHeIJj1ekDRaH1zio3VZcEdF6nExG1sKZWvWNlFQ3aaBugFjv2grZSfyPN njJ0IDQDW2EJ2Imw2Duj5G5gOZiBuk+bvJrMftbEpXlcIlL6zJ3HBilZ+fG58sQEV6HX bdFA== X-Gm-Message-State: AOJu0YwbiZWKqMcAne8/4cgbQA/6EBvBuEwK5lf9dQ4bKMZmpIIf0p4Q KESYJ3sOT9F9KE5a4SbNjII1nGLmBKstktGthV0X5clczED8eTBBrcrPWFEhrPzroc426rWEJXD QULXn/wOSRGUUewJqpb2JBkHcprgPKbXnDMJT92rFOqgwX6H54gioJJPBSEAt5s2+ X-Gm-Gg: ASbGncsVmcW7gsFv/yMIaqNxxu+ScJ5eUYMyDRsw194J54LVIw/JNQf03u3NDtp1D0L 6VSO2IpKC5ctKSuY3ZcFfljGCk26kbtcZnogerH/ePCC9PlAmuzR1aj0rZ0+X+ZkTQb4FOF2WR1 46t12vGVXgJcvdFDRSSu+DBnLOZSvm8mKgEsfJDEC7xHC+xDUBQrDW6uzXIX3iS7lsaXLpl8ga7 qnO33Nvu61lOqLsszqj0oyRfWPFnZkqM6aoXTOijlqYB228IIm4lanJyIyBX5pYXun/EqTZgL2J pV8QVr0ysPq7BUfm1Ldt8rfHhEhhPpYUPOdAZuIclIW7QaqgWj8= X-Received: by 2002:a17:902:da84:b0:224:10a2:cae7 with SMTP id d9443c01a7336-22428c057cemr176810995ad.40.1741499205687; Sat, 08 Mar 2025 21:46:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IECJeYnA+nsUD+o/eqnm4QtvsRdhmKFL8Q+7mFkXSS4GdY8aPxKPCskNUDwUo9BRavJxDnd1g== X-Received: by 2002:a17:902:da84:b0:224:10a2:cae7 with SMTP id d9443c01a7336-22428c057cemr176810675ad.40.1741499205331; Sat, 08 Mar 2025 21:46:45 -0800 (PST) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-224109ddbe7sm54887145ad.32.2025.03.08.21.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Mar 2025 21:46:44 -0800 (PST) From: Krishna Chaitanya Chundru Date: Sun, 09 Mar 2025 11:15:29 +0530 Subject: [PATCH v5 7/7] PCI: qcom: Add support for ECAM feature Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250309-ecam_v4-v5-7-8eff4b59790d@oss.qualcomm.com> References: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> In-Reply-To: <20250309-ecam_v4-v5-0-8eff4b59790d@oss.qualcomm.com> To: cros-qcom-dts-watchers@chromium.org, Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Jingoo Han Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_vbadigan@quicinc.com, quic_mrana@quicinc.com, quic_vpernami@quicinc.com, mmareddy@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741499159; l=5409; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=sEcZFHTUzdOTAZzu2vqRCbTaZ+x+54x0/4maTU/qWnM=; b=Hf6ymgF00bE2KFsDVcS36WMgOqoJSOXu97ObSuEfqieJtzHX2tNxi+qIlGhK2zOamXPPDnWfs aLfNgw0nCItC8hCza4NPVivk2X0//WHCGuWnjv31ObgWsMPeMbTwtjZ X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-ORIG-GUID: QVJd_WUOGGBjWGxVyGevDNelBD7ZqZqr X-Proofpoint-GUID: QVJd_WUOGGBjWGxVyGevDNelBD7ZqZqr X-Authority-Analysis: v=2.4 cv=MICamNZl c=1 sm=1 tr=0 ts=67cd2b46 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=oQbQ34n3Jerzy_GFPTkA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-09_02,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503090043 The ELBI registers falls after the DBI space, PARF_SLV_DBI_ELBI register gives us the offset from which ELBI starts. so use this offset and cfg win to map these regions. On root bus, we have only the root port. Any access other than that should not go out of the link and should return all F's. Since the iATU is configured for the buses which starts after root bus, block the transactions starting from function 1 of the root bus to the end of the root bus (i.e from dbi_base + 4kb to dbi_base + 1MB) from going outside the link through ECAM blocker through PARF registers. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 258b2d615080..c34c0edd225f 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -52,6 +52,7 @@ #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 #define PARF_Q2A_FLUSH 0x1ac #define PARF_LTSSM 0x1b0 +#define PARF_SLV_DBI_ELBI 0x1b4 #define PARF_INT_ALL_STATUS 0x224 #define PARF_INT_ALL_CLEAR 0x228 #define PARF_INT_ALL_MASK 0x22c @@ -61,6 +62,17 @@ #define PARF_DBI_BASE_ADDR_V2_HI 0x354 #define PARF_SLV_ADDR_SPACE_SIZE_V2 0x358 #define PARF_SLV_ADDR_SPACE_SIZE_V2_HI 0x35c +#define PARF_BLOCK_SLV_AXI_WR_BASE 0x360 +#define PARF_BLOCK_SLV_AXI_WR_BASE_HI 0x364 +#define PARF_BLOCK_SLV_AXI_WR_LIMIT 0x368 +#define PARF_BLOCK_SLV_AXI_WR_LIMIT_HI 0x36c +#define PARF_BLOCK_SLV_AXI_RD_BASE 0x370 +#define PARF_BLOCK_SLV_AXI_RD_BASE_HI 0x374 +#define PARF_BLOCK_SLV_AXI_RD_LIMIT 0x378 +#define PARF_BLOCK_SLV_AXI_RD_LIMIT_HI 0x37c +#define PARF_ECAM_BASE 0x380 +#define PARF_ECAM_BASE_HI 0x384 + #define PARF_NO_SNOOP_OVERIDE 0x3d4 #define PARF_ATU_BASE_ADDR 0x634 #define PARF_ATU_BASE_ADDR_HI 0x638 @@ -84,6 +96,7 @@ /* PARF_SYS_CTRL register fields */ #define MAC_PHY_POWERDOWN_IN_P2_D_MUX_EN BIT(29) +#define PCIE_ECAM_BLOCKER_EN BIT(26) #define MST_WAKEUP_EN BIT(13) #define SLV_WAKEUP_EN BIT(12) #define MSTR_ACLK_CGC_DIS BIT(10) @@ -293,6 +306,48 @@ static void qcom_ep_reset_deassert(struct qcom_pcie *pcie) usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500); } +static void qcom_pci_config_ecam(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct qcom_pcie *pcie = to_qcom_pcie(pci); + u64 addr, addr_end; + u32 val; + + /* Set the ECAM base */ + writel_relaxed(lower_32_bits(pci->dbi_phys_addr), pcie->parf + PARF_ECAM_BASE); + writel_relaxed(upper_32_bits(pci->dbi_phys_addr), pcie->parf + PARF_ECAM_BASE_HI); + + /* + * The only device on root bus is the Root Port. Any access to the PCIe + * region will go outside the PCIe link. As part of enumeration the PCI + * sw can try to read to vendor ID & device ID with different device + * number and function number under root bus. As any access other than + * root bus, device 0, function 0, should not go out of the link and + * should return all F's. Since the iATU is configured for the buses + * which starts after root bus, block the transactions starting from + * function 1 of the root bus to the end of the root bus (i.e from + * dbi_base + 4kb to dbi_base + 1MB) from going outside the link. + */ + addr = pci->dbi_phys_addr + SZ_4K; + writel_relaxed(lower_32_bits(addr), pcie->parf + PARF_BLOCK_SLV_AXI_WR_BASE); + writel_relaxed(upper_32_bits(addr), pcie->parf + PARF_BLOCK_SLV_AXI_WR_BASE_HI); + + writel_relaxed(lower_32_bits(addr), pcie->parf + PARF_BLOCK_SLV_AXI_RD_BASE); + writel_relaxed(upper_32_bits(addr), pcie->parf + PARF_BLOCK_SLV_AXI_RD_BASE_HI); + + addr_end = pci->dbi_phys_addr + SZ_1M - 1; + + writel_relaxed(lower_32_bits(addr_end), pcie->parf + PARF_BLOCK_SLV_AXI_WR_LIMIT); + writel_relaxed(upper_32_bits(addr_end), pcie->parf + PARF_BLOCK_SLV_AXI_WR_LIMIT_HI); + + writel_relaxed(lower_32_bits(addr_end), pcie->parf + PARF_BLOCK_SLV_AXI_RD_LIMIT); + writel_relaxed(upper_32_bits(addr_end), pcie->parf + PARF_BLOCK_SLV_AXI_RD_LIMIT_HI); + + val = readl_relaxed(pcie->parf + PARF_SYS_CTRL); + val |= PCIE_ECAM_BLOCKER_EN; + writel_relaxed(val, pcie->parf + PARF_SYS_CTRL); +} + static int qcom_pcie_start_link(struct dw_pcie *pci) { struct qcom_pcie *pcie = to_qcom_pcie(pci); @@ -302,6 +357,9 @@ static int qcom_pcie_start_link(struct dw_pcie *pci) qcom_pcie_common_set_16gt_lane_margining(pci); } + if (pci->pp.ecam_mode) + qcom_pci_config_ecam(&pci->pp); + /* Enable Link Training state machine */ if (pcie->cfg->ops->ltssm_enable) pcie->cfg->ops->ltssm_enable(pcie); @@ -1233,6 +1291,7 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct qcom_pcie *pcie = to_qcom_pcie(pci); + u16 offset; int ret; qcom_ep_reset_assert(pcie); @@ -1241,6 +1300,11 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp) if (ret) return ret; + if (pp->ecam_mode) { + offset = readl(pcie->parf + PARF_SLV_DBI_ELBI); + pci->elbi_base = pci->dbi_base + offset; + } + ret = phy_set_mode_ext(pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); if (ret) goto err_deinit;