From patchwork Sun Jul 21 00:47:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 13737929 X-Patchwork-Delegate: herbert@gondor.apana.org.au Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A332633EC; Sun, 21 Jul 2024 00:47:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721522853; cv=none; b=LN/ecU7LLMaknWxpZOxk0Ubbx3oRK2f2lFZ/wiTGahAWYOhGrj4KBBQFhNz4ozqvP5S2H65X+8IkK+Lhkh8ggACfWgROTisHnsAWch6+OLSwKvO3nQLBbXW9KSXkaRK1ixHkUPEdI079mLf7K26zj6Fd/hOiDkhNMCwAQTazSXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721522853; c=relaxed/simple; bh=O3xTM3y/kCRLme3nU4+C2HZWNaDjgwFLNx85PEFmzxw=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qdrpp1swwyl2naHJ1UJF60yh6karpjDBCZkSYsNOmZR0lYAT6anBsQ1wfrc2L10QojpnwuQuRFk+3No0cLZSw+oPqEAx0Azlbsi3l2c86hNGbUCCi0SFzEaCCdozs0M8QbiuHY8U+OZmWVcEO3uXeZxuRkgAu8jI2luWxq2tLPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98) (envelope-from ) id 1sVKjM-000000007Pp-2MoX; Sun, 21 Jul 2024 00:47:16 +0000 Date: Sun, 21 Jul 2024 01:47:13 +0100 From: Daniel Golle To: Daniel Golle , Aurelien Jarno , Olivia Mackall , Herbert Xu , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Philipp Zabel , Dragan Simic , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Sascha Hauer , Cristian Ciocaltea , Martin Kaiser , Francesco Dolcini , Ard Biesheuvel , linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 1/3] dt-bindings: rng: Add Rockchip RK3568 TRNG Message-ID: <19c94cbeae8175b8c6f920c3e3029082ade85ae6.1721522430.git.daniel@makrotopia.org> References: Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: From: Aurelien Jarno Add the True Random Number Generator on the Rockchip RK3568 SoC. Signed-off-by: Aurelien Jarno Signed-off-by: Daniel Golle Reviewed-by: Krzysztof Kozlowski --- .../bindings/rng/rockchip,rk3568-rng.yaml | 82 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 88 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..383a39e60ad8 --- /dev/null +++ b/Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml @@ -0,0 +1,82 @@ +# 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 RK3568 TRNG + +description: True Random Number Generator on Rockchip RK3568 SoC + +maintainers: + - Aurelien Jarno + - Daniel Golle + +properties: + compatible: + enum: + - rockchip,rk3568-rng + + reg: + maxItems: 1 + + clocks: + items: + - description: TRNG clock + - description: TRNG AHB clock + + clock-names: + items: + - const: core + - const: ahb + + quality: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0 + description: + Estimated number of bits of true entropy per 1024 bits read from the rng. + Defaults to zero which causes the kernel's default quality to be used + instead. Note that the default quality is usually zero which disables + using this rng to automatically fill the kernel's entropy pool. + + rockchip,sample-count: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 1000 + description: + Bits to skip on TRNG osc ring output before collection. + The value is a tradeoff between speed and quality, the higher the slower + and the better quality. + + resets: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - quality + - resets + - rockchip,sample-count + +additionalProperties: false + +examples: + - | + #include + 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 = "core", "ahb"; + quality = <900>; + resets = <&cru SRST_TRNG_NS>; + rockchip,sample-count = <1000>; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index 61053a8c625e..41aecf9736c9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19707,6 +19707,12 @@ F: Documentation/userspace-api/media/v4l/metafmt-rkisp1.rst F: drivers/media/platform/rockchip/rkisp1 F: include/uapi/linux/rkisp1-config.h +ROCKCHIP RK3568 RANDOM NUMBER GENERATOR SUPPORT +M: Daniel Golle +M: Aurelien Jarno +S: Maintained +F: Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml + ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER M: Jacob Chen M: Ezequiel Garcia