linux/drivers/fpga/dfl-afu-main.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for FPGA Accelerated Function Unit (AFU)
 *
 * Copyright (C) 2017-2018 Intel Corporation, Inc.
 *
 * Authors:
 *   Wu Hao <[email protected]>
 *   Xiao Guangrong <[email protected]>
 *   Joseph Grecco <[email protected]>
 *   Enno Luebbers <[email protected]>
 *   Tim Whisonant <[email protected]>
 *   Ananda Ravuri <[email protected]>
 *   Henry Mitchel <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/fpga-dfl.h>

#include "dfl-afu.h"

#define RST_POLL_INVL
#define RST_POLL_TIMEOUT

/**
 * __afu_port_enable - enable a port by clear reset
 * @pdev: port platform device.
 *
 * Enable Port by clear the port soft reset bit, which is set by default.
 * The AFU is unable to respond to any MMIO access while in reset.
 * __afu_port_enable function should only be used after __afu_port_disable
 * function.
 *
 * The caller needs to hold lock for protection.
 */
int __afu_port_enable(struct platform_device *pdev)
{}

/**
 * __afu_port_disable - disable a port by hold reset
 * @pdev: port platform device.
 *
 * Disable Port by setting the port soft reset bit, it puts the port into reset.
 *
 * The caller needs to hold lock for protection.
 */
int __afu_port_disable(struct platform_device *pdev)
{}

/*
 * This function resets the FPGA Port and its accelerator (AFU) by function
 * __port_disable and __port_enable (set port soft reset bit and then clear
 * it). Userspace can do Port reset at any time, e.g. during DMA or Partial
 * Reconfiguration. But it should never cause any system level issue, only
 * functional failure (e.g. DMA or PR operation failure) and be recoverable
 * from the failure.
 *
 * Note: the accelerator (AFU) is not accessible when its port is in reset
 * (disabled). Any attempts on MMIO access to AFU while in reset, will
 * result errors reported via port error reporting sub feature (if present).
 */
static int __port_reset(struct platform_device *pdev)
{}

static int port_reset(struct platform_device *pdev)
{}

static int port_get_id(struct platform_device *pdev)
{}

static ssize_t
id_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(id);

static ssize_t
ltr_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t
ltr_store(struct device *dev, struct device_attribute *attr,
	  const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(ltr);

static ssize_t
ap1_event_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t
ap1_event_store(struct device *dev, struct device_attribute *attr,
		const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(ap1_event);

static ssize_t
ap2_event_show(struct device *dev, struct device_attribute *attr,
	       char *buf)
{}

static ssize_t
ap2_event_store(struct device *dev, struct device_attribute *attr,
		const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(ap2_event);

static ssize_t
power_state_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(power_state);

static ssize_t
userclk_freqcmd_store(struct device *dev, struct device_attribute *attr,
		      const char *buf, size_t count)
{}
static DEVICE_ATTR_WO(userclk_freqcmd);

static ssize_t
userclk_freqcntrcmd_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{}
static DEVICE_ATTR_WO(userclk_freqcntrcmd);

static ssize_t
userclk_freqsts_show(struct device *dev, struct device_attribute *attr,
		     char *buf)
{}
static DEVICE_ATTR_RO(userclk_freqsts);

static ssize_t
userclk_freqcntrsts_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}
static DEVICE_ATTR_RO(userclk_freqcntrsts);

static struct attribute *port_hdr_attrs[] =;

static umode_t port_hdr_attrs_visible(struct kobject *kobj,
				      struct attribute *attr, int n)
{}

static const struct attribute_group port_hdr_group =;

static int port_hdr_init(struct platform_device *pdev,
			 struct dfl_feature *feature)
{}

static long
port_hdr_ioctl(struct platform_device *pdev, struct dfl_feature *feature,
	       unsigned int cmd, unsigned long arg)
{}

static const struct dfl_feature_id port_hdr_id_table[] =;

static const struct dfl_feature_ops port_hdr_ops =;

static ssize_t
afu_id_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(afu_id);

static struct attribute *port_afu_attrs[] =;

static umode_t port_afu_attrs_visible(struct kobject *kobj,
				      struct attribute *attr, int n)
{}

static const struct attribute_group port_afu_group =;

static int port_afu_init(struct platform_device *pdev,
			 struct dfl_feature *feature)
{}

static const struct dfl_feature_id port_afu_id_table[] =;

static const struct dfl_feature_ops port_afu_ops =;

static int port_stp_init(struct platform_device *pdev,
			 struct dfl_feature *feature)
{}

static const struct dfl_feature_id port_stp_id_table[] =;

static const struct dfl_feature_ops port_stp_ops =;

static long
port_uint_ioctl(struct platform_device *pdev, struct dfl_feature *feature,
		unsigned int cmd, unsigned long arg)
{}

static const struct dfl_feature_id port_uint_id_table[] =;

static const struct dfl_feature_ops port_uint_ops =;

static struct dfl_feature_driver port_feature_drvs[] =;

static int afu_open(struct inode *inode, struct file *filp)
{}

static int afu_release(struct inode *inode, struct file *filp)
{}

static long afu_ioctl_check_extension(struct dfl_feature_platform_data *pdata,
				      unsigned long arg)
{}

static long
afu_ioctl_get_info(struct dfl_feature_platform_data *pdata, void __user *arg)
{}

static long afu_ioctl_get_region_info(struct dfl_feature_platform_data *pdata,
				      void __user *arg)
{}

static long
afu_ioctl_dma_map(struct dfl_feature_platform_data *pdata, void __user *arg)
{}

static long
afu_ioctl_dma_unmap(struct dfl_feature_platform_data *pdata, void __user *arg)
{}

static long afu_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{}

static const struct vm_operations_struct afu_vma_ops =;

static int afu_mmap(struct file *filp, struct vm_area_struct *vma)
{}

static const struct file_operations afu_fops =;

static int afu_dev_init(struct platform_device *pdev)
{}

static int afu_dev_destroy(struct platform_device *pdev)
{}

static int port_enable_set(struct platform_device *pdev, bool enable)
{}

static struct dfl_fpga_port_ops afu_port_ops =;

static int afu_probe(struct platform_device *pdev)
{}

static void afu_remove(struct platform_device *pdev)
{}

static const struct attribute_group *afu_dev_groups[] =;

static struct platform_driver afu_driver =;

static int __init afu_init(void)
{}

static void __exit afu_exit(void)
{}

module_init();
module_exit(afu_exit);

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