Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2030882ybb; Thu, 26 Mar 2020 20:05:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+/saRcp5HEfpuBBnTWXqVSx60OjFqYxmvQ77GA8FN8VnmR18Eqi4dh+2+TK6OP+YJoR11 X-Received: by 2002:a05:6830:144f:: with SMTP id w15mr9075681otp.218.1585278300069; Thu, 26 Mar 2020 20:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585278300; cv=none; d=google.com; s=arc-20160816; b=Agl0jq/HwHPo1TJqyNYZXH/EmI1nMC6DLN9O3qopnuniewPK3JjObJa74iEbAYm3zU 2PbjjiUdYI1+MZ9lgwofJxBrTCXePw81+jW0NLLicCPzIvm+LvdNaS+0SGszAMjXt/Um DxZxMCiOmUDBqOeH+vX0vYl+D5lQEyTVYVmpitAvoSFtxCGGwdrxJDcttyMZJ5gczaXC E4UctfvpI+oaJ+45qTRJXrzT380RUpGRT+L5nwF79yoy5QY+Y+kZ6lttBjfJJQzPzojP Th/0IUBWHoX8PzqIXQjjnaGYzUFIYqI5Iq5xmMUJv4FOpy0cteJlUKEA8pykixto5Xu6 PZrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Cbdd6WNo2psXrEPtpv9Erm0YPB2E3vuvHzbItSvJ5kg=; b=azGxet+mJuVLlMWzTLH2/kLpKCrBBrsM22BX2m0PL0kYSgsi5j0B3JA2dklAG7faOc V4U1QSZ65n0PZQ2kOotvWyU90uVTlAKT8R22wMnsi+wlY9MZ9OGEOlsy7TPi+Z5RO6ev yee+nBtd0yi3qKiVa0gNzJzGBNYMcNpCeMq6hI8CvmSCSzcbT4FLV2rVlYaPatIHpB5r jupRxCdphhMMHVR+hku67FkpTDMOI+GcD3a/bogJbDMTw10cyTR5kI7ZKAQX3TXHhhA6 yBF+rI+0y8mHNiRphdAO54nbpAOTc73xn4OvAkxxEhhwCHDgCnuspJzJSoJpIfS+iqUz QVDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="g3V4/S5y"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o85si2006900ooo.19.2020.03.26.20.04.38; Thu, 26 Mar 2020 20:05:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="g3V4/S5y"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 S1727703AbgC0DEV (ORCPT + 99 others); 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-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-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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