#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <crypto/internal/hash.h>
#include <crypto/md5.h>
#include <crypto/sha1.h>
#include <crypto/sha2.h>
#define CR_RESET …
#define CR_RESET_SET …
#define CR_RESET_UNSET …
#define CR_MESSAGE_LENGTH_H …
#define CR_MESSAGE_LENGTH_L …
#define CR_CONTROL …
#define CR_CONTROL_BYTE_ORDER_3210 …
#define CR_CONTROL_BYTE_ORDER_0123 …
#define CR_CONTROL_BYTE_ORDER_2310 …
#define CR_CONTROL_BYTE_ORDER_1032 …
#define CR_CONTROL_BYTE_ORDER_SHIFT …
#define CR_CONTROL_ALGO_MD5 …
#define CR_CONTROL_ALGO_SHA1 …
#define CR_CONTROL_ALGO_SHA224 …
#define CR_CONTROL_ALGO_SHA256 …
#define CR_INTSTAT …
#define CR_INTENAB …
#define CR_INTCLEAR …
#define CR_INT_RESULTS_AVAILABLE …
#define CR_INT_NEW_RESULTS_SET …
#define CR_INT_RESULT_READ_ERR …
#define CR_INT_MESSAGE_WRITE_ERROR …
#define CR_INT_STATUS …
#define CR_RESULT_QUEUE …
#define CR_RSD0 …
#define CR_CORE_REV …
#define CR_CORE_DES1 …
#define CR_CORE_DES2 …
#define DRIVER_FLAGS_BUSY …
#define DRIVER_FLAGS_FINAL …
#define DRIVER_FLAGS_DMA_ACTIVE …
#define DRIVER_FLAGS_OUTPUT_READY …
#define DRIVER_FLAGS_INIT …
#define DRIVER_FLAGS_CPU …
#define DRIVER_FLAGS_DMA_READY …
#define DRIVER_FLAGS_ERROR …
#define DRIVER_FLAGS_SG …
#define DRIVER_FLAGS_SHA1 …
#define DRIVER_FLAGS_SHA224 …
#define DRIVER_FLAGS_SHA256 …
#define DRIVER_FLAGS_MD5 …
#define IMG_HASH_QUEUE_LENGTH …
#define IMG_HASH_DMA_BURST …
#define IMG_HASH_DMA_THRESHOLD …
#ifdef __LITTLE_ENDIAN
#define IMG_HASH_BYTE_ORDER …
#else
#define IMG_HASH_BYTE_ORDER …
#endif
struct img_hash_dev;
struct img_hash_request_ctx { … };
struct img_hash_ctx { … };
struct img_hash_dev { … };
struct img_hash_drv { … };
static struct img_hash_drv img_hash = …;
static inline u32 img_hash_read(struct img_hash_dev *hdev, u32 offset)
{ … }
static inline void img_hash_write(struct img_hash_dev *hdev,
u32 offset, u32 value)
{ … }
static inline __be32 img_hash_read_result_queue(struct img_hash_dev *hdev)
{ … }
static void img_hash_start(struct img_hash_dev *hdev, bool dma)
{ … }
static int img_hash_xmit_cpu(struct img_hash_dev *hdev, const u8 *buf,
size_t length, int final)
{ … }
static void img_hash_dma_callback(void *data)
{ … }
static int img_hash_xmit_dma(struct img_hash_dev *hdev, struct scatterlist *sg)
{ … }
static int img_hash_write_via_cpu(struct img_hash_dev *hdev)
{ … }
static int img_hash_finish(struct ahash_request *req)
{ … }
static void img_hash_copy_hash(struct ahash_request *req)
{ … }
static void img_hash_finish_req(struct ahash_request *req, int err)
{ … }
static int img_hash_write_via_dma(struct img_hash_dev *hdev)
{ … }
static int img_hash_dma_init(struct img_hash_dev *hdev)
{ … }
static void img_hash_dma_task(unsigned long d)
{ … }
static int img_hash_write_via_dma_stop(struct img_hash_dev *hdev)
{ … }
static int img_hash_process_data(struct img_hash_dev *hdev)
{ … }
static int img_hash_hw_init(struct img_hash_dev *hdev)
{ … }
static int img_hash_init(struct ahash_request *req)
{ … }
static int img_hash_handle_queue(struct img_hash_dev *hdev,
struct ahash_request *req)
{ … }
static int img_hash_update(struct ahash_request *req)
{ … }
static int img_hash_final(struct ahash_request *req)
{ … }
static int img_hash_finup(struct ahash_request *req)
{ … }
static int img_hash_import(struct ahash_request *req, const void *in)
{ … }
static int img_hash_export(struct ahash_request *req, void *out)
{ … }
static int img_hash_digest(struct ahash_request *req)
{ … }
static int img_hash_cra_init(struct crypto_tfm *tfm, const char *alg_name)
{ … }
static int img_hash_cra_md5_init(struct crypto_tfm *tfm)
{ … }
static int img_hash_cra_sha1_init(struct crypto_tfm *tfm)
{ … }
static int img_hash_cra_sha224_init(struct crypto_tfm *tfm)
{ … }
static int img_hash_cra_sha256_init(struct crypto_tfm *tfm)
{ … }
static void img_hash_cra_exit(struct crypto_tfm *tfm)
{ … }
static irqreturn_t img_irq_handler(int irq, void *dev_id)
{ … }
static struct ahash_alg img_algs[] = …;
static int img_register_algs(struct img_hash_dev *hdev)
{ … }
static int img_unregister_algs(struct img_hash_dev *hdev)
{ … }
static void img_hash_done_task(unsigned long data)
{ … }
static const struct of_device_id img_hash_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, img_hash_match);
static int img_hash_probe(struct platform_device *pdev)
{ … }
static void img_hash_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int img_hash_suspend(struct device *dev)
{ … }
static int img_hash_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops img_hash_pm_ops = …;
static struct platform_driver img_hash_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;