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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * APM X-Gene SoC RNG Driver
 *
 * Copyright (c) 2014, Applied Micro Circuits Corporation
 * Author: Rameshwar Prasad Sahu <[email protected]>
 *	   Shamal Winchurkar <[email protected]>
 *	   Feng Kan <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/hw_random.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/timer.h>

#define RNG_MAX_DATUM
#define MAX_TRY
#define XGENE_RNG_RETRY_COUNT
#define XGENE_RNG_RETRY_INTERVAL

/* RNG  Registers */
#define RNG_INOUT_0
#define RNG_INTR_STS_ACK
#define RNG_CONTROL
#define RNG_CONFIG
#define RNG_ALARMCNT
#define RNG_FROENABLE
#define RNG_FRODETUNE
#define RNG_ALARMMASK
#define RNG_ALARMSTOP
#define RNG_OPTIONS
#define RNG_EIP_REV

#define MONOBIT_FAIL_MASK
#define POKER_FAIL_MASK
#define LONG_RUN_FAIL_MASK
#define RUN_FAIL_MASK
#define NOISE_FAIL_MASK
#define STUCK_OUT_MASK
#define SHUTDOWN_OFLO_MASK
#define READY_MASK

#define MAJOR_HW_REV_RD(src)
#define MINOR_HW_REV_RD(src)
#define HW_PATCH_LEVEL_RD(src)
#define MAX_REFILL_CYCLES_SET(dst, src)
#define MIN_REFILL_CYCLES_SET(dst, src)
#define ALARM_THRESHOLD_SET(dst, src)
#define ENABLE_RNG_SET(dst, src)
#define REGSPEC_TEST_MODE_SET(dst, src)
#define MONOBIT_FAIL_MASK_SET(dst, src)
#define POKER_FAIL_MASK_SET(dst, src)
#define LONG_RUN_FAIL_MASK_SET(dst, src)
#define RUN_FAIL_MASK_SET(dst, src)
#define NOISE_FAIL_MASK_SET(dst, src)
#define STUCK_OUT_MASK_SET(dst, src)
#define SHUTDOWN_OFLO_MASK_SET(dst, src)

struct xgene_rng_dev {};

static void xgene_rng_expired_timer(struct timer_list *t)
{}

static void xgene_rng_start_timer(struct xgene_rng_dev *ctx)
{}

/*
 * Initialize or reinit free running oscillators (FROs)
 */
static void xgene_rng_init_fro(struct xgene_rng_dev *ctx, u32 fro_val)
{}

static void xgene_rng_chk_overflow(struct xgene_rng_dev *ctx)
{}

static irqreturn_t xgene_rng_irq_handler(int irq, void *id)
{}

static int xgene_rng_data_present(struct hwrng *rng, int wait)
{}

static int xgene_rng_data_read(struct hwrng *rng, u32 *data)
{}

static void xgene_rng_init_internal(struct xgene_rng_dev *ctx)
{}

static int xgene_rng_init(struct hwrng *rng)
{}

#ifdef CONFIG_ACPI
static const struct acpi_device_id xgene_rng_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, xgene_rng_acpi_match);
#endif

static struct hwrng xgene_rng_func =;

static int xgene_rng_probe(struct platform_device *pdev)
{}

static void xgene_rng_remove(struct platform_device *pdev)
{}

static const struct of_device_id xgene_rng_of_match[] =;

MODULE_DEVICE_TABLE(of, xgene_rng_of_match);

static struct platform_driver xgene_rng_driver =;

module_platform_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();