linux/drivers/char/hw_random/omap-rng.c

/*
 * omap-rng.c - RNG driver for TI OMAP CPU family
 *
 * Author: Deepak Saxena <[email protected]>
 *
 * Copyright 2005 (c) MontaVista Software, Inc.
 *
 * Mostly based on original driver:
 *
 * Copyright (C) 2005 Nokia Corporation
 * Author: Juha Yrjölä <[email protected]>
 *
 * This file is licensed under  the terms of the GNU General Public
 * License version 2. This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/random.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/hw_random.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/io.h>

#define RNG_REG_STATUS_RDY

#define RNG_REG_INTACK_RDY_MASK
#define RNG_REG_INTACK_SHUTDOWN_OFLO_MASK
#define RNG_SHUTDOWN_OFLO_MASK

#define RNG_CONTROL_STARTUP_CYCLES_SHIFT
#define RNG_CONTROL_STARTUP_CYCLES_MASK
#define RNG_CONTROL_ENABLE_TRNG_SHIFT
#define RNG_CONTROL_ENABLE_TRNG_MASK

#define RNG_CONFIG_MAX_REFIL_CYCLES_SHIFT
#define RNG_CONFIG_MAX_REFIL_CYCLES_MASK
#define RNG_CONFIG_MIN_REFIL_CYCLES_SHIFT
#define RNG_CONFIG_MIN_REFIL_CYCLES_MASK

#define RNG_CONTROL_STARTUP_CYCLES
#define RNG_CONFIG_MIN_REFIL_CYCLES
#define RNG_CONFIG_MAX_REFIL_CYCLES

#define RNG_ALARMCNT_ALARM_TH_SHIFT
#define RNG_ALARMCNT_ALARM_TH_MASK
#define RNG_ALARMCNT_SHUTDOWN_TH_SHIFT
#define RNG_ALARMCNT_SHUTDOWN_TH_MASK
#define RNG_ALARM_THRESHOLD
#define RNG_SHUTDOWN_THRESHOLD

#define RNG_REG_FROENABLE_MASK
#define RNG_REG_FRODETUNE_MASK

#define OMAP2_RNG_OUTPUT_SIZE
#define OMAP4_RNG_OUTPUT_SIZE
#define EIP76_RNG_OUTPUT_SIZE

/*
 * EIP76 RNG takes approx. 700us to produce 16 bytes of output data
 * as per testing results. And to account for the lack of udelay()'s
 * reliability, we keep the timeout as 1000us.
 */
#define RNG_DATA_FILL_TIMEOUT

enum {};

static const u16 reg_map_omap2[] =;

static const u16 reg_map_omap4[] =;

static const u16 reg_map_eip76[] =;

struct omap_rng_dev;
/**
 * struct omap_rng_pdata - RNG IP block-specific data
 * @regs: Pointer to the register offsets structure.
 * @data_size: No. of bytes in RNG output.
 * @data_present: Callback to determine if data is available.
 * @init: Callback for IP specific initialization sequence.
 * @cleanup: Callback for IP specific cleanup sequence.
 */
struct omap_rng_pdata {};

struct omap_rng_dev {};

static inline u32 omap_rng_read(struct omap_rng_dev *priv, u16 reg)
{}

static inline void omap_rng_write(struct omap_rng_dev *priv, u16 reg,
				      u32 val)
{}


static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max,
			    bool wait)
{}

static int omap_rng_init(struct hwrng *rng)
{}

static void omap_rng_cleanup(struct hwrng *rng)
{}


static inline u32 omap2_rng_data_present(struct omap_rng_dev *priv)
{}

static int omap2_rng_init(struct omap_rng_dev *priv)
{}

static void omap2_rng_cleanup(struct omap_rng_dev *priv)
{}

static struct omap_rng_pdata omap2_rng_pdata =;

static inline u32 omap4_rng_data_present(struct omap_rng_dev *priv)
{}

static int eip76_rng_init(struct omap_rng_dev *priv)
{}

static int omap4_rng_init(struct omap_rng_dev *priv)
{}

static void omap4_rng_cleanup(struct omap_rng_dev *priv)
{}

static irqreturn_t omap4_rng_irq(int irq, void *dev_id)
{}

static struct omap_rng_pdata omap4_rng_pdata =;

static struct omap_rng_pdata eip76_rng_pdata =;

static const struct of_device_id omap_rng_of_match[] __maybe_unused =;
MODULE_DEVICE_TABLE(of, omap_rng_of_match);

static int of_get_omap_rng_device_details(struct omap_rng_dev *priv,
					  struct platform_device *pdev)
{}

static int get_omap_rng_device_details(struct omap_rng_dev *omap_rng)
{}

static int omap_rng_probe(struct platform_device *pdev)
{}

static void omap_rng_remove(struct platform_device *pdev)
{}

static int __maybe_unused omap_rng_suspend(struct device *dev)
{}

static int __maybe_unused omap_rng_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);

static struct platform_driver omap_rng_driver =;

module_platform_driver();
MODULE_ALIAS();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();