linux/drivers/mtd/nand/raw/mxic_nand.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2019 Macronix International Co., Ltd.
 *
 * Author:
 *	Mason Yang <[email protected]>
 */

#include <linux/clk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/nand-ecc-sw-hamming.h>
#include <linux/mtd/rawnand.h>
#include <linux/platform_device.h>

#include "internals.h"

#define HC_CFG
#define HC_CFG_IF_CFG(x)
#define HC_CFG_DUAL_SLAVE
#define HC_CFG_INDIVIDUAL
#define HC_CFG_NIO(x)
#define HC_CFG_TYPE(s, t)
#define HC_CFG_TYPE_SPI_NOR
#define HC_CFG_TYPE_SPI_NAND
#define HC_CFG_TYPE_SPI_RAM
#define HC_CFG_TYPE_RAW_NAND
#define HC_CFG_SLV_ACT(x)
#define HC_CFG_CLK_PH_EN
#define HC_CFG_CLK_POL_INV
#define HC_CFG_BIG_ENDIAN
#define HC_CFG_DATA_PASS
#define HC_CFG_IDLE_SIO_LVL(x)
#define HC_CFG_MAN_START_EN
#define HC_CFG_MAN_START
#define HC_CFG_MAN_CS_EN
#define HC_CFG_MAN_CS_ASSERT

#define INT_STS
#define INT_STS_EN
#define INT_SIG_EN
#define INT_STS_ALL
#define INT_RDY_PIN
#define INT_RDY_SR
#define INT_LNR_SUSP
#define INT_ECC_ERR
#define INT_CRC_ERR
#define INT_LWR_DIS
#define INT_LRD_DIS
#define INT_SDMA_INT
#define INT_DMA_FINISH
#define INT_RX_NOT_FULL
#define INT_RX_NOT_EMPTY
#define INT_TX_NOT_FULL
#define INT_TX_EMPTY

#define HC_EN
#define HC_EN_BIT

#define TXD(x)
#define RXD

#define SS_CTRL(s)
#define LRD_CFG
#define LWR_CFG
#define RWW_CFG
#define OP_READ
#define OP_DUMMY_CYC(x)
#define OP_ADDR_BYTES(x)
#define OP_CMD_BYTES(x)
#define OP_OCTA_CRC_EN
#define OP_DQS_EN
#define OP_ENHC_EN
#define OP_PREAMBLE_EN
#define OP_DATA_DDR
#define OP_DATA_BUSW(x)
#define OP_ADDR_DDR
#define OP_ADDR_BUSW(x)
#define OP_CMD_DDR
#define OP_CMD_BUSW(x)
#define OP_BUSW_1
#define OP_BUSW_2
#define OP_BUSW_4
#define OP_BUSW_8

#define OCTA_CRC
#define OCTA_CRC_IN_EN(s)
#define OCTA_CRC_CHUNK(s, x)
#define OCTA_CRC_OUT_EN(s)

#define ONFI_DIN_CNT(s)

#define LRD_CTRL
#define RWW_CTRL
#define LWR_CTRL
#define LMODE_EN
#define LMODE_SLV_ACT(x)
#define LMODE_CMD1(x)
#define LMODE_CMD0(x)

#define LRD_ADDR
#define LWR_ADDR
#define LRD_RANGE
#define LWR_RANGE

#define AXI_SLV_ADDR

#define DMAC_RD_CFG
#define DMAC_WR_CFG
#define DMAC_CFG_PERIPH_EN
#define DMAC_CFG_ALLFLUSH_EN
#define DMAC_CFG_LASTFLUSH_EN
#define DMAC_CFG_QE(x)
#define DMAC_CFG_BURST_LEN(x)
#define DMAC_CFG_BURST_SZ(x)
#define DMAC_CFG_DIR_READ
#define DMAC_CFG_START

#define DMAC_RD_CNT
#define DMAC_WR_CNT

#define SDMA_ADDR

#define DMAM_CFG
#define DMAM_CFG_START
#define DMAM_CFG_CONT
#define DMAM_CFG_SDMA_GAP(x)
#define DMAM_CFG_DIR_READ
#define DMAM_CFG_EN

#define DMAM_CNT

#define LNR_TIMER_TH

#define RDM_CFG0
#define RDM_CFG0_POLY(x)

#define RDM_CFG1
#define RDM_CFG1_RDM_EN
#define RDM_CFG1_SEED(x)

#define LWR_SUSP_CTRL
#define LWR_SUSP_CTRL_EN

#define DMAS_CTRL
#define DMAS_CTRL_EN
#define DMAS_CTRL_DIR_READ

#define DATA_STROB
#define DATA_STROB_EDO_EN
#define DATA_STROB_INV_POL
#define DATA_STROB_DELAY_2CYC

#define IDLY_CODE(x)
#define IDLY_CODE_VAL(x, v)

#define GPIO
#define GPIO_PT(x)
#define GPIO_RESET(x)
#define GPIO_HOLDB(x)
#define GPIO_WPB(x)

#define HC_VER

#define HW_TEST(x)

#define MXIC_NFC_MAX_CLK_HZ
#define IRQ_TIMEOUT

struct mxic_nand_ctlr {};

static int mxic_nfc_clk_enable(struct mxic_nand_ctlr *nfc)
{}

static void mxic_nfc_clk_disable(struct mxic_nand_ctlr *nfc)
{}

static void mxic_nfc_set_input_delay(struct mxic_nand_ctlr *nfc, u8 idly_code)
{}

static int mxic_nfc_clk_setup(struct mxic_nand_ctlr *nfc, unsigned long freq)
{}

static int mxic_nfc_set_freq(struct mxic_nand_ctlr *nfc, unsigned long freq)
{}

static irqreturn_t mxic_nfc_isr(int irq, void *dev_id)
{}

static void mxic_nfc_hw_init(struct mxic_nand_ctlr *nfc)
{}

static void mxic_nfc_cs_enable(struct mxic_nand_ctlr *nfc)
{}

static void mxic_nfc_cs_disable(struct mxic_nand_ctlr *nfc)
{}

static int  mxic_nfc_wait_ready(struct nand_chip *chip)
{}

static int mxic_nfc_data_xfer(struct mxic_nand_ctlr *nfc, const void *txbuf,
			      void *rxbuf, unsigned int len)
{}

static int mxic_nfc_exec_op(struct nand_chip *chip,
			    const struct nand_operation *op, bool check_only)
{}

static int mxic_nfc_setup_interface(struct nand_chip *chip, int chipnr,
				    const struct nand_interface_config *conf)
{}

static const struct nand_controller_ops mxic_nand_controller_ops =;

static int mxic_nfc_probe(struct platform_device *pdev)
{}

static void mxic_nfc_remove(struct platform_device *pdev)
{}

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

static struct platform_driver mxic_nfc_driver =;
module_platform_driver();

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