From patchwork Sat Mar 2 03:59:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579369 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 670798BFD; Sat, 2 Mar 2024 04:00:26 +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=1709352027; cv=none; b=i6gcZm4XYZrUTJ178RTRPRqhuYnlbFF/8/8f+lkBFrDBymNRJ3WwWKxKVBeU9FWWXIu/qCg9vYgcra3qoRoiOxISrtedBxFeMr5MKse5pHbGhQhu1855Nw4OauKfkmno8jxiIMPtOB7T/qhztWC2QCwrATmPJiI56x4eT1uMO6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352027; c=relaxed/simple; bh=gEXVyphupj2CWbliP1o3xIi3gZkXWhknxxEg/8SeEs0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=eEjUgG4LBzzo3x6B+mCNGDA4eceXkSr/B+0to5T2OLjXdvUeVw8Nvk06M7e4w/bQSFeLfu89/1tOaao/VNpD75c0p+TeoYQ0pDOSfCx9K7clCTnpOxU6Y3RZUS4G5fdaNryDdDbixcerracIZsSjds/2ChLfK6FELDDFi3VGwPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=pCgRPf5l; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="pCgRPf5l" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223sGMS005133; Sat, 2 Mar 2024 04:00:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=Zyj0RWvOiosbqWwtwDt7FHmCZXnxwMqY+tBECEjX24I =; b=pCgRPf5lmTu16BQMaGt3PEB4bVv5hZtQx0UQS4TNPTEDg1RSmXawmCEcET/ Kn+sxx2DCdvdwzMN8Bt5R3rJFmsXd0O8nu8gGcwdaCP33cc4pvjmIJZhqaTskrUl pnPbutvhxMc8KxHVvdaMCIYdKYvzFTXTYLoBTRB8o547A5l7hbuvYUHGscXR1ckE 1bvj/PFPeIWV4UNmahjysL1JHRsYUUp9H1jfQZiFdbxvZHEn2rQMdfItQmq92pY2 7yz3IwoKtLO7hihJRociyvx/SpX5gBJf4ei54dodhj8pfQhbJIatic/QsRR8vMOX V/oCsaviYvlhaTwBvQdM52NfmWg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkk3u102k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:18 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240HGt006359 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:17 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:11 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:29:55 +0530 Subject: [PATCH v8 1/7] dt-bindings: PCI: qcom: Add interconnects path as required property Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-1-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352003; l=929; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=gEXVyphupj2CWbliP1o3xIi3gZkXWhknxxEg/8SeEs0=; b=nhHW3sijbUU6+aQsN2ArCeH3WIZo7u6mD7Dt7EgnqobTdWvWUyrJDtP0H4f7YyQ1tK4FXMnpE ZkF08yFxYyPA439eIBfYuWD5BSm7TBP7oJ621VJ/uNSdlgMzLbVTmAB X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: AJQMHq3IfoH7Gqwo2jVEdZC5rTzpmxIb X-Proofpoint-ORIG-GUID: AJQMHq3IfoH7Gqwo2jVEdZC5rTzpmxIb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=860 lowpriorityscore=0 clxscore=1015 mlxscore=0 impostorscore=0 adultscore=0 spamscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 Add the interconnects path as required property for sm8450 platform. Reviewed-by: Manivannan Sadhasivam Acked-by: Rob Herring Signed-off-by: Krishna chaitanya chundru --- Documentation/devicetree/bindings/pci/qcom,pcie.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml index a93ab3b54066..5ad5c4cfd2a8 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml @@ -834,6 +834,8 @@ allOf: - qcom,pcie-sa8540p - qcom,pcie-sa8775p - qcom,pcie-sc8280xp + - qcom,pcie-sm8450-pcie0 + - qcom,pcie-sm8450-pcie1 then: required: - interconnects From patchwork Sat Mar 2 03:59:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579371 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 0459F12B9A; Sat, 2 Mar 2024 04:00:32 +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=1709352034; cv=none; b=ZIBiYAL18Ca/D+NTGuGHcqcI6/7Mx+lb+z3bU7seqo7/7oXZQg09FPNHhscPoQkEYmkNyzV98wLpVaWIlUolLaQ6/JzgLZv3xnKjOzWLRbWvcrAaASia/mEcpfw8TJ8ZEsP8l8dDbd8cukrbiYwRMtFPsoiDOAXmwdUFiNqZGAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352034; c=relaxed/simple; bh=nrOFF1PG0Ddvzaj3cU3X6VJdG6aS86Nli2BwddOLFA0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=KLIPCK+HPdZy0yhi3LxbqMOzfYz0WG7WtCT4gpZENHpOnr/cas90ldg+mxaCFeCRe6BkhyAIRegUN2RNWPDvEKV+y5p9T7CknYkZXkKcGp5jwEmUIzz9D8ipm0+UKn6P77oOpN19bOl99DD+3rG0+rgVoTNJ/j/uqU9q3vQ7xyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=QxGaPWEE; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="QxGaPWEE" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223PHKB029084; Sat, 2 Mar 2024 04:00:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=3FogZb3RjOu/p0gevLn/krzCPQWG9ibDSved21e76mM =; b=QxGaPWEEeO57rRxfqIS4XhuAi9G4Ho2j0wsx4p+lhQMgc1HM+ut64er+P/s oiyQBLG1D9HdjsoHtEm/FGmxJAAenMaDJ6KsNhYi2OrWi8Grd/rXdInOE6WyISz8 ZFQiiIcnuxnstEN6RUI6E4JsDKP5mgMbr5y5IF27hF5XjwgjXlS3bZXAEx7GUKGN A3lK7mIXRE6M1vxgSd+/nPD/hqoytXjdhh3eld5DT8uyQ5OBn+UlsXNVkUuWSVEf 8T1M5a5NiBe/y1ZjmI2ernXav0FKK2FFrFLCk7YpduGU9x6nlGNc16LgUnvpEVvq FfmEGZvMXkTanH5GDLROuFBO28w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wku2wr3s4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:25 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240OqM006833 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:24 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:17 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:29:56 +0530 Subject: [PATCH v8 2/7] arm64: dts: qcom: sm8450: Add interconnect path to PCIe node Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-2-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352003; l=1479; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=nrOFF1PG0Ddvzaj3cU3X6VJdG6aS86Nli2BwddOLFA0=; b=HJdwvIqS/ykP/LoV4t1efAFoFEkOMB32mavxM6+uFVVeUz9cYc7Y6L94fihxUpUANVtqQYHrp qsmlTswKNg/BoVcyN2cELHaH5YED/PkkCQRXYUZkS4dAa1bghbKIG4Z X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: AkpGrqIMuq91HT9pCVew3kMLDG6ASIGJ X-Proofpoint-GUID: AkpGrqIMuq91HT9pCVew3kMLDG6ASIGJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 Add pcie-mem & cpu-pcie interconnect path to the PCIe nodes. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Krishna chaitanya chundru --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi index 01e4dfc4babd..6b1d2e0d9d14 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -1781,6 +1781,10 @@ pcie0: pcie@1c00000 { <0 0 0 3 &intc 0 0 0 151 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ <0 0 0 4 &intc 0 0 0 152 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + interconnects = <&pcie_noc MASTER_PCIE_0 0 &mc_virt SLAVE_EBI1 0>, + <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_PCIE_0 0>; + interconnect-names = "pcie-mem", "cpu-pcie"; + clocks = <&gcc GCC_PCIE_0_PIPE_CLK>, <&gcc GCC_PCIE_0_PIPE_CLK_SRC>, <&pcie0_phy>, @@ -1890,6 +1894,10 @@ pcie1: pcie@1c08000 { <0 0 0 3 &intc 0 0 0 438 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ <0 0 0 4 &intc 0 0 0 439 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + interconnects = <&pcie_noc MASTER_PCIE_1 0 &mc_virt SLAVE_EBI1 0>, + <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_PCIE_1 0>; + interconnect-names = "pcie-mem", "cpu-pcie"; + clocks = <&gcc GCC_PCIE_1_PIPE_CLK>, <&gcc GCC_PCIE_1_PIPE_CLK_SRC>, <&pcie1_phy>, From patchwork Sat Mar 2 03:59:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579372 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 A17591401E; Sat, 2 Mar 2024 04:00:39 +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=1709352041; cv=none; b=YXEkP3zzAgP1+sbl+8CJFwlxbPpnXSu0bAmtQtxUkmhWjUrW5um+CBVtxfuxIsQn6670RBTFoMWqhdXvWCnzdI8sEVHl+eHGwME0+Hz26jTpr9dlnxyRt5Fh6EtXv6C3rFJUiOe9Rhe8laWn0FNQ5594wQNZZyKsVKEUzBQ23E8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352041; c=relaxed/simple; bh=juVQh0d9T+B/H5cHSGyuBUCU/bdjSwgnP9a0FrBSPPE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=SgggWffrLVofux7aqoJ10KZR3DS87n9fIZYNAHQRElP6L+gZFKTXvatFdiK5f82gn317/lpkMh13TFrXI58YV9y3YtCgD848RVsCSYrbLXJ7/mwzOdqcaLRx9tF7S4kNThSMkrHWI1OWegbg5oFghDq1DTXYyIuhQU6GCwjFys8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=M00g1QlS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="M00g1QlS" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223aNum016764; Sat, 2 Mar 2024 04:00:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=JTt03ap6invxnj8mxB5rD01WcQ5nu+m9RxcfWbtVUag =; b=M00g1QlSwj4ACPwEAyeqI6e6AUkFkx/YZIq7qNLz6UkEp6vUrRsnzL2JkTP tOsEWNcOv2xZWCgTXTaxAVOt8RfWMxJwqrSN9VRu7P0Ec/M90SJSeqroBX91924l XTCtzFpGxLPs0hAMms/qDLzVGKtj7EcdYiDG/J1Tzt6VPAfj59x7I49xzd7CR+lw 7Ny2w9GnSqNrWYZS5227g4Fa3LhmTZOIWXl2IjzhGi4E9bVfTZH3kDom6YgrKWZs rz1zfAcsGupVHyENsm15pi5A3p0iQOLPHgcr+aTLbMP/t0gG0j13KRurawx7E7hq a62Re7RiFZSQ6iHXGnJjl6ADE5w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wku2wr3s7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:31 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240VuF006877 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:31 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:24 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:29:57 +0530 Subject: [PATCH v8 3/7] PCI: qcom: Add ICC bandwidth vote for CPU to PCIe path Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-3-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru , Bryan O'Donoghue X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352003; l=3475; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=juVQh0d9T+B/H5cHSGyuBUCU/bdjSwgnP9a0FrBSPPE=; b=qUDwXT7fUMVUEg4okLu1zBxKWcF9DFu2g0YcLzk/H/jOjshkortpE0HcKkQhLDKjwfYwZlmn8 qg9PJKnGkMvCn9i3wq09OD8huKK12jLJnCaXNe2NPPg8MPniTXCBEcx X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Qioo2zdQLbKyoPmLr-49jD6uXKFl8Jk9 X-Proofpoint-GUID: Qioo2zdQLbKyoPmLr-49jD6uXKFl8Jk9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 To access PCIe registers, PCIe BAR space, config space the CPU-PCIe ICC (interconnect consumers) path should be voted otherwise it may lead to NoC (Network on chip) timeout. We are surviving because of other driver vote for this path. As there is less access on this path compared to PCIe to mem path add minimum vote i.e 1KBps bandwidth always. When suspending, disable this path after register space access is done. Reviewed-by: Bryan O'Donoghue Signed-off-by: Krishna chaitanya chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 38 ++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 10f2d0bb86be..a0266bfe71f1 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -240,6 +240,7 @@ struct qcom_pcie { struct phy *phy; struct gpio_desc *reset; struct icc_path *icc_mem; + struct icc_path *icc_cpu; const struct qcom_pcie_cfg *cfg; struct dentry *debugfs; bool suspended; @@ -1372,6 +1373,9 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) if (IS_ERR(pcie->icc_mem)) return PTR_ERR(pcie->icc_mem); + pcie->icc_cpu = devm_of_icc_get(pci->dev, "cpu-pcie"); + if (IS_ERR(pcie->icc_cpu)) + return PTR_ERR(pcie->icc_cpu); /* * Some Qualcomm platforms require interconnect bandwidth constraints * to be set before enabling interconnect clocks. @@ -1381,7 +1385,19 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) */ ret = icc_set_bw(pcie->icc_mem, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); if (ret) { - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", + dev_err(pci->dev, "failed to set interconnect bandwidth for pcie-mem: %d\n", + ret); + return ret; + } + + /* + * The config space, BAR space and registers goes through cpu-pcie path + * Set peak bandwidth to 1KBps as recommended by HW team for this path + * all the time. + */ + ret = icc_set_bw(pcie->icc_cpu, 0, kBps_to_icc(1)); + if (ret) { + dev_err(pci->dev, "failed to set interconnect bandwidth for cpu-pcie: %d\n", ret); return ret; } @@ -1573,7 +1589,7 @@ static int qcom_pcie_suspend_noirq(struct device *dev) */ ret = icc_set_bw(pcie->icc_mem, 0, kBps_to_icc(1)); if (ret) { - dev_err(dev, "Failed to set interconnect bandwidth: %d\n", ret); + dev_err(dev, "Failed to set interconnect bandwidth for pcie-mem: %d\n", ret); return ret; } @@ -1597,6 +1613,18 @@ static int qcom_pcie_suspend_noirq(struct device *dev) pcie->suspended = true; } + /* Remove CPU path vote after all the register access is done */ + ret = icc_disable(pcie->icc_cpu); + if (ret) { + dev_err(dev, "failed to disable icc path of cpu-pcie: %d\n", ret); + if (pcie->suspended) { + qcom_pcie_host_init(&pcie->pci->pp); + pcie->suspended = false; + } + qcom_pcie_icc_update(pcie); + return ret; + } + return 0; } @@ -1605,6 +1633,12 @@ static int qcom_pcie_resume_noirq(struct device *dev) struct qcom_pcie *pcie = dev_get_drvdata(dev); int ret; + ret = icc_enable(pcie->icc_cpu); + if (ret) { + dev_err(dev, "failed to enable icc path of cpu-pcie: %d\n", ret); + return ret; + } + if (pcie->suspended) { ret = qcom_pcie_host_init(&pcie->pci->pp); if (ret) From patchwork Sat Mar 2 03:59:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579373 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 EF5991118B; Sat, 2 Mar 2024 04:00:45 +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=1709352047; cv=none; b=PJCfTUi3rmJFWyG7Nr9HIJRzgdXypGKehyk3Vvxr4USlKU/Ki0gC/A+sFMl2W852tdzLyHjpqSplW2cNLSjxuGroJUAugP+f/2/cyXZwi6wPfcbxuZ4FEW0HAAoaC9WHpDYuJ9Pycj72bZFDQ7iHhdqLu5nLatLQz16zPgCCTQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352047; c=relaxed/simple; bh=sUI5hJ3jZ135N0buYIvZdIjDEI5T2GRIwmaUXAbq2Io=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=jHopQNH7lyE25jTJ3xSDx0Z9s16r99ZVNIgmkvQLZepxDD/IGSv9QvRes4WhRBb+0gbJ2HlVoUgqmNd/PGpGFXaRJt3evk4lxALP4NGsGYZw4xQzQc+o+q/68TdyfrBw60wUImkpUiAXDobKMzjpkBrfo9hOl6r/CSSo1Jir2j8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=A3zvmc4w; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="A3zvmc4w" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223cHE5031520; Sat, 2 Mar 2024 04:00:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=2ilRA4F8XouQOkHZIvowRMIrWXeaZkTccgPDvx1p9nE =; b=A3zvmc4wxLRzX/VcTHg9RhWfaAweNbZmOCrdllNke7vOLA32U1mrvF2aqfH SUV7/VtoVcpHvGRyS9kmReJz5X+rWgMYVe3hpkBbvmeuNOl4PS0wtmc69iW/e/9j ACuEfRQa9+VuH2TYLPJxEQZrTbJW+aRRsuY4wdozuRZ1SzpK5qkxtQHVHtrvQmij uAS+R18obwUqdNJnY3nqPmt7w/6GK1SLgk/DkH64rss2FYbHr6+5gIEUFN90IV6P ySv31DrmFHMD9OezAzcCx6B0Sgurk7FIkWwCluRyX0kI9mtLBQpfHVOM/VL49sdF qKOKVKR6xvlGX7FSHmPP0TZckvA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkvb700uj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:38 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240bk0022020 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:37 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:31 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:29:58 +0530 Subject: [PATCH v8 4/7] dt-bindings: pci: qcom: Add opp table Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-4-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru , Krzysztof Kozlowski X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352003; l=1100; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=sUI5hJ3jZ135N0buYIvZdIjDEI5T2GRIwmaUXAbq2Io=; b=90BuwUoUGlGb5Y09sLQamOc/5rpkMeK9o7ILGO8ZC+p2acsODxhCGkHSOAk3L5F4gMoYvHXp1 r+hUoI2CdbVDfwhriv9NOS1JxRzBVKav+Dw5Hnk19L1iian3snlgmXA X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: O6xiWKqvSTBjrPZnzPKcPntHbJeJmXuu X-Proofpoint-ORIG-GUID: O6xiWKqvSTBjrPZnzPKcPntHbJeJmXuu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=919 lowpriorityscore=0 phishscore=0 malwarescore=0 impostorscore=0 clxscore=1015 spamscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 PCIe needs to choose the appropriate performance state of RPMH power domain based upon the PCIe gen speed. Adding the Operating Performance Points table allows to adjust power domain performance state and icc peak bw, depending on the PCIe gen speed and width. Acked-by: Manivannan Sadhasivam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krishna chaitanya chundru --- Documentation/devicetree/bindings/pci/qcom,pcie.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml index 5ad5c4cfd2a8..e1d75cabb1a9 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml @@ -127,6 +127,10 @@ properties: description: GPIO controlled connection to WAKE# signal maxItems: 1 + operating-points-v2: true + opp-table: + type: object + required: - compatible - reg From patchwork Sat Mar 2 03:59:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579374 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 A31EF17566; Sat, 2 Mar 2024 04:00:58 +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=1709352061; cv=none; b=DaUy5PepDgeiuK210DgXHhf40qhI5GPYo5VUF37pKsq1UeBDD9zIInMH4PPRFUsvnFMx8EnLgQBEtgNg+Vb2m6tfkkNmrQkCfTSehB/QDcyTmjtoF6RBmjgnPNSXPFIoKVIzxLnFtIlmpIuUtEcR1i2IpreyRDoaSKO0mwLLPJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352061; c=relaxed/simple; bh=QhBOenPCWU9RPOLZkMRagkZZgTUlqWbD929MpJwSVcQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=rmJg7+ZjskyYWOsd5OCdKWUxI39e2LozjVOZSuFaljUMBeekteBcilcLgfQBqCFl/rtLj9zIxr/irLld6EnWEJ5wTJsDscZKfVzSkRwkjMZA7n+roQKSjxE6HH27Pg900It0gcmeqD8++tGCm2C+yDCDbJSfmlga79IPdxUfaw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=U8tIVKdP; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="U8tIVKdP" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223TPHa030744; Sat, 2 Mar 2024 04:00:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=MWJFlLU/eSswcHRepliMx7VnE186DBZvx1uc7BliI60 =; b=U8tIVKdPmKlImkTJAicLjUAHcPxNZeFxqGwpY7YmA0ahayn+Z7wN/YPnr03 v8Ww2DC1yuOQl2wsyVNfHLww1XNJ5Z6rO7sMvkKdIDc0c/Lx3zgspETWnUT6LRiS p8WiiLcgZkmx33O5nkJGfdc3kuYa/l6k3z0ccUkW/ZjGySfFomXMLf+pMdPrGMNe iuM6VDf3RpandfrXUZ++aFlA+BbYhsU23z2YVGrzwcDKF39P/PV3+pzt17oI198o PFXBy6QA74uuozttGHorEqFASusNFbwOcwaR7PNmJCaPPG2Rx1dEbRDV6Sgfgizl CtHKK88G/tgQjMQtMm37YYSzwPw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkuq50272-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:45 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240ieB001102 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:44 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:37 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:29:59 +0530 Subject: [PATCH v8 5/7] arm64: dts: qcom: sm8450: Add opp table support to PCIe Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-5-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352004; l=2796; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=QhBOenPCWU9RPOLZkMRagkZZgTUlqWbD929MpJwSVcQ=; b=vnx6mLJnnJdrZijp/viQGGipCrCgbXJPf9wx1hwyAyoKdSPIzRxCqMmTpajeqytIX644RXiYZ WxMCJ4FCMgOC+8ROJ+GbtxQ1eIxsoj88iBnFGd4DtfusIcLKtDF3eoQ X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: mOQ5sA1A0AS8pVJZ8IyoZZYF-2jAxEpb X-Proofpoint-ORIG-GUID: mOQ5sA1A0AS8pVJZ8IyoZZYF-2jAxEpb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 mlxscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=851 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 PCIe needs to choose the appropriate performance state of RPMH power domain and interconnect bandwidth based up on the PCIe gen speed. Add the OPP table support to specify RPMH performance states and interconnect peak bandwidth. Signed-off-by: Krishna chaitanya chundru --- arch/arm64/boot/dts/qcom/sm8450.dtsi | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi index 6b1d2e0d9d14..662f2129f20d 100644 --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi @@ -1827,7 +1827,32 @@ pcie0: pcie@1c00000 { pinctrl-names = "default"; pinctrl-0 = <&pcie0_default_state>; + operating-points-v2 = <&pcie0_opp_table>; + status = "disabled"; + + pcie0_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-2500000 { + opp-hz = /bits/ 64 <2500000>; + required-opps = <&rpmhpd_opp_low_svs>; + opp-peak-kBps = <250000 1>; + }; + + opp-5000000 { + opp-hz = /bits/ 64 <5000000>; + required-opps = <&rpmhpd_opp_low_svs>; + opp-peak-kBps = <500000 1>; + }; + + opp-8000000 { + opp-hz = /bits/ 64 <8000000>; + required-opps = <&rpmhpd_opp_nom>; + opp-peak-kBps = <984500 1>; + }; + }; + }; pcie0_phy: phy@1c06000 { @@ -1938,7 +1963,56 @@ pcie1: pcie@1c08000 { pinctrl-names = "default"; pinctrl-0 = <&pcie1_default_state>; + operating-points-v2 = <&pcie1_opp_table>; + status = "disabled"; + + pcie1_opp_table: opp-table { + compatible = "operating-points-v2"; + + /* GEN 1x1 */ + opp-2500000 { + opp-hz = /bits/ 64 <2500000>; + required-opps = <&rpmhpd_opp_low_svs>; + opp-peak-kBps = <250000 1>; + }; + + /* GEN 1x2 GEN 2x1 */ + opp-5000000 { + opp-hz = /bits/ 64 <5000000>; + required-opps = <&rpmhpd_opp_low_svs>; + opp-peak-kBps = <500000 1>; + }; + + /* GEN 2x2 */ + opp-10000000 { + opp-hz = /bits/ 64 <10000000>; + required-opps = <&rpmhpd_opp_low_svs>; + opp-peak-kBps = <1000000 1>; + }; + + /* GEN 3x1 */ + opp-8000000 { + opp-hz = /bits/ 64 <8000000>; + required-opps = <&rpmhpd_opp_nom>; + opp-peak-kBps = <984500 1>; + }; + + /* GEN 3x2 GEN 4x1 */ + opp-16000000 { + opp-hz = /bits/ 64 <16000000>; + required-opps = <&rpmhpd_opp_nom>; + opp-peak-kBps = <1969000 1>; + }; + + /* GEN 4x2 */ + opp-32000000 { + opp-hz = /bits/ 64 <32000000>; + required-opps = <&rpmhpd_opp_nom>; + opp-peak-kBps = <3938000 1>; + }; + }; + }; pcie1_phy: phy@1c0e000 { From patchwork Sat Mar 2 04:00:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579375 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 232571756E; Sat, 2 Mar 2024 04:01:00 +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=1709352062; cv=none; b=DQPi2Gt0QYkosaF92WKV60yobCW6IuXVifz3K/To08wi6BND59TIWePR7IIrPwlutDuq8vOBzVbbcrL6bVUkYweVEBQHeYPgAR7mDoKzp1rkHVhsWK5GkhD0Bnj6PpMS5hBGbp0Lz+I6N4ROAJp/I4Z+zzFGsjlRE/9RP45++hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352062; c=relaxed/simple; bh=nSpbkHHNz+FKFBbDuIW+CvRRR7bDmGt7PvmlIiVYSsQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=a6QQ7m6nzqKQZyyILdwLCPTsKdGMPqUS278LK6X8YluvENLhlc/aF/e37EDnLMDG/XtN3QQ+5ByVX4eIzc+4H70ZwxEqleLW5oLzcwMN9XDuCViHsgtqSGpKnp0Ef9ZTszzsdfjeL4mEAq+jDlaxS2R4e4ya6BP2B2cIfu/yzGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ccl2kzYj; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ccl2kzYj" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223xFjf021339; Sat, 2 Mar 2024 04:00:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=NzS2INWWqVE2VaxwVYFo0ZkDao5Z7uZu2P/3PWHMcGI =; b=ccl2kzYjUR9+HKqDrThNoouCmQXHID7IwazpIoO+DkMwxbcfR+pLL/d3pKs AJe2LRNU/6O9+cGeZuRFq8BmCMXlxkKtYSg6Xhi1HWMIhN0UfYT5qmXBBUvdax1F vQjYMSWKBgGiqdUzuR5zcFKn+YIE7KdAk3u/S234dukEPxoICVu7vMgczcrSRp+l qiHEU/nKqJjWKpF6rPIicsYHwRpoBhWX7lTp7PSYb8kkIRr8nyMEQrUcYEIcF2gt 1lBWaoq/PEQUaAIoyr9yCG9AYFpM1a7aw0zmcyGZeGcAExCuPKlcqiVNJQsF+l0b gNKCoUH7vDT7+BgKkNa+P5p6rtA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkuq50275-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:52 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240oCL007050 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:51 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:44 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:30:00 +0530 Subject: [PATCH v8 6/7] PCI: Bring the PCIe speed to MBps logic to new pcie_link_speed_to_mbps() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-6-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352004; l=1963; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=nSpbkHHNz+FKFBbDuIW+CvRRR7bDmGt7PvmlIiVYSsQ=; b=j3d2h6SUWrZPRZyoY8IypkYWBISHl59nk2Y2kGCMa6t1Aa7VDgxqiqVH9XWfql8CR6f1cfLln xUXjjeNvqLfBej+lNNO+jM0F/8b33HlUt4Dk8FOL1dHFN65HSSH5Yz7 X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: bDslgW6CwmrHY1LOWqCl-OtZddYO-Xf9 X-Proofpoint-ORIG-GUID: bDslgW6CwmrHY1LOWqCl-OtZddYO-Xf9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 mlxscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=923 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 Bring the switch case in pcie_link_speed_mbps() to new function to the header file so that it can be used in other places like in controller driver. Signed-off-by: Krishna chaitanya chundru Reviewed-by: Manivannan Sadhasivam --- drivers/pci/pci.c | 19 +------------------ drivers/pci/pci.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d8f11a078924..b441ab862a8d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -6309,24 +6309,7 @@ int pcie_link_speed_mbps(struct pci_dev *pdev) if (err) return err; - switch (to_pcie_link_speed(lnksta)) { - case PCIE_SPEED_2_5GT: - return 2500; - case PCIE_SPEED_5_0GT: - return 5000; - case PCIE_SPEED_8_0GT: - return 8000; - case PCIE_SPEED_16_0GT: - return 16000; - case PCIE_SPEED_32_0GT: - return 32000; - case PCIE_SPEED_64_0GT: - return 64000; - default: - break; - } - - return -EINVAL; + return pcie_link_speed_to_mbps(to_pcie_link_speed(lnksta)); } EXPORT_SYMBOL(pcie_link_speed_mbps); diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 2336a8d1edab..40403783229f 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -282,6 +282,28 @@ void pci_bus_put(struct pci_bus *bus); (speed) == PCIE_SPEED_2_5GT ? 2500*8/10 : \ 0) +static inline int pcie_link_speed_to_mbps(enum pci_bus_speed speed) +{ + switch (speed) { + case PCIE_SPEED_2_5GT: + return 2500; + case PCIE_SPEED_5_0GT: + return 5000; + case PCIE_SPEED_8_0GT: + return 8000; + case PCIE_SPEED_16_0GT: + return 16000; + case PCIE_SPEED_32_0GT: + return 32000; + case PCIE_SPEED_64_0GT: + return 64000; + default: + break; + } + + return -EINVAL; +} + const char *pci_speed_string(enum pci_bus_speed speed); enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); From patchwork Sat Mar 2 04:00:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna chaitanya chundru X-Patchwork-Id: 13579376 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 C42F1179BC; Sat, 2 Mar 2024 04:01:05 +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=1709352067; cv=none; b=Sy3/duhyLy7Y/rUf68A2zmp5m218IE+i7CM4FDCcomwNTMmMfcgLwpgoezS+aRgfrlu51kd4KhJ2QVcgWIzVuBA1Dep/h/vpvx2bcKTkw6j/B9w51/KIjyWq21bzaYZB7jzPNjrZ4Xqi82D3GyZ33O6kwYNxKD5Yxk3XbjAJcEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709352067; c=relaxed/simple; bh=QUJ+uyOOht+Lnc6Y4adY/bs8ZcDhOvU50AmkDpCQsfQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=afqf6Xm9OnKHmcRPphzIesGuq++POjQeHN0YAkzMZrA1lnPi9mvBMfGOVNz0277IpxO0mbzX/UirwJM2VnEMpGcdgt8iJSvEYIXIWIkEDLuxfBBatZegnzHKJHWtGzDf0nyjyL1oqPkFKRoQ3arAaIkbOlH01UyaPIW6J72jo5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=f1kXHz4N; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="f1kXHz4N" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4223k3oR016757; Sat, 2 Mar 2024 04:00:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=UgXdaho2g1wAGEkx5lrs8R4Q61U+T3fkNPkjg6bs7M4 =; b=f1kXHz4N7n9Aak90wcQ+U+760SkFTu0zlkdH+9rpwa3Qx99B6dN7ik9LmpK LFnfLbw47rqvqz2pMzuclBixdyXS6LuuSV/A0WU2+m9fwFpmtf23sFdsqXgyJKxY fW9b1Xc48F4+tT1dgbGbFe2hMl2ItIOEbddtTugAweZ6Ev4a0woNW8bonysH0ZTU GdWrTCWS5BxMDaRGECYRw+0LjmaJ7PTB1aWvCLyknJPqypAdIlynfnzmR7XrG5DZ wIzrQVaSSR4aXDTzkObd1fewCdevns0UZ29PV0+1Ra+/E9J+DawKGR5Y9og5sa3p LXsjCdfzpXof1GV0CXAeikHhLnA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkvb700v2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 02 Mar 2024 04:00:58 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42240v8c022368 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 2 Mar 2024 04:00:57 GMT Received: from hu-krichai-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 1 Mar 2024 20:00:51 -0800 From: Krishna chaitanya chundru Date: Sat, 2 Mar 2024 09:30:01 +0530 Subject: [PATCH v8 7/7] PCI: qcom: Add OPP support to scale performance state of power domain Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240302-opp_support-v8-7-158285b86b10@quicinc.com> References: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> In-Reply-To: <20240302-opp_support-v8-0-158285b86b10@quicinc.com> To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Rob Herring , Johan Hovold , Brian Masney , Georgi Djakov CC: , , , , , , , , , Krishna chaitanya chundru X-Mailer: b4 0.13-dev-83828 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709352004; l=5942; i=quic_krichai@quicinc.com; s=20230907; h=from:subject:message-id; bh=QUJ+uyOOht+Lnc6Y4adY/bs8ZcDhOvU50AmkDpCQsfQ=; b=hW7ITjW6G5LvtaqTuJ34NeeUYCWzHiMfeFprZaObeexidG+hGigmIx//ij8DAZ0EZVd7NgK1+ Sb7gRxYjNI7B+iIK3DWlCVI0HKfrNZ3wGYeUrRERqZuR99URx8KejEH X-Developer-Key: i=quic_krichai@quicinc.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ksJOpkJ0QGO-ZZOAlhlqsbEcauEdec9Q X-Proofpoint-ORIG-GUID: ksJOpkJ0QGO-ZZOAlhlqsbEcauEdec9Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-01_24,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 malwarescore=0 impostorscore=0 clxscore=1015 spamscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403020031 QCOM Resource Power Manager-hardened (RPMh) is a hardware block which maintains hardware state of a regulator by performing max aggregation of the requests made by all of the clients. PCIe controller can operate on different RPMh performance state of power domain based on the speed of the link. And this performance state varies from target to target, like some controllers support GEN3 in NOM (Nominal) voltage corner, while some other supports GEN3 in low SVS (static voltage scaling). The SoC can be more power efficient if we scale the performance state based on the aggregate PCIe link bandwidth. Add Operating Performance Points (OPP) support to vote for RPMh state based on the aggregate link bandwidth. OPP can handle ICC bw voting also, so move ICC bw voting through OPP framework if OPP entries are present. Different link configurations may share the same aggregate bandwidth, e.g., a 2.5 GT/s x2 link and a 5.0 GT/s x1 link have the same bandwidth and share the same OPP entry. As we are moving ICC voting as part of OPP, don't initialize ICC if OPP is supported. Signed-off-by: Krishna chaitanya chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 81 +++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index a0266bfe71f1..2ec14bfafcfc 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -244,6 +245,7 @@ struct qcom_pcie { const struct qcom_pcie_cfg *cfg; struct dentry *debugfs; bool suspended; + bool opp_supported; }; #define to_qcom_pcie(x) dev_get_drvdata((x)->dev) @@ -1405,15 +1407,13 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) return 0; } -static void qcom_pcie_icc_update(struct qcom_pcie *pcie) +static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie) { struct dw_pcie *pci = pcie->pci; - u32 offset, status; + u32 offset, status, freq; + struct dev_pm_opp *opp; int speed, width; - int ret; - - if (!pcie->icc_mem) - return; + int ret, mbps; offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); status = readw(pci->dbi_base + offset + PCI_EXP_LNKSTA); @@ -1425,11 +1425,30 @@ static void qcom_pcie_icc_update(struct qcom_pcie *pcie) speed = FIELD_GET(PCI_EXP_LNKSTA_CLS, status); width = FIELD_GET(PCI_EXP_LNKSTA_NLW, status); - ret = icc_set_bw(pcie->icc_mem, 0, width * QCOM_PCIE_LINK_SPEED_TO_BW(speed)); - if (ret) { - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", - ret); + if (pcie->opp_supported) { + mbps = pcie_link_speed_to_mbps(pcie_link_speed[speed]); + if (mbps < 0) + return; + + freq = mbps * 1000; + opp = dev_pm_opp_find_freq_exact(pci->dev, freq * width, true); + if (!IS_ERR(opp)) { + ret = dev_pm_opp_set_opp(pci->dev, opp); + if (ret) + dev_err(pci->dev, "Failed to set opp: freq %ld ret %d\n", + dev_pm_opp_get_freq(opp), ret); + dev_pm_opp_put(opp); + } + } else { + ret = icc_set_bw(pcie->icc_mem, 0, + width * QCOM_PCIE_LINK_SPEED_TO_BW(speed)); + if (ret) { + dev_err(pci->dev, + "failed to set interconnect bandwidth for pcie-mem: %d\n", ret); + } } + + return; } static int qcom_pcie_link_transition_count(struct seq_file *s, void *data) @@ -1472,8 +1491,10 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie) static int qcom_pcie_probe(struct platform_device *pdev) { const struct qcom_pcie_cfg *pcie_cfg; + unsigned long max_freq = INT_MAX; struct device *dev = &pdev->dev; struct qcom_pcie *pcie; + struct dev_pm_opp *opp; struct dw_pcie_rp *pp; struct resource *res; struct dw_pcie *pci; @@ -1540,9 +1561,36 @@ static int qcom_pcie_probe(struct platform_device *pdev) goto err_pm_runtime_put; } - ret = qcom_pcie_icc_init(pcie); - if (ret) + /* OPP table is optional */ + ret = devm_pm_opp_of_add_table(dev); + if (ret && ret != -ENODEV) { + dev_err_probe(dev, ret, "Failed to add OPP table\n"); goto err_pm_runtime_put; + } + + /* + * Use highest OPP here if the OPP table is present. At the end of + * the probe(), OPP will be updated using qcom_pcie_icc_opp_update(). + */ + if (ret != -ENODEV) { + opp = dev_pm_opp_find_freq_floor(dev, &max_freq); + if (!IS_ERR(opp)) { + ret = dev_pm_opp_set_opp(dev, opp); + if (ret) + dev_err_probe(pci->dev, ret, + "Failed to set opp: freq %ld\n", + dev_pm_opp_get_freq(opp)); + dev_pm_opp_put(opp); + } + pcie->opp_supported = true; + } + + /* Skip ICC init if OPP is supported as ICC bw is handled by OPP */ + if (!pcie->opp_supported) { + ret = qcom_pcie_icc_init(pcie); + if (ret) + goto err_pm_runtime_put; + } ret = pcie->cfg->ops->get_resources(pcie); if (ret) @@ -1562,7 +1610,7 @@ static int qcom_pcie_probe(struct platform_device *pdev) goto err_phy_exit; } - qcom_pcie_icc_update(pcie); + qcom_pcie_icc_opp_update(pcie); if (pcie->mhi) qcom_pcie_init_debugfs(pcie); @@ -1621,10 +1669,13 @@ static int qcom_pcie_suspend_noirq(struct device *dev) qcom_pcie_host_init(&pcie->pci->pp); pcie->suspended = false; } - qcom_pcie_icc_update(pcie); + qcom_pcie_icc_opp_update(pcie); return ret; } + if (pcie->opp_supported) + dev_pm_opp_set_opp(pcie->pci->dev, NULL); + return 0; } @@ -1647,7 +1698,7 @@ static int qcom_pcie_resume_noirq(struct device *dev) pcie->suspended = false; } - qcom_pcie_icc_update(pcie); + qcom_pcie_icc_opp_update(pcie); return 0; }