linux/drivers/spi/spi-sn-f-ospi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Socionext SPI flash controller F_OSPI driver
 * Copyright (C) 2021 Socionext Inc.
 */

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi-mem.h>

/* Registers */
#define OSPI_PROT_CTL_INDIR
#define OSPI_PROT_MODE_DATA_MASK
#define OSPI_PROT_MODE_ALT_MASK
#define OSPI_PROT_MODE_ADDR_MASK
#define OSPI_PROT_MODE_CODE_MASK
#define OSPI_PROT_MODE_SINGLE
#define OSPI_PROT_MODE_DUAL
#define OSPI_PROT_MODE_QUAD
#define OSPI_PROT_MODE_OCTAL
#define OSPI_PROT_DATA_RATE_DATA
#define OSPI_PROT_DATA_RATE_ALT
#define OSPI_PROT_DATA_RATE_ADDR
#define OSPI_PROT_DATA_RATE_CODE
#define OSPI_PROT_SDR
#define OSPI_PROT_DDR
#define OSPI_PROT_BIT_POS_DATA
#define OSPI_PROT_BIT_POS_ALT
#define OSPI_PROT_BIT_POS_ADDR
#define OSPI_PROT_BIT_POS_CODE
#define OSPI_PROT_SAMP_EDGE
#define OSPI_PROT_DATA_UNIT_MASK
#define OSPI_PROT_DATA_UNIT_1B
#define OSPI_PROT_DATA_UNIT_2B
#define OSPI_PROT_DATA_UNIT_4B
#define OSPI_PROT_TRANS_DIR_WRITE
#define OSPI_PROT_DATA_EN
#define OSPI_PROT_ALT_SIZE_MASK
#define OSPI_PROT_ADDR_SIZE_MASK
#define OSPI_PROT_CODE_SIZE_MASK

#define OSPI_CLK_CTL
#define OSPI_CLK_CTL_BOOT_INT_CLK_EN
#define OSPI_CLK_CTL_PHA
#define OSPI_CLK_CTL_PHA_180
#define OSPI_CLK_CTL_PHA_90
#define OSPI_CLK_CTL_DIV
#define OSPI_CLK_CTL_DIV_1
#define OSPI_CLK_CTL_DIV_2
#define OSPI_CLK_CTL_DIV_4
#define OSPI_CLK_CTL_DIV_8
#define OSPI_CLK_CTL_INT_CLK_EN

#define OSPI_CS_CTL1
#define OSPI_CS_CTL2
#define OSPI_SSEL
#define OSPI_CMD_IDX_INDIR
#define OSPI_ADDR
#define OSPI_ALT_INDIR
#define OSPI_DMY_INDIR
#define OSPI_DAT
#define OSPI_DAT_SWP_INDIR

#define OSPI_DAT_SIZE_INDIR
#define OSPI_DAT_SIZE_EN
#define OSPI_DAT_SIZE_MASK
#define OSPI_DAT_SIZE_MAX

#define OSPI_TRANS_CTL
#define OSPI_TRANS_CTL_STOP_REQ
#define OSPI_TRANS_CTL_START_REQ

#define OSPI_ACC_MODE
#define OSPI_ACC_MODE_BOOT_DISABLE

#define OSPI_SWRST
#define OSPI_SWRST_INDIR_WRITE_FIFO
#define OSPI_SWRST_INDIR_READ_FIFO

#define OSPI_STAT
#define OSPI_STAT_IS_AXI_WRITING
#define OSPI_STAT_IS_AXI_READING
#define OSPI_STAT_IS_SPI_INT_CLK_STOP
#define OSPI_STAT_IS_SPI_IDLE

#define OSPI_IRQ
#define OSPI_IRQ_CS_DEASSERT
#define OSPI_IRQ_WRITE_BUF_READY
#define OSPI_IRQ_READ_BUF_READY
#define OSPI_IRQ_CS_TRANS_COMP
#define OSPI_IRQ_ALL

#define OSPI_IRQ_STAT_EN
#define OSPI_IRQ_SIG_EN

/* Parameters */
#define OSPI_NUM_CS
#define OSPI_DUMMY_CYCLE_MAX
#define OSPI_WAIT_MAX_MSEC

struct f_ospi {};

static u32 f_ospi_get_dummy_cycle(const struct spi_mem_op *op)
{}

static void f_ospi_clear_irq(struct f_ospi *ospi)
{}

static void f_ospi_enable_irq_status(struct f_ospi *ospi, u32 irq_bits)
{}

static void f_ospi_disable_irq_status(struct f_ospi *ospi, u32 irq_bits)
{}

static void f_ospi_disable_irq_output(struct f_ospi *ospi, u32 irq_bits)
{}

static int f_ospi_prepare_config(struct f_ospi *ospi)
{}

static int f_ospi_unprepare_config(struct f_ospi *ospi)
{}

static void f_ospi_config_clk(struct f_ospi *ospi, u32 device_hz)
{}

static void f_ospi_config_dll(struct f_ospi *ospi)
{}

static u8 f_ospi_get_mode(struct f_ospi *ospi, int width, int data_size)
{}

static void f_ospi_config_indir_protocol(struct f_ospi *ospi,
					 struct spi_mem *mem,
					 const struct spi_mem_op *op)
{}

static int f_ospi_indir_prepare_op(struct f_ospi *ospi, struct spi_mem *mem,
				   const struct spi_mem_op *op)
{}

static void f_ospi_indir_start_xfer(struct f_ospi *ospi)
{}

static void f_ospi_indir_stop_xfer(struct f_ospi *ospi)
{}

static int f_ospi_indir_wait_xfer_complete(struct f_ospi *ospi)
{}

static int f_ospi_indir_read(struct f_ospi *ospi, struct spi_mem *mem,
			     const struct spi_mem_op *op)
{}

static int f_ospi_indir_write(struct f_ospi *ospi, struct spi_mem *mem,
			      const struct spi_mem_op *op)
{}

static int f_ospi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
{}

static bool f_ospi_supports_op_width(struct spi_mem *mem,
				     const struct spi_mem_op *op)
{}

static bool f_ospi_supports_op(struct spi_mem *mem,
			       const struct spi_mem_op *op)
{}

static int f_ospi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
{}

static const struct spi_controller_mem_ops f_ospi_mem_ops =;

static int f_ospi_init(struct f_ospi *ospi)
{}

static int f_ospi_probe(struct platform_device *pdev)
{}

static void f_ospi_remove(struct platform_device *pdev)
{}

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

static struct platform_driver f_ospi_driver =;
module_platform_driver();

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