/drivers/char/hw_random/ |
D | core.c | 74 static int hwrng_init(struct hwrng *rng); 77 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, 85 static void add_early_randomness(struct hwrng *rng) in add_early_randomness() argument 91 bytes_read = rng_get_data(rng, rng_buffer, size, 1); in add_early_randomness() 99 struct hwrng *rng = container_of(kref, struct hwrng, ref); in cleanup_rng() local 101 if (rng->cleanup) in cleanup_rng() 102 rng->cleanup(rng); in cleanup_rng() 104 complete(&rng->cleanup_done); in cleanup_rng() 107 static int set_current_rng(struct hwrng *rng) in set_current_rng() argument 113 err = hwrng_init(rng); in set_current_rng() [all …]
|
D | Makefile | 5 obj-$(CONFIG_HW_RANDOM) += rng-core.o 6 rng-core-y := core.o 7 obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o 8 obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o 9 obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o 10 obj-$(CONFIG_HW_RANDOM_ATMEL) += atmel-rng.o 11 obj-$(CONFIG_HW_RANDOM_BCM63XX) += bcm63xx-rng.o 12 obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o 13 obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o 14 n2-rng-y := n2-drv.o n2-asm.o [all …]
|
D | msm-rng.c | 48 struct msm_rng *rng = to_msm_rng(hwrng); in msm_rng_enable() local 52 ret = clk_prepare_enable(rng->clk); in msm_rng_enable() 58 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable() 62 val = readl_relaxed(rng->base + PRNG_LFSR_CFG); in msm_rng_enable() 65 writel(val, rng->base + PRNG_LFSR_CFG); in msm_rng_enable() 67 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable() 69 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable() 71 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable() 73 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable() 77 clk_disable_unprepare(rng->clk); in msm_rng_enable() [all …]
|
D | hisi-rng.c | 26 #define to_hisi_rng(p) container_of(p, struct hisi_rng, rng) 34 struct hwrng rng; member 37 static int hisi_rng_init(struct hwrng *rng) in hisi_rng_init() argument 39 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_init() 60 static void hisi_rng_cleanup(struct hwrng *rng) in hisi_rng_cleanup() argument 62 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_cleanup() 67 static int hisi_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in hisi_rng_read() argument 69 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_read() 78 struct hisi_rng *rng; in hisi_rng_probe() local 82 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in hisi_rng_probe() [all …]
|
D | cavium-rng-vf.c | 24 static int cavium_rng_read(struct hwrng *rng, void *dat, size_t max, bool wait) in cavium_rng_read() argument 26 struct cavium_rng *p = container_of(rng, struct cavium_rng, ops); in cavium_rng_read() 46 struct cavium_rng *rng; in cavium_rng_probe_vf() local 49 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in cavium_rng_probe_vf() 50 if (!rng) in cavium_rng_probe_vf() 54 rng->result = pcim_iomap(pdev, 0, 0); in cavium_rng_probe_vf() 55 if (!rng->result) { in cavium_rng_probe_vf() 60 rng->ops.name = "cavium rng"; in cavium_rng_probe_vf() 61 rng->ops.read = cavium_rng_read; in cavium_rng_probe_vf() 62 rng->ops.quality = 1000; in cavium_rng_probe_vf() [all …]
|
D | octeon-rng.c | 28 static int octeon_rng_init(struct hwrng *rng) in octeon_rng_init() argument 31 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_init() 40 static void octeon_rng_cleanup(struct hwrng *rng) in octeon_rng_cleanup() argument 43 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_cleanup() 50 static int octeon_rng_data_read(struct hwrng *rng, u32 *data) in octeon_rng_data_read() argument 52 struct octeon_rng *p = container_of(rng, struct octeon_rng, ops); in octeon_rng_data_read() 62 struct octeon_rng *rng; in octeon_rng_probe() local 71 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in octeon_rng_probe() 72 if (!rng) in octeon_rng_probe() 84 rng->control_status = devm_ioremap_nocache(&pdev->dev, in octeon_rng_probe() [all …]
|
D | stm32-rng.c | 46 struct hwrng rng; member 51 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in stm32_rng_read() argument 54 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_read() 58 pm_runtime_get_sync((struct device *) priv->rng.priv); in stm32_rng_read() 86 pm_runtime_mark_last_busy((struct device *) priv->rng.priv); in stm32_rng_read() 87 pm_runtime_put_sync_autosuspend((struct device *) priv->rng.priv); in stm32_rng_read() 92 static int stm32_rng_init(struct hwrng *rng) in stm32_rng_init() argument 95 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_init() 110 static void stm32_rng_cleanup(struct hwrng *rng) in stm32_rng_cleanup() argument 113 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_cleanup() [all …]
|
D | bcm63xx-rng.c | 28 struct hwrng rng; member 33 #define to_rng_priv(rng) container_of(rng, struct bcm63xx_rng_priv, rng) argument 35 static int bcm63xx_rng_init(struct hwrng *rng) in bcm63xx_rng_init() argument 37 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_init() 52 static void bcm63xx_rng_cleanup(struct hwrng *rng) in bcm63xx_rng_cleanup() argument 54 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_cleanup() 64 static int bcm63xx_rng_data_present(struct hwrng *rng, int wait) in bcm63xx_rng_data_present() argument 66 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_data_present() 71 static int bcm63xx_rng_data_read(struct hwrng *rng, u32 *data) in bcm63xx_rng_data_read() argument 73 struct bcm63xx_rng_priv *priv = to_rng_priv(rng); in bcm63xx_rng_data_read() [all …]
|
D | mxc-rnga.c | 64 struct hwrng rng; member 69 static int mxc_rnga_data_present(struct hwrng *rng, int wait) in mxc_rnga_data_present() argument 72 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_present() 85 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) in mxc_rnga_data_read() argument 89 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_read() 108 static int mxc_rnga_init(struct hwrng *rng) in mxc_rnga_init() argument 111 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_init() 131 static void mxc_rnga_cleanup(struct hwrng *rng) in mxc_rnga_cleanup() argument 134 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_cleanup() 153 mxc_rng->rng.name = "mxc-rnga"; in mxc_rnga_probe() [all …]
|
D | cavium-rng.c | 29 struct cavium_rng_pf *rng; in cavium_rng_probe() local 32 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in cavium_rng_probe() 33 if (!rng) in cavium_rng_probe() 37 rng->control_status = pcim_iomap(pdev, 0, 0); in cavium_rng_probe() 38 if (!rng->control_status) { in cavium_rng_probe() 46 rng->control_status); in cavium_rng_probe() 48 pci_set_drvdata(pdev, rng); in cavium_rng_probe() 54 writeq(0, rng->control_status); in cavium_rng_probe() 67 struct cavium_rng_pf *rng; in cavium_rng_remove() local 69 rng = pci_get_drvdata(pdev); in cavium_rng_remove() [all …]
|
D | pic32-rng.c | 46 struct hwrng rng; member 57 static int pic32_rng_read(struct hwrng *rng, void *buf, size_t max, in pic32_rng_read() argument 60 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng); in pic32_rng_read() 109 priv->rng.name = pdev->name; in pic32_rng_probe() 110 priv->rng.read = pic32_rng_read; in pic32_rng_probe() 112 ret = hwrng_register(&priv->rng); in pic32_rng_probe() 127 struct pic32_rng *rng = platform_get_drvdata(pdev); in pic32_rng_remove() local 129 hwrng_unregister(&rng->rng); in pic32_rng_remove() 130 writel(0, rng->base + RNGCON); in pic32_rng_remove() 131 clk_disable_unprepare(rng->clk); in pic32_rng_remove()
|
D | iproc-rng200.c | 51 struct hwrng rng; member 55 #define to_rng_priv(rng) container_of(rng, struct iproc_rng200_dev, rng) argument 94 static int iproc_rng200_read(struct hwrng *rng, void *buf, size_t max, in iproc_rng200_read() argument 97 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_read() 155 static int iproc_rng200_init(struct hwrng *rng) in iproc_rng200_init() argument 157 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_init() 169 static void iproc_rng200_cleanup(struct hwrng *rng) in iproc_rng200_cleanup() argument 171 struct iproc_rng200_dev *priv = to_rng_priv(rng); in iproc_rng200_cleanup() 205 priv->rng.name = "iproc-rng200", in iproc_rng200_probe() 206 priv->rng.read = iproc_rng200_read, in iproc_rng200_probe() [all …]
|
D | exynos-rng.c | 41 struct hwrng rng; member 46 static u32 exynos_rng_readl(struct exynos_rng *rng, u32 offset) in exynos_rng_readl() argument 48 return readl_relaxed(rng->mem + offset); in exynos_rng_readl() 51 static void exynos_rng_writel(struct exynos_rng *rng, u32 val, u32 offset) in exynos_rng_writel() argument 53 writel_relaxed(val, rng->mem + offset); in exynos_rng_writel() 72 static int exynos_init(struct hwrng *rng) in exynos_init() argument 74 struct exynos_rng *exynos_rng = container_of(rng, in exynos_init() 75 struct exynos_rng, rng); in exynos_init() 86 static int exynos_read(struct hwrng *rng, void *buf, in exynos_read() argument 89 struct exynos_rng *exynos_rng = container_of(rng, in exynos_read() [all …]
|
D | tx4939-rng.c | 29 struct hwrng rng; member 65 static int tx4939_rng_data_present(struct hwrng *rng, int wait) in tx4939_rng_data_present() argument 67 struct tx4939_rng *rngdev = container_of(rng, struct tx4939_rng, rng); in tx4939_rng_data_present() 98 static int tx4939_rng_data_read(struct hwrng *rng, u32 *buffer) in tx4939_rng_data_read() argument 100 struct tx4939_rng *rngdev = container_of(rng, struct tx4939_rng, rng); in tx4939_rng_data_read() 121 rngdev->rng.name = dev_name(&dev->dev); in tx4939_rng_probe() 122 rngdev->rng.data_present = tx4939_rng_data_present; in tx4939_rng_probe() 123 rngdev->rng.data_read = tx4939_rng_data_read; in tx4939_rng_probe() 142 if (!tx4939_rng_data_present(&rngdev->rng, 1)) in tx4939_rng_probe() 147 return devm_hwrng_register(&dev->dev, &rngdev->rng); in tx4939_rng_probe()
|
D | meson-rng.c | 71 struct hwrng rng; member 74 static int meson_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in meson_rng_read() argument 77 container_of(rng, struct meson_rng_data, rng); in meson_rng_read() 101 data->rng.name = pdev->name; in meson_rng_probe() 102 data->rng.read = meson_rng_read; in meson_rng_probe() 106 return devm_hwrng_register(dev, &data->rng); in meson_rng_probe()
|
D | pasemi-rng.c | 46 static int pasemi_rng_data_present(struct hwrng *rng, int wait) in pasemi_rng_data_present() argument 48 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_data_present() 61 static int pasemi_rng_data_read(struct hwrng *rng, u32 *data) in pasemi_rng_data_read() argument 63 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_data_read() 68 static int pasemi_rng_init(struct hwrng *rng) in pasemi_rng_init() argument 70 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_init() 80 static void pasemi_rng_cleanup(struct hwrng *rng) in pasemi_rng_cleanup() argument 82 void __iomem *rng_regs = (void __iomem *)rng->priv; in pasemi_rng_cleanup()
|
D | atmel-rng.c | 27 struct hwrng rng; member 30 static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, in atmel_trng_read() argument 33 struct atmel_trng *trng = container_of(rng, struct atmel_trng, rng); in atmel_trng_read() 75 trng->rng.name = pdev->name; in atmel_trng_probe() 76 trng->rng.read = atmel_trng_read; in atmel_trng_probe() 78 ret = hwrng_register(&trng->rng); in atmel_trng_probe() 95 hwrng_unregister(&trng->rng); in atmel_trng_remove()
|
D | Kconfig | 12 module will be called rng-core. This provides a device 35 module will be called timeriomem-rng. 48 module will be called intel-rng. 61 module will be called amd-rng. 74 module will be called atmel-rng. 87 module will be called bcm63xx-rng 100 module will be called bcm2835-rng 126 module will be called geode-rng. 139 module will be called n2-rng. 152 module will be called via-rng. [all …]
|
D | amd-rng.c | 61 static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in amd_rng_read() argument 64 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_read() 94 static int amd_rng_init(struct hwrng *rng) in amd_rng_init() argument 96 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_init() 110 static void amd_rng_cleanup(struct hwrng *rng) in amd_rng_cleanup() argument 112 struct amd768_priv *priv = (struct amd768_priv *)rng->priv; in amd_rng_cleanup()
|
D | timeriomem-rng.c | 48 #define to_rng_priv(rng) \ argument 49 ((struct timeriomem_rng_private_data *)rng->priv) 54 static int timeriomem_rng_data_present(struct hwrng *rng, int wait) in timeriomem_rng_data_present() argument 56 struct timeriomem_rng_private_data *priv = to_rng_priv(rng); in timeriomem_rng_data_present() 66 static int timeriomem_rng_data_read(struct hwrng *rng, u32 *data) in timeriomem_rng_data_read() argument 68 struct timeriomem_rng_private_data *priv = to_rng_priv(rng); in timeriomem_rng_data_read()
|
D | intel-rng.c | 167 static int intel_rng_data_present(struct hwrng *rng, int wait) in intel_rng_data_present() argument 169 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_present() 182 static int intel_rng_data_read(struct hwrng *rng, u32 *data) in intel_rng_data_read() argument 184 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_data_read() 191 static int intel_rng_init(struct hwrng *rng) in intel_rng_init() argument 193 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_init() 210 static void intel_rng_cleanup(struct hwrng *rng) in intel_rng_cleanup() argument 212 void __iomem *mem = (void __iomem *)rng->priv; in intel_rng_cleanup()
|
D | via-rng.c | 91 static int via_rng_data_present(struct hwrng *rng, int wait) in via_rng_data_present() argument 120 rng->priv = *via_rng_datum; in via_rng_data_present() 124 static int via_rng_data_read(struct hwrng *rng, u32 *data) in via_rng_data_read() argument 126 u32 via_rng_datum = (u32)rng->priv; in via_rng_data_read() 133 static int via_rng_init(struct hwrng *rng) in via_rng_init() argument
|
D | geode-rng.c | 55 static int geode_rng_data_read(struct hwrng *rng, u32 *data) in geode_rng_data_read() argument 57 void __iomem *mem = (void __iomem *)rng->priv; in geode_rng_data_read() 64 static int geode_rng_data_present(struct hwrng *rng, int wait) in geode_rng_data_present() argument 66 void __iomem *mem = (void __iomem *)rng->priv; in geode_rng_data_present()
|
D | omap-rng.c | 143 static int omap_rng_data_present(struct hwrng *rng, int wait) in omap_rng_data_present() argument 148 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_data_present() 164 static int omap_rng_data_read(struct hwrng *rng, u32 *data) in omap_rng_data_read() argument 169 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_data_read() 180 static int omap_rng_init(struct hwrng *rng) in omap_rng_init() argument 184 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_init() 188 static void omap_rng_cleanup(struct hwrng *rng) in omap_rng_cleanup() argument 192 priv = (struct omap_rng_dev *)rng->priv; in omap_rng_cleanup()
|
/drivers/crypto/amcc/ |
D | crypto4xx_trng.c | 31 static int ppc4xx_trng_data_present(struct hwrng *rng, int wait) in ppc4xx_trng_data_present() argument 33 struct crypto4xx_device *dev = (void *)rng->priv; in ppc4xx_trng_data_present() 48 static int ppc4xx_trng_data_read(struct hwrng *rng, u32 *data) in ppc4xx_trng_data_read() argument 50 struct crypto4xx_device *dev = (void *)rng->priv; in ppc4xx_trng_data_read() 78 struct hwrng *rng = NULL; in ppc4xx_trng_probe() local 91 rng = kzalloc(sizeof(*rng), GFP_KERNEL); in ppc4xx_trng_probe() 92 if (!rng) in ppc4xx_trng_probe() 95 rng->name = MODULE_NAME; in ppc4xx_trng_probe() 96 rng->data_present = ppc4xx_trng_data_present; in ppc4xx_trng_probe() 97 rng->data_read = ppc4xx_trng_data_read; in ppc4xx_trng_probe() [all …]
|