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

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright (c) 2023 David Yang
 */

#include <linux/err.h>
#include <linux/hw_random.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#define RNG_CTRL
#define RNG_SOURCE
#define DROP_ENABLE
#define POST_PROCESS_ENABLE
#define POST_PROCESS_DEPTH
#define RNG_NUMBER
#define RNG_STAT
#define DATA_COUNT

struct histb_rng_priv {};

/*
 * Observed:
 * depth = 1 -> ~1ms
 * depth = 255 -> ~16ms
 */
static int histb_rng_wait(void __iomem *base)
{}

static void histb_rng_init(void __iomem *base, unsigned int depth)
{}

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

static unsigned int histb_rng_get_depth(void __iomem *base)
{}

static ssize_t
depth_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t
depth_store(struct device *dev, struct device_attribute *attr,
	    const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(depth);

static struct attribute *histb_rng_attrs[] =;

ATTRIBUTE_GROUPS();

static int histb_rng_probe(struct platform_device *pdev)
{}

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

static struct platform_driver histb_rng_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();