Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1282020rwd; Sat, 27 May 2023 14:42:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Uv/3bOiuUpDUULvRh/JXjVNPPLV3+AmRmvorEPjcoMSFXZath2YiqgiIwqziuA7zvL28E X-Received: by 2002:aa7:888e:0:b0:63b:8eeb:77b8 with SMTP id z14-20020aa7888e000000b0063b8eeb77b8mr9340634pfe.13.1685223755302; Sat, 27 May 2023 14:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685223755; cv=none; d=google.com; s=arc-20160816; b=D59eOOY/Gv+5caOgQwsyg0xS+yUrWWRT4Ps99rhpjv3rlKztdiIi5nSt4FL3dg5ub+ nrh5Bc5o1DwoVknsXHunqRYye3ufMnvGk06Tbt2q6CTX8pS0E++tBYW65JRxZ9b4VnSo MFZgTnorLKHWH4lqWIea+io6y52L4FI7WZTNQGC37fe4E6dPdL5xpxSMjCBgJpAxHlFH JyBeGszuE57lg1exYPD50lZdTUFZy3nNAbVcOs/q2XMULR+S2w8ywhx8EmAYRcRXSJvV c6cup//rfjqxJy02kYnhmEstUeKaoCAYkvmHyk/Nr9Br100WuLIDRMNEXLmiFmz5Lhn9 0dTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m9aD5dVWEr27JBVIgNMD0JeGf7JKBVGpX05y5wBJkII=; b=C6ZBH6v/SV17aAccHmd/RsW4Bd47RFc7MZSY56CwnOAmH+2ryFWlUhVP111aOAA3pZ ELKhGwGapITYD33Itxd9BruAI1P8x905vS5gvzlaOGSX6R7Hp69Sjm92fiaT99in7AcK lWSbWxb85QRzfWtsCpLCHT6spmojPYd6ytVgvPbFxKCdt5azG6eAVN6ecUeeHKQtUdLV yLmAsyZ80s7UQKx6MCo6yCtakikc2YjxMAGhYqOUhe6NzJWp+X7c1xKVjo1f+qHIlbOg KWaAx8gi+dadEe1JdFUqkyEJL2oWpYdBw3OuzgOmFPisurNKJIk1DT6tzAVQ5t9uumzx EEjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RFB/48Ql"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a637009000000b005323e566996si2610690pgc.58.2023.05.27.14.42.14; Sat, 27 May 2023 14:42:35 -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=@kernel.org header.s=k20201202 header.b="RFB/48Ql"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbjE0VFc (ORCPT + 99 others); Sat, 27 May 2023 17:05:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjE0VFE (ORCPT ); Sat, 27 May 2023 17:05:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F9F5BC; Sat, 27 May 2023 14:05:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 35798603F6; Sat, 27 May 2023 21:05:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF29C433EF; Sat, 27 May 2023 21:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685221502; bh=pO4NwEQHJ6F7ZIjFw4Ym65Z1i7QKkvs9nTut+QbJV0A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RFB/48QllP9PKC6JBeIHhB8cfchqrGR7c4nAJ6tMi0BawiJRsjMHi/4JFYT3u/OOB Mi45hGvJ7ztIYXYyVLXSXwxA9cMWrsdKnVRbsji+dSstDwYn/e112a3dy+M5bbEERO bd+yD2fIc0vdw3iEEgBW66ACsLb7UahjLpt7i8zQIoqI5zeys2ZT7J0gXB5xbkmWh8 Z9vzq+qjt98cplsrW99OdpMAfVbShRlwVcs9JT+ieLqiMq8eUc1eJOOV7xTd5bL1bv tCXrlHQPJISzUjJZVDWr6hDv4G9YcbykXjv7SkJ5yJtC+w7S08ePnqjmk/T9bnVkT/ P4fmSDWvQNjTA== Date: Sat, 27 May 2023 14:08:49 -0700 From: Bjorn Andersson To: Komal Bajaj Cc: Dmitry Baryshkov , Krzysztof Kozlowski , Andy Gross , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 04/10] nvmem: qfprom: Add support for secure reading on QDU1000/QRU1000 Message-ID: <20230527210849.sd3ycp2pqyorpbpr@ripper> References: <20230512122134.24339-1-quic_kbajaj@quicinc.com> <20230512122134.24339-5-quic_kbajaj@quicinc.com> <68f9bee2-5a5b-2962-6c3d-e73ade371545@linaro.org> <257e11b5-29b5-78c6-882b-ec3bb64ee28b@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <257e11b5-29b5-78c6-882b-ec3bb64ee28b@quicinc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > wrote: > > > On 12/05/2023 14:21, Komal Bajaj wrote: > > > > Add qfprom driver support for QDU1000/QRU1000 SOCs. > > > > > > > > Signed-off-by: Komal Bajaj > > > > --- > > > > 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 > > > > >