linux/drivers/crypto/atmel-tdes.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Cryptographic API.
 *
 * Support for ATMEL DES/TDES HW acceleration.
 *
 * Copyright (c) 2012 Eukréa Electromatique - ATMEL
 * Author: Nicolas Royer <[email protected]>
 *
 * Some ideas are from omap-aes.c drivers.
 */


#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/hw_random.h>
#include <linux/platform_device.h>

#include <linux/device.h>
#include <linux/dmaengine.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/mod_devicetable.h>
#include <linux/delay.h>
#include <linux/crypto.h>
#include <crypto/scatterwalk.h>
#include <crypto/algapi.h>
#include <crypto/internal/des.h>
#include <crypto/internal/skcipher.h>
#include "atmel-tdes-regs.h"

#define ATMEL_TDES_PRIORITY

/* TDES flags  */
/* Reserve bits [17:16], [13:12], [2:0] for AES Mode Register */
#define TDES_FLAGS_ENCRYPT
#define TDES_FLAGS_OPMODE_MASK
#define TDES_FLAGS_ECB
#define TDES_FLAGS_CBC

#define TDES_FLAGS_MODE_MASK

#define TDES_FLAGS_INIT
#define TDES_FLAGS_FAST
#define TDES_FLAGS_BUSY
#define TDES_FLAGS_DMA

#define ATMEL_TDES_QUEUE_LENGTH

struct atmel_tdes_caps {};

struct atmel_tdes_dev;

struct atmel_tdes_ctx {};

struct atmel_tdes_reqctx {};

struct atmel_tdes_dma {};

struct atmel_tdes_dev {};

struct atmel_tdes_drv {};

static struct atmel_tdes_drv atmel_tdes =;

static int atmel_tdes_sg_copy(struct scatterlist **sg, size_t *offset,
			void *buf, size_t buflen, size_t total, int out)
{}

static inline u32 atmel_tdes_read(struct atmel_tdes_dev *dd, u32 offset)
{}

static inline void atmel_tdes_write(struct atmel_tdes_dev *dd,
					u32 offset, u32 value)
{}

static void atmel_tdes_write_n(struct atmel_tdes_dev *dd, u32 offset,
			       const u32 *value, int count)
{}

static struct atmel_tdes_dev *atmel_tdes_dev_alloc(void)
{}

static int atmel_tdes_hw_init(struct atmel_tdes_dev *dd)
{}

static inline unsigned int atmel_tdes_get_version(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd)
{}

static void atmel_tdes_dma_callback(void *data)
{}

static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_crypt_pdc_stop(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_buff_init(struct atmel_tdes_dev *dd)
{}

static void atmel_tdes_buff_cleanup(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_crypt_pdc(struct atmel_tdes_dev *dd,
				dma_addr_t dma_addr_in,
				dma_addr_t dma_addr_out, int length)
{}

static int atmel_tdes_crypt_dma(struct atmel_tdes_dev *dd,
				dma_addr_t dma_addr_in,
				dma_addr_t dma_addr_out, int length)
{}

static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd)
{}

static void
atmel_tdes_set_iv_as_last_ciphertext_block(struct atmel_tdes_dev *dd)
{}

static void atmel_tdes_finish_req(struct atmel_tdes_dev *dd, int err)
{}

static int atmel_tdes_handle_queue(struct atmel_tdes_dev *dd,
			       struct skcipher_request *req)
{}

static int atmel_tdes_crypt_dma_stop(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_crypt(struct skcipher_request *req, unsigned long mode)
{}

static int atmel_tdes_dma_init(struct atmel_tdes_dev *dd)
{}

static void atmel_tdes_dma_cleanup(struct atmel_tdes_dev *dd)
{}

static int atmel_des_setkey(struct crypto_skcipher *tfm, const u8 *key,
			   unsigned int keylen)
{}

static int atmel_tdes_setkey(struct crypto_skcipher *tfm, const u8 *key,
			   unsigned int keylen)
{}

static int atmel_tdes_ecb_encrypt(struct skcipher_request *req)
{}

static int atmel_tdes_ecb_decrypt(struct skcipher_request *req)
{}

static int atmel_tdes_cbc_encrypt(struct skcipher_request *req)
{}

static int atmel_tdes_cbc_decrypt(struct skcipher_request *req)
{}

static int atmel_tdes_init_tfm(struct crypto_skcipher *tfm)
{}

static void atmel_tdes_skcipher_alg_init(struct skcipher_alg *alg)
{}

static struct skcipher_alg tdes_algs[] =;

static void atmel_tdes_queue_task(unsigned long data)
{}

static void atmel_tdes_done_task(unsigned long data)
{}

static irqreturn_t atmel_tdes_irq(int irq, void *dev_id)
{}

static void atmel_tdes_unregister_algs(struct atmel_tdes_dev *dd)
{}

static int atmel_tdes_register_algs(struct atmel_tdes_dev *dd)
{}

static void atmel_tdes_get_cap(struct atmel_tdes_dev *dd)
{}

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

static int atmel_tdes_probe(struct platform_device *pdev)
{}

static void atmel_tdes_remove(struct platform_device *pdev)
{}

static struct platform_driver atmel_tdes_driver =;

module_platform_driver();

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