From patchwork Mon Nov 28 18:47:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 13057862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28A10C433FE for ; Mon, 28 Nov 2022 18:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=GML8lM6YimTBHRrIAjtsJag9Qjp+8+b/wmRYyatC8KI=; b=ZTtYLnsKat8z5O m6fyDtkV16r51zhDKt3c7e3JYnRfB6MWiapyY3fLvacE3DFYHrLS0+ekSWX8cR6Kc5STJQuXJO1Km B4+bxJyXR/Jx/oeSjRvcInwvEGcU+AW4icopsWY4mgjRHAO+8Cs5y1cyK98WvY5+b6TnRYb/lEuPF hHHsgKurLO3nqX4Ttsrfjjl476uPMDLHprHOkytdwAm3vVtOiNoGkwa0Fbk+rHhgDs6hD9aikt/8q 0oR2pCSAN333IW0RqKodK51W+CQDRZ3I51YGV107H8q832YdYprbg4PrL/RxVSUCgLbNJWkDd4IHU 5fkP3OaDNxYKqEpVhnvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozjB2-003l5e-LA; Mon, 28 Nov 2022 18:48:24 +0000 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozjAU-003kkn-09; Mon, 28 Nov 2022 18:47:53 +0000 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:Message-Id:Date: Subject:Cc:To:From:Content-Type:From:Reply-To:Subject:Content-ID: Content-Description:In-Reply-To:References:X-Debbugs-Cc; bh=2nc6ETieocz1/MF7D4a379nzMdeyEycYLQGwrA8DsAQ=; b=Shn+niV8Dwihi1yTofxwyKMWTu +zIt+swVCw1jCd4qzUK8xUpPMOupBnWuWw1qppfhsrrKQQzf1PFqSJChwmqV9iaRWW6YkmTI8WDA7 YQbaZjjCmF0JXrlDBBHlSxQAiZTpGe4D/tL5gy+HfjaMpNECY/aEe9Vp1PyxN5LaDPRZe/Ddde5nP le25Zdm3BNTreQI1LPlbYYhfa8jsFxpYQT1EgdlSyO9ByAY+jy7L83PTHnBK+vvW3sYbLhlPxz2m+ sqbPonHFgOSi8/TGjgho9yei9aH22ewVBzFG+va+qSO6d1pMrGFPIEtLnJHfpmqh4+Nqobx/EU7eb xnnrevqw==; 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 ) id 1ozjA2-006BV6-Ih; Mon, 28 Nov 2022 19:47:22 +0100 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.96) (envelope-from ) id 1ozjA1-008Ell-1p; Mon, 28 Nov 2022 19:47:21 +0100 From: Aurelien Jarno To: Olivia Mackall , Herbert Xu , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Philipp Zabel , Lin Jinhan 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 Subject: [PATCH v2 0/3] hwrng: add hwrng support for Rockchip RK3568 Date: Mon, 28 Nov 2022 19:47:15 +0100 Message-Id: <20221128184718.1963353-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221128_104750_498687_46065B03 X-CRM114-Status: GOOD ( 14.59 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Rockchip SoCs used to have a random number generator as part of their crypto device, and support for it has to be added to the corresponding driver. However newer Rockchip SoCs like the RK3568 have an independent True Random Number Generator device. This patchset adds a driver for it and enable it in the device tree. v1 -> v2: * Patch 1: fix issues reported by Rob Herring and Krzysztof Kozlowski: - Rename rockchip-rng.yaml into rockchip,rk3568-rng.yaml - Fix binding title and description - Fix compatible property - Rename clocks and add the corresponding descriptions - Drop reset-names - Add a bus definition with #address-cells and #size-cells to the example. * Patch 2: fix issue reported by kernel test robot - Do not read the random registers as big endian, looking at the RK3568 TRM this is actually not needed. This fixes a sparse warning. * Patch 3: unchanged Aurelien Jarno (3): dt-bindings: RNG: Add Rockchip RNG bindings hwrng: add Rockchip SoC hwrng driver arm64: dts: rockchip: add DT entry for RNG to RK356x .../bindings/rng/rockchip,rk3568-rng.yaml | 60 +++++ arch/arm64/boot/dts/rockchip/rk356x.dtsi | 9 + drivers/char/hw_random/Kconfig | 14 + drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/rockchip-rng.c | 250 ++++++++++++++++++ 5 files changed, 334 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/rockchip,rk3568-rng.yaml create mode 100644 drivers/char/hw_random/rockchip-rng.c