#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/spi-nor.h>
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi-mem.h>
#include "spi-intel.h"
#define BFPREG …
#define HSFSTS_CTL …
#define HSFSTS_CTL_FSMIE …
#define HSFSTS_CTL_FDBC_SHIFT …
#define HSFSTS_CTL_FDBC_MASK …
#define HSFSTS_CTL_FCYCLE_SHIFT …
#define HSFSTS_CTL_FCYCLE_MASK …
#define HSFSTS_CTL_FCYCLE_READ …
#define HSFSTS_CTL_FCYCLE_WRITE …
#define HSFSTS_CTL_FCYCLE_ERASE …
#define HSFSTS_CTL_FCYCLE_ERASE_64K …
#define HSFSTS_CTL_FCYCLE_RDSFDP …
#define HSFSTS_CTL_FCYCLE_RDID …
#define HSFSTS_CTL_FCYCLE_WRSR …
#define HSFSTS_CTL_FCYCLE_RDSR …
#define HSFSTS_CTL_FGO …
#define HSFSTS_CTL_FLOCKDN …
#define HSFSTS_CTL_FDV …
#define HSFSTS_CTL_SCIP …
#define HSFSTS_CTL_AEL …
#define HSFSTS_CTL_FCERR …
#define HSFSTS_CTL_FDONE …
#define FADDR …
#define DLOCK …
#define FDATA(n) …
#define FRACC …
#define FREG(n) …
#define FREG_BASE_MASK …
#define FREG_LIMIT_SHIFT …
#define FREG_LIMIT_MASK …
#define PR(n) …
#define PR_WPE …
#define PR_LIMIT_SHIFT …
#define PR_LIMIT_MASK …
#define PR_RPE …
#define PR_BASE_MASK …
#define SSFSTS_CTL …
#define SSFSTS_CTL_FSMIE …
#define SSFSTS_CTL_DS …
#define SSFSTS_CTL_DBC_SHIFT …
#define SSFSTS_CTL_SPOP …
#define SSFSTS_CTL_ACS …
#define SSFSTS_CTL_SCGO …
#define SSFSTS_CTL_COP_SHIFT …
#define SSFSTS_CTL_FRS …
#define SSFSTS_CTL_DOFRS …
#define SSFSTS_CTL_AEL …
#define SSFSTS_CTL_FCERR …
#define SSFSTS_CTL_FDONE …
#define SSFSTS_CTL_SCIP …
#define PREOP_OPTYPE …
#define OPMENU0 …
#define OPMENU1 …
#define OPTYPE_READ_NO_ADDR …
#define OPTYPE_WRITE_NO_ADDR …
#define OPTYPE_READ_WITH_ADDR …
#define OPTYPE_WRITE_WITH_ADDR …
#define BYT_PR …
#define BYT_SSFSTS_CTL …
#define BYT_FREG_NUM …
#define BYT_PR_NUM …
#define LPT_PR …
#define LPT_SSFSTS_CTL …
#define LPT_FREG_NUM …
#define LPT_PR_NUM …
#define BXT_PR …
#define BXT_SSFSTS_CTL …
#define BXT_FREG_NUM …
#define BXT_PR_NUM …
#define CNL_PR …
#define CNL_FREG_NUM …
#define CNL_PR_NUM …
#define LVSCC …
#define UVSCC …
#define ERASE_OPCODE_SHIFT …
#define ERASE_OPCODE_MASK …
#define ERASE_64K_OPCODE_SHIFT …
#define ERASE_64K_OPCODE_MASK …
#define FLVALSIG_MAGIC …
#define FLMAP0_NC_MASK …
#define FLMAP0_NC_SHIFT …
#define FLMAP0_FCBA_MASK …
#define FLCOMP_C0DEN_MASK …
#define FLCOMP_C0DEN_512K …
#define FLCOMP_C0DEN_1M …
#define FLCOMP_C0DEN_2M …
#define FLCOMP_C0DEN_4M …
#define FLCOMP_C0DEN_8M …
#define FLCOMP_C0DEN_16M …
#define FLCOMP_C0DEN_32M …
#define FLCOMP_C0DEN_64M …
#define INTEL_SPI_TIMEOUT …
#define INTEL_SPI_FIFO_SZ …
struct intel_spi { … };
struct intel_spi_mem_op { … };
static bool writeable;
module_param(writeable, bool, 0);
MODULE_PARM_DESC(…) …;
static void intel_spi_dump_regs(struct intel_spi *ispi)
{ … }
static int intel_spi_read_block(struct intel_spi *ispi, void *buf, size_t size)
{ … }
static int intel_spi_write_block(struct intel_spi *ispi, const void *buf,
size_t size)
{ … }
static int intel_spi_wait_hw_busy(struct intel_spi *ispi)
{ … }
static int intel_spi_wait_sw_busy(struct intel_spi *ispi)
{ … }
static bool intel_spi_set_writeable(struct intel_spi *ispi)
{ … }
static int intel_spi_opcode_index(struct intel_spi *ispi, u8 opcode, int optype)
{ … }
static int intel_spi_hw_cycle(struct intel_spi *ispi,
const struct intel_spi_mem_op *iop, size_t len)
{ … }
static int intel_spi_sw_cycle(struct intel_spi *ispi, u8 opcode, size_t len,
int optype)
{ … }
static u32 intel_spi_chip_addr(const struct intel_spi *ispi,
const struct spi_mem *mem)
{ … }
static int intel_spi_read_reg(struct intel_spi *ispi, const struct spi_mem *mem,
const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static int intel_spi_write_reg(struct intel_spi *ispi, const struct spi_mem *mem,
const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static int intel_spi_read(struct intel_spi *ispi, const struct spi_mem *mem,
const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static int intel_spi_write(struct intel_spi *ispi, const struct spi_mem *mem,
const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static int intel_spi_erase(struct intel_spi *ispi, const struct spi_mem *mem,
const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static int intel_spi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
{ … }
static bool intel_spi_cmp_mem_op(const struct intel_spi_mem_op *iop,
const struct spi_mem_op *op)
{ … }
static const struct intel_spi_mem_op *
intel_spi_match_mem_op(struct intel_spi *ispi, const struct spi_mem_op *op)
{ … }
static bool intel_spi_supports_mem_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{ … }
static int intel_spi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)
{ … }
static const char *intel_spi_get_name(struct spi_mem *mem)
{ … }
static int intel_spi_dirmap_create(struct spi_mem_dirmap_desc *desc)
{ … }
static ssize_t intel_spi_dirmap_read(struct spi_mem_dirmap_desc *desc, u64 offs,
size_t len, void *buf)
{ … }
static ssize_t intel_spi_dirmap_write(struct spi_mem_dirmap_desc *desc, u64 offs,
size_t len, const void *buf)
{ … }
static const struct spi_controller_mem_ops intel_spi_mem_ops = …;
#define INTEL_SPI_OP_ADDR(__nbytes) …
#define INTEL_SPI_OP_NO_DATA …
#define INTEL_SPI_OP_DATA_IN(__buswidth) …
#define INTEL_SPI_OP_DATA_OUT(__buswidth) …
#define INTEL_SPI_MEM_OP(__cmd, __addr, __data, __exec_op) …
#define INTEL_SPI_MEM_OP_REPL(__cmd, __addr, __data, __exec_op, __repl) …
#define INTEL_SPI_GENERIC_OPS … \
static const struct intel_spi_mem_op generic_mem_ops[] = …;
static const struct intel_spi_mem_op erase_64k_mem_ops[] = …;
static int intel_spi_init(struct intel_spi *ispi)
{ … }
static bool intel_spi_is_protected(const struct intel_spi *ispi,
unsigned int base, unsigned int limit)
{ … }
static void intel_spi_fill_partition(struct intel_spi *ispi,
struct mtd_partition *part)
{ … }
static int intel_spi_read_desc(struct intel_spi *ispi)
{ … }
static int intel_spi_populate_chip(struct intel_spi *ispi)
{ … }
int intel_spi_probe(struct device *dev, struct resource *mem,
const struct intel_spi_boardinfo *info)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;