linux/drivers/fpga/microchip-spi.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Microchip Polarfire FPGA programming over slave SPI interface.
 */

#include <asm/unaligned.h>
#include <linux/delay.h>
#include <linux/fpga/fpga-mgr.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/spi/spi.h>

#define MPF_SPI_ISC_ENABLE
#define MPF_SPI_ISC_DISABLE
#define MPF_SPI_READ_STATUS
#define MPF_SPI_READ_DATA
#define MPF_SPI_FRAME_INIT
#define MPF_SPI_FRAME
#define MPF_SPI_PRG_MODE
#define MPF_SPI_RELEASE

#define MPF_SPI_FRAME_SIZE

#define MPF_HEADER_SIZE_OFFSET
#define MPF_DATA_SIZE_OFFSET

#define MPF_LOOKUP_TABLE_RECORD_SIZE
#define MPF_LOOKUP_TABLE_BLOCK_ID_OFFSET
#define MPF_LOOKUP_TABLE_BLOCK_START_OFFSET

#define MPF_COMPONENTS_SIZE_ID
#define MPF_BITSTREAM_ID

#define MPF_BITS_PER_COMPONENT_SIZE

#define MPF_STATUS_POLL_TIMEOUT
#define MPF_STATUS_BUSY
#define MPF_STATUS_READY
#define MPF_STATUS_SPI_VIOLATION
#define MPF_STATUS_SPI_ERROR

struct mpf_priv {};

static int mpf_read_status(struct mpf_priv *priv)
{}

static enum fpga_mgr_states mpf_ops_state(struct fpga_manager *mgr)
{}

static int mpf_ops_parse_header(struct fpga_manager *mgr,
				struct fpga_image_info *info,
				const char *buf, size_t count)
{}

static int mpf_poll_status(struct mpf_priv *priv, u8 mask)
{}

static int mpf_spi_write(struct mpf_priv *priv, const void *buf, size_t buf_size)
{}

static int mpf_spi_write_then_read(struct mpf_priv *priv,
				   const void *txbuf, size_t txbuf_size,
				   void *rxbuf, size_t rxbuf_size)
{}

static int mpf_ops_write_init(struct fpga_manager *mgr,
			      struct fpga_image_info *info, const char *buf,
			      size_t count)
{}

static int mpf_spi_frame_write(struct mpf_priv *priv, const char *buf)
{}

static int mpf_ops_write(struct fpga_manager *mgr, const char *buf, size_t count)
{}

static int mpf_ops_write_complete(struct fpga_manager *mgr,
				  struct fpga_image_info *info)
{}

static const struct fpga_manager_ops mpf_ops =;

static int mpf_probe(struct spi_device *spi)
{}

static const struct spi_device_id mpf_spi_ids[] =;
MODULE_DEVICE_TABLE(spi, mpf_spi_ids);

#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id mpf_of_ids[] =;
MODULE_DEVICE_TABLE(of, mpf_of_ids);
#endif /* IS_ENABLED(CONFIG_OF) */

static struct spi_driver mpf_driver =;

module_spi_driver();

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