Message ID | 20230512122134.24339-5-quic_kbajaj@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5062504vqo; Fri, 12 May 2023 05:28:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64WrlCzfjzZc7Fz9In+TAXhZdvNJb5bQavCzWF1iN6i21rxA7QZIAzX6eqVbaMmhmZqHsu X-Received: by 2002:a17:902:c40a:b0:1ab:1624:38cf with SMTP id k10-20020a170902c40a00b001ab162438cfmr36328393plk.60.1683894497762; Fri, 12 May 2023 05:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683894497; cv=none; d=google.com; s=arc-20160816; b=V3HSRptXX3ai0eTE25FWlwU3dqMebHDaC8hbuIPfjiLkeEk5hARndwd1Xx4cs3scGQ tRCoscr+8yqX7K+xVmtAWJAWiMQdV0ZeUnoEvVJlwpkPlaAgos88zIpCX3htrlyL5X0b sD7HkquZ2bmgza8WEh8dENzkMtSrMJ3j8LSQH/PmsNbaVubRNiWcKZIOICxshFbnjX+l fiPFMdT26J8l+anBqvIddS4mqjnzjRlYa6Ooa8P4MFiLrD7Q4NOieytuAznr3+r5HBm/ 90pNPkCJ2LCOk10PytXiIZPkfKvo2lfhpi8BLtbBhnlGyaJoa14rj/88W98ggmxnYEBY ePKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=qRWrHVDwbLS+lNdPMcQNCVsVTRkpVonMCQUakS2Yv+k=; b=QVEMixdj2arGD+43WUoXsAzwdDb28urBl/GyQZd+SD/ygJo/eOO67ui+YtyWmNouiI Yw4U5u+WyrhgcgHbBL8lgD3LJp21JnDVo6X/35iS1nSWZZzWpT/GPdk3lWvtLOR15TlX t1t1MJOxoYXBhsx3K+oWoHJJG3YkgCFV0mnozS6l0u7zTbjIMUbkcsNlQP3IRsmF8mj0 CoCbNftZ/CBVMuRIe6Ih3YEKSgW+yja3AdYyPGh/OmHIApyfMciwEAEV4HSDDO2ry1BF UHfo15v4zRnUnWIsRss8PctHDPwSgp1MiI9h58eyqptIlvDk2zf23Ay1h3+H9LlcNiG/ N2yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KzcjMaJh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a170902eccd00b0019c33978781si9659912plh.283.2023.05.12.05.28.02; Fri, 12 May 2023 05:28:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KzcjMaJh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240826AbjELMWA (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Fri, 12 May 2023 08:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240725AbjELMVz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 12 May 2023 08:21:55 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAEF72136; Fri, 12 May 2023 05:21:54 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34CBjEOH020981; Fri, 12 May 2023 12:21:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=qRWrHVDwbLS+lNdPMcQNCVsVTRkpVonMCQUakS2Yv+k=; b=KzcjMaJhSc3xOCc9Q0WTVat71unx7/ZadGeH0xAmSwtjxQevYcFfTWDsuAk/jFdf9bnc 3WWy04IJ29w6a/LmxsMbOe//T7MNrBktAn/pRWg04XzDuVPBBQWjLSLATREzYJrFMAEu x8GqMbICYzp2E64cw9M2zvKa7/Nl0I9+PTV6mqTgtRAo/niatWCqpyzDv2zplU5ecq4x OM/YhmshIq6MRR9OcOFtdX1Jn+/3LfGSsZjWJ6/q9Ew3cgMdHOwo1xgvrmn+G1qvrbRF r8ZKINAMcs/GuUay94SCrRb6H5+MPvlDMMHRX6qb0ChDywi7H6m6bYRU40EVPatTsW8Q 7A== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qhes20x14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 May 2023 12:21:51 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34CCLj5W028989; Fri, 12 May 2023 12:21:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3qdy59u1v4-1; Fri, 12 May 2023 12:21:48 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34CCLmet029036; Fri, 12 May 2023 12:21:48 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-kbajaj-hyd.qualcomm.com [10.147.247.189]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 34CCLmab029035; Fri, 12 May 2023 12:21:48 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2340697) id 87FCD52974D; Fri, 12 May 2023 17:51:47 +0530 (+0530) From: Komal Bajaj <quic_kbajaj@quicinc.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Komal Bajaj <quic_kbajaj@quicinc.com>, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 04/10] nvmem: qfprom: Add support for secure reading on QDU1000/QRU1000 Date: Fri, 12 May 2023 17:51:28 +0530 Message-Id: <20230512122134.24339-5-quic_kbajaj@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230512122134.24339-1-quic_kbajaj@quicinc.com> References: <20230512122134.24339-1-quic_kbajaj@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: IARbnrTGb9K1hxRrRUGmlX-AD9sHcsMM X-Proofpoint-GUID: IARbnrTGb9K1hxRrRUGmlX-AD9sHcsMM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-12_08,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305120103 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765691356898611494?= X-GMAIL-MSGID: =?utf-8?q?1765691356898611494?= |
Series |
soc: qcom: llcc: Add support for QDU1000/QRU1000
|
|
Commit Message
Komal Bajaj
May 12, 2023, 12:21 p.m. UTC
Add qfprom driver support for QDU1000/QRU1000 SOCs.
Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com>
---
drivers/nvmem/qfprom.c | 5 +++++
1 file changed, 5 insertions(+)
--
2.17.1
Comments
On 12/05/2023 14:21, Komal Bajaj wrote: > Add qfprom driver support for QDU1000/QRU1000 SOCs. > > Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com> > --- > drivers/nvmem/qfprom.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c > index 20662e2d3732..12a7981a8a71 100644 > --- a/drivers/nvmem/qfprom.c > +++ b/drivers/nvmem/qfprom.c > @@ -109,6 +109,10 @@ struct qfprom_soc_compatible_data { > bool secure; > }; > > +static const struct qfprom_soc_compatible_data qdu1000_qfprom = { > + .secure = true > +}; > + > static const struct nvmem_keepout sc7180_qfprom_keepout[] = { > {.start = 0x128, .end = 0x148}, > {.start = 0x220, .end = 0x228} > @@ -490,6 +494,7 @@ static int qfprom_probe(struct platform_device *pdev) > > static const struct of_device_id qfprom_of_match[] = { > { .compatible = "qcom,qfprom",}, > + { .compatible = "qcom,qdu1000-qfprom", .data = &qdu1000_qfprom}, > { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom}, I have doubts that this is still compatible with qcom,qfprom. It uses entirely different read method. That's why generic fallbacks are bad, one more case to my growing list of awesome examples. :) Best regards, Krzysztof
On Fri, 12 May 2023 at 20:01, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 12/05/2023 14:21, Komal Bajaj wrote: > > Add qfprom driver support for QDU1000/QRU1000 SOCs. > > > > Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com> > > --- > > drivers/nvmem/qfprom.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c > > index 20662e2d3732..12a7981a8a71 100644 > > --- a/drivers/nvmem/qfprom.c > > +++ b/drivers/nvmem/qfprom.c > > @@ -109,6 +109,10 @@ struct qfprom_soc_compatible_data { > > bool secure; > > }; > > > > +static const struct qfprom_soc_compatible_data qdu1000_qfprom = { > > + .secure = true > > +}; > > + > > static const struct nvmem_keepout sc7180_qfprom_keepout[] = { > > {.start = 0x128, .end = 0x148}, > > {.start = 0x220, .end = 0x228} > > @@ -490,6 +494,7 @@ static int qfprom_probe(struct platform_device *pdev) > > > > static const struct of_device_id qfprom_of_match[] = { > > { .compatible = "qcom,qfprom",}, > > + { .compatible = "qcom,qdu1000-qfprom", .data = &qdu1000_qfprom}, > > { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom}, > > I have doubts that this is still compatible with qcom,qfprom. It uses > entirely different read method. That's why generic fallbacks are bad, > one more case to my growing list of awesome examples. :) Yes, it looks like it should be 'qcom,qdu1000-qfprom", "qcom,scm-qfprom". And possibly a separate driver for scm-qfprom.
On 5/12/2023 11:01 PM, Dmitry Baryshkov wrote: > On Fri, 12 May 2023 at 20:01, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> On 12/05/2023 14:21, Komal Bajaj wrote: >>> Add qfprom driver support for QDU1000/QRU1000 SOCs. >>> >>> Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com> >>> --- >>> drivers/nvmem/qfprom.c | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c >>> index 20662e2d3732..12a7981a8a71 100644 >>> --- a/drivers/nvmem/qfprom.c >>> +++ b/drivers/nvmem/qfprom.c >>> @@ -109,6 +109,10 @@ struct qfprom_soc_compatible_data { >>> bool secure; >>> }; >>> >>> +static const struct qfprom_soc_compatible_data qdu1000_qfprom = { >>> + .secure = true >>> +}; >>> + >>> static const struct nvmem_keepout sc7180_qfprom_keepout[] = { >>> {.start = 0x128, .end = 0x148}, >>> {.start = 0x220, .end = 0x228} >>> @@ -490,6 +494,7 @@ static int qfprom_probe(struct platform_device *pdev) >>> >>> static const struct of_device_id qfprom_of_match[] = { >>> { .compatible = "qcom,qfprom",}, >>> + { .compatible = "qcom,qdu1000-qfprom", .data = &qdu1000_qfprom}, >>> { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom}, >> I have doubts that this is still compatible with qcom,qfprom. It uses >> entirely different read method. That's why generic fallbacks are bad, >> one more case to my growing list of awesome examples. :) Okay, will do that. > Yes, it looks like it should be 'qcom,qdu1000-qfprom", > "qcom,scm-qfprom". And possibly a separate driver for scm-qfprom. The only difference here is in read method, which can be controlled by a single property, do we really need to write a separate driver for just reading secure feature register. Thanks, Komal > >
On Mon, May 15, 2023 at 02:02:11PM +0530, Komal Bajaj wrote: > > > On 5/12/2023 11:01 PM, Dmitry Baryshkov wrote: > > On Fri, 12 May 2023 at 20:01, Krzysztof Kozlowski > > <krzysztof.kozlowski@linaro.org> wrote: > > > On 12/05/2023 14:21, Komal Bajaj wrote: > > > > Add qfprom driver support for QDU1000/QRU1000 SOCs. > > > > > > > > Signed-off-by: Komal Bajaj <quic_kbajaj@quicinc.com> > > > > --- > > > > drivers/nvmem/qfprom.c | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c > > > > index 20662e2d3732..12a7981a8a71 100644 > > > > --- a/drivers/nvmem/qfprom.c > > > > +++ b/drivers/nvmem/qfprom.c > > > > @@ -109,6 +109,10 @@ struct qfprom_soc_compatible_data { > > > > bool secure; > > > > }; > > > > > > > > +static const struct qfprom_soc_compatible_data qdu1000_qfprom = { > > > > + .secure = true > > > > +}; > > > > + > > > > static const struct nvmem_keepout sc7180_qfprom_keepout[] = { > > > > {.start = 0x128, .end = 0x148}, > > > > {.start = 0x220, .end = 0x228} > > > > @@ -490,6 +494,7 @@ static int qfprom_probe(struct platform_device *pdev) > > > > > > > > static const struct of_device_id qfprom_of_match[] = { > > > > { .compatible = "qcom,qfprom",}, > > > > + { .compatible = "qcom,qdu1000-qfprom", .data = &qdu1000_qfprom}, > > > > { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom}, > > > I have doubts that this is still compatible with qcom,qfprom. It uses > > > entirely different read method. That's why generic fallbacks are bad, > > > one more case to my growing list of awesome examples. :) > Okay, will do that. > > Yes, it looks like it should be 'qcom,qdu1000-qfprom", > > "qcom,scm-qfprom". And possibly a separate driver for scm-qfprom. > The only difference here is in read method, which can be controlled by a > single property, > do we really need to write a separate driver for just reading secure feature > register. I presume that if reads are hidden behind scm, then the most of the driver - which deals with writing to qfprom - isn't going to be at all applicable. So, I actually think it would make sense to put that in a separate qfprom-scm driver, which handles the generic fallback of "qcom,qfprom-scm". Regards, Bjorn > > Thanks, > Komal > > > > >
diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index 20662e2d3732..12a7981a8a71 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -109,6 +109,10 @@ struct qfprom_soc_compatible_data { bool secure; }; +static const struct qfprom_soc_compatible_data qdu1000_qfprom = { + .secure = true +}; + static const struct nvmem_keepout sc7180_qfprom_keepout[] = { {.start = 0x128, .end = 0x148}, {.start = 0x220, .end = 0x228} @@ -490,6 +494,7 @@ static int qfprom_probe(struct platform_device *pdev) static const struct of_device_id qfprom_of_match[] = { { .compatible = "qcom,qfprom",}, + { .compatible = "qcom,qdu1000-qfprom", .data = &qdu1000_qfprom}, { .compatible = "qcom,sc7180-qfprom", .data = &sc7180_qfprom}, { .compatible = "qcom,sc7280-qfprom", .data = &sc7280_qfprom}, {/* sentinel */},