linux/drivers/char/hw_random/exynos-trng.c

// SPDX-License-Identifier: GPL-2.0
/*
 * RNG driver for Exynos TRNGs
 *
 * Author: Łukasz Stelmach <[email protected]>
 *
 * Copyright 2017 (c) Samsung Electronics Software, Inc.
 *
 * Based on the Exynos PRNG driver drivers/crypto/exynos-rng by
 * Krzysztof Kozłowski <[email protected]>
 */

#include <linux/arm-smccc.h>
#include <linux/clk.h>
#include <linux/crypto.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/hw_random.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>

#define EXYNOS_TRNG_CLKDIV

#define EXYNOS_TRNG_CTRL
#define EXYNOS_TRNG_CTRL_RNGEN

#define EXYNOS_TRNG_POST_CTRL
#define EXYNOS_TRNG_ONLINE_CTRL
#define EXYNOS_TRNG_ONLINE_STAT
#define EXYNOS_TRNG_ONLINE_MAXCHI2
#define EXYNOS_TRNG_FIFO_CTRL
#define EXYNOS_TRNG_FIFO_0
#define EXYNOS_TRNG_FIFO_1
#define EXYNOS_TRNG_FIFO_2
#define EXYNOS_TRNG_FIFO_3
#define EXYNOS_TRNG_FIFO_4
#define EXYNOS_TRNG_FIFO_5
#define EXYNOS_TRNG_FIFO_6
#define EXYNOS_TRNG_FIFO_7
#define EXYNOS_TRNG_FIFO_LEN
#define EXYNOS_TRNG_CLOCK_RATE

/* Driver feature flags */
#define EXYNOS_SMC

#define EXYNOS_SMC_CALL_VAL(func_num)

/* SMC command for DTRNG access */
#define SMC_CMD_RANDOM

/* SMC_CMD_RANDOM: arguments */
#define HWRNG_INIT
#define HWRNG_EXIT
#define HWRNG_GET_DATA
#define HWRNG_RESUME

/* SMC_CMD_RANDOM: return values */
#define HWRNG_RET_OK
#define HWRNG_RET_RETRY_ERROR

#define HWRNG_MAX_TRIES

struct exynos_trng_dev {};

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

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

static int exynos_trng_init_reg(struct hwrng *rng)
{}

static int exynos_trng_init_smc(struct hwrng *rng)
{}

static int exynos_trng_probe(struct platform_device *pdev)
{}

static void exynos_trng_remove(struct platform_device *pdev)
{}

static int exynos_trng_suspend(struct device *dev)
{}

static int exynos_trng_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(exynos_trng_pm_ops, exynos_trng_suspend,
				exynos_trng_resume);

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

static struct platform_driver exynos_trng_driver =;

module_platform_driver();

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