From nobody Sun Oct 5 03:38:53 2025 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 723672E0924; Mon, 11 Aug 2025 09:10: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=1754903433; cv=none; b=snPx3+ZpuzbMLxQo8jCD7KwX0Coamhffwc9d2hKRAe27Z0PszB/v8bphubgLaDDyuPIQi6xTd0jUpPvbqYn3huU3w+bwK48VxTsDcOii9wJZyEYoieKvBFGNl7Q+JKzkzcBk5u8QJ78lrWLPPWBuJ7ANIk0iqgpbfdQW54UmQqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754903433; c=relaxed/simple; bh=Ztfu/dcEq6pZJ+vtoSkR99aWDu6yBZOhG1pLPhH9wP8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HqM/8GRI5yrc4E979+mFe8Leh9MTjsz3aC4RG8L/gzie95jGKGq5TPEZ9FoSi+FHcYGSel2zFVVgYFQ8/UkeP3IHP29YfTpKkl5v/EERaUUNgNDYeC/m8PggMNEe8cO7f0SyWKdLbfHsaiG7ktr8X3bdgGHXvbHflhHyzEahlt0= 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=djHkTRqJ; 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="djHkTRqJ" 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 57ALwvpF004245; Mon, 11 Aug 2025 09:10:27 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= PcQP/LVOaUjn/ZGPYjDlE6qZirGI1tSVP9hECb/DR8g=; b=djHkTRqJFIjjg1y+ 24S0QZDn3V5qZnqi4xrgvo1/CKMhjENfYw2en2KBEBSab0advDzVBDlrrO6PH0Q4 iOPqvQx2BgBut7ythLYGNg5Q3N5sIH5BLQ0EPBdtLak+XBSLEwlTTJucbrRUAEFK pS1abcBYuUEOexXUry4ZuFSSu73R7u88oHoGRd4GzRXpRtZMHBtrgeTz3gvfVsvz TmwjeaF7W+vN+fdLo0zGUFU3wcUrPkluel/fX6nHDwlsDT16ISjn5Cb3civ06GTr z/QgUJfFp+SnQ4Ls+XzS3BuEy4pcChtJ2HlM3EZS/q4xdS/5xBQVENng495rdIgA /HeP4g== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 48dupmkw2h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Aug 2025 09:10:27 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 57B9AQrm025931 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Aug 2025 09:10:26 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.1748.10; Mon, 11 Aug 2025 02:10:21 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , CC: Md Sadre Alam , Sricharan Ramabadhran , Konrad Dybcio Subject: [PATCH v7 3/4] cpufreq: qcom-nvmem: Enable cpufreq for ipq5424 Date: Mon, 11 Aug 2025 14:39:53 +0530 Message-ID: <20250811090954.2854440-4-quic_varada@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250811090954.2854440-1-quic_varada@quicinc.com> References: <20250811090954.2854440-1-quic_varada@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Authority-Analysis: v=2.4 cv=bY5rUPPB c=1 sm=1 tr=0 ts=6899b383 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=2OwXVqhp2XgA:10 a=COk6AnOGAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=XqKM0RL5GMr1h_B9R8QA:9 a=TjNXssC_j7lpFel5tvFf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: EgrbuHlb_6bvNegajKZ6P5pyjPOvk4Tb X-Proofpoint-ORIG-GUID: EgrbuHlb_6bvNegajKZ6P5pyjPOvk4Tb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA5MDAwMCBTYWx0ZWRfX9QRYckcQsTr2 WHT7Tt/biSRClNzXYwiDysL7MdgkTC9p1fQ8N4LCm9klhv1af/S+nq9SS4wEm1RjlRO5yLQdMUf Zh/XP/j2PnLj91TK/VAf20YT9WdnrYONb827/AIdjtikvt6FqPuQU2qfcvoEngTMKCpPvXXE1Bh MuVDCVaclzPfpKPixN+1W1049iViMGdv0pRsN7Ti3hdnBBYZ3pzXPRGU0qr0enX7j6YhjwpDo+J ZgPA7hYMDZosFRyn5mYA4sNqvBRqhXx2LSDaR7xVEEXC/bCbq5gtTRkJSG27bw8mnziE36GrIVr Z1Cha05h47UjYXrHVotQwF342QipSsY4Eq0pYic3LmG89QiHgIrV8GJFr6HC+rsRjJC5FVg3/MP k2Xud4Oc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-11_01,2025-08-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 bulkscore=0 impostorscore=0 priorityscore=1501 spamscore=0 clxscore=1015 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2508090000 Content-Type: text/plain; charset="utf-8" From: Md Sadre Alam IPQ5424 have different OPPs available for the CPU based on SoC variant. This can be determined through use of an eFuse register present in the silicon. Added support for ipq5424 on nvmem driver which helps to determine OPPs at runtime based on the eFuse register which has the CPU frequency limits. opp-supported-hw dt binding can be used to indicate the available OPPs for each limit. nvmem driver also creates the "cpufreq-dt" platform_device after passing the version matching data to the OPP framework so that the cpufreq-dt handles the actual cpufreq implementation. Signed-off-by: Md Sadre Alam Signed-off-by: Sricharan Ramabadhran Acked-by: Viresh Kumar Reviewed-by: Konrad Dybcio [ Changed '!=3D' based check to '=3D=3D' based check ] Signed-off-by: Varadarajan Narayanan --- v5: Add 'Acked-by: Viresh Kumar' --- drivers/cpufreq/cpufreq-dt-platdev.c | 1 + drivers/cpufreq/qcom-cpufreq-nvmem.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq= -dt-platdev.c index 015dd393eaba..de1769649368 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -191,6 +191,7 @@ static const struct of_device_id blocklist[] __initcons= t =3D { { .compatible =3D "ti,am62p5", }, =20 { .compatible =3D "qcom,ipq5332", }, + { .compatible =3D "qcom,ipq5424", }, { .compatible =3D "qcom,ipq6018", }, { .compatible =3D "qcom,ipq8064", }, { .compatible =3D "qcom,ipq8074", }, diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cp= ufreq-nvmem.c index 54f8117103c8..765a5bb81829 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -200,6 +200,10 @@ static int qcom_cpufreq_kryo_name_version(struct devic= e *cpu_dev, case QCOM_ID_IPQ9574: drv->versions =3D 1 << (unsigned int)(*speedbin); break; + case QCOM_ID_IPQ5424: + case QCOM_ID_IPQ5404: + drv->versions =3D (*speedbin =3D=3D 0x3b) ? BIT(1) : BIT(0); + break; case QCOM_ID_MSM8996SG: case QCOM_ID_APQ8096SG: drv->versions =3D 1 << ((unsigned int)(*speedbin) + 4); @@ -591,6 +595,7 @@ static const struct of_device_id qcom_cpufreq_match_lis= t[] __initconst __maybe_u { .compatible =3D "qcom,msm8996", .data =3D &match_data_kryo }, { .compatible =3D "qcom,qcs404", .data =3D &match_data_qcs404 }, { .compatible =3D "qcom,ipq5332", .data =3D &match_data_kryo }, + { .compatible =3D "qcom,ipq5424", .data =3D &match_data_kryo }, { .compatible =3D "qcom,ipq6018", .data =3D &match_data_ipq6018 }, { .compatible =3D "qcom,ipq8064", .data =3D &match_data_ipq8064 }, { .compatible =3D "qcom,ipq8074", .data =3D &match_data_ipq8074 }, --=20 2.34.1