1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2013, Michael Ellerman, IBM Corporation.
6 #define pr_fmt(fmt) "pseries-rng: " fmt
8 #include <linux/kernel.h>
10 #include <asm/archrandom.h>
11 #include <asm/machdep.h>
12 #include <asm/plpar_wrappers.h>
16 static int pseries_get_random_long(unsigned long *v)
18 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
20 if (plpar_hcall(H_RANDOM, retbuf) == H_SUCCESS) {
28 void __init pseries_rng_init(void)
30 struct device_node *dn;
32 dn = of_find_compatible_node(NULL, NULL, "ibm,random");
35 ppc_md.get_random_seed = pseries_get_random_long;