Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2361266pxb; Tue, 9 Mar 2021 00:00:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0Fu+GjDs8CejviaCy4Gk1DoTSBjxrUxmtaUh/ihWxXdU9btW9ux/nY03EXIHItIZAAoXV X-Received: by 2002:aa7:c496:: with SMTP id m22mr2615377edq.292.1615276804626; Tue, 09 Mar 2021 00:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615276804; cv=none; d=google.com; s=arc-20160816; b=T+BmYSY6sAQKtZUIrdCljhhdJszC4rJ5ZgprdEULuQ9Bbt3A/Hcj/qRsqgPZn1Ebyq yTiCzJOYdTTy6zbSi2BnGGzzlWlHHuwqbFKx9WVDQxwS5wQ5z2hF57SXUqQ48R6CZmC1 CudWSLP8nLlh0dH8B1WriG45GeNzxiFWLjw6UiqfnONt/oIl848MZpdYH6p6p8hshdtD SrsrG3gFCjUDrrkbeOUZkoFB469z757z7errOtx1xci2Qgec/9r50HY1k6T5vFsExvFh eLPsK/aHDNZVc3aAlP/uFTj8nSmfXaisCDIR1JgY7trnBaVDaOgyRWU2jfOodHAntIL0 Flaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=lIKxufw319Oy8FvrKIgV0v9GGq8WeitNrWi0sTAfbGs=; b=W3TTt5RY1z/esSGpWcEQ+1E9ulel3rI89YxUabUC+JW4RZvvr0fDtnCiLJ/RSPpjP8 DaX8Rc3CjW84eGWw7o6BGGCCCW/rZjnfR12uXJrJ1i1tASKtdxBTgi0YHKWzGbJ99x0f 2yC9Op21wbm8fhMz/s3bzhz94HzvWnKg5AOCiOricdGLZ2acXb28spAKZTA0MXY7fmke ZiF1aXmYKgCDxhIvR1BtzCR1tC6gASVYe93W+mTusgfjj9zHHxbSzkJKPDI+CJoUlZGz 8Wyfr4yNQqu72kbYffXahIcnOegnFBYe7HL64vxIJfhdYACqK0UKWUxMIAxIlairoXyG 4ItA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si9859059edj.481.2021.03.08.23.59.42; Tue, 09 Mar 2021 00:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbhCIH5i (ORCPT + 99 others); Tue, 9 Mar 2021 02:57:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbhCIH5M (ORCPT ); Tue, 9 Mar 2021 02:57:12 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B21C06174A; Mon, 8 Mar 2021 23:57:11 -0800 (PST) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 85B731F44A74; Tue, 9 Mar 2021 07:57:09 +0000 (GMT) Date: Tue, 9 Mar 2021 08:57:06 +0100 From: Boris Brezillon To: Manivannan Sadhasivam Cc: miquel.raynal@bootlin.com, richard@nod.at, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Daniele.Palmas@telit.com, bjorn.andersson@linaro.org Subject: Re: [PATCH v4 2/3] dt-bindings: mtd: Add a property to declare secure regions in NAND chips Message-ID: <20210309085706.2d6bd0f0@collabora.com> In-Reply-To: <20210308133134.GC5457@thinkpad> References: <20210308054447.28418-1-manivannan.sadhasivam@linaro.org> <20210308054447.28418-3-manivannan.sadhasivam@linaro.org> <20210308101059.08658fbe@collabora.com> <20210308133134.GC5457@thinkpad> Organization: Collabora X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Mar 2021 19:01:34 +0530 Manivannan Sadhasivam wrote: > On Mon, Mar 08, 2021 at 10:10:59AM +0100, Boris Brezillon wrote: > > On Mon, 8 Mar 2021 11:14:46 +0530 > > Manivannan Sadhasivam wrote: > > > > > On a typical end product, a vendor may choose to secure some regions in > > > the NAND memory which are supposed to stay intact between FW upgrades. > > > The access to those regions will be blocked by a secure element like > > > Trustzone. So the normal world software like Linux kernel should not > > > touch these regions (including reading). > > > > > > So let's add a property for declaring such secure regions so that the > > > drivers can skip touching them. > > > > > > Signed-off-by: Manivannan Sadhasivam > > > --- > > > Documentation/devicetree/bindings/mtd/nand-controller.yaml | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/mtd/nand-controller.yaml b/Documentation/devicetree/bindings/mtd/nand-controller.yaml > > > index d0e422f4b3e0..15a674bedca3 100644 > > > --- a/Documentation/devicetree/bindings/mtd/nand-controller.yaml > > > +++ b/Documentation/devicetree/bindings/mtd/nand-controller.yaml > > > @@ -143,6 +143,13 @@ patternProperties: > > > Ready/Busy pins. Active state refers to the NAND ready state and > > > should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted. > > > > > > + secure-regions: > > > + $ref: /schemas/types.yaml#/definitions/uint32-matrix > > > + description: > > > + Regions in the NAND chip which are protected using a secure element > > > + like Trustzone. This property contains the start address and size of > > > + the secure regions present. > > > + > > > > Since you declare this as a generic property, I think it'd be simpler > > to do the check at the core level. > > > > Hmm, so have the parsing logic in qcom driver and check in core or both parsing > and check in core? Both in the core.