2023-09-26 11:20:58

by Alexey Romanov

[permalink] [raw]
Subject: [PATCH v4 0/3] Meson S4 HW RNG Support

From: Alexey Romanov <[email protected]>

Hello!

This patch series adds hwrng support for Amlogic S4-series.
Now, S4 uses a new random number generation algorithm.
This changes implemnents new algo and also adds description
to meson-s4.dtsi.

V2:

- Use readl_relaxed_poll_timeout_atomic() function instead of loop.
- Use two different functions: meson_rng_read() and meson_s4_rng_read().
- Fix naming in DT schema (meson-s4-hwrng instead of meson-hwrng-s4).
- A little code style fixes.

V3:

- Fix commit message in patch with dt-bindings schema changes.

V4:

- Drop struct meson_rng_priv field from struct meson_rng_data.

Alexey Romanov (3):
drivers: rng: meson: add support for S4
dt-bindings: rng: meson: add meson-rng-s4 compatible
arch/arm64: dts: meson-s4: add hwrng node

.../bindings/rng/amlogic,meson-rng.yaml | 1 +
arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 5 ++
drivers/char/hw_random/meson-rng.c | 80 ++++++++++++++++++-
3 files changed, 83 insertions(+), 3 deletions(-)

--
2.25.1


2023-09-26 15:13:35

by Alexey Romanov

[permalink] [raw]
Subject: [PATCH v4 3/3] arch/arm64: dts: meson-s4: add hwrng node

From: Alexey Romanov <[email protected]>

Using this node, we can obtain random numbers via
hardware random number generator.

Signed-off-by: Alexey Romanov <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
index f24460186d3d..b3a1ecf36467 100644
--- a/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-s4.dtsi
@@ -133,6 +133,11 @@ reset: reset-controller@2000 {
reg = <0x0 0x2000 0x0 0x98>;
#reset-cells = <1>;
};
+
+ hwrng: rng@440788 {
+ compatible = "amlogic,meson-s4-rng";
+ reg = <0x0 0x440788 0x0 0x0c>;
+ };
};
};
};
--
2.25.1