linux/drivers/crypto/inside-secure/safexcel.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2017 Marvell
 *
 * Antoine Tenart <[email protected]>
 */

#include <linux/clk.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/of_irq.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/workqueue.h>

#include <crypto/internal/aead.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>

#include "safexcel.h"

static u32 max_rings =;
module_param(max_rings, uint, 0644);
MODULE_PARM_DESC();

static void eip197_trc_cache_setupvirt(struct safexcel_crypto_priv *priv)
{}

static void eip197_trc_cache_banksel(struct safexcel_crypto_priv *priv,
				     u32 addrmid, int *actbank)
{}

static u32 eip197_trc_cache_probe(struct safexcel_crypto_priv *priv,
				  int maxbanks, u32 probemask, u32 stride)
{}

static void eip197_trc_cache_clear(struct safexcel_crypto_priv *priv,
				   int cs_rc_max, int cs_ht_wc)
{}

static int eip197_trc_cache_init(struct safexcel_crypto_priv *priv)
{}

static void eip197_init_firmware(struct safexcel_crypto_priv *priv)
{}

static int eip197_write_firmware(struct safexcel_crypto_priv *priv,
				  const struct firmware *fw)
{}

/*
 * If FW is actual production firmware, then poll for its initialization
 * to complete and check if it is good for the HW, otherwise just return OK.
 */
static bool poll_fw_ready(struct safexcel_crypto_priv *priv, int fpp)
{}

static bool eip197_start_firmware(struct safexcel_crypto_priv *priv,
				  int ipuesz, int ifppsz, int minifw)
{}

static int eip197_load_firmwares(struct safexcel_crypto_priv *priv)
{}

static int safexcel_hw_setup_cdesc_rings(struct safexcel_crypto_priv *priv)
{}

static int safexcel_hw_setup_rdesc_rings(struct safexcel_crypto_priv *priv)
{}

static int safexcel_hw_init(struct safexcel_crypto_priv *priv)
{}

/* Called with ring's lock taken */
static void safexcel_try_push_requests(struct safexcel_crypto_priv *priv,
				       int ring)
{}

void safexcel_dequeue(struct safexcel_crypto_priv *priv, int ring)
{}

inline int safexcel_rdesc_check_errors(struct safexcel_crypto_priv *priv,
				       void *rdp)
{}

inline void safexcel_rdr_req_set(struct safexcel_crypto_priv *priv,
				 int ring,
				 struct safexcel_result_desc *rdesc,
				 struct crypto_async_request *req)
{}

inline struct crypto_async_request *
safexcel_rdr_req_get(struct safexcel_crypto_priv *priv, int ring)
{}

void safexcel_complete(struct safexcel_crypto_priv *priv, int ring)
{}

int safexcel_invalidate_cache(struct crypto_async_request *async,
			      struct safexcel_crypto_priv *priv,
			      dma_addr_t ctxr_dma, int ring)
{}

static inline void safexcel_handle_result_descriptor(struct safexcel_crypto_priv *priv,
						     int ring)
{}

static void safexcel_dequeue_work(struct work_struct *work)
{}

struct safexcel_ring_irq_data {};

static irqreturn_t safexcel_irq_ring(int irq, void *data)
{}

static irqreturn_t safexcel_irq_ring_thread(int irq, void *data)
{}

static int safexcel_request_ring_irq(void *pdev, int irqid,
				     int is_pci_dev,
				     int ring_id,
				     irq_handler_t handler,
				     irq_handler_t threaded_handler,
				     struct safexcel_ring_irq_data *ring_irq_priv)
{}

static struct safexcel_alg_template *safexcel_algs[] =;

static int safexcel_register_algorithms(struct safexcel_crypto_priv *priv)
{}

static void safexcel_unregister_algorithms(struct safexcel_crypto_priv *priv)
{}

static void safexcel_configure(struct safexcel_crypto_priv *priv)
{}

static void safexcel_init_register_offsets(struct safexcel_crypto_priv *priv)
{}

/*
 * Generic part of probe routine, shared by platform and PCI driver
 *
 * Assumes IO resources have been mapped, private data mem has been allocated,
 * clocks have been enabled, device pointer has been assigned etc.
 *
 */
static int safexcel_probe_generic(void *pdev,
				  struct safexcel_crypto_priv *priv,
				  int is_pci_dev)
{}

static void safexcel_hw_reset_rings(struct safexcel_crypto_priv *priv)
{}

/* for Device Tree platform driver */

static int safexcel_probe(struct platform_device *pdev)
{}

static void safexcel_remove(struct platform_device *pdev)
{}

static const struct safexcel_priv_data eip97ies_mrvl_data =;

static const struct safexcel_priv_data eip197b_mrvl_data =;

static const struct safexcel_priv_data eip197d_mrvl_data =;

static const struct safexcel_priv_data eip197_devbrd_data =;

static const struct safexcel_priv_data eip197c_mxl_data =;

static const struct of_device_id safexcel_of_match_table[] =;

MODULE_DEVICE_TABLE(of, safexcel_of_match_table);

static struct platform_driver  crypto_safexcel =;

/* PCIE devices - i.e. Inside Secure development boards */

static int safexcel_pci_probe(struct pci_dev *pdev,
			       const struct pci_device_id *ent)
{}

static void safexcel_pci_remove(struct pci_dev *pdev)
{}

static const struct pci_device_id safexcel_pci_ids[] =;

MODULE_DEVICE_TABLE(pci, safexcel_pci_ids);

static struct pci_driver safexcel_pci_driver =;

static int __init safexcel_init(void)
{}

static void __exit safexcel_exit(void)
{}

module_init();
module_exit(safexcel_exit);

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

MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();