#include <linux/crypto.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <crypto/internal/rng.h>
#define EXYNOS_RNG_CONTROL 0x0
#define EXYNOS_RNG_STATUS 0x10
#define EXYNOS_RNG_SEED_CONF 0x14
#define EXYNOS_RNG_GEN_PRNG BIT(1)
#define EXYNOS_RNG_SEED_BASE 0x140
#define EXYNOS_RNG_SEED(n) (EXYNOS_RNG_SEED_BASE + (n * 0x4))
#define EXYNOS_RNG_OUT_BASE 0x160
#define EXYNOS_RNG_OUT(n) (EXYNOS_RNG_OUT_BASE + (n * 0x4))
#define EXYNOS_RNG_CONTROL_START 0x18
#define EXYNOS_RNG_STATUS_SEED_SETTING_DONE BIT(1)
#define EXYNOS_RNG_STATUS_RNG_DONE BIT(5)
#define EXYNOS_RNG_SEED_REGS 5
#define EXYNOS_RNG_SEED_SIZE (EXYNOS_RNG_SEED_REGS * 4)
#define EXYNOS_RNG_RESEED_TIME 1000
#define EXYNOS_RNG_RESEED_BYTES 65536
#define EXYNOS_RNG_WAIT_RETRIES 100