Add support for hwrng on PolarFire SoC
[email protected]
maintainerPATCH v2 1/1 Add support for hwrng on PolarFire SoC
From: Conor Dooley <[email protected]>
As it says on the tin, add support for the hardware rng on PolarFire SoC, which is accessed via the system controller.
I dropped the maintainers entry change that v1 had, I will send a single update via RISCV to avoid any conflicts.
On v1 I replied saying there was a refcount issue, but that's not actually the case, so no changes required there.
Thanks,
Conor
Changes since v1:
- Rebased on v5.18-rc1
- Dropped the MAINTAINERS change
- Added quality estimation
Conor Dooley (1):
hwrng: mpfs - add polarfire soc hwrng support
drivers/char/hw_random/Kconfig | 13 ++++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/mpfs-rng.c | 104 ++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 drivers/char/hw_random/mpfs-rng.c
Signature · 1 line
2.35.1
[email protected]
maintainerPATCH v2 1/1 hwrng: mpfs - add polarfire soc hwrng support
From: Conor Dooley <[email protected]>
Add a driver to access the hardware random number generator on the Polarfire SoC. The hwrng can only be accessed via the system controller, so use the mailbox interface the system controller exposes to access the hwrng.
--- drivers/char/hw_random/Kconfig | 13 ++++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/mpfs-rng.c | 104 ++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 drivers/char/hw_random/mpfs-rng.c
drivers/char/hw_random/Kconfig +13 -0
@@ -385,6 +385,19 @@ config HW_RANDOM_PIC32 If unsure, say Y. +config HW_RANDOM_POLARFIRE_SOC + tristate "Microchip PolarFire SoC Random Number Generator support" + depends on HW_RANDOM && POLARFIRE_SOC_SYS_CTRL + help + This driver provides kernel-side support for the Random Number + Generator hardware found on PolarFire SoC (MPFS). + + To compile this driver as a module, choose M here. The + module will be called mfps_rng. + + If unsure, say N. + + config HW_RANDOM_MESON tristate "Amlogic Meson Random Number Generator support" depends on HW_RANDOM
drivers/char/hw_random/Makefile +1 -0
@@ -46,3 +46,4 @@ obj-$(CONFIG_HW_RANDOM_CCTRNG) += cctrng.o obj-$(CONFIG_HW_RANDOM_XIPHERA) += xiphera-trng.o obj-$(CONFIG_HW_RANDOM_ARM_SMCCC_TRNG) += arm_smccc_trng.o obj-$(CONFIG_HW_RANDOM_CN10K) += cn10k-rng.o +obj-$(CONFIG_HW_RANDOM_POLARFIRE_SOC) += mpfs-rng.o
drivers/char/hw_random/mpfs-rng.c new file +104 -0
104 lines not on this page · raw message
Signature · 1 line
2.35.1
Herbert Xu
maintainerhwrng: mpfs - Enable COMPILE_TEST
The dependency on HW_RANDOM is redundant so this patch removes it. As this driver seems to cross-compile just fine we could also enable COMPILE_TEST.
drivers/char/hw_random/Kconfig +1 -1
@@ -387,7 +387,7 @@ config HW_RANDOM_PIC32 config HW_RANDOM_POLARFIRE_SOC tristate "Microchip PolarFire SoC Random Number Generator support" - depends on HW_RANDOM && POLARFIRE_SOC_SYS_CTRL + depends on POLARFIRE_SOC_SYS_CTRL || COMPILE_TEST help This driver provides kernel-side support for the Random Number Generator hardware found on PolarFire SoC (MPFS).
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
Herbert Xu
maintainerRe: [PATCH v2 1/1] hwrng: mpfs - add polarfire soc hwrng support
In reply to [email protected]Quoted 7 lines · On Fri, Apr 08, 2022 at 10:09:12AM +0000, [email protected] wrote:
From: Conor Dooley <[email protected]>
Add a driver to access the hardware random number generator on the Polarfire SoC. The hwrng can only be accessed via the system controller, so use the mailbox interface the system controller exposes to access the hwrng.
Quoted 7 lines
Signed-off-by Conor Dooley <[email protected]>--- drivers/char/hw_random/Kconfig | 13 ++++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/mpfs-rng.c | 104 ++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 drivers/char/hw_random/mpfs-rng.c
Patch applied. Thanks.
Signature · 8 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: hwrng: mpfs - Enable COMPILE_TEST
In reply to Herbert XuQuoted 3 lines · Herbert Xu
The dependency on
HW_RANDOMis redundant so this patch removes it. As this driver seems to cross-compile just fine we could also enableCOMPILE_TEST.
Sorry about that. Compile test makes sense to me too.
Thanks for applying my patch :)
Conor
Quoted 16 lines
Signed-off-by Herbert Xu <[email protected]>drivers/char/hw_random/Kconfig +1
-1@@ -387,7 +387,7 @@ config HW_RANDOM_PIC32 config HW_RANDOM_POLARFIRE_SOC tristate "Microchip PolarFire SoC Random Number Generator support" - depends on HW_RANDOM && POLARFIRE_SOC_SYS_CTRL + depends on POLARFIRE_SOC_SYS_CTRL || COMPILE_TEST help This driver provides kernel-side support for the Random Number Generator hardware found on PolarFire SoC (MPFS).
Re: hwrng: mpfs - Enable COMPILE_TEST
Quoted 10 lines · On 15/04/2022 10:18, [email protected] wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoted 3 lines · Herbert Xu
The dependency on
HW_RANDOMis redundant so this patch removes it. As this driver seems to cross-compile just fine we could also enableCOMPILE_TEST.Sorry about that. Compile test makes sense to me too.
Reviewed-by Conor Dooley <[email protected]
woops, missing a >.
Quoted 24 lines
Thanks for applying my patch :)
ConorQuoted 8 lines
Signed-off-by Herbert Xu <[email protected]>drivers/char/hw_random/Kconfig +0
-0drivers/char/hw_random/Kconfig config HW_RANDOM_PIC32 · line 393
Quoted 8 lines
drivers/char/hw_random/Kconfig +1
-1@@ -387,7 +387,7 @@ config HW_RANDOM_PIC32 config HW_RANDOM_POLARFIRE_SOC tristate "Microchip PolarFire SoC Random Number Generator support" - depends on HW_RANDOM && POLARFIRE_SOC_SYS_CTRL + depends on POLARFIRE_SOC_SYS_CTRL || COMPILE_TEST help This driver provides kernel-side support for the Random Number Generator hardware found on PolarFire SoC (MPFS)._______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv