Lines Matching +full:- +full:seed

1 // SPDX-License-Identifier: GPL-2.0-only
27 MODULE_PARM_DESC(seed_sel, "Auto reload seed. 0, use LFSR(default); 1, use ring oscillator.");
38 u32 seed; in hisi_rng_init() local
40 /* get a random number as initial seed */ in hisi_rng_init()
41 get_random_bytes(&seed, sizeof(seed)); in hisi_rng_init()
43 writel_relaxed(seed, hrng->base + RNG_SEED); in hisi_rng_init()
46 * The seed is reload periodically, there are two choice in hisi_rng_init()
47 * of seeds, default seed using the value from LFSR, or in hisi_rng_init()
48 * will use seed generated by ring oscillator. in hisi_rng_init()
53 writel_relaxed(val, hrng->base + RNG_CTRL); in hisi_rng_init()
61 writel_relaxed(0, hrng->base + RNG_CTRL); in hisi_rng_cleanup()
69 *data = readl_relaxed(hrng->base + RNG_RAN_NUM); in hisi_rng_read()
78 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in hisi_rng_probe()
80 return -ENOMEM; in hisi_rng_probe()
84 rng->base = devm_platform_ioremap_resource(pdev, 0); in hisi_rng_probe()
85 if (IS_ERR(rng->base)) in hisi_rng_probe()
86 return PTR_ERR(rng->base); in hisi_rng_probe()
88 rng->rng.name = pdev->name; in hisi_rng_probe()
89 rng->rng.init = hisi_rng_init; in hisi_rng_probe()
90 rng->rng.cleanup = hisi_rng_cleanup; in hisi_rng_probe()
91 rng->rng.read = hisi_rng_read; in hisi_rng_probe()
93 ret = devm_hwrng_register(&pdev->dev, &rng->rng); in hisi_rng_probe()
95 dev_err(&pdev->dev, "failed to register hwrng\n"); in hisi_rng_probe()
103 { .compatible = "hisilicon,hip04-rng" },
104 { .compatible = "hisilicon,hip05-rng" },
112 .name = "hisi-rng",