From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46252C2D0EC for ; Fri, 27 Mar 2020 03:04:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DA3920787 for ; Fri, 27 Mar 2020 03:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585278262; bh=1QaBX/TCVQartJ3XCSnS4hcC6ju0GnYBjA0EyGXhNwU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=f7qp6tXHMCM3Aa3xn1Iiv5pGHEsnIx7RxDMYsKHT9sLc6OiRDnt2vrO30ifqdtUOa 8NUKxXe8nWLfktw/XLqKnfX1N0r0pkUE7tokpWhh0h2f5kuZDayumEM/IdT09f6TTO xQaJzwFJd8BNIt/hM6urh74Aoc9oURdUrET9jdvw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbgC0DEV (ORCPT ); Thu, 26 Mar 2020 23:04:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgC0DEU (ORCPT ); Thu, 26 Mar 2020 23:04:20 -0400 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57B8420A8B; Fri, 27 Mar 2020 03:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585278260; bh=1QaBX/TCVQartJ3XCSnS4hcC6ju0GnYBjA0EyGXhNwU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=g3V4/S5yj0lkokrjq4rHn0YaOs5ktFQxGyBri6i9mLjh0c1xqkKhIao0TOazbBZSq 84E9NQfJ6lh/3VfY4GH7c4g9VxS8lbiPEUpO/xEZHNMYAlz9jR2eaDufUTrUFb89ap E0Tlfdi5n3a+n5Qctfr8SHGWQZONpmPqCMGrQVYI= Received: by mail-qt1-f182.google.com with SMTP id m33so7502289qtb.3; Thu, 26 Mar 2020 20:04:20 -0700 (PDT) X-Gm-Message-State: ANhLgQ2VxEIU5dlPF61a6ilq7N7voIXoaMD18r4RsryKpNUHE96d6N/u /p48aB1klGYeGoGxnST56SbKYHubaDhMrWhEFA== X-Google-Smtp-Source: ADFU+vumdp+yoHmOndReHPe5KBTcIwfbcpwYm2SJv4vxq3LNPhVocpSd6D04SDQe+ewv6F3wC3JVyohcF8lQkB31Pr8= X-Received: by 2002:aed:3461:: with SMTP id w88mr12145077qtd.143.1585278259310; Thu, 26 Mar 2020 20:04:19 -0700 (PDT) MIME-Version: 1.0 References: <1585114871-6912-1-git-send-email-hadar.gat@arm.com> <1585114871-6912-2-git-send-email-hadar.gat@arm.com> <20200326194104.GA4118@bogus> In-Reply-To: From: Rob Herring Date: Thu, 26 Mar 2020 21:04:07 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/3] dt-bindings: add device tree binding for Arm CryptoCell trng engine To: Hadar Gat Cc: Matt Mackall , Herbert Xu , Mark Rutland , Arnd Bergmann , Greg Kroah-Hartman , Krzysztof Kozlowski , Florian Fainelli , Alexander Sverdlin , Thomas Gleixner , Tomer Maimon , Randy Dunlap , Zaibo Xu , Daniel Thompson , Mauro Carvalho Chehab , "David S. Miller" , Jonathan Cameron , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Gilad Ben-Yossef , Ofir Drang , nd Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 3:05 PM Hadar Gat wrote: > > Hi Rob, > > > > > On Wed, Mar 25, 2020 at 07:41:09AM +0200, Hadar Gat wrote: > > > The Arm CryptoCell is a hardware security engine. This patch adds DT > > > bindings for its TRNG (True Random Number Generator) engine. > > > > > > Signed-off-by: Hadar Gat > > > --- > > > .../devicetree/bindings/rng/arm-cctrng.yaml | 55 > > ++++++++++++++++++++++ > > > 1 file changed, 55 insertions(+) > > > create mode 100644 > > > Documentation/devicetree/bindings/rng/arm-cctrng.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/rng/arm-cctrng.yaml > > > b/Documentation/devicetree/bindings/rng/arm-cctrng.yaml > > > new file mode 100644 > > > index 0000000..7f70e4b > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/rng/arm-cctrng.yaml > > > @@ -0,0 +1,55 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/rng/arm-cctrng.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Arm TrustZone CryptoCell TRNG engine > > > + > > > +maintainers: > > > + - Hadar Gat > > > + > > > +description: |+ > > > + Arm TrustZone CryptoCell TRNG (True Random Number Generator) > > engine. > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - arm,cryptocell-713-trng > > > + - arm,cryptocell-703-trng > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + arm,rosc-ratio: > > > + description: > > > + Arm TrustZone CryptoCell TRNG engine has 4 ring oscillators. > > > + Sampling ratio values for these 4 ring oscillators. (from calibration) > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/uint32-array > > > + - items: > > > + minItems: 4 > > > + maxItems: 4 > > > > Aren't there some constraints on the values? > > > > If not, then just this is enough: > > > > - maxItems: 4 > > > The constraint is just on the array size and not on the values. > The array is of 4 elements for the CryptoCell 4 ring oscillators. > Isn't 'minitems:' is about the array min size? Isn't it the way to block less than 4 items? This is what I want to do. > I'm a bit confused if it is required or not.. Essentially, we always require bounds on the array size, so if you only specify one of minItems or maxItems it's implied to be a fixed size. IOW, you only have to specify both if you have a variable number of items. Also, note that an 'items' list implies the exact size. Both of these are not the default behavior for json-schema. Hope that helps. Rob