/kernel/linux/linux-5.10/drivers/crypto/ |
D | exynos-rng.c | 66 struct exynos_rng_dev *rng; member 87 static u32 exynos_rng_readl(struct exynos_rng_dev *rng, u32 offset) in exynos_rng_readl() argument 89 return readl_relaxed(rng->mem + offset); in exynos_rng_readl() 92 static void exynos_rng_writel(struct exynos_rng_dev *rng, u32 val, u32 offset) in exynos_rng_writel() argument 94 writel_relaxed(val, rng->mem + offset); in exynos_rng_writel() 97 static int exynos_rng_set_seed(struct exynos_rng_dev *rng, in exynos_rng_set_seed() argument 117 exynos_rng_writel(rng, val, EXYNOS_RNG_SEED(seed_reg)); in exynos_rng_set_seed() 120 val = exynos_rng_readl(rng, EXYNOS_RNG_STATUS); in exynos_rng_set_seed() 122 dev_warn(rng->dev, "Seed setting not finished\n"); in exynos_rng_set_seed() 126 rng->last_seeding = jiffies; in exynos_rng_set_seed() [all …]
|
D | qcom-rng.c | 37 struct qcom_rng *rng; member 42 static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max) in qcom_rng_read() argument 49 val = readl_relaxed(rng->base + PRNG_STATUS); in qcom_rng_read() 53 val = readl_relaxed(rng->base + PRNG_DATA_OUT); in qcom_rng_read() 76 struct qcom_rng *rng = ctx->rng; in qcom_rng_generate() local 79 ret = clk_prepare_enable(rng->clk); in qcom_rng_generate() 83 mutex_lock(&rng->lock); in qcom_rng_generate() 85 ret = qcom_rng_read(rng, dstn, dlen); in qcom_rng_generate() 87 mutex_unlock(&rng->lock); in qcom_rng_generate() 88 clk_disable_unprepare(rng->clk); in qcom_rng_generate() [all …]
|
/kernel/linux/linux-5.10/drivers/char/hw_random/ |
D | core.c | 53 static int hwrng_init(struct hwrng *rng); 56 static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, 64 static void add_early_randomness(struct hwrng *rng) in add_early_randomness() argument 70 bytes_read = rng_get_data(rng, rng_buffer, size, 0); in add_early_randomness() 78 struct hwrng *rng = container_of(kref, struct hwrng, ref); in cleanup_rng() local 80 if (rng->cleanup) in cleanup_rng() 81 rng->cleanup(rng); in cleanup_rng() 83 complete(&rng->cleanup_done); in cleanup_rng() 86 static int set_current_rng(struct hwrng *rng) in set_current_rng() argument 92 err = hwrng_init(rng); in set_current_rng() [all …]
|
D | Makefile | 6 obj-$(CONFIG_HW_RANDOM) += rng-core.o 7 rng-core-y := core.o 8 obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o 9 obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o 10 obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o 11 obj-$(CONFIG_HW_RANDOM_ATMEL) += atmel-rng.o 12 obj-$(CONFIG_HW_RANDOM_BA431) += ba431-rng.o 13 obj-$(CONFIG_HW_RANDOM_GEODE) += geode-rng.o 14 obj-$(CONFIG_HW_RANDOM_N2RNG) += n2-rng.o 15 n2-rng-y := n2-drv.o n2-asm.o [all …]
|
D | hisi-rng.c | 23 #define to_hisi_rng(p) container_of(p, struct hisi_rng, rng) 31 struct hwrng rng; member 34 static int hisi_rng_init(struct hwrng *rng) in hisi_rng_init() argument 36 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_init() 57 static void hisi_rng_cleanup(struct hwrng *rng) in hisi_rng_cleanup() argument 59 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_cleanup() 64 static int hisi_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in hisi_rng_read() argument 66 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_read() 75 struct hisi_rng *rng; in hisi_rng_probe() local 78 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in hisi_rng_probe() [all …]
|
D | mtk-rng.c | 33 #define to_mtk_rng(p) container_of(p, struct mtk_rng, rng) 38 struct hwrng rng; member 41 static int mtk_rng_init(struct hwrng *rng) in mtk_rng_init() argument 43 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_init() 58 static void mtk_rng_cleanup(struct hwrng *rng) in mtk_rng_cleanup() argument 60 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_cleanup() 70 static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) in mtk_rng_wait_ready() argument 72 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_wait_ready() 83 static int mtk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in mtk_rng_read() argument 85 struct mtk_rng *priv = to_mtk_rng(rng); in mtk_rng_read() [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(&pdev->dev, in octeon_rng_probe() [all …]
|
D | npcm-rng.c | 29 #define to_npcm_rng(p) container_of(p, struct npcm_rng, rng) 33 struct hwrng rng; member 36 static int npcm_rng_init(struct hwrng *rng) in npcm_rng_init() argument 38 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_init() 46 static void npcm_rng_cleanup(struct hwrng *rng) in npcm_rng_cleanup() argument 48 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_cleanup() 53 static int npcm_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in npcm_rng_read() argument 55 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_read() 59 pm_runtime_get_sync((struct device *)priv->rng.priv); in npcm_rng_read() 81 pm_runtime_mark_last_busy((struct device *)priv->rng.priv); in npcm_rng_read() [all …]
|
D | stm32-rng.c | 31 struct hwrng rng; member 38 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait) in stm32_rng_read() argument 41 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_read() 45 pm_runtime_get_sync((struct device *) priv->rng.priv); in stm32_rng_read() 57 dev_err((struct device *)priv->rng.priv, in stm32_rng_read() 76 pm_runtime_mark_last_busy((struct device *) priv->rng.priv); in stm32_rng_read() 77 pm_runtime_put_sync_autosuspend((struct device *) priv->rng.priv); in stm32_rng_read() 82 static int stm32_rng_init(struct hwrng *rng) in stm32_rng_init() argument 85 container_of(rng, struct stm32_rng_private, rng); in stm32_rng_init() 104 static void stm32_rng_cleanup(struct hwrng *rng) in stm32_rng_cleanup() argument [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 = devm_kasprintf(&pdev->dev, GFP_KERNEL, in cavium_rng_probe_vf() 62 if (!rng->ops.name) in cavium_rng_probe_vf() 65 rng->ops.read = cavium_rng_read; in cavium_rng_probe_vf() [all …]
|
D | mxc-rnga.c | 56 struct hwrng rng; member 61 static int mxc_rnga_data_present(struct hwrng *rng, int wait) in mxc_rnga_data_present() argument 64 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_present() 77 static int mxc_rnga_data_read(struct hwrng *rng, u32 * data) in mxc_rnga_data_read() argument 81 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_data_read() 100 static int mxc_rnga_init(struct hwrng *rng) in mxc_rnga_init() argument 103 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_init() 123 static void mxc_rnga_cleanup(struct hwrng *rng) in mxc_rnga_cleanup() argument 126 struct mxc_rng *mxc_rng = container_of(rng, struct mxc_rng, rng); in mxc_rnga_cleanup() 144 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 | ingenic-rng.c | 36 struct hwrng rng; member 39 static int ingenic_rng_init(struct hwrng *rng) in ingenic_rng_init() argument 41 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_init() 48 static void ingenic_rng_cleanup(struct hwrng *rng) in ingenic_rng_cleanup() argument 50 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_cleanup() 55 static int ingenic_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in ingenic_rng_read() argument 57 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_read() 100 priv->rng.name = pdev->name; in ingenic_rng_probe() 101 priv->rng.init = ingenic_rng_init; in ingenic_rng_probe() 102 priv->rng.cleanup = ingenic_rng_cleanup; in ingenic_rng_probe() [all …]
|
D | ingenic-trng.c | 35 struct hwrng rng; member 38 static int ingenic_trng_init(struct hwrng *rng) in ingenic_trng_init() argument 40 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng); in ingenic_trng_init() 50 static void ingenic_trng_cleanup(struct hwrng *rng) in ingenic_trng_cleanup() argument 52 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng); in ingenic_trng_cleanup() 60 static int ingenic_trng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in ingenic_trng_read() argument 62 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng); in ingenic_trng_read() 108 trng->rng.name = pdev->name; in ingenic_trng_probe() 109 trng->rng.init = ingenic_trng_init; in ingenic_trng_probe() 110 trng->rng.cleanup = ingenic_trng_cleanup; in ingenic_trng_probe() [all …]
|
D | pic32-rng.c | 38 struct hwrng rng; member 49 static int pic32_rng_read(struct hwrng *rng, void *buf, size_t max, in pic32_rng_read() argument 52 struct pic32_rng *priv = container_of(rng, struct pic32_rng, rng); in pic32_rng_read() 96 priv->rng.name = pdev->name; in pic32_rng_probe() 97 priv->rng.read = pic32_rng_read; in pic32_rng_probe() 99 ret = hwrng_register(&priv->rng); in pic32_rng_probe() 114 struct pic32_rng *rng = platform_get_drvdata(pdev); in pic32_rng_remove() local 116 hwrng_unregister(&rng->rng); in pic32_rng_remove() 117 writel(0, rng->base + RNGCON); in pic32_rng_remove() 118 clk_disable_unprepare(rng->clk); in pic32_rng_remove()
|
D | ba431-rng.c | 42 struct hwrng rng; member 115 static int ba431_trng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in ba431_trng_read() argument 117 struct ba431_trng *ba431 = container_of(rng, struct ba431_trng, rng); in ba431_trng_read() 155 static void ba431_trng_cleanup(struct hwrng *rng) in ba431_trng_cleanup() argument 157 struct ba431_trng *ba431 = container_of(rng, struct ba431_trng, rng); in ba431_trng_cleanup() 163 static int ba431_trng_init(struct hwrng *rng) in ba431_trng_init() argument 165 struct ba431_trng *ba431 = container_of(rng, struct ba431_trng, rng); in ba431_trng_init() 189 ba431->rng.name = pdev->name; in ba431_trng_probe() 190 ba431->rng.init = ba431_trng_init; in ba431_trng_probe() 191 ba431->rng.cleanup = ba431_trng_cleanup; in ba431_trng_probe() [all …]
|
D | bcm2835-rng.c | 31 struct hwrng rng; member 37 static inline struct bcm2835_rng_priv *to_rng_priv(struct hwrng *rng) in to_rng_priv() argument 39 return container_of(rng, struct bcm2835_rng_priv, rng); in to_rng_priv() 62 static int bcm2835_rng_read(struct hwrng *rng, void *buf, size_t max, in bcm2835_rng_read() argument 65 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_read() 85 static int bcm2835_rng_init(struct hwrng *rng) in bcm2835_rng_init() argument 87 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_init() 111 static void bcm2835_rng_cleanup(struct hwrng *rng) in bcm2835_rng_cleanup() argument 113 struct bcm2835_rng_priv *priv = to_rng_priv(rng); in bcm2835_rng_cleanup() 162 priv->rng.name = pdev->name; in bcm2835_rng_probe() [all …]
|
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() 198 priv->rng.name = "iproc-rng200"; in iproc_rng200_probe() 199 priv->rng.read = iproc_rng200_read; in iproc_rng200_probe() [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() 119 rngdev->rng.name = dev_name(&dev->dev); in tx4939_rng_probe() 120 rngdev->rng.data_present = tx4939_rng_data_present; in tx4939_rng_probe() 121 rngdev->rng.data_read = tx4939_rng_data_read; in tx4939_rng_probe() 140 if (!tx4939_rng_data_present(&rngdev->rng, 1)) in tx4939_rng_probe() 145 return devm_hwrng_register(&dev->dev, &rngdev->rng); in tx4939_rng_probe()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
D | rng.c | 34 struct powernv_rng *rng; in powernv_hwrng_present() local 36 rng = get_cpu_var(powernv_rng); in powernv_hwrng_present() 37 put_cpu_var(rng); in powernv_hwrng_present() 38 return rng != NULL; in powernv_hwrng_present() 41 static unsigned long rng_whiten(struct powernv_rng *rng, unsigned long val) in rng_whiten() argument 49 val ^= rng->mask; in rng_whiten() 52 rng->mask = (rng->mask << 1) | (parity & 1); in rng_whiten() 59 struct powernv_rng *rng; in powernv_get_random_real_mode() local 61 rng = raw_cpu_read(powernv_rng); in powernv_get_random_real_mode() 63 *v = rng_whiten(rng, __raw_rm_readq(rng->regs_real)); in powernv_get_random_real_mode() [all …]
|
/kernel/linux/linux-5.10/crypto/ |
D | jitterentropy-kcapi.c | 116 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_init() local 119 rng->entropy_collector = jent_entropy_collector_alloc(1, 0); in jent_kcapi_init() 120 if (!rng->entropy_collector) in jent_kcapi_init() 123 spin_lock_init(&rng->jent_lock); in jent_kcapi_init() 129 struct jitterentropy *rng = crypto_tfm_ctx(tfm); in jent_kcapi_cleanup() local 131 spin_lock(&rng->jent_lock); in jent_kcapi_cleanup() 132 if (rng->entropy_collector) in jent_kcapi_cleanup() 133 jent_entropy_collector_free(rng->entropy_collector); in jent_kcapi_cleanup() 134 rng->entropy_collector = NULL; in jent_kcapi_cleanup() 135 spin_unlock(&rng->jent_lock); in jent_kcapi_cleanup() [all …]
|
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/rng/ |
D | mtk-rng.txt | 6 "mediatek,mt7622-rng", "mediatek,mt7623-rng" : for MT7622 7 "mediatek,mt7629-rng", "mediatek,mt7623-rng" : for MT7629 8 "mediatek,mt7623-rng" : for MT7623 9 "mediatek,mt8516-rng", "mediatek,mt7623-rng" : for MT8516 12 - clock-names : Should contain "rng" entries; 17 rng: rng@1020f000 { 18 compatible = "mediatek,mt7623-rng"; 21 clock-names = "rng";
|
D | sparc_sun_oracle_rng.txt | 7 - 'SUNW,n2-rng' for Niagara 2 Platform (SUN UltraSPARC T2 CPU) 8 - 'SUNW,vf-rng' for Victoria Falls Platform (SUN UltraSPARC T2 Plus CPU) 9 …- 'SUNW,kt-rng' for Rainbow/Yosemite Falls Platform (SUN SPARC T3/T4), (UltraSPARC KT/Niagara 3 - … 11 - 'ORCL,m4-rng' for SPARC T5/M5 12 - 'ORCL,m7-rng' for SPARC T7/M7 18 rng-#units: 00000002 19 compatible: 'ORCL,m4-rng' 25 rng-#units: 00000003 26 compatible: 'ORCL,m7-rng'
|
/kernel/linux/linux-5.10/drivers/crypto/amcc/ |
D | crypto4xx_trng.c | 28 static int ppc4xx_trng_data_present(struct hwrng *rng, int wait) in ppc4xx_trng_data_present() argument 30 struct crypto4xx_device *dev = (void *)rng->priv; in ppc4xx_trng_data_present() 45 static int ppc4xx_trng_data_read(struct hwrng *rng, u32 *data) in ppc4xx_trng_data_read() argument 47 struct crypto4xx_device *dev = (void *)rng->priv; in ppc4xx_trng_data_read() 75 struct hwrng *rng = NULL; in ppc4xx_trng_probe() local 90 rng = kzalloc(sizeof(*rng), GFP_KERNEL); in ppc4xx_trng_probe() 91 if (!rng) in ppc4xx_trng_probe() 94 rng->name = KBUILD_MODNAME; in ppc4xx_trng_probe() 95 rng->data_present = ppc4xx_trng_data_present; in ppc4xx_trng_probe() 96 rng->data_read = ppc4xx_trng_data_read; in ppc4xx_trng_probe() [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | hw_random.h | 41 int (*init)(struct hwrng *rng); 42 void (*cleanup)(struct hwrng *rng); 43 int (*data_present)(struct hwrng *rng, int wait); 44 int (*data_read)(struct hwrng *rng, u32 *data); 45 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait); 58 extern int hwrng_register(struct hwrng *rng); 59 extern int devm_hwrng_register(struct device *dev, struct hwrng *rng); 61 extern void hwrng_unregister(struct hwrng *rng); 62 extern void devm_hwrng_unregister(struct device *dve, struct hwrng *rng);
|