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

// SPDX-License-Identifier: GPL-2.0
/* Marvell CN10K RVU Hardware Random Number Generator.
 *
 * Copyright (C) 2021 Marvell.
 *
 */

#include <linux/hw_random.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/delay.h>

#include <linux/arm-smccc.h>

/* CSRs */
#define RNM_CTL_STATUS
#define RNM_ENTROPY_STATUS
#define RNM_CONST
#define RNM_EBG_ENT
#define RNM_PF_EBG_HEALTH
#define RNM_PF_RANDOM
#define RNM_TRNG_RESULT

/* Extended TRNG Read and Status Registers */
#define RNM_PF_TRNG_DAT
#define RNM_PF_TRNG_RES

struct cn10k_rng {};

#define PLAT_OCTEONTX_RESET_RNG_EBG_HEALTH_STATE

#define PCI_SUBSYS_DEVID_CN10K_A_RNG
#define PCI_SUBSYS_DEVID_CNF10K_A_RNG
#define PCI_SUBSYS_DEVID_CNF10K_B_RNG

static bool cn10k_is_extended_trng_regs_supported(struct pci_dev *pdev)
{}

static unsigned long reset_rng_health_state(struct cn10k_rng *rng)
{}

static int check_rng_health(struct cn10k_rng *rng)
{}

/* Returns true when valid data available otherwise return false */
static bool cn10k_read_trng(struct cn10k_rng *rng, u64 *value)
{}

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

static int cn10k_rng_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{}

static const struct pci_device_id cn10k_rng_id_table[] =;

MODULE_DEVICE_TABLE(pci, cn10k_rng_id_table);

static struct pci_driver cn10k_rng_driver =;

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