// SPDX-License-Identifier: GPL-2.0 /* * sun8i-ce-trng.c - hardware cryptographic offloader for * Allwinner H3/A64/H5/H2+/H6/R40 SoC * * Copyright (C) 2015-2020 Corentin Labbe <[email protected]> * * This file handle the TRNG * * You could find a link for the datasheet in Documentation/arch/arm/sunxi.rst */ #include "sun8i-ce.h" #include <linux/dma-mapping.h> #include <linux/pm_runtime.h> #include <linux/hw_random.h> /* * Note that according to the algorithm ID, 2 versions of the TRNG exists, * The first present in H3/H5/R40/A64 and the second present in H6. * This file adds support for both, but only the second is working * reliabily according to rngtest. **/ static int sun8i_ce_trng_read(struct hwrng *rng, void *data, size_t max, bool wait) { … } int sun8i_ce_hwrng_register(struct sun8i_ce_dev *ce) { … } void sun8i_ce_hwrng_unregister(struct sun8i_ce_dev *ce) { … }