hwrng: npcm: add NPCM RNG driver support
Subsystems (4)
Tomer Maimon
maintainercover hwrng: npcm: add NPCM RNG driver support
This patch set adds Randon Number Generator (RNG) support for the Nuvoton NPCM Baseboard Management Controller (BMC).
The RNG driver we use power consumption when the RNG is not required.
The NPCM RNG driver tested on NPCM750 evaluation board.
Tomer Maimon (2):
dt-binding: hwrng: add NPCM RNG documentation
hwrng: npcm: add NPCM RNG driver
.../bindings/rng/nuvoton,npcm-rng.txt | 17 ++ drivers/char/hw_random/Kconfig | 13 ++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/npcm-rng.c | 207 ++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt create mode 100644 drivers/char/hw_random/npcm-rng.c
Signature · 1 line
2.18.0
Tomer Maimon
maintainerPATCH 1/2 dt-binding: hwrng: add NPCM RNG documentation
Added device tree binding documentation for Nuvoton BMC NPCM Random Number Generator (RNG).
--- .../bindings/rng/nuvoton,npcm-rng.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt
Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt new file +17 -0
@@ -0,0 +1,17 @@ +NPCM SoC Random Number Generator + +Required properties: +- compatible : "nuvoton,npcm750-rng" for the NPCM7XX BMC. +- reg : Specifies physical base address and size of the registers. + +Optional property: +- quality : estimated number of bits of true entropy per 1024 bits + read from the rng. + If this property is not defined, it defaults to 1000. + +Example: + +rng: rng@f000b000 { + compatible = "nuvoton,npcm750-rng"; + reg = <0xf000b000 0x8>; +};
Signature · 1 line
2.18.0
Rob Herring
maintainerRe: [PATCH v1 1/2] dt-binding: hwrng: add NPCM RNG documentation
Quoted 15 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton BMC NPCM Random Number Generator (RNG).
Signed-off-by Tomer Maimon <[email protected]>--- .../bindings/rng/nuvoton,npcm-rng.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txtDocumentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt new file +0
-0
Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt line 10
Quoted 10 lines
Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt new file +10
-0@@ -0,0 +1,17 @@ +NPCM SoC Random Number Generator + +Required properties: +- compatible : "nuvoton,npcm750-rng" for the NPCM7XX BMC. +- reg : Specifies physical base address and size of the registers. + +Optional property: +- quality : estimated number of bits of true entropy per 1024 bits + read from the rng. + If this property is not defined, it defaults to 1000.
This would need a vendor prefix, however, I think it should be implied by the compatible string. It is fixed per SoC, right?
Avi Fishman
maintainerRe: [PATCH v1 1/2] dt-binding: hwrng: add NPCM RNG documentation
Quoted 22 lines · Rob Herring
Quoted 20 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton BMC NPCM Random Number Generator (RNG).
Signed-off-by Tomer Maimon <[email protected]>--- .../bindings/rng/nuvoton,npcm-rng.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txtDocumentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt new file +5
-0@@ -0,0 +1,17 @@ +NPCM SoC Random Number Generator + +Required properties: +- compatible : "nuvoton,npcm750-rng" for the NPCM7XX BMC. +- reg : Specifies physical base address and size of the registers.
Quoted 8 lines
Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt line 10
Quoted 5 lines
Documentation/devicetree/bindings/rng/nuvoton,npcm-rng.txt new file +5
-0+ +Optional property: +- quality : estimated number of bits of true entropy per 1024 bits + read from the rng. + If this property is not defined, it defaults to 1000.This would need a vendor prefix, however, I think it should be implied by the compatible string. It is fixed per SoC, right?
Tomer is on vacation, so I answer instead:
This value is the same for all our SoC flavor that contains this RNG HW.
Signature · 2 lines
Regards, Avi
Tomer Maimon
maintainerPATCH 2/2 hwrng: npcm: add NPCM RNG driver
In reply to Tomer MaimonAdd Nuvoton NPCM BMC Random Number Generator(RNG) driver.
--- drivers/char/hw_random/Kconfig | 13 ++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/npcm-rng.c | 207 ++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 drivers/char/hw_random/npcm-rng.c
drivers/char/hw_random/Kconfig +13 -0
@@ -440,6 +440,19 @@ config HW_RANDOM_OPTEE If unsure, say Y. +config HW_RANDOM_NPCM + tristate "NPCM Random Number Generator support" + depends on ARCH_NPCM || COMPILE_TEST + default HW_RANDOM + help + This driver provides support for the Random Number + Generator hardware available in Nuvoton NPCM SoCs. + + To compile this driver as a module, choose M here: the + module will be called npcm-rng. + + If unsure, say Y. + endif # HW_RANDOM config UML_RANDOM
drivers/char/hw_random/Makefile +1 -0
@@ -39,3 +39,4 @@ obj-$(CONFIG_HW_RANDOM_MTK) += mtk-rng.o obj-$(CONFIG_HW_RANDOM_S390) += s390-trng.o obj-$(CONFIG_HW_RANDOM_KEYSTONE) += ks-sa-rng.o obj-$(CONFIG_HW_RANDOM_OPTEE) += optee-rng.o +obj-$(CONFIG_HW_RANDOM_NPCM) += npcm-rng.o
drivers/char/hw_random/npcm-rng.c new file +207 -0
207 lines not on this page · raw message
Signature · 1 line
2.18.0