From patchwork Wed Jul 10 06:10:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 811826 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 B35A73FB30; Wed, 10 Jul 2024 06:11:51 +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=1720591913; cv=none; b=fQJtcIqdkoMRjo5luijPPU5hAHA5MCUp5AGgTC93u5Fjm0cz291dcn85Qunvii4wLbBtKE4Er00LNHSShc44057T/3gHro+taiurKHRf9H3rnp0khtEnZgRihXNTN5xkJLDCpTt60nM8ru21cVVydVGgdMqTvKr5IgY5IQafpGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591913; c=relaxed/simple; bh=vFRk7/rTQDrTZ8HK/TrY2TGAPfKllCdDSB87qCjJ2fo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HQvu6k6jLqRZ9L/7rALEg6+HFdozBLpBnKQSnkBjZ7ysaJnKUEaV1+5oKfqNoMYdgFQx5ysRvGoOGyZORgpU0p6eXh8wZfu58cZyEaLNPRmvKQai9TmNOqxREnfu8dFUiXawSfJycbpgUWJ7wYz5wA1b6h+cxIQsl00yRv9Endg= 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=lmNM1aI4; 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="lmNM1aI4" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46A4aA9J024317; Wed, 10 Jul 2024 06:11:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1MvwAaE9Ic1qgTdPu5/tkjDHPI+KygVcOLxNMwan3Rs=; b=lmNM1aI4NKjzbUYX Z0ovK8fYtmKp2A9/TCQ/wO0mokyz03BNrf0fl05sIvCwO9LCpT2UHnDgw/wt4tbf UCbCwvFifXQ5LlKi4z+nh5p1j0AcJNtlR9WCvzg/OwW0D1m9kerxiXJ8yFyX9Q1N 1ab7mK3hRev4HtfE6GkJ38w2DTx7ZF6fwzE4H7SYU+k/ihJDhn8XXQoLQ+ZbFhUG HRSltAn+CprJtp2mC4GDj8BW4JmfDMtlbl4tYVZXksD8BPzgENuB0IO+y6Z/KwMj qxuFhN2fqvJGBHfGpIgq1Y4Y015FBKWN/kFfOCwYSUnGCDXw2e9ZboBgE7V5LiqT zos+jw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 409kdtg53t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:11:31 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A6BUG2025378 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:11:30 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 23:11:22 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 1/9] soc: qcom: cpr3: Fix 'acc_desc' usage Date: Wed, 10 Jul 2024 11:40:54 +0530 Message-ID: <20240710061102.1323550-2-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710061102.1323550-1-quic_varada@quicinc.com> References: <20240710061102.1323550-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: JlH7gqpMAYf1YCXz-0G8v0DbAN2Qoo5C X-Proofpoint-GUID: JlH7gqpMAYf1YCXz-0G8v0DbAN2Qoo5C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_02,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 impostorscore=0 mlxlogscore=782 lowpriorityscore=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100046 cpr3 code assumes that 'acc_desc' is available for SoCs implementing CPR version 4 or less. However, IPQ9574 SoC implements CPRv4 without ACC. This causes NULL pointer accesses resulting in crashes. Hence, check if 'acc_desc' is populated before using it. Signed-off-by: Varadarajan Narayanan --- v6: Changes done in the previous version of this patch got squashed into Konrad's V15 - https://lore.kernel.org/lkml/20240708-topic-cpr3h-v15-9-5bc8b8936489@linaro.org/ In v14, cpr_set_acc() was invoked from cpr_pre_voltage() or cpr_post_voltage(). Both of those functions invoked cpr_set_acc() only if drv->tcsr was not NULL (and that implied acc_desc != NULL). In v15, cpr_pre_voltage() & cpr_post_voltage() have been removed and cpr_set_acc() is called even though acc_desc is NULL resulting in NULL pointer access. Hence allow cpr_set_acc() to proceed only if acc_desc is set. v5: Add acc_desc check in a different way without breaking other SoC v4: Undo the acc_desc validation in probe function as that could affect other SoC. --- drivers/pmdomain/qcom/cpr3.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/qcom/cpr3.c b/drivers/pmdomain/qcom/cpr3.c index de24973978b7..d594bc79be1c 100644 --- a/drivers/pmdomain/qcom/cpr3.c +++ b/drivers/pmdomain/qcom/cpr3.c @@ -536,12 +536,15 @@ static void cpr_corner_restore(struct cpr_thread *thread, static void cpr_set_acc(struct cpr_drv *drv, int f) { const struct acc_desc *desc = drv->acc_desc; - struct reg_sequence *s = desc->settings; - int n = desc->num_regs_per_fuse; + struct reg_sequence *s; + int n; - if (!drv->tcsr) + if (!desc || !drv->tcsr) return; + s = desc->settings; + n = desc->num_regs_per_fuse; + if (!s || f == drv->fuse_level_set) return; From patchwork Wed Jul 10 06:10:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 811825 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 12F1781749; Wed, 10 Jul 2024 06:11:57 +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=1720591919; cv=none; b=YEi0pCeh2NiY5R7nu/r5y7SpGipVZ1vWuhH+1WSigRRgeTM0KOplE/29eefAnyo8QO+ZFcfVhBBb+8NQUcEToJ3fd1ukebRzwtQUt7JZNcyC46T8wwuRQX8Gy0x48ucihXRxSE6EsR6Fe4HyYmiqLB311ChrERGyuBQlb4YsGJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591919; c=relaxed/simple; bh=tDjrifa2LqFmQWsLg/ZSP6qje1xKGbwYP8qq+mdaR4Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Nqm9wZ57lxl0MwEhy7Mm3rd/J+e0G7Vf9YRjbO+lkN7xYc5A/8j9xZsqMeTV3z4KgS/yKnDpgng9YmABMe+jziPkVBg9Ngl/xa/ln1dn4/Z44PQ1OpLDqIrvHXlqh9u20PdcVEvRG5X8zaYIAC/ZwUqLXHJ/2Yox4oi9dXHJJL0= 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=nG5/v5C8; 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="nG5/v5C8" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46A04HV6020395; Wed, 10 Jul 2024 06:11:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LpWFBmy7fneVsM1DRhC0RthcvO+OK8rZqAR7uEmawuo=; b=nG5/v5C8LQWG3YPq csEo6zmvvNgccuZGux72tEHWtQW05sotfILj/5b1icKy2Kjy8nh/i+IPxm2gFkpN vyiaZGO5FNLy6HW7x4WxbkrVGyv/DG2MZl7lxNw5flEZuXYSjFOskgy0VTRii5nx GUpBZS9f3/DKiuiuhSKNs9JVp6crfojoMBTjJJuklTfTiQKcqpTyaw2Du/r7vJbc ZGo3opp1tJoUAbPpBf/agi7ndDw+Gk7TccK/WnmnLu2nN1l2ZeSlK36za3Gv/DHr oQ74YS07niqGgFD2JiK1RlNoNlpFkRDwzWTK61JaWFqXSP3oaIXtnIkkEgJX5IyA jcrwIw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 406x0t8km1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:11:47 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A6Bkdk031382 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:11:46 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 23:11:38 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , , , , , , CC: Krzysztof Kozlowski Subject: [PATCH v6 3/9] dt-bindings: power: rpmpd: Add IPQ9574 power domains Date: Wed, 10 Jul 2024 11:40:56 +0530 Message-ID: <20240710061102.1323550-4-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710061102.1323550-1-quic_varada@quicinc.com> References: <20240710061102.1323550-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: CVFm7ImBWMKyMx8nTmt18Es7aFVVTKHJ X-Proofpoint-ORIG-GUID: CVFm7ImBWMKyMx8nTmt18Es7aFVVTKHJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_02,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 suspectscore=0 phishscore=0 mlxlogscore=938 priorityscore=1501 malwarescore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100046 Add the compatibles and indexes for the rpmpd in IPQ9574. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Varadarajan Narayanan --- v3 & v4: no changes v2: Add Reviewed-by --- Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 + include/dt-bindings/power/qcom-rpmpd.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml index 929b7ef9c1bc..e20ba25fa094 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml @@ -17,6 +17,7 @@ properties: compatible: oneOf: - enum: + - qcom,ipq9574-rpmpd - qcom,mdm9607-rpmpd - qcom,msm8226-rpmpd - qcom,msm8909-rpmpd diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h index 608087fb9a3d..0538370bfbb4 100644 --- a/include/dt-bindings/power/qcom-rpmpd.h +++ b/include/dt-bindings/power/qcom-rpmpd.h @@ -402,6 +402,9 @@ #define QCM2290_VDD_LPI_CX 6 #define QCM2290_VDD_LPI_MX 7 +/* IPQ9574 Power Domains */ +#define IPQ9574_VDDAPC 0 + /* RPM SMD Power Domain performance levels */ #define RPM_SMD_LEVEL_RETENTION 16 #define RPM_SMD_LEVEL_RETENTION_PLUS 32 From patchwork Wed Jul 10 06:10:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 811824 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 113AB57C8D; Wed, 10 Jul 2024 06:12:19 +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=1720591941; cv=none; b=dXrRlj6mZkPQEDsc/wPTfr9gjFl3k3HDfJmgtqGiAnbfjSDmSmTmy+eoDsFNiJDJIQcGT9erh4c61Mwt0BDYCmgpDwUjuP/ihihfJ7NoSFakB5wiFP4XkKnUxek7e1MChRn7q0NBbDx8dwZhGDSQYWkcChlOZV8hRyEUoHwFYWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591941; c=relaxed/simple; bh=kyT2lvnZ/z/NDW94MzCkn8+4xY1RNh2feW47eeACaGM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RgdptI1FKaCh1opKbCKTaAtoReCpSrk2YXKrnMUPip67yBrwIAd00DAGurMGfHOhwhaY8Yu+O1T3XKzisIqFv3R1NqWyrONJePPhD4comMEqzRQrL5wntiZf9E5UNXE31QwB3cPoCFGjBHnNFyrTrrwzMajuaq2CT55c/DQqhzQ= 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=pVF5yOXg; 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="pVF5yOXg" 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 469HB3jl026771; Wed, 10 Jul 2024 06:12:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ZReu1Re5cu0W/i7PRU33nbGEbt3ZUnonMSTjz/njU+A=; b=pVF5yOXgyUDW96PU aD/QbkPFt2Z1KqY5Fr9NnPjDNQQkjB3btNwwgr47H9jTupc4lJgCXCDrHxNnCDQT xqQDwPRklcRIS1ic2xKBengjQMxS9ls0Myo6rcpr+pBFpcjduXb+6XDDjtqeGAHc TDZKwAQTLrblV9OeM1UZ97ePK6ho085HNXNwx2mNyvDGODzWKXd8wBui6SZ68seU Uv54a9ULdbYR1oAhhWo/2EMnF9E2OrcEetz5itaeh7rkmMGI3ihgapW99M7Gkb7d iWkMfkoEAZ1whJ8G6llkNAZzWNb0ZpVbkVc71d5C32Vk5H8q+L0+Prpi8jrs8pxt EcXTXw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4091jdjnes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:03 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A6C2SR024489 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:02 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 23:11:54 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , , , , , , CC: Praveenkumar I , Dmitry Baryshkov Subject: [PATCH v6 5/9] pmdomain: qcom: rpmpd: Add IPQ9574 power domains Date: Wed, 10 Jul 2024 11:40:58 +0530 Message-ID: <20240710061102.1323550-6-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710061102.1323550-1-quic_varada@quicinc.com> References: <20240710061102.1323550-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: rfPWICN7bGvtt5MxKLcz-Dhv_M8ueML0 X-Proofpoint-ORIG-GUID: rfPWICN7bGvtt5MxKLcz-Dhv_M8ueML0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_02,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100045 From: Praveenkumar I Add the APC power domain definitions used in IPQ9574. Reviewed-by: Dmitry Baryshkov Signed-off-by: Praveenkumar I Signed-off-by: Varadarajan Narayanan --- v4: Add Reviewed-by: Dmitry Baryshkov v3: Fix patch author v2: Fix Signed-off-by order --- drivers/pmdomain/qcom/rpmpd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c index 5e6280b4cf70..947d6a9c3897 100644 --- a/drivers/pmdomain/qcom/rpmpd.c +++ b/drivers/pmdomain/qcom/rpmpd.c @@ -38,6 +38,7 @@ static struct qcom_smd_rpm *rpmpd_smd_rpm; #define KEY_FLOOR_CORNER 0x636676 /* vfc */ #define KEY_FLOOR_LEVEL 0x6c6676 /* vfl */ #define KEY_LEVEL 0x6c766c76 /* vlvl */ +#define RPM_KEY_UV 0x00007675 /* "uv" */ #define MAX_CORNER_RPMPD_STATE 6 @@ -644,6 +645,23 @@ static const struct rpmpd_desc mdm9607_desc = { .max_state = RPM_SMD_LEVEL_TURBO, }; +static struct rpmpd apc_s1_lvl = { + .pd = { .name = "apc", }, + .res_type = RPMPD_SMPA, + .res_id = 1, + .key = RPM_KEY_UV, +}; + +static struct rpmpd *ipq9574_rpmpds[] = { + [IPQ9574_VDDAPC] = &apc_s1_lvl, +}; + +static const struct rpmpd_desc ipq9574_desc = { + .rpmpds = ipq9574_rpmpds, + .num_pds = ARRAY_SIZE(ipq9574_rpmpds), + .max_state = RPM_SMD_LEVEL_TURBO_HIGH, +}; + static struct rpmpd *msm8226_rpmpds[] = { [MSM8226_VDDCX] = &cx_s1a_corner, [MSM8226_VDDCX_AO] = &cx_s1a_corner_ao, @@ -931,6 +949,7 @@ static const struct rpmpd_desc qcm2290_desc = { }; static const struct of_device_id rpmpd_match_table[] = { + { .compatible = "qcom,ipq9574-rpmpd", .data = &ipq9574_desc }, { .compatible = "qcom,mdm9607-rpmpd", .data = &mdm9607_desc }, { .compatible = "qcom,msm8226-rpmpd", .data = &msm8226_desc }, { .compatible = "qcom,msm8909-rpmpd", .data = &msm8916_desc }, From patchwork Wed Jul 10 06:11:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 811823 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 6C1BF57CB6; Wed, 10 Jul 2024 06:12:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591953; cv=none; b=OiqZLYG57JtOUagernf80QXgUuFusqpmQLyypP+PkSLFk7c/TOCQ4Lbisr8boE4dVDOflFobrfyZdxIxmzqQo46Nz70H8qawKXL8/cvQU6+WjUPIgu1A7AFUgzeTpBlJqcTio1OzKAu0RCsJi9DUm4LImzap9lDU4ZXXkzGYKAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591953; c=relaxed/simple; bh=NbghBCuv6Z9GqbuZNLOUww8AHwyziSDpjlICfOPy36A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jbpsG2E9HgY0hnKlA/ax7ocMN3LBBgoMHrciNr1s8oojTJTWlIaQWsDKyY8thpwkp0DGdwkiiEzCtEWWsPLYKwhIfbsKfqLVegE0aAJLu9llVqa3jXuYVuAbdyf919oBdNxFcngkUOid3YMFsCoFJm5pbaU77F9FS/Ufeg/UQsI= 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=cfXl5xQ6; 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="cfXl5xQ6" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 469MV6Mu031488; Wed, 10 Jul 2024 06:12:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= b7L/FBiJ5rwG+vtCCzRfyxibTJlnj405qJWswdSeEWc=; b=cfXl5xQ6q5MAsOrE HK/HiozEB/2Bsd8qgATZ3Ernve2tyViHlN+cRRhxMwCmj1CAfP+RuyVUbOPmpKy7 xCd+pVfbB8SCkBNtW7Ac6LN9eS89dYxgFFOa7LfdQa9+ZwX4wQYNsK1LyV2XGtKr v7mQnERk8S+yacK/UQde+3q8i8pxxeAkjn65RzhwI3rIxiPNyee2KMN86qKCcaLW 81+RlXKeyouCkiflRvgZt2rcOd9Jn6Xf1eYhK/ehuxFv05xeiVcIvSh++5XYoCXT AfJMjccswXUSKX4MHSseNUugfUyxwcVr4ShyH94uBXx0qBM9Bz60MKZenRU93ifT rL3syw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 406wgwrcat-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:19 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A6CHJR026269 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:17 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 23:12:10 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , , , , , , CC: Dmitry Baryshkov Subject: [PATCH v6 7/9] clk: qcom: gcc-ipq9574: Add CPR clock definition Date: Wed, 10 Jul 2024 11:41:00 +0530 Message-ID: <20240710061102.1323550-8-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710061102.1323550-1-quic_varada@quicinc.com> References: <20240710061102.1323550-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: qdznHAP2ff9NesnUHJJSYM3Q9WV2vfKa X-Proofpoint-ORIG-GUID: qdznHAP2ff9NesnUHJJSYM3Q9WV2vfKa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_02,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100046 Add the CPR clock definition needed for enabling access to CPR register space. Reviewed-by: Dmitry Baryshkov Signed-off-by: Varadarajan Narayanan --- drivers/clk/qcom/gcc-ipq9574.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c index e1dc74d04ed1..eac557937fd3 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -3994,6 +3994,43 @@ static struct clk_branch gcc_xo_div4_clk = { }, }; +static const struct freq_tbl ftbl_hmss_rbcpr_clk_src[] = { + F(24000000, P_XO, 1, 0, 0), + { } +}; + +static struct clk_rcg2 rbcpr_clk_src = { + .cmd_rcgr = 0x48044, + .mnd_width = 0, + .hid_width = 5, + .parent_map = gcc_xo_map, + .freq_tbl = ftbl_gp1_clk_src, + .clkr.hw.init = &(struct clk_init_data){ + .name = "rbcpr_clk_src", + .parent_data = gcc_xo_gpll0_gpll4, + .num_parents = ARRAY_SIZE(gcc_xo_map), + .ops = &clk_rcg2_ops, + }, +}; + +static struct clk_branch gcc_rbcpr_clk = { + .halt_reg = 0x48008, + .halt_check = BRANCH_HALT, + .clkr = { + .enable_reg = 0x48008, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_rbcpr_clk", + .parent_hws = (const struct clk_hw *[]) { + &rbcpr_clk_src.clkr.hw, + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static struct clk_hw *gcc_ipq9574_hws[] = { &gpll0_out_main_div2.hw, &gcc_xo_div4_clk_src.hw, @@ -4219,6 +4256,8 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr, [GCC_PCIE2_PIPE_CLK] = &gcc_pcie2_pipe_clk.clkr, [GCC_PCIE3_PIPE_CLK] = &gcc_pcie3_pipe_clk.clkr, + [GCC_RBCPR_CLK_SRC] = &rbcpr_clk_src.clkr, + [GCC_RBCPR_CLK] = &gcc_rbcpr_clk.clkr, }; static const struct qcom_reset_map gcc_ipq9574_resets[] = { From patchwork Wed Jul 10 06:11:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 811822 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 7946B823C3; Wed, 10 Jul 2024 06:12:49 +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=1720591971; cv=none; b=FzAYDiP6pma0QWX2VUlwUfCYfltGgRjJxR7Sf9C1PzeAfJ6doGH3pxFPjMw+H5qZg9Z9oZfWw2QMPBY6e4ZadBfFZT0nOVfbV5wa4uajUPFjHDgsPllE4rQF6zAO/ybqdp+9zZdu1ykhj3kYfF4edjvvstrwmzRKs3urjXJj2BE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720591971; c=relaxed/simple; bh=ZsXydFv8JGtjYKym6GFdVNe0Y6/7YebF+tpjJH5oAv8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IaA2X1IkUVWLGgiQu99nm1hJWsrtGD7gEXL01HXrnR/oLF6qGtdrmd267prpyusMx1Un0chmWjGAy86wumRzH4Gh1TbMsuYPx0Oy4W84KzJpJE4h9SBFNhHtpllc80A/OYQSMxpingz4TiuBhSkqp3MNa+h+sg1V0tLzuktVOfs= 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=jFv2cLSy; 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="jFv2cLSy" 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 469JM2Od016923; Wed, 10 Jul 2024 06:12:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= RTbAyFCRDsEa+UvAoTe6L5S+AKSGjTKSYu3oMGkNmm0=; b=jFv2cLSy43Xotn4x DBdlnhPNrq7E4YFNYIxQTZEO1Bop4zQDo7CAVX6BLKSpWA3VUd8ljtXziTNDST+c 3kycqgb+lEPH+k8dv6yVBmwAAfDgJnn4uDYGb3Ue8I2J+yVpI7usjBB5e+7UIPde p0f+4pa791lPyIHH64W5mFEOd099SKsMj/MkqBzOgqxjkvE3y2CCWXJiTwYvW0r+ y+xw9Gz3WSJdXZxOYWI4lt8I/fndNQhwcFwpQC1WCDWQOOp1Dx7ykcf8KU1JpLeF iUZOkROgvwi4M6ssW8y02vXuw0wQHMGP0EaeXXemo782YnR6TWEUsU/OYChyY4dR qee3Kw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 406xpdr3q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:33 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A6CXdY032378 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 06:12:33 GMT Received: from hu-varada-blr.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 23:12:25 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 9/9] arm64: dts: qcom: ipq9574: Enable CPR Date: Wed, 10 Jul 2024 11:41:02 +0530 Message-ID: <20240710061102.1323550-10-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240710061102.1323550-1-quic_varada@quicinc.com> References: <20240710061102.1323550-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Kg4uClq24RiFPKhcdQqTCBpMzBuYi3no X-Proofpoint-ORIG-GUID: Kg4uClq24RiFPKhcdQqTCBpMzBuYi3no X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-10_02,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 adultscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100046 * Add CPR, RPMPD, OPP table nodes as applicable to IPQ9574 to enable CPR functionality on IPQ9574. * Bootloader set frequency 792MHz is added to the OPP table to the avoid 'need at least 2 OPPs to use CPR' error * Remove 1.2GHz as it is not supported in any of the IPQ9574 SKUs. Signed-off-by: Varadarajan Narayanan --- v6: Fix subject prefix v4: s/cprh/cpr4/ v2: Update commit log. No code change. --- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 269 ++++++++++++++++++++++++-- 1 file changed, 252 insertions(+), 17 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi index 04ba09a9156c..cda30a877877 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -11,6 +11,7 @@ #include #include #include +#include / { interrupt-parent = <&intc>; @@ -42,8 +43,9 @@ CPU0: cpu@0 { clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; clock-names = "cpu"; operating-points-v2 = <&cpu_opp_table>; - cpu-supply = <&ipq9574_s1>; #cooling-cells = <2>; + power-domains = <&apc_cpr4 0>; + power-domain-names = "perf"; }; CPU1: cpu@1 { @@ -55,8 +57,9 @@ CPU1: cpu@1 { clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; clock-names = "cpu"; operating-points-v2 = <&cpu_opp_table>; - cpu-supply = <&ipq9574_s1>; #cooling-cells = <2>; + power-domains = <&apc_cpr4 0>; + power-domain-names = "perf"; }; CPU2: cpu@2 { @@ -68,8 +71,9 @@ CPU2: cpu@2 { clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; clock-names = "cpu"; operating-points-v2 = <&cpu_opp_table>; - cpu-supply = <&ipq9574_s1>; #cooling-cells = <2>; + power-domains = <&apc_cpr4 0>; + power-domain-names = "perf"; }; CPU3: cpu@3 { @@ -81,8 +85,9 @@ CPU3: cpu@3 { clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>; clock-names = "cpu"; operating-points-v2 = <&cpu_opp_table>; - cpu-supply = <&ipq9574_s1>; #cooling-cells = <2>; + power-domains = <&apc_cpr4 0>; + power-domain-names = "perf"; }; L2_0: l2-cache { @@ -105,58 +110,111 @@ memory@40000000 { reg = <0x0 0x40000000 0x0 0x0>; }; + cpr4_opp_table: opp-table-cpr4 { + compatible = "operating-points-v2-qcom-level"; + + cpr4_opp0: opp-0 { + opp-level = <1>; + qcom,opp-fuse-level = <1>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp1: opp-1 { + opp-level = <2>; + qcom,opp-fuse-level = <1>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp2: opp-2 { + opp-level = <3>; + qcom,opp-fuse-level = <1>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp3: opp-3 { + opp-level = <4>; + qcom,opp-fuse-level = <2>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp4: opp-4 { + opp-level = <5>; + qcom,opp-fuse-level = <2>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp5: opp-5 { + opp-level = <6>; + qcom,opp-fuse-level = <3>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + + cpr4_opp6: opp-6 { + opp-level = <7>; + qcom,opp-fuse-level = <4>; + qcom,opp-cloop-vadj = <0>; + qcom,opp-oloop-vadj = <0>; + }; + }; + cpu_opp_table: opp-table-cpu { compatible = "operating-points-v2-kryo-cpu"; opp-shared; nvmem-cells = <&cpu_speed_bin>; + opp-792000000 { + opp-hz = /bits/ 64 <792000000>; + opp-supported-hw = <0x0>; + clock-latency-ns = <200000>; + required-opps = <&cpr4_opp0>; + }; + opp-936000000 { opp-hz = /bits/ 64 <936000000>; - opp-microvolt = <725000>; opp-supported-hw = <0xf>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp1>; }; opp-1104000000 { opp-hz = /bits/ 64 <1104000000>; - opp-microvolt = <787500>; - opp-supported-hw = <0xf>; - clock-latency-ns = <200000>; - }; - - opp-1200000000 { - opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <862500>; opp-supported-hw = <0xf>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp2>; }; opp-1416000000 { opp-hz = /bits/ 64 <1416000000>; - opp-microvolt = <862500>; opp-supported-hw = <0x7>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp3>; }; opp-1488000000 { opp-hz = /bits/ 64 <1488000000>; - opp-microvolt = <925000>; opp-supported-hw = <0x7>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp4>; }; opp-1800000000 { opp-hz = /bits/ 64 <1800000000>; - opp-microvolt = <987500>; opp-supported-hw = <0x5>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp5>; }; opp-2208000000 { opp-hz = /bits/ 64 <2208000000>; - opp-microvolt = <1062500>; opp-supported-hw = <0x1>; clock-latency-ns = <200000>; + required-opps = <&cpr4_opp6>; }; }; @@ -182,6 +240,40 @@ glink-edge { rpm_requests: rpm-requests { compatible = "qcom,rpm-ipq9574"; qcom,glink-channels = "rpm_requests"; + + rpmpd: power-controller { + compatible = "qcom,ipq9574-rpmpd"; + #power-domain-cells = <1>; + operating-points-v2 = <&rpmpd_opp_table>; + + rpmpd_opp_table: opp-table { + compatible = "operating-points-v2"; + + rpmpd_opp_svs: opp1 { + opp-level = ; + }; + + rpmpd_opp_svs_plus: opp2 { + opp-level = ; + }; + + rpmpd_opp_nom: opp3 { + opp-level = ; + }; + + rpmpd_opp_nom_plus: opp4 { + opp-level = ; + }; + + rpmpd_opp_turbo: opp5 { + opp-level = ; + }; + + rpmpd_opp_turbo_high: opp6 { + opp-level = ; + }; + }; + }; }; }; }; @@ -252,6 +344,95 @@ cpu_speed_bin: cpu-speed-bin@15 { reg = <0x15 0x2>; bits = <7 2>; }; + + cpr_efuse_speedbin: speedbin@5 { + reg = <0x5 0x8>; + bits = <0 3>; + }; + + cpr_fuse_revision: cpr-fusing-rev@7 { + reg = <0x7 0x8>; + bits = <1 5>; + }; + + /* CPR Ring Oscillator: Power Cluster */ + cpr_ro_sel0_pwrcl: rosel0-pwrcl@358 { /* ROSEL_SVS */ + reg = <0x358 0x1>; + bits = <4 4>; + }; + + cpr_ro_sel1_pwrcl: rosel1-pwrcl@358 { /* ROSEL_NOM */ + reg = <0x358 0x1>; + bits = <0 4>; + }; + + cpr_ro_sel2_pwrcl: rosel2-pwrcl@350 { /* ROSEL_TUR */ + reg = <0x350 0x1>; + bits = <4 4>; + }; + + cpr_ro_sel3_pwrcl: rosel3-pwrcl@350 { /* ROSEL_STUR */ + reg = <0x350 0x1>; + bits = <0 4>; + }; + + /* CPR Init Voltage: Power Cluster */ + cpr_init_voltage0_pwrcl: ivolt0-pwrcl@343 { /* VOLT_SVS */ + reg = <0x343 0x1>; + bits = <0 6>; + }; + + cpr_init_voltage1_pwrcl: ivolt1-pwrcl@342 { /* VOLT_NOM */ + reg = <0x342 0x1>; + bits = <2 6>; + }; + + cpr_init_voltage2_pwrcl: ivolt2-pwrcl@341 { /* VOLT_TUR */ + reg = <0x341 0x2>; + bits = <4 6>; + }; + + cpr_init_voltage3_pwrcl: ivolt3-pwrcl@340 { /* VOLT_STUR */ + reg = <0x340 0x2>; + bits = <6 6>; + }; + + /* CPR Target Quotients: Power Cluster */ + cpr_quot0_pwrcl: quot0-pwrcl@354 { /* QUOT_VMIN_SVS */ + reg = <0x354 0x2>; + bits = <0 12>; + }; + + cpr_quot1_pwrcl: quot1-pwrcl@352 { /* QUOT_VMIN_NOM */ + reg = <0x352 0x2>; + bits = <4 12>; + }; + + cpr_quot2_pwrcl: quot2-pwrcl@351 { /* QUOT_VMIN_TUR */ + reg = <0x351 0x2>; + bits = <0 12>; + }; + + cpr_quot3_pwrcl: quot3-pwrcl@355 { /* QUOT_VMIN_STUR */ + reg = <0x355 0x2>; + bits = <4 12>; + }; + + /* CPR Quotient Offsets: Power Cluster */ + cpr_quot_offset1_pwrcl: qoff1-pwrcl@34e { /* QUOT_OFFSET_NOM_SVS */ + reg = <0x34e 0x1>; + bits = <0 8>; + }; + + cpr_quot_offset2_pwrcl: qoff2-pwrcl@34d { /* QUOT_OFFSET_TUR_NOM */ + reg = <0x34d 0x1>; + bits = <0 8>; + }; + + cpr_quot_offset3_pwrcl: qoff0-pwrcl@34c { /* QUOT_OFFSET_STUR_TUR */ + reg = <0x34c 0x1>; + bits = <0 8>; + }; }; cryptobam: dma-controller@704000 { @@ -639,6 +820,60 @@ usb_0_dwc3: usb@8a00000 { }; }; + apc_cpr4: power-controller@b018000 { + compatible = "qcom,ipq9574-cpr4", "qcom,cprh"; + reg = <0x0b018000 0x4000>, + <0x00048000 0x4000>; + + clocks = <&gcc GCC_RBCPR_CLK>; + + interrupts = ; + vdd-supply = <&ipq9574_s1>; + + /* Set the CPR clock here, it needs to match XO */ + assigned-clocks = <&gcc GCC_RBCPR_CLK>; + assigned-clock-rates = <24000000>; + + operating-points-v2 = <&cpr4_opp_table>; + power-domains = <&rpmpd IPQ9574_VDDAPC>; + #power-domain-cells = <1>; + + nvmem-cells = <&cpr_efuse_speedbin>, + <&cpr_fuse_revision>, + <&cpr_quot0_pwrcl>, + <&cpr_quot1_pwrcl>, + <&cpr_quot2_pwrcl>, + <&cpr_quot3_pwrcl>, + <&cpr_quot_offset1_pwrcl>, + <&cpr_quot_offset2_pwrcl>, + <&cpr_quot_offset3_pwrcl>, + <&cpr_init_voltage0_pwrcl>, + <&cpr_init_voltage1_pwrcl>, + <&cpr_init_voltage2_pwrcl>, + <&cpr_init_voltage3_pwrcl>, + <&cpr_ro_sel0_pwrcl>, + <&cpr_ro_sel1_pwrcl>, + <&cpr_ro_sel2_pwrcl>, + <&cpr_ro_sel3_pwrcl>; + nvmem-cell-names = "cpr_speed_bin", + "cpr_fuse_revision", + "cpr0_quotient1", + "cpr0_quotient2", + "cpr0_quotient3", + "cpr0_quotient4", + "cpr0_quotient_offset2", + "cpr0_quotient_offset3", + "cpr0_quotient_offset4", + "cpr0_init_voltage1", + "cpr0_init_voltage2", + "cpr0_init_voltage3", + "cpr0_init_voltage4", + "cpr0_ring_osc1", + "cpr0_ring_osc2", + "cpr0_ring_osc3", + "cpr0_ring_osc4"; + }; + intc: interrupt-controller@b000000 { compatible = "qcom,msm-qgic2"; reg = <0x0b000000 0x1000>, /* GICD */