crypto: hisilicon/trng - add support for HiSTB TRNG
Subsystems (2)
PATCH v4 1/1 crypto: hisilicon/trng - add support for HiSTB TRNG
HiSTB TRNG are found on some HiSilicon STB SoCs.
---
v2: fix typo
v3: add option for post process depth, adjust timeout
v4: do not case to __iomem, as requested
drivers/crypto/hisilicon/Kconfig | 7 + drivers/crypto/hisilicon/Makefile | 2 +- drivers/crypto/hisilicon/trng/Makefile | 3 + drivers/crypto/hisilicon/trng/trng-stb.c | 186 +++++++++++++++++++++++ 4 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/hisilicon/trng/trng-stb.c
drivers/crypto/hisilicon/Kconfig +7 -0
@@ -82,3 +82,10 @@ config CRYPTO_DEV_HISI_TRNG select CRYPTO_RNG help Support for HiSilicon TRNG Driver. + +config CRYPTO_DEV_HISTB_TRNG + tristate "Support for HiSTB TRNG Driver" + depends on ARCH_HISI || COMPILE_TEST + select HW_RANDOM + help + Support for HiSTB TRNG Driver.
drivers/crypto/hisilicon/Makefile +1 -1
@@ -5,4 +5,4 @@ obj-$(CONFIG_CRYPTO_DEV_HISI_SEC2) += sec2/ obj-$(CONFIG_CRYPTO_DEV_HISI_QM) += hisi_qm.o hisi_qm-objs = qm.o sgl.o debugfs.o obj-$(CONFIG_CRYPTO_DEV_HISI_ZIP) += zip/ -obj-$(CONFIG_CRYPTO_DEV_HISI_TRNG) += trng/ +obj-y += trng/
drivers/crypto/hisilicon/trng/Makefile +3 -0
@@ -1,2 +1,5 @@ obj-$(CONFIG_CRYPTO_DEV_HISI_TRNG) += hisi-trng-v2.o hisi-trng-v2-objs = trng.o + +obj-$(CONFIG_CRYPTO_DEV_HISTB_TRNG) += histb-trng.o +histb-trng-objs += trng-stb.o
drivers/crypto/hisilicon/trng/trng-stb.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
2.39.2
Herbert Xu
maintainerReview
Quoted 2 lines · David Yang
(quoted diff) +1
-0+ struct histb_trng_priv *priv = (struct histb_trng_priv *) rng->priv;
Plesae don't use rng->priv at all. We're trying to phase it out because it encourages horrible casting like this.
Please follow the model used in the meson driver.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 8 lines · Herbert Xu <[email protected]> 于2023年4月1日周六 16:07写道:
Quoted 2 lines · David Yang
+ struct
histb_trng_priv*priv = (structhistb_trng_priv*)rng->priv;Plesae don't use
rng->privat all. We're trying to phase it out because it encourages horrible casting like this.
Quoted 7 lines
Please follow the model used in the meson driver.
Thanks,
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Which meson driver? I didn't find any rng module under amlogic/ dir.
Herbert Xu
maintainerQuoted 2 lines · Yangfl
Which meson driver? I didn't find any rng module under amlogic/ dir.
drivers/char/hw_random/meson-rng.c
Cheers,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt