From nobody Sun Dec 14 12:14:53 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 918D421ABB4 for ; Fri, 28 Mar 2025 10:29:04 +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=1743157746; cv=none; b=Vop+LvQuG/8OBp1ZUCyOK1MgeuaXGr/A4FrDzhpLtXtuJldGki4Wv5OECO/XHdsFSruajhbTBoJHKyzrMG99R013ACMqJ+HUE8exY8HZId2BJWemZWOAIS7L4YdYm/58bytzPI4ts1+y8JLZ5Gfo/y+xldlCNYpcx5PmPGs3qDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743157746; c=relaxed/simple; bh=3xtlvs1vbdz9Lx9DTGncf10UyrhBPWHbtrA9J6tHahs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WNM9kbCLFY/nODmDnzSA/KA4zD3PGJLx/fML9/vyPhGAQ7nb31J68/VHYSff2zTAIzd6JS4N318uPFMBWNl+VZECkd95WO6+WvD9kiakDeoh7UDVzMSadFpiNK6JuFsTabViWntxNdR1LoY591alWhBHlTCS6RsX/xu4BJm9yPo= 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=pV5pup4M; 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="pV5pup4M" 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 52S6NP2W011014 for ; Fri, 28 Mar 2025 10:29:03 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= OOCWk2D0zXdlqRt97flBwH+ovhY8VuJGcvABkqQ95gA=; b=pV5pup4Mmye4wiWE riA+ELf6VMimGnr6PEFmbK/OHkV1ZWSY5Kun6KqTs7rKlXdptgaUwrMm9R4MGSsD YglQ1pKMhE65oar/bDlKtdF1zpMe1u12/q+jtPo86kh4ilhFQ9tOA9rD+JD6ryxF tRV9AByl5oWC4+vErii1+75viy1DnJfU0cVWD6/0gymhgjn1SBuRFh44L/M1d5dD i5rLiuxirj+rOo145YOS1qC940wtVI8kMYO57FRg6hxqnSUktnsSLb98y8OTGT9f etOrwXHM1TfieNBB7Rlfchuh6oodLMjpR6uhKoIak69ESH1TKCP8ZSQf/C7MC5wl W1kj+w== 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 45n0kqm9g5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Mar 2025 10:29:03 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2254e0b4b85so35362355ad.0 for ; Fri, 28 Mar 2025 03:29:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743157743; x=1743762543; 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=OOCWk2D0zXdlqRt97flBwH+ovhY8VuJGcvABkqQ95gA=; b=qtdYpnbhpD9SCvt3GIVb2NWXwFtJ//DCngfDWKAGMEM7tS8IcscuWXXbk8C3fhn3Fq WVToVO1vNe3OZsSvRZgVrV0DPCngzkmtgdV2EYRedA6Yl8xWDpi1M/Hk2arNFfNd06yH 6WQNQfGSymLNdel5CA5UDROvxeZpIhzSpSVsBQj9HP9gHDNMABhSL6us7kCLUakpOVql HcAhrmWb/LoDJlstzNvOPvkfRzVu1Z64XtkoSqDGf5CtuYr6ufSUmBJIUfn8ETLQ8eQj x/WMom+CAs6FqGNttTgG74Crs/Wqb4U5rsNIUwHq1Bido+OiGOBcLOL0AG/AOyibVKnz HnZA== X-Forwarded-Encrypted: i=1; AJvYcCU/azS9aajHh02BBjUr3MFHfPdPxQUKyvL8vFOT6TZtn27hUYEOcWUpbrnIRrntLueRp+ZtKIE8JypI7yQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwGRZB5Wgql7pQg/y5joTRia3fwiWNaCRHiVYa56wVKoEO8/JWH BhPBIuljrhVwh1dM+UhAlIFnPLwO48RH/+yPVvirS+eKWC/O5nEt7Wk1HGiQay9+778+fl0cQLg ridJoZSWFehhw/lXBMZaypFQEBENXRYvGoIszirJzOcLSOatIMUARZoO0lYnH2fc= X-Gm-Gg: ASbGncuL94veupISLG1IjfiCZlwOsbnHto5bdaPqvCyLmAJqOYwkNmNLQkSVJMUOnyt hycoZJzXY8uUHVVMGJXnzTl3VKrZYki4CT9Cnj91agiQxdg+ID2IVZDOhxLIctJDUHoF+Urc7e0 fKFkyXzzS6Kx/obdRkfiPpthaM6l14Lv+HOkKwx7K88daRvhHMDhUvuA9xYglst4AgcPoFn+a7r WqrCgZCzgqSSS02PYw4YBkUXRqjwm/vd6XkZH2kF0yffBr4MmA6tuqnFE3BKrNivUsAvXo0fSXM dM04hWDLzachtR5q4LerersjEVkABzT1Mj4y9bVZLHfSk9UOIP8= X-Received: by 2002:a17:902:d507:b0:224:24d3:60fb with SMTP id d9443c01a7336-22921cca739mr35292105ad.10.1743157742713; Fri, 28 Mar 2025 03:29:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEOrLiW9qS/wbDey08G3CBHaVs8TzgU0Gb0MlZV7nWK/tlufZpQxHUCI59tzGgvJMc0Iw7Aw== X-Received: by 2002:a17:902:d507:b0:224:24d3:60fb with SMTP id d9443c01a7336-22921cca739mr35291635ad.10.1743157742178; Fri, 28 Mar 2025 03:29:02 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eee11b7sm14561965ad.86.2025.03.28.03.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 03:29:01 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Fri, 28 Mar 2025 15:58:29 +0530 Subject: [PATCH v9 1/5] arm64: dts: qcom: x1e80100: Add PCIe lane equalization preset properties 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: <20250328-preset_v6-v9-1-22cfa0490518@oss.qualcomm.com> References: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> In-Reply-To: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Helgaas , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_mrana@quicinc.com, quic_vbadigan@quicinc.com, Krishna Chaitanya Chundru , Konrad Dybcio X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743157732; l=1925; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=3xtlvs1vbdz9Lx9DTGncf10UyrhBPWHbtrA9J6tHahs=; b=8wAQ+IxIsnfUS5TRRIA0pmea3c7X5AZ8Oj0Mp4K7+EVTYxybUsChyeiQcrS+yhnAGbNhnhVHi 0rux6SvyIIYDmTWBwvU9bE6kNh5AJI0y6NhEwXLGTtAleVn7wBQ4lAv X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-ORIG-GUID: X1MyZ2rR86_-brkJsK993bu7X8Wv8EBl X-Authority-Analysis: v=2.4 cv=FrcF/3rq c=1 sm=1 tr=0 ts=67e679ef cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=TRJGHeO7bdl8qYu8Ap8A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: X1MyZ2rR86_-brkJsK993bu7X8Wv8EBl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-28_05,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503280071 Add PCIe lane equalization preset properties for 8 GT/s and 16 GT/s data rates used in lane equalization procedure. Signed-off-by: Krishna Chaitanya Chundru Reviewed-by: Konrad Dybcio Reviewed-by: Manivannan Sadhasivam --- This patch depends on the this dt binding pull request which got recently merged: https://github.com/devicetree-org/dt-schema/pull/146 --- --- arch/arm64/boot/dts/qcom/x1e80100.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/q= com/x1e80100.dtsi index 4936fa5b98ff..9f14dd13d02e 100644 --- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi +++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi @@ -3209,6 +3209,10 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, phys =3D <&pcie3_phy>; phy-names =3D "pciephy"; =20 + eq-presets-8gts =3D /bits/ 16 <0x5555 0x5555 0x5555 0x5555 + 0x5555 0x5555 0x5555 0x5555>; + eq-presets-16gts =3D /bits/ 8 <0x55 0x55 0x55 0x55 0x55 0x55 0x55 0x55>; + operating-points-v2 =3D <&pcie3_opp_table>; =20 status =3D "disabled"; @@ -3411,6 +3415,9 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, phys =3D <&pcie6a_phy>; phy-names =3D "pciephy"; =20 + eq-presets-8gts =3D /bits/ 16 <0x5555 0x5555 0x5555 0x5555>; + eq-presets-16gts =3D /bits/ 8 <0x55 0x55 0x55 0x55>; + status =3D "disabled"; }; =20 @@ -3538,6 +3545,8 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, phys =3D <&pcie5_phy>; phy-names =3D "pciephy"; =20 + eq-presets-8gts =3D /bits/ 16 <0x5555 0x5555>; + status =3D "disabled"; }; =20 @@ -3662,6 +3671,8 @@ &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, phys =3D <&pcie4_phy>; phy-names =3D "pciephy"; =20 + eq-presets-8gts =3D /bits/ 16 <0x5555 0x5555>; + status =3D "disabled"; =20 pcie4_port0: pcie@0 { --=20 2.34.1 From nobody Sun Dec 14 12:14:53 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 1553221ADC7 for ; Fri, 28 Mar 2025 10:29:09 +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=1743157750; cv=none; b=Ash9hv7kvDUiFMcQRkx5jHJ7mjkoriNQH8hljS01FxF8NIxJfaVVL+v1UQKtVI3NICxDUfbbksKx9ZS5A1RyobhSXzlqkj6kvsWBS0TqmG3N5fn55uUHjF+GvoMXbIsIJilEt+BXullYGEuDaWHUneklEhDI5k2qhC1AGWuL0Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743157750; c=relaxed/simple; bh=CYfCgudxUmM43dHQpOpG9OMJgPcOsEIA5bFr+29j8ow=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WUj+tGCRbkmrUD32O4a6FfJmquXlohT/Prz8ZiCvGR+WB6dSUzTyRP0/yhpFpQyhp/1OIMdcXx7oAS94m02P5YHSJ8rOIU1pnseBNAjsP/OLZrT3L4LcJOtnXEeKSVq7Pa2azFt1xtzPw/nP5u1xzBPL5SsIyUckr5w1MlFj6q0= 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=WXvAgqZT; 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="WXvAgqZT" 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 52S5Tnxg025784 for ; Fri, 28 Mar 2025 10:29:08 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= aS50xFiu7/l9/tSwsWmVMjNyLVHaqm97GJbuXD8siio=; b=WXvAgqZThVIQTRfk khPWkCW4HN5YAZtNg0Qrqvmir11NmG0u5OZUm+PLBxpOYIa1XLYn5XA1mY1beLjF c8nZbSL6UYtFvaGIGz1eXi17NAuc+5SRz6FnJhy6Gq0rQFyavV/8HyVOWw/FxS6r FZfPmbBBVQKkCQHjwcF48OUeHXUJSTr8pJk29hlCs+Xz6sI1igcBH3r5JY0TqSVc i6C1c7hbLBgCk1lrUJBIUqgODIV1Tw0rNGdPMSCB+g2QY8WvKhL2Q4fPfXK1PpRt cpfR+RP8dDQJ2JXNpxghoLWNJ5c/SHsEYiwHeWj7aKakx1uRKTqgNoLadesL2hwS +7SQ9A== 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 45n0nuv90a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Mar 2025 10:29:08 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-224364f2492so36408675ad.3 for ; Fri, 28 Mar 2025 03:29:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743157747; x=1743762547; 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=aS50xFiu7/l9/tSwsWmVMjNyLVHaqm97GJbuXD8siio=; b=sx+8i6xlO/fRuohTD0BboOOrdRsJqygu0TBw8oYqIbWMgppwAFdDEspD22U5d268Bi InKm9n0zXCn7SOz+A3t0XXSqr2oTJ1IhEshpjLfXl0rBKxLiTbdTVKfUaeuuM5E//NS8 xpPYgBR2E64gyJo3ZHYu4zxENAlhHfgAdj0Re9EeP1t+AqF39Vq+7bPCPo0I7Vhbh4Kt 7AoSDRVx0AODsTQ8iVHtiXRhw9KnI7VXGn2HYo9UAoC8xkwdMnRARttEnoi/G3w1V7CM NvVNUehY1JRCCQ7Da/yyFTy3ABCBxeouftJGcGZ+sPVbCKlwIHrSyV+4HFQPV2gEsnPS BdWg== X-Forwarded-Encrypted: i=1; AJvYcCXsIHBNKlqk2YmA2+rfU4Ck4JGuyix5f8zz+Z3l0EUwN1/kaarWShOgq8m5fhtk5DNjRwgEDfcEBwej63M=@vger.kernel.org X-Gm-Message-State: AOJu0YwfY9guchb12BLMpdsszNvTjAcV5dSo1F47QJvRvCP3C1yu5O5y EIp1RvDyaIVMyCfNYe35zYAc00avyl4W+u2+scQcMu/b8GciRRQ2S3m5V7v48PPSrw2tTYvzXXR xO/M3tICwbNJB0gznKy1uPMlVSQZ9jUgeixs2Wtqqma+814C3XQSw+ByIs+IB1EA= X-Gm-Gg: ASbGncupmOU5kDkLNXT3ibILtIOrICvtHE1011itGTHMfEKb82MVUGIDPXpkrn3yy8h jLlxJ5VtTl2It1vqy6en4iBNihIQtCdsjMQ/ZCk9VXOTOhNGEhxxokybzlDS+ZDd/NUs2cjaXdU ZXyWKAojP9bthxAOBc07LTAcwUX0kR6P0+HWIc5C9EvebnG7pCYhX6xMeIsUZ5cOLReP/H2NBfl 4awtePMtLd5VdZEnvGq0wqpptuptb8CL2hPYPrBLDEMwNnD2DSFqGJV+R+wyOwExdesG1opzHRe St36q3drZdYiCeH0kmefZT+gVutqr9s19PoWQayhB8zSx8JL2Y4= X-Received: by 2002:a17:902:c94e:b0:224:3db:a296 with SMTP id d9443c01a7336-22804882d26mr102654485ad.2.1743157747293; Fri, 28 Mar 2025 03:29:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL2jCaQeU1Ozk/9Xg9vIpyceHfMUqX+QmN7WOzJq+oW5h9ux/cLhPlK4EWKDjUvowOHr/gew== X-Received: by 2002:a17:902:c94e:b0:224:3db:a296 with SMTP id d9443c01a7336-22804882d26mr102654005ad.2.1743157746737; Fri, 28 Mar 2025 03:29:06 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eee11b7sm14561965ad.86.2025.03.28.03.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 03:29:06 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Fri, 28 Mar 2025 15:58:30 +0530 Subject: [PATCH v9 2/5] PCI: of: Add of_pci_get_equalization_presets() API 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: <20250328-preset_v6-v9-2-22cfa0490518@oss.qualcomm.com> References: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> In-Reply-To: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Helgaas , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_mrana@quicinc.com, quic_vbadigan@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743157732; l=4772; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=CYfCgudxUmM43dHQpOpG9OMJgPcOsEIA5bFr+29j8ow=; b=kxT+GbvQGv6lewdqLXVnzWQKFj468RHAVjYTBH2ufsP0NLN3vEqK6LeZ+C/4zC0eXWrhxLqlg Zcy2ODbz6nbCBwIgUy+Y5rLrOExN9kXJjeuZd+Klmjx9OUzLmjqkyEK X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: yqesErtW3e_4pOVByQSRARun9Ax_vLs5 X-Authority-Analysis: v=2.4 cv=AcaxH2XG c=1 sm=1 tr=0 ts=67e679f4 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=C2froRUT8Woxtj4mbF0A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: yqesErtW3e_4pOVByQSRARun9Ax_vLs5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-28_05,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 impostorscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503280070 PCIe equalization presets are predefined settings used to optimize signal integrity by compensating for signal loss and distortion in high-speed data transmission. As per PCIe spec 6.0.1 revision section 8.3.3.3 & 4.2.4 for data rates of 8.0 GT/s, 16.0 GT/s, 32.0 GT/s, and 64.0 GT/s, there is a way to configure lane equalization presets for each lane to enhance the PCIe link reliability. Each preset value represents a different combination of pre-shoot and de-emphasis values. For each data rate, different registers are defined: for 8.0 GT/s, registers are defined in section 7.7.3.4; for 16.0 GT/s, in section 7.7.5.9, etc. The 8.0 GT/s rate has an extra receiver preset hint, requiring 16 bits per lane, while the remaining data rates use 8 bits per lane. Based on the number of lanes and the supported data rate, of_pci_get_equalization_presets() reads the device tree property and stores in the presets structure. Signed-off-by: Krishna Chaitanya Chundru Reviewed-by: Manivannan Sadhasivam --- drivers/pci/of.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ drivers/pci/pci.h | 32 +++++++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 7a806f5c0d20..d594a0e2fdfd 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -851,3 +851,47 @@ u32 of_pci_get_slot_power_limit(struct device_node *no= de, return slot_power_limit_mw; } EXPORT_SYMBOL_GPL(of_pci_get_slot_power_limit); + +/** + * of_pci_get_equalization_presets - Parses the "eq-presets-Ngts" property. + * + * @dev: Device containing the properties. + * @presets: Pointer to store the parsed data. + * @num_lanes: Maximum number of lanes supported. + * + * If the property is present, read and store the data in the @presets str= ucture. + * Else, assign a default value of PCI_EQ_RESV. + * + * Return: 0 if the property is not available or successfully parsed else + * errno otherwise. + */ +int of_pci_get_equalization_presets(struct device *dev, + struct pci_eq_presets *presets, + int num_lanes) +{ + char name[20]; + int ret; + + presets->eq_presets_8gts[0] =3D PCI_EQ_RESV; + ret =3D of_property_read_u16_array(dev->of_node, "eq-presets-8gts", + presets->eq_presets_8gts, num_lanes); + if (ret && ret !=3D -EINVAL) { + dev_err(dev, "Error reading eq-presets-8gts: %d\n", ret); + return ret; + } + + for (int i =3D 0; i < EQ_PRESET_TYPE_MAX - 1; i++) { + presets->eq_presets_Ngts[i][0] =3D PCI_EQ_RESV; + snprintf(name, sizeof(name), "eq-presets-%dgts", 8 << (i + 1)); + ret =3D of_property_read_u8_array(dev->of_node, name, + presets->eq_presets_Ngts[i], + num_lanes); + if (ret && ret !=3D -EINVAL) { + dev_err(dev, "Error reading %s: %d\n", name, ret); + return ret; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(of_pci_get_equalization_presets); diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 01e51db8d285..78c9cc0ad8fa 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -9,6 +9,8 @@ struct pcie_tlp_log; /* Number of possible devfns: 0.0 to 1f.7 inclusive */ #define MAX_NR_DEVFNS 256 =20 +#define MAX_NR_LANES 16 + #define PCI_FIND_CAP_TTL 48 =20 #define PCI_VSEC_ID_INTEL_TBT 0x1234 /* Thunderbolt */ @@ -808,6 +810,21 @@ static inline u64 pci_rebar_size_to_bytes(int size) =20 struct device_node; =20 +#define PCI_EQ_RESV 0xff + +enum equalization_preset_type { + EQ_PRESET_TYPE_8GTS, + EQ_PRESET_TYPE_16GTS, + EQ_PRESET_TYPE_32GTS, + EQ_PRESET_TYPE_64GTS, + EQ_PRESET_TYPE_MAX +}; + +struct pci_eq_presets { + u16 eq_presets_8gts[MAX_NR_LANES]; + u8 eq_presets_Ngts[EQ_PRESET_TYPE_MAX - 1][MAX_NR_LANES]; +}; + #ifdef CONFIG_OF int of_get_pci_domain_nr(struct device_node *node); int of_pci_get_max_link_speed(struct device_node *node); @@ -822,7 +839,9 @@ void pci_release_bus_of_node(struct pci_bus *bus); =20 int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *br= idge); bool of_pci_supply_present(struct device_node *np); - +int of_pci_get_equalization_presets(struct device *dev, + struct pci_eq_presets *presets, + int num_lanes); #else static inline int of_get_pci_domain_nr(struct device_node *node) @@ -867,6 +886,17 @@ static inline bool of_pci_supply_present(struct device= _node *np) { return false; } + +static inline int of_pci_get_equalization_presets(struct device *dev, + struct pci_eq_presets *presets, + int num_lanes) +{ + presets->eq_presets_8gts[0] =3D PCI_EQ_RESV; + for (int i =3D 0; i < EQ_PRESET_TYPE_MAX - 1; i++) + presets->eq_presets_Ngts[i][0] =3D PCI_EQ_RESV; + + return 0; +} #endif /* CONFIG_OF */ =20 struct of_changeset; --=20 2.34.1 From nobody Sun Dec 14 12:14:53 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 81A9221B9CA for ; Fri, 28 Mar 2025 10:29:13 +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=1743157755; cv=none; b=MGKIhhpeiEQEb30IzC8mgQnv3GrjEO9812PODupI+XsyHieYHg9ojDKcK2ZlxygNTLQqSxkdnY/2nlvDliOlmvNIA6kTxlwLSpK95ZqLSVEgMwe0dGxs6/hYA2qjaasdZt9KIMAWC6HqZErlhXRlpgf0OvVqwpqHj6fyFfBZwu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743157755; c=relaxed/simple; bh=+5NeY14GAaZjhf9/kf9i4kyV16jVK7K3/ekUtxFah+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZGTKme8jFTUYPTlqzi5UzF0fVJXHQGppbeixcJ5nDVcevPSvylGzclQcR2g5fyoFW1j1qho30YQo7lQuydw0M+fZeHRCUWaW0Ao/CzqsfVqUXALOy3Z6pT8edzdcE3pOAQYKU4orYKt+wBC0rWfjCkiRDz/7YMpuMvnVASnu1fQ= 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=Qb6C+umn; 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="Qb6C+umn" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52S5K5xH012429 for ; Fri, 28 Mar 2025 10:29: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= 80CEep44lPSG9HKI/yxAQvAq0iPYIRCTfFFMWIfFXLE=; b=Qb6C+umnPj908RUD yKF00GV5DZbu24/nhfNJniTVWCKeVdoOkmM/7S7GjTjlTX4orohhjf3yO9RKD7km W71mWQ4WyaLAAuh+t558M6+R7VTe2FPBNVpG4ZHykTMEUn1AY65iliZi94TdYI3o JHQGUmlQVOYxnTgtYxTm4huRQh+m2qdG8D6Z7GSOaRll2mWU4VmvX8S/H7noIMnC zqHTaqdXWAhDlA77Yl//L9FRO71waUbgB0p71lg+INg3MBqQPWA2r6YvTPmoI27W DjW9UZvlgpa8pqFijFegNqSyyC6E50Bpx1EvOHk0OUWcMWztDk2yeqcLJhJobPiW ja62PA== 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 45mmutp3jn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Mar 2025 10:29:12 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2254e0b4b85so35365775ad.0 for ; Fri, 28 Mar 2025 03:29:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743157752; x=1743762552; 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=80CEep44lPSG9HKI/yxAQvAq0iPYIRCTfFFMWIfFXLE=; b=BFAXL2O7HQtS6XWMQd09aZihQlmAXQKntutRn4jSqeOxQD2a6EKxKtgcIFvztwSaRG ebVuK4Vctjvf5OXGi5rF1pOrYmEn3XOY7pQgKcA05Y4jo7FQ0yiHT6iWmuIQBPAkTpHs flcdJSteVoMxv37qKSuLipc2Qxpj7M+kcaP4K+0HzzUYMnz3fM4RYTkcApA+CYZ2rKEC 6PuSnpBkQ/8xr+rL1simyALB2eAyuQu5LLul/gVPTVXKAIMHdveu2fXOo38MbFh+k7FT ALOXyxkpzknH7lNVfUUwVxdMSMznbLf8D6Oz6PejiGa0qcMXDfLUOyEM7sY+rRNjwSC4 KnSQ== X-Forwarded-Encrypted: i=1; AJvYcCUB5MtszQZ6CiG1UxKIf70vDK7aJTcfkfiXGYT1Yq9diDyTt+Zc7DfAkJ0eU80JS1x7lyWB16ADftvhsR8=@vger.kernel.org X-Gm-Message-State: AOJu0YyDbVy4SyWZHUTWXvnD+7YU6TXujdbVBPIPueqYIISkITWrreso 7ceekpu/HiHOhRxh8VB7nseyvnepTF5eDjy6ftCwb8WUAltXIa8q+vkHQs/Civ72Uhg6iDKh9mz MmSHNip7KG0nAENfa9erTy9nwka8iNsMP9HUNF8Lybl4y6N/axl+i3xwMaNr8WJo= X-Gm-Gg: ASbGnct+eCUuiz0Qn2+crRqJoPicYB51QKn0H+p3mc5jwiKiX5ClV+6dSxuKtWrrwJ0 uWuyWFzJTOClYR+kHsZOfoxg/v9Oyns7O0YSyDeamNtcSCirwlBoU861i2aX3TfMZddD339CoMb VSBVNWaG3dw2Rq+MMaF1FvAKnskFBh11tBLSwEOxzQ13E9Yrsac0cm6m/rxq+w/SWRPK5dxCx2O 6kcPM4pvXJfO+eohP2/SCSUwzs4sW7RfyOjWhV0KjYKmnipXvrmd61QJo+LGHJbNK3ekbaMM9hx xHrviKL5V7DaszBNRLU7BH9LOYoJwEvGV3I2IIxSGT95AT+ltkg= X-Received: by 2002:a17:903:320e:b0:215:742e:5cff with SMTP id d9443c01a7336-22921f58252mr38676615ad.16.1743157751894; Fri, 28 Mar 2025 03:29:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/9+OWQt2tzJ+8IkaPQziFxf8VoAuY+gpALQggWTQ7aiXeiyfL8ffb6i3XDE8ji42HpyiVLQ== X-Received: by 2002:a17:903:320e:b0:215:742e:5cff with SMTP id d9443c01a7336-22921f58252mr38675985ad.16.1743157751329; Fri, 28 Mar 2025 03:29:11 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eee11b7sm14561965ad.86.2025.03.28.03.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 03:29:10 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Fri, 28 Mar 2025 15:58:31 +0530 Subject: [PATCH v9 3/5] PCI: dwc: Update pci->num_lanes to maximum supported link width 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: <20250328-preset_v6-v9-3-22cfa0490518@oss.qualcomm.com> References: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> In-Reply-To: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Helgaas , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_mrana@quicinc.com, quic_vbadigan@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743157732; l=2730; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=+5NeY14GAaZjhf9/kf9i4kyV16jVK7K3/ekUtxFah+Q=; b=8kWMZulfaiG7eGCAWonbcj+4X20zPIFgg/s0opVxPbR9CUT5jB2an9qsYZhXXiH5Qv34Zb0oN p0I6gxSpHwjBgP8nRD7eyV5KHao6nCe8hC2aStQ/HvoMZ1XCYvqBpui X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-ORIG-GUID: n3-gCY3LyEcShty_oEkxWJdhEP90loQp X-Authority-Analysis: v=2.4 cv=MqlS63ae c=1 sm=1 tr=0 ts=67e679f8 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=kXhGf0cxdCgfIYue-YsA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: n3-gCY3LyEcShty_oEkxWJdhEP90loQp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-28_05,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503280071 If the num-lanes property is not present in the devicetree update the pci->num_lanes with the hardware supported maximum link width using the newly introduced dw_pcie_link_get_max_link_width() API. Introduce dw_pcie_link_get_max_link_width() to get the maximum lane width the hardware supports. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-designware-host.c | 3 +++ drivers/pci/controller/dwc/pcie-designware.c | 8 ++++++++ drivers/pci/controller/dwc/pcie-designware.h | 1 + 3 files changed, 12 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index ffaded8f2df7..dd56cc02f4ef 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -504,6 +504,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) =20 dw_pcie_iatu_detect(pci); =20 + if (pci->num_lanes < 1) + pci->num_lanes =3D dw_pcie_link_get_max_link_width(pci); + /* * Allocate the resource for MSG TLP before programming the iATU * outbound window in dw_pcie_setup_rc(). Since the allocation depends diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/con= troller/dwc/pcie-designware.c index 145e7f579072..f39e6f5732a9 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -737,6 +737,14 @@ static void dw_pcie_link_set_max_speed(struct dw_pcie = *pci) =20 } =20 +int dw_pcie_link_get_max_link_width(struct dw_pcie *pci) +{ + u8 cap =3D dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); + u32 lnkcap =3D dw_pcie_readl_dbi(pci, cap + PCI_EXP_LNKCAP); + + return FIELD_GET(PCI_EXP_LNKCAP_MLW, lnkcap); +} + static void dw_pcie_link_set_max_link_width(struct dw_pcie *pci, u32 num_l= anes) { u32 lnkcap, lwsc, plc; diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index 501d9ddfea16..61d1fb6b437b 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -488,6 +488,7 @@ void dw_pcie_write_dbi2(struct dw_pcie *pci, u32 reg, s= ize_t size, u32 val); int dw_pcie_link_up(struct dw_pcie *pci); void dw_pcie_upconfig_setup(struct dw_pcie *pci); int dw_pcie_wait_for_link(struct dw_pcie *pci); +int dw_pcie_link_get_max_link_width(struct dw_pcie *pci); int dw_pcie_prog_outbound_atu(struct dw_pcie *pci, const struct dw_pcie_ob_atu_cfg *atu); int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int type, --=20 2.34.1 From nobody Sun Dec 14 12:14:53 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 0991E21C160 for ; Fri, 28 Mar 2025 10:29:18 +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=1743157760; cv=none; b=bCvrZPDQDwDIYcVqofjGYujK0/Fc9TUDdK6KRh1l0hIwicqj54X2sndpfAmFFMttz//4JR+/pH8oSZHhq5vVp4ME7LkZtX7nwN3GMZAnQE1GhQfFbYFQIE8kV0rjZF9HJ/rO74FdFVpIw8SLTgxfDkcPDNlgMyukDSIoEz8pmUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743157760; c=relaxed/simple; bh=sHJJJcuX61owR2kyjUesjcXVSkVy1yJD+aWD4is8QhY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mS5sqYJSqX6dJWZzOiGJ1bt61wjkVuSobpjy0J16xC9YJKDzIg1p1fxyD1lEDw+q69rIOfBkaBG6P21d7T0SHADTN4je0FUQAatW0i8tLna/T1e30kYWHoqd28t0M5UCaF0mEbZAiX4eCtLItAJJvjawBYTGDA5/n6nhk62NzbU= 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=D+mcOQgd; 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="D+mcOQgd" 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 52S5TE2I025687 for ; Fri, 28 Mar 2025 10:29:17 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= 76wnfktK4/WqcnPSiRccrWPBKZwX9OX9wOv5n8+c2Zk=; b=D+mcOQgdKQlRd3Uy gWvfXVkAUAf4/iq1V8VbbXoWSFpfS4GydVJR4Kvpcg5/regeFipbgVut6SHYeS7J Tj8ll71aczrDsB2nE/WaokfrftnsTkppdIqTCvpFvT2ADsEDIEusB8MYtZtUGogN 408t+uAAW+ZCdb2gCvZClmb1I8dLPUg6W+ollQcck5vHout1y8KoaG2i7+rGydmK 58/ywm7sC6vEbJ2Hqd2Oj0+Un/OI+CEvlttUU3lz4CS7r/ZRhuGjaMNjSpuH3Slj PdMwfYngPWdSihFJIxfkELAf8Gt+A5R/moBBXKsEBB7TQYcA345E4VHTRkWiJJuD e6Pdlg== 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 45n0nuv90u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Mar 2025 10:29:17 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2241ae15dcbso43912975ad.0 for ; Fri, 28 Mar 2025 03:29:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743157756; x=1743762556; 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=76wnfktK4/WqcnPSiRccrWPBKZwX9OX9wOv5n8+c2Zk=; b=TvobnKnnzLhtL3wsQLRYjFT8/R0Aw3qcIvKrmRP2/DJf1TyeAQ8mY6EIr78xZxkU+H +tw9KwfZ6TkKNWHtQN/Qy4RGsbSXIJimRrMbNGLyY/QRUqSiJmywXsAfvo/OwyBkw8mZ IZDH/HLi/U86cGUn70fakTXIrBmaI50vESebmINc6gwQqXrC9a919QpUHGbjbkjBOvT4 uhq7LI0XVRFXp/FL3rlk7RpL5Xy2ZHUiU2O/3I8xrSJdLhYtiM6seRs1doCzLkb9M6Ss FaEVubKoOd1hPM4bwJEkBbHKa1CqBMgEevgz7zW+bHiqTcen5BF4XKCCbG/VVXfx7IJS Gm2A== X-Forwarded-Encrypted: i=1; AJvYcCWacF2YsEcuSEIZEQAWJz2De2s8uIFXJB6pZOWO6YTpKp/Q0STDRnAgTmWuvD9iiNqbeyNXRH79JN7y0J0=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9GeRX787eRxBA8ountkxKjveOPA2n0OsZbgxQThPyClw22AOv 0anK3E8JxC0wzlBgJF2ax7NuXZYFSf0F6tVHG8hh+xTCMJSfotwXNIai5uzZA2uI5vxIRUkC4A0 o1JPUJ15BeoFwFHtJ90uHXA88boI6B+EuLly0mgl5hGt1faqmqZz+GgWKpA0lWBY= X-Gm-Gg: ASbGncsPUMIrvau6ZcKIhShLf7lXgRM9Syd78g5nhpfRxYFaAkFiT8krYn98bBm8V8d bjT6bvVHvw9KEBesqsk2EgcWCMHtgEJMO3ICLeEAu8dBbkFD5gnsDRpdiVWdFX9KcvyT3zzyRF+ hRT7DQKgQ4wKavV84U0bI385BqIzR6rO9V4ki/2/8ovSDnw0yP9aielCJxFZ7FyNV5n7O0Wy/xN sO2ab+W7VLv8MwqgNW/gO37fFOd9L0V6rUg6Us/xqnhsDSHeNZTLuRmRBcRy4BWpc3VklaqAG3L qR3YZIPfSIgsDtrbJp6q/ErIP3FOsZhWv6dYsbcpYUL0foMWQV4= X-Received: by 2002:a17:902:f709:b0:21f:1202:f2f5 with SMTP id d9443c01a7336-2280481cc49mr105959475ad.8.1743157756407; Fri, 28 Mar 2025 03:29:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXkA4w1mpUhoDFXTTo21wx0R4Ts3go+ZL4NmFZ2yuDManGOG7lOg7EVTJNBHvMCKqEBeqaQg== X-Received: by 2002:a17:902:f709:b0:21f:1202:f2f5 with SMTP id d9443c01a7336-2280481cc49mr105958905ad.8.1743157755896; Fri, 28 Mar 2025 03:29:15 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eee11b7sm14561965ad.86.2025.03.28.03.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 03:29:15 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Fri, 28 Mar 2025 15:58:32 +0530 Subject: [PATCH v9 4/5] PCI: Add lane equalization register offsets 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: <20250328-preset_v6-v9-4-22cfa0490518@oss.qualcomm.com> References: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> In-Reply-To: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Helgaas , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_mrana@quicinc.com, quic_vbadigan@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743157732; l=2046; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=sHJJJcuX61owR2kyjUesjcXVSkVy1yJD+aWD4is8QhY=; b=a9KRYry7jIrmqwsIS2XJJ3sGB8e+LtGwDrzvmnIfoUkWsS2MMxW0KQF0540d8pI13QVDyreqo mrRxGO35u41BBXt18lsZ9/RQI3K5I/ZR4IL+lB0eukonydk4IFeYCzk X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: 85eJEx-2i3SjT00REy2V-7HSD1q7sH56 X-Authority-Analysis: v=2.4 cv=AcaxH2XG c=1 sm=1 tr=0 ts=67e679fd cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=QpCTzhXZHEQm8rbsoTIA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: 85eJEx-2i3SjT00REy2V-7HSD1q7sH56 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-28_05,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 impostorscore=0 malwarescore=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503280070 As per PCIe spec 6.0.1, add PCIe lane equalization register offset for data rates 8.0 GT/s, 32.0 GT/s and 64.0 GT/s. Add macro for defining data rate 64.0 GT/s physical layer capability ID. Signed-off-by: Krishna Chaitanya Chundru Reviewed-by: Manivannan Sadhasivam --- include/uapi/linux/pci_regs.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 3445c4970e4d..0dcd9aba584d 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -749,7 +749,8 @@ #define PCI_EXT_CAP_ID_NPEM 0x29 /* Native PCIe Enclosure Management */ #define PCI_EXT_CAP_ID_PL_32GT 0x2A /* Physical Layer 32.0 GT/s */ #define PCI_EXT_CAP_ID_DOE 0x2E /* Data Object Exchange */ -#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_DOE +#define PCI_EXT_CAP_ID_PL_64GT 0x31 /* Physical Layer 64.0 GT/s */ +#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_64GT =20 #define PCI_EXT_CAP_DSN_SIZEOF 12 #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 @@ -1140,12 +1141,21 @@ #define PCI_DLF_CAP 0x04 /* Capabilities Register */ #define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange= Enable */ =20 +/* Secondary PCIe Capability 8.0 GT/s */ +#define PCI_SECPCI_LE_CTRL 0x0c /* Lane Equalization Control Register */ + /* Physical Layer 16.0 GT/s */ #define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ #define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 =20 +/* Physical Layer 32.0 GT/s */ +#define PCI_PL_32GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ + +/* Physical Layer 64.0 GT/s */ +#define PCI_PL_64GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ + /* Native PCIe Enclosure Management */ #define PCI_NPEM_CAP 0x04 /* NPEM capability register */ #define PCI_NPEM_CAP_CAPABLE 0x00000001 /* NPEM Capable */ --=20 2.34.1 From nobody Sun Dec 14 12:14:53 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 A370721C193 for ; Fri, 28 Mar 2025 10:29:22 +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=1743157764; cv=none; b=P+CYwCw1yYZdmNUrU1hF401DOpJbhMheXm/WC6EnbHu5QQjprS8qlr0xifhyO2+/TvQ+Wfe9fL57nm90UTaFuMOjDG8Sq7+RmJbZvHZJYIlxug3pi6ZLrrHNpVg0cYNFPWC8o/rfx69SFQnyx+6cFPlQ6I0/nGGIHf1hbSQLees= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743157764; c=relaxed/simple; bh=U7DWrCD6EQXqUQIkpwerhpxSQhLGZ9eFto7N2dbcVTs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ph9Ng0ukNoGpNSLcL39qLYEakywKprFnFd90FxBJftRJh1U9zzitCsl304Ky51ZsQ9uw67iqKXmzibqbxbP+6DuGp0QZsNrrXPJSSX9bmCSc0wnCIRy6J27iXW1eVRZCrN1z8BJQbKDeoTMxvzwSWdbmyulVE96VLdZzsIblA4U= 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=FjG5K+U9; 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="FjG5K+U9" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52S2CTNo023886 for ; Fri, 28 Mar 2025 10:29:22 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= YZyozmENnf1D4BlU1MbFdQpfwvTwdNp0J/DqysHuxfs=; b=FjG5K+U95cf8EhPB 6x4JwH11FCMLZvGAdwnJjjL/o78Y9ujkdHHpeQ2krlZXflnlCWWR6rkJr/6EMfCA jFpfXnRSZvczgEiNCGihfaV4dFBYtKUcSPe8RxqjdgmXDvhNd64rPAj69tHj3NlW HdPXiG8LGRLPWAVC+uz91IsQBLAr/EFwWwarKJ4rF3SCkrOGwKCzzxhYHO9PULe9 0qy45rfs64BPDY4M2iXbDELE7SkLm2CKoXgj9US9p0OhBqzcfDDmNrpUp1ApbpFO PnEvXY4Ii5YsioEhvyhzRKVhLYukSnxQpdXV3wRwWWffcFT9tx8iJyeLIuRwGlXD 6tnwoA== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45njsc1b5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 28 Mar 2025 10:29:21 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-224364f2492so36411985ad.3 for ; Fri, 28 Mar 2025 03:29:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743157761; x=1743762561; 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=YZyozmENnf1D4BlU1MbFdQpfwvTwdNp0J/DqysHuxfs=; b=TFmUP1qJCZTW3kv4G+ypRHXrIJBcRytN4zFdenp+EY67TWd6vZeS2dfU4kYwkFg9Wv HSExqD2TM8Bo7ZtuvejuciiFlQF1jWg1VkeZuMCVhygvhA/JVYtPOd4hNnHReAVRqNvc c9zRR0riJaNjaz5R3yw0Cav8mf6b6u8eNjsAUtsyQBuTmSEp4iaVZp6RnspzV0OAkyVU XA+pGamdZeoBF8zHgKpu8Fodbr574+/OJS6XgTrjmjgq9JnInXitiVJzFhegZdSC6qqg WqCNwzMCEAKkJMu2uQudL0yrKS2t5RL4MWv07ZmBu9i+dVBE1SoZ3RbrSh5eq6lwlAuX IhVw== X-Forwarded-Encrypted: i=1; AJvYcCWasPTWOoy2y0QO27PBmqsOWtSJtwGTChBvlf5TS0RcvNHJMJKWsiX/rPTKU93Z+dQoJkOUO9kQwQsOa+0=@vger.kernel.org X-Gm-Message-State: AOJu0Yzu7AzS9ExJe8StR6LtmEwWQW0C7kLhyxvluBsV0VoO4UYFEQYA 58Ag5j6ITZ53cK34YM+o+qIvUpHHQqpoJJ+ldQNZWlXp18NNVjngm5Gh5jCtHfX7h1kigNfRu9a /ZS57wQBgrDScZsWYzOcgIqnom5s0VICCWqngZtvJjAvoO6Cd3C6s882bgXHRvxE= X-Gm-Gg: ASbGncu8lxQNxuxYxDPPd2nHqmkMmIBR9Uv5NSkEI1IrU6gN6zoKKAvbTJogjoX8u2e CyaHTbiXRS/lM4zNA0C4dr9l7+H4gwJAxSMiqPZwMObIZZfJei9OxJZb2FTFuLT+UdDpQsRlHCP vSrwC/qyEauWvKqx1iYefM4K4BWnUVXCX9yJeL75RBvS9Bf6DnuxjbOetsSXe2H0BLImzARtoYW EGEg9xVWRpQkHxz/ozhfi3DqDgOu5Dop/hqh0tOkrcQQF+2PcIsG35YmQL8s4/g5yvDo+GxXyCu YP5norieJR7GdmeCp5w68ik0IczKAIuARYhWRVcmeQ8h5a7gpe8= X-Received: by 2002:a17:902:f646:b0:224:f12:3735 with SMTP id d9443c01a7336-228048c8674mr121121925ad.31.1743157761020; Fri, 28 Mar 2025 03:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTLwXEUOwEmMsUdJEpr/rmOv1KKLheXbqRHRhCDP2HIepa0hdRuCAfWHrz2ORIUC0rf+g8sA== X-Received: by 2002:a17:902:f646:b0:224:f12:3735 with SMTP id d9443c01a7336-228048c8674mr121121265ad.31.1743157760482; Fri, 28 Mar 2025 03:29:20 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eee11b7sm14561965ad.86.2025.03.28.03.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 03:29:20 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Fri, 28 Mar 2025 15:58:33 +0530 Subject: [PATCH v9 5/5] PCI: dwc: Add support for configuring lane equalization presets 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: <20250328-preset_v6-v9-5-22cfa0490518@oss.qualcomm.com> References: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> In-Reply-To: <20250328-preset_v6-v9-0-22cfa0490518@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Helgaas , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, quic_mrana@quicinc.com, quic_vbadigan@quicinc.com, Krishna Chaitanya Chundru X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1743157732; l=4766; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=U7DWrCD6EQXqUQIkpwerhpxSQhLGZ9eFto7N2dbcVTs=; b=ViVIJg5kkCvIkqx3JzuIUQN0sSRyoXOi/qnO2mEdfQm4OUIlPz9oHhnr8KbEv4i7UX18xCpYj /+zdbyIrLUjCq8x/e45RiGbdUi1PTRy2ZoMyrZhMZAZ0+CXHcpW0mX/ X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=fJk53Yae c=1 sm=1 tr=0 ts=67e67a02 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=S-wDCh2AgS0RhsWIeBgA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-GUID: qVWRgGo-wAqK4cZTeTASIf2_RXgSX3iM X-Proofpoint-ORIG-GUID: qVWRgGo-wAqK4cZTeTASIf2_RXgSX3iM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-28_05,2025-03-27_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503280071 PCIe equalization presets are predefined settings used to optimize signal integrity by compensating for signal loss and distortion in high-speed data transmission. Based upon the number of lanes and the data rate supported, write the preset data read from the device tree in to the lane equalization control registers. Signed-off-by: Krishna Chaitanya Chundru Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-designware-host.c | 76 +++++++++++++++++++= ++++ drivers/pci/controller/dwc/pcie-designware.h | 3 + 2 files changed, 79 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index dd56cc02f4ef..153f9ce93ccd 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -507,6 +507,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) if (pci->num_lanes < 1) pci->num_lanes =3D dw_pcie_link_get_max_link_width(pci); =20 + ret =3D of_pci_get_equalization_presets(dev, &pp->presets, pci->num_lanes= ); + if (ret) + 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 @@ -808,6 +812,77 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp) return 0; } =20 +static void dw_pcie_program_presets(struct dw_pcie_rp *pp, enum pci_bus_sp= eed speed) +{ + struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); + u8 lane_eq_offset, lane_reg_size, cap_id; + u8 *presets; + u32 cap; + int i; + + if (speed =3D=3D PCIE_SPEED_8_0GT) { + presets =3D (u8 *)pp->presets.eq_presets_8gts; + lane_eq_offset =3D PCI_SECPCI_LE_CTRL; + cap_id =3D PCI_EXT_CAP_ID_SECPCI; + /* For data rate of 8 GT/S each lane equalization control is 16bits wide= */ + lane_reg_size =3D 0x2; + } else if (speed =3D=3D PCIE_SPEED_16_0GT) { + presets =3D pp->presets.eq_presets_Ngts[EQ_PRESET_TYPE_16GTS - 1]; + lane_eq_offset =3D PCI_PL_16GT_LE_CTRL; + cap_id =3D PCI_EXT_CAP_ID_PL_16GT; + lane_reg_size =3D 0x1; + } else if (speed =3D=3D PCIE_SPEED_32_0GT) { + presets =3D pp->presets.eq_presets_Ngts[EQ_PRESET_TYPE_32GTS - 1]; + lane_eq_offset =3D PCI_PL_32GT_LE_CTRL; + cap_id =3D PCI_EXT_CAP_ID_PL_32GT; + lane_reg_size =3D 0x1; + } else if (speed =3D=3D PCIE_SPEED_64_0GT) { + presets =3D pp->presets.eq_presets_Ngts[EQ_PRESET_TYPE_64GTS - 1]; + lane_eq_offset =3D PCI_PL_64GT_LE_CTRL; + cap_id =3D PCI_EXT_CAP_ID_PL_64GT; + lane_reg_size =3D 0x1; + } else { + return; + } + + if (presets[0] =3D=3D PCI_EQ_RESV) + return; + + cap =3D dw_pcie_find_ext_capability(pci, cap_id); + if (!cap) + return; + + /* + * Write preset values to the registers byte-by-byte for the given + * number of lanes and register size. + */ + for (i =3D 0; i < pci->num_lanes * lane_reg_size; i++) + dw_pcie_writeb_dbi(pci, cap + lane_eq_offset + i, presets[i]); +} + +static void dw_pcie_config_presets(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); + enum pci_bus_speed speed =3D pcie_link_speed[pci->max_link_speed]; + + /* + * Lane equalization needs to be perfomed for all data rates + * the controller supports and for all supported lanes. + */ + + if (speed >=3D PCIE_SPEED_8_0GT) + dw_pcie_program_presets(pp, PCIE_SPEED_8_0GT); + + if (speed >=3D PCIE_SPEED_16_0GT) + dw_pcie_program_presets(pp, PCIE_SPEED_16_0GT); + + if (speed >=3D PCIE_SPEED_32_0GT) + dw_pcie_program_presets(pp, PCIE_SPEED_32_0GT); + + if (speed >=3D PCIE_SPEED_64_0GT) + dw_pcie_program_presets(pp, PCIE_SPEED_64_0GT); +} + int dw_pcie_setup_rc(struct dw_pcie_rp *pp) { struct dw_pcie *pci =3D to_dw_pcie_from_pp(pp); @@ -861,6 +936,7 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp) PCI_COMMAND_MASTER | PCI_COMMAND_SERR; dw_pcie_writel_dbi(pci, PCI_COMMAND, val); =20 + dw_pcie_config_presets(pp); /* * If the platform provides its own child bus config accesses, it means * the platform uses its own address translation component rather than diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/con= troller/dwc/pcie-designware.h index 61d1fb6b437b..30ae8d3f4282 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -25,6 +25,8 @@ #include #include =20 +#include "../../pci.h" + /* DWC PCIe IP-core versions (native support since v4.70a) */ #define DW_PCIE_VER_365A 0x3336352a #define DW_PCIE_VER_460A 0x3436302a @@ -381,6 +383,7 @@ struct dw_pcie_rp { int msg_atu_index; struct resource *msg_res; bool use_linkup_irq; + struct pci_eq_presets presets; }; =20 struct dw_pcie_ep_ops { --=20 2.34.1