11 #include <linux/module.h>
12 #include <linux/kernel.h>
19 #define PPC4XX_TRNG_DEV_CTRL 0x60080
21 #define PPC4XX_TRNGE 0x00020000
22 #define PPC4XX_TRNG_CTRL 0x0008
23 #define PPC4XX_TRNG_CTRL_DALM 0x20
24 #define PPC4XX_TRNG_STAT 0x0004
25 #define PPC4XX_TRNG_STAT_B 0x1
26 #define PPC4XX_TRNG_DATA 0x0000
28 #define MODULE_NAME "ppc4xx_rng"
30 static int ppc4xx_rng_data_present(
struct hwrng *rng,
int wait)
33 int busy,
i, present = 0;
46 static int ppc4xx_rng_data_read(
struct hwrng *rng,
u32 *
data)
53 static int ppc4xx_rng_enable(
int enable)
87 static struct hwrng ppc4xx_rng = {
89 .data_present = ppc4xx_rng_data_present,
90 .data_read = ppc4xx_rng_data_read,
102 err = ppc4xx_rng_enable(1);
107 ppc4xx_rng.
priv = (
unsigned long) rng_regs;
119 ppc4xx_rng_enable(0);
126 { .compatible =
"ppc4xx-rng", },
127 { .compatible =
"amcc,ppc460ex-rng", },
128 { .compatible =
"amcc,ppc440epx-rng", },
136 .of_match_table = ppc4xx_rng_match,
138 .probe = ppc4xx_rng_probe,
139 .remove = ppc4xx_rng_remove,