Message ID | 20221128184718.1963353-2-aurelien@aurel32.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5876431wrr; Mon, 28 Nov 2022 10:50:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4XXmQP8WCwZBr7rVF5uCn8ExaJJtPApEfEMnuIAYcWUQTzG5GcBGD7LPKLwI54sZIJ1aoH X-Received: by 2002:a05:6402:1950:b0:461:4c59:143c with SMTP id f16-20020a056402195000b004614c59143cmr46604205edz.85.1669661421766; Mon, 28 Nov 2022 10:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669661421; cv=none; d=google.com; s=arc-20160816; b=YxFrjcNqkMCAjrmzHEkfndLaOmhXogY4a7dIMlGXFftgZXYRm6KOOS49ybTMKqyT4n c5zt/Iy62fB/561u1rYVVX+B697ucg9SKO63el6jXxCQWPhLBOiCr41PNBoiSOXM1xXM MGmpHZPH6zphEu5InyFAxgIiAc2d+4eKFj66vpwYwLihf3Q5J8tLenITlKhS99wq23eZ ioTDKOjQ3zwSgLzg7EUI8pN1G8WKRbGvUQBSZpLs903SFRLGeEppFhW7OKtVNVPtnPzq tO1pNa8+IMz0Gw/8Hs5g4j0dHbavWXgewyWgd0FL3tdcNYyu06KXHyogf2mUc0QXpaPj UTvA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4Fpzg/r7Nlj+z1PQflqBj9rgdK6sLYVVCPbweKR8DMg=; b=fytg75hLADSs2ZcgKFP+wzNfTDfQJ9F68v4dQ1yyDVjVq9F2w6rkKjPhtKVLq4pm8V Ai4/QNiUs9Ql8SMTbtlJJ4KGCbEPGnQ3yO8XBIn8XwU9Hqx1ztkecqpjb3NKHsER0mZX 3mrIZyzXCHkQnw89VTPRTmYRIOzudpTHCfTevbuGLfvwk5aGS7RgAw5FMLFHzZup3c1t Qg9zs4HMHBhua2JorjGNRDg2rVvkBOzdsRyVxFgF9oqGgrRfwk0h5mEPcaIXT8bR5y32 yph27pYtqHIoMjpXttI6dHxrDRhtskYcgawBnOLHuG73VYRBrxi5wtRoP8oH4aNVkvkq MWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aurel32.net header.s=202004.hall header.b=OI8zH4EE; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv16-20020a17090760d000b00782e85ae302si11339418ejc.574.2022.11.28.10.49.58; Mon, 28 Nov 2022 10:50:21 -0800 (PST) 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=@aurel32.net header.s=202004.hall header.b=OI8zH4EE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232833AbiK1SsL (ORCPT <rfc822;gah0developer@gmail.com> + 99 others); Mon, 28 Nov 2022 13:48:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbiK1Srt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Nov 2022 13:47:49 -0500 Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED1DB1403E; Mon, 28 Nov 2022 10:47:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=4Fpzg/r7Nlj+z1PQflqBj9rgdK6sLYVVCPbweKR8DMg=; b=OI8zH4EE3KjDJsLnBmSVvyHfVg /fwhI9IObx8xNMfW4OWvClHdLFF7l1fKr+uqDf0ALnQMWm9FO6CAKoY6wUPx5+/LZC/bZj2zahfqA XgduWrVdKxQVUKCdsf2VbNWCmtO8Sthd7YW5XF/73ytdrYu21YRNMsk9ducxf7Bb3LWPeKkuP/50L /E9qofunJWdAxkJ9e6zN1VDbXJuCQ8G0fdKzGcr8Q6WIfkvCtWKAdHrx0Yjvg8DsZzkmu8Q23DYWE 0YeCifaFtLi80Cn49canEJigheRQ7IV+HUFVGoWpUznax9PYPzrAqm1Xz95GAVZtvCPE9YrfXPupn m/3ak0jQ==; Received: from [2a01:e34:ec5d:a741:8a4c:7c4e:dc4c:1787] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <aurelien@aurel32.net>) id 1ozjA2-006BV8-Ii; Mon, 28 Nov 2022 19:47:22 +0100 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.96) (envelope-from <aurelien@aurel32.net>) id 1ozjA1-008Elo-1x; Mon, 28 Nov 2022 19:47:21 +0100 From: Aurelien Jarno <aurelien@aurel32.net> To: Olivia Mackall <olivia@selenic.com>, Herbert Xu <herbert@gondor.apana.org.au>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Heiko Stuebner <heiko@sntech.de>, Philipp Zabel <p.zabel@pengutronix.de>, Lin Jinhan <troy.lin@rock-chips.com> Cc: linux-crypto@vger.kernel.org (open list:HARDWARE RANDOM NUMBER GENERATOR CORE), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list), Aurelien Jarno <aurelien@aurel32.net> Subject: [PATCH v2 1/3] dt-bindings: RNG: Add Rockchip RNG bindings Date: Mon, 28 Nov 2022 19:47:16 +0100 Message-Id: <20221128184718.1963353-2-aurelien@aurel32.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221128184718.1963353-1-aurelien@aurel32.net> References: <20221128184718.1963353-1-aurelien@aurel32.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750766895159408233?= X-GMAIL-MSGID: =?utf-8?q?1750766895159408233?= |
Series |
hwrng: add hwrng support for Rockchip RK3568
|
|
Commit Message
Aurelien Jarno
Nov. 28, 2022, 6:47 p.m. UTC
Add the RNG bindings for the RK3568 SoC from Rockchip
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
.../bindings/rng/rockchip,rk3568-rng.yaml | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml
Comments
On 28/11/2022 19:47, Aurelien Jarno wrote: > Add the RNG bindings for the RK3568 SoC from Rockchip Use subject prefixes matching the subsystem (git log --oneline -- ...), so it is rng, not RNG. Also, you are not adding all-Rockhip RNG but a specific device. Subject: drop second, redundant "bindings". > > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> > --- > .../bindings/rng/rockchip,rk3568-rng.yaml | 60 +++++++++++++++++++ > 1 file changed, 60 insertions(+) > create mode 100644 Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > > diff --git a/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > new file mode 100644 > index 000000000000..c2f5ef69cf07 > --- /dev/null > +++ b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > @@ -0,0 +1,60 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/rng/rockchip,rk3568-rng.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Rockchip TRNG > + > +description: True Random Number Generator for some Rockchip SoCs s/for some Rockchip SoCs/on Rokchip RK3568 SoC/ > + > +maintainers: > + - Aurelien Jarno <aurelien@aurel32.net> > + > +properties: > + compatible: > + enum: > + - rockchip,rk3568-rng > + > + reg: > + maxItems: 1 > + > + clocks: > + items: > + - description: TRNG clock > + - description: TRNG AHB clock > + > + clock-names: > + items: > + - const: trng_clk > + - const: trng_hclk These are too vague names. Everything is a clk in clock-names, so no need usually to add it as name suffix. Give them some descriptive names, e.g. core and ahb. > + > + resets: > + maxItems: 1 > + Best regards, Krzysztof
Hi, Thanks for your feedback. On 2022-11-29 10:24, Krzysztof Kozlowski wrote: > On 28/11/2022 19:47, Aurelien Jarno wrote: > > Add the RNG bindings for the RK3568 SoC from Rockchip > > Use subject prefixes matching the subsystem (git log --oneline -- ...), > so it is rng, not RNG. Also, you are not adding all-Rockhip RNG but a > specific device. > > Subject: drop second, redundant "bindings". > > > > > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> > > --- > > .../bindings/rng/rockchip,rk3568-rng.yaml | 60 +++++++++++++++++++ > > 1 file changed, 60 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > > > > diff --git a/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > > new file mode 100644 > > index 000000000000..c2f5ef69cf07 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml > > @@ -0,0 +1,60 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/rng/rockchip,rk3568-rng.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Rockchip TRNG > > + > > +description: True Random Number Generator for some Rockchip SoCs > > s/for some Rockchip SoCs/on Rokchip RK3568 SoC/ My point there is that this driver should also work for other Rockchip SoCs like the RK3588, but 1) it support for this SoC is being added and not yet available in the Linux kernel 2) it hasn't been tested. Should we mark it as RK3568 specific (or rather RK356x) and change that once a compatible entry is added for the RK3588? > > + > > +maintainers: > > + - Aurelien Jarno <aurelien@aurel32.net> > > + > > +properties: > > + compatible: > > + enum: > > + - rockchip,rk3568-rng > > + > > + reg: > > + maxItems: 1 > > + > > + clocks: > > + items: > > + - description: TRNG clock > > + - description: TRNG AHB clock > > + > > + clock-names: > > + items: > > + - const: trng_clk > > + - const: trng_hclk > > These are too vague names. Everything is a clk in clock-names, so no > need usually to add it as name suffix. Give them some descriptive names, > e.g. core and ahb. Those names are based on <include/dt-bindings/clock/rk3568-cru.h> and other drivers seems to have used those for the names. But I understand that broken things could have been merged, so I am fine changing that to core and ahb. > > + > > + resets: > > + maxItems: 1 > > + Regards Aurelien
On 02/12/2022 20:20, Aurelien Jarno wrote: > Hi, > > Thanks for your feedback. > > On 2022-11-29 10:24, Krzysztof Kozlowski wrote: >> On 28/11/2022 19:47, Aurelien Jarno wrote: >>> Add the RNG bindings for the RK3568 SoC from Rockchip >> >> Use subject prefixes matching the subsystem (git log --oneline -- ...), >> so it is rng, not RNG. Also, you are not adding all-Rockhip RNG but a >> specific device. >> >> Subject: drop second, redundant "bindings". >> >>> >>> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> >>> --- >>> .../bindings/rng/rockchip,rk3568-rng.yaml | 60 +++++++++++++++++++ >>> 1 file changed, 60 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml >>> new file mode 100644 >>> index 000000000000..c2f5ef69cf07 >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml >>> @@ -0,0 +1,60 @@ >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >>> +%YAML 1.2 >>> +--- >>> +$id: http://devicetree.org/schemas/rng/rockchip,rk3568-rng.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: Rockchip TRNG >>> + >>> +description: True Random Number Generator for some Rockchip SoCs >> >> s/for some Rockchip SoCs/on Rokchip RK3568 SoC/ > > My point there is that this driver should also work for other Rockchip > SoCs like the RK3588, but 1) Driver maybe less, but bindings might not. > it support for this SoC is being added and > not yet available in the Linux kernel 2) it hasn't been tested. > > Should we mark it as RK3568 specific (or rather RK356x) and change that > once a compatible entry is added for the RK3588? Describe what you are adding here, not something else. > >>> + >>> +maintainers: >>> + - Aurelien Jarno <aurelien@aurel32.net> >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - rockchip,rk3568-rng >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + clocks: >>> + items: >>> + - description: TRNG clock >>> + - description: TRNG AHB clock >>> + >>> + clock-names: >>> + items: >>> + - const: trng_clk >>> + - const: trng_hclk >> >> These are too vague names. Everything is a clk in clock-names, so no >> need usually to add it as name suffix. Give them some descriptive names, >> e.g. core and ahb. > > Those names are based on <include/dt-bindings/clock/rk3568-cru.h> and clock-names is not for the actual name of the clock feeding it, but rather name of input of the device. Reader-friendly. > other drivers seems to have used those for the names. But I understand > that broken things could have been merged, so I am fine changing that to > core and ahb. > >>> + >>> + resets: >>> + maxItems: 1 >>> + > > Regards > Aurelien > Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml new file mode 100644 index 000000000000..c2f5ef69cf07 --- /dev/null +++ b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/rng/rockchip,rk3568-rng.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip TRNG + +description: True Random Number Generator for some Rockchip SoCs + +maintainers: + - Aurelien Jarno <aurelien@aurel32.net> + +properties: + compatible: + enum: + - rockchip,rk3568-rng + + reg: + maxItems: 1 + + clocks: + items: + - description: TRNG clock + - description: TRNG AHB clock + + clock-names: + items: + - const: trng_clk + - const: trng_hclk + + resets: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - resets + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/rk3568-cru.h> + bus { + #address-cells = <2>; + #size-cells = <2>; + + rng@fe388000 { + compatible = "rockchip,rk3568-rng"; + reg = <0x0 0xfe388000 0x0 0x4000>; + clocks = <&cru CLK_TRNG_NS>, <&cru HCLK_TRNG_NS>; + clock-names = "trng_clk", "trng_hclk"; + resets = <&cru SRST_TRNG_NS>; + }; + }; + +...