Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1692300pxb; Fri, 20 Aug 2021 11:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKshfHbmbVU0KfNRoEj1hR8oWE8Q8t8lLO3xUzIcxlHyEo4cIbD7VxtZ9abYfxp+n5Q+rR X-Received: by 2002:a17:906:31cf:: with SMTP id f15mr23395142ejf.272.1629484111083; Fri, 20 Aug 2021 11:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629484111; cv=none; d=google.com; s=arc-20160816; b=GzNEr3W/TF0exxHOiLPWbqLwoU1Gk8rEwF/aqV9YgczIvEM9XvvPmKMvRItwXn2by6 A2/IqV5IAJIjX5ElkFti0Gh7aoViGEe25gqQNz/DPupNYyWluoNxberIlf2QSJHIbcyl U4MAfbYOgom+miZa73ONcZun/fSajYHITC5Mot0Xa9U75uyRdRE5C4OEq6wtPB9dfe15 0v/LHzJkhMO2uXVzm/uWypXOuSIayAiOfn5n0Wgjx2bIr7m7lJwIA1OgwDXv1EwovZCG uNL7sfSGz0RoZnBrSGdJXuESLuFvj10Rzu/2HmgEFmzKUOsmn1/vJfts1sPN10DCZQrh Nk7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VXYzJGkdH5dpRVUAMwsJuDyys7rHq5xONhmRQTVa0sk=; b=dRKKP/lZRO5dxDTyrjhhbmCJZa/PaNhDHGStvb1n5r7kkXz0lsPW1WlJp+0uThx0NM 2SGJ5ADDeJzYvhTJRvJvC0/3ZgxScbB3AviayflWACLvA7npp/ajpXNwJ3e5wViZlyHg kFs34cw5Cb26PZbkGRMSvlHdzfPXlESEAM4HArA5VsT88FigLaVnBV6gLGyCjIRDIFHb Eo8vMuLqqtS4AC50HtJBAuyDfaKwhiycSylxP21aCMDYbjcpYuJufQwnznNxQCpyMfq1 V1kaM5AxPik9Kzx9K3Y89psqiKUNK7Bzgnsaw5JvACO4OuRlm7qEHgTTCDwUjI4H70jM fLXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QDmhDcr5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w17si1427964edr.212.2021.08.20.11.27.56; Fri, 20 Aug 2021 11:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QDmhDcr5; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 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 S230395AbhHTS2b (ORCPT + 99 others); Fri, 20 Aug 2021 14:28:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:55648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhHTS2b (ORCPT ); Fri, 20 Aug 2021 14:28:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CCE26124C; Fri, 20 Aug 2021 18:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629484073; bh=bKkSyF0cIR7C2YqfM8yKj7Qp9nOnaWZgsyvjnNl53BI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QDmhDcr5RLG8KteL+FGyHFgWOAWE40/VW5F4h8utD1g+VxmZdTbDF9huphbCCp+Ta FidIR7HZRM+/1ss8nyoryVG9x71BlMsuGJEzOrDAtrlxMmF/LV/YOT5v00Ib46HdOE eUWufuhKaUJUKprf+MogP8oWx/N7rXNrP4xknPuXIPkx8rslUnhxphTKhivhgGIRct m1ozWbRNMnYVCOp8CqCzPD+qzIuqMZCa8BshvzLDonKMTX6BmPzem1XUcABurrXHYl plH8o7pn/7S14BiBjNXQjxHOSbmg5hkjig1RRXNHjHoI4nPq1bRALPpqfHAQj1D6C0 HYwR6yAVNiSVg== Received: by mail-ej1-f44.google.com with SMTP id d11so21892467eja.8; Fri, 20 Aug 2021 11:27:53 -0700 (PDT) X-Gm-Message-State: AOAM533P5cz1oMe4nSAKxtqZFmBRHIr7NsPuUXSBpL36OqWw9Z22ODGu VAgyhw5ncl3kAOvr5TI/w7moEIw3U1YVMADFsw== X-Received: by 2002:a17:906:25db:: with SMTP id n27mr22606820ejb.108.1629484071600; Fri, 20 Aug 2021 11:27:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rob Herring Date: Fri, 20 Aug 2021 13:27:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] dt-bindings: rng: convert Samsung Exynos TRNG to dtschema To: Lukasz Stelmach Cc: Krzysztof Kozlowski , Thomas Gleixner , Marc Zyngier , Matt Mackall , Herbert Xu , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, linux-arm-kernel , linux-samsung-soc , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Aug 17, 2021 at 5:17 PM Lukasz Stelmach wr= ote: > > It was <2021-08-17 wto 16:07>, when Krzysztof Kozlowski wrote: > > On 17/08/2021 14:34, Lukasz Stelmach wrote: > >> It was <2021-08-17 wto 12:05>, when Krzysztof Kozlowski wrote: > >>> On 17/08/2021 11:55, Lukasz Stelmach wrote: > >>>> It was <2021-08-11 =C5=9Bro 10:43>, when Krzysztof Kozlowski wrote: > >>>>> Convert Samsung Exynos SoC True Random Number Generator bindings to= DT > >>>>> schema format using json-schema. > >>>>> > >>>>> Signed-off-by: Krzysztof Kozlowski > >>>>> --- > >>>>> .../bindings/rng/samsung,exynos5250-trng.txt | 17 ------- > >>>>> .../bindings/rng/samsung,exynos5250-trng.yaml | 44 +++++++++++++++= ++++ > >>>>> MAINTAINERS | 2 +- > >>>>> 3 files changed, 45 insertions(+), 18 deletions(-) > >>>>> delete mode 100644 Documentation/devicetree/bindings/rng/samsung,e= xynos5250-trng.txt > >>>>> create mode 100644 Documentation/devicetree/bindings/rng/samsung,e= xynos5250-trng.yaml > >>>>> > >>>>> diff --git > >>>>> a/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.txt > >>>>> b/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.txt > >>>>> deleted file mode 100644 > >>>>> index 5a613a4ec780..000000000000 > >>>>> --- a/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng= .txt > >>>>> +++ /dev/null > >>>>> @@ -1,17 +0,0 @@ > >>>>> -Exynos True Random Number Generator > >>>>> - > >>>>> -Required properties: > >>>>> - > >>>>> -- compatible : Should be "samsung,exynos5250-trng". > >>>>> -- reg : Specifies base physical address and size of the re= gisters map. > >>>>> -- clocks : Phandle to clock-controller plus clock-specifier p= air. > >>>>> -- clock-names : "secss" as a clock name. > >>>>> - > >>>>> -Example: > >>>>> - > >>>>> - rng@10830600 { > >>>>> - compatible =3D "samsung,exynos5250-trng"; > >>>>> - reg =3D <0x10830600 0x100>; > >>>>> - clocks =3D <&clock CLK_SSS>; > >>>>> - clock-names =3D "secss"; > >>>>> - }; > >>>>> diff --git > >>>>> a/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yam= l > >>>>> b/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yam= l > >>>>> new file mode 100644 > >>>>> index 000000000000..a50c34d5d199 > >>>>> --- /dev/null > >>>>> +++ b/Documentation/devicetree/bindings/rng/samsung,exynos5250-trng= .yaml > >>>>> @@ -0,0 +1,44 @@ > >>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > >>>>> +%YAML 1.2 > >>>>> +--- > >>>>> +$id: > >>>>> https://protect2.fireeye.com/v1/url?k=3Df38ca35b-ac179a0d-f38d2814-= 0cc47a31ce52-1faa1ecb65482b8a&q=3D1&e=3D8b3490f9-a5fc-4da0-b2ee-7b0aec78140= 3&u=3Dhttp%3A%2F%2Fdevicetree.org%2Fschemas%2Frng%2Fsamsung%2Cexynos5250-tr= ng.yaml%23 > >>>>> +$schema: > >>>>> https://protect2.fireeye.com/v1/url?k=3D9409519d-cb9268cb-9408dad2-= 0cc47a31ce52-12394c4409905980&q=3D1&e=3D8b3490f9-a5fc-4da0-b2ee-7b0aec78140= 3&u=3Dhttp%3A%2F%2Fdevicetree.org%2Fmeta-schemas%2Fcore.yaml%23 > >>>>> + > >>>>> +title: Samsung Exynos SoC True Random Number Generator > >>>>> + > >>>>> +maintainers: > >>>>> + - Krzysztof Kozlowski > >>>>> + - =C5=81ukasz Stelmach > >>>>> + > >>>>> +properties: > >>>>> + compatible: > >>>>> + const: samsung,exynos5250-trng > >>>>> + > >>>>> + clocks: > >>>>> + maxItems: 1 > >>>> > >>>> How about copying description from above into the description: prope= rty? > >>> > >>> But what to copy? There is no description except generic clock bindin= gs. > >>> > >> > >> The description that "was" in the txt file. > > > > But there was no description of fields except copy&paste of the core > > schema. Do you describe C code like: > > > > ... > > /* unsigned int is a integer number greater or equal 0 */ > > unsigned int i; > > ... > > I believe having descriptions for reg and clocks > > >>>>> -- reg : Specifies base physical address and size of the re= gisters map. > >>>>> -- clocks : Phandle to clock-controller plus clock-specifier p= air. > > right next to properties' formal definitions is beneficial for anyone > browsing the YAML file. If you think otherwise, oh well, I am fine with > that. We have 2000 schemas currently (and 2300 still to convert). Of the ~2000, 1646 have 'reg' and 1005 have 'clocks' (I was going to guess 3/4 and 1/2, respectively, but with a nice uniform, parsable format we don't have to guess). Do we need that many copies of variations of the same description? What I would like to have is generated documentation from the schemas. With that we could either insert a description or a link on all the common properties. There are already tools that generate documentation out of json-schema, but I don't have the time to investigate them or work on any of that. My other idea is some sort of property grepping utility. While grep generally works, it would be nice to have some tools aware of the schema structure where you could just run 'dt-grep clocks' and have it spit out the description. Another example would be to list all the valid properties for a given compatible string. Lots of possibilities with machine readable bindings. Rob