22 #include <linux/module.h>
23 #include <linux/kernel.h>
30 #define SDCRNG_CTL_REG 0x00
31 #define SDCRNG_CTL_FVLD_M 0x0000f000
32 #define SDCRNG_CTL_FVLD_S 12
33 #define SDCRNG_CTL_KSZ 0x00000800
34 #define SDCRNG_CTL_RSRC_CRG 0x00000010
35 #define SDCRNG_CTL_RSRC_RRG 0x00000000
36 #define SDCRNG_CTL_CE 0x00000004
37 #define SDCRNG_CTL_RE 0x00000002
38 #define SDCRNG_CTL_DR 0x00000001
39 #define SDCRNG_CTL_SELECT_RRG_RNG (SDCRNG_CTL_RE | SDCRNG_CTL_RSRC_RRG)
40 #define SDCRNG_CTL_SELECT_CRG_RNG (SDCRNG_CTL_CE | SDCRNG_CTL_RSRC_CRG)
41 #define SDCRNG_VAL_REG 0x20
43 #define MODULE_NAME "pasemi_rng"
45 static int pasemi_rng_data_present(
struct hwrng *rng,
int wait)
60 static int pasemi_rng_data_read(
struct hwrng *rng,
u32 *
data)
67 static int pasemi_rng_init(
struct hwrng *rng)
79 static void pasemi_rng_cleanup(
struct hwrng *rng)
89 static struct hwrng pasemi_rng = {
91 .init = pasemi_rng_init,
92 .cleanup = pasemi_rng_cleanup,
93 .data_present = pasemi_rng_data_present,
94 .data_read = pasemi_rng_data_read,
113 pasemi_rng.
priv = (
unsigned long)rng_regs;
136 { .compatible =
"1682m-rng", },
137 { .compatible =
"pasemi,pwrficient-rng", },
143 .name =
"pasemi-rng",
145 .of_match_table = rng_match,
148 .remove = rng_remove,