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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Freescale Integrated Flash Controller NAND driver
 *
 * Copyright 2011-2012 Freescale Semiconductor, Inc
 *
 * Author: Dipen Dudhat <[email protected]>
 */

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/fsl_ifc.h>
#include <linux/iopoll.h>

#define ERR_BYTE
#define IFC_TIMEOUT_MSECS

struct fsl_ifc_ctrl;

/* mtd information per set */
struct fsl_ifc_mtd {};

/* overview of the fsl ifc controller */
struct fsl_ifc_nand_ctrl {};

static struct fsl_ifc_nand_ctrl *ifc_nand_ctrl;

/*
 * Generic flash bbt descriptors
 */
static u8 bbt_pattern[] =;
static u8 mirror_pattern[] =;

static struct nand_bbt_descr bbt_main_descr =;

static struct nand_bbt_descr bbt_mirror_descr =;

static int fsl_ifc_ooblayout_ecc(struct mtd_info *mtd, int section,
				 struct mtd_oob_region *oobregion)
{}

static int fsl_ifc_ooblayout_free(struct mtd_info *mtd, int section,
				  struct mtd_oob_region *oobregion)
{}

static const struct mtd_ooblayout_ops fsl_ifc_ooblayout_ops =;

/*
 * Set up the IFC hardware block and page address fields, and the ifc nand
 * structure addr field to point to the correct IFC buffer in memory
 */
static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
{}

/* returns nonzero if entire page is blank */
static int check_read_ecc(struct mtd_info *mtd, struct fsl_ifc_ctrl *ctrl,
			  u32 eccstat, unsigned int bufnum)
{}

/*
 * execute IFC NAND command and wait for it to complete
 */
static void fsl_ifc_run_command(struct mtd_info *mtd)
{}

static void fsl_ifc_do_read(struct nand_chip *chip,
			    int oob,
			    struct mtd_info *mtd)
{}

/* cmdfunc send commands to the IFC NAND Machine */
static void fsl_ifc_cmdfunc(struct nand_chip *chip, unsigned int command,
			    int column, int page_addr) {}

static void fsl_ifc_select_chip(struct nand_chip *chip, int cs)
{}

/*
 * Write buf to the IFC NAND Controller Data Buffer
 */
static void fsl_ifc_write_buf(struct nand_chip *chip, const u8 *buf, int len)
{}

/*
 * Read a byte from either the IFC hardware buffer
 * read function for 8-bit buswidth
 */
static uint8_t fsl_ifc_read_byte(struct nand_chip *chip)
{}

/*
 * Read two bytes from the IFC hardware buffer
 * read function for 16-bit buswith
 */
static uint8_t fsl_ifc_read_byte16(struct nand_chip *chip)
{}

/*
 * Read from the IFC Controller Data Buffer
 */
static void fsl_ifc_read_buf(struct nand_chip *chip, u8 *buf, int len)
{}

/*
 * This function is called after Program and Erase Operations to
 * check for success or failure.
 */
static int fsl_ifc_wait(struct nand_chip *chip)
{}

/*
 * The controller does not check for bitflips in erased pages,
 * therefore software must check instead.
 */
static int check_erased_page(struct nand_chip *chip, u8 *buf)
{}

static int fsl_ifc_read_page(struct nand_chip *chip, uint8_t *buf,
			     int oob_required, int page)
{}

/* ECC will be calculated automatically, and errors will be detected in
 * waitfunc.
 */
static int fsl_ifc_write_page(struct nand_chip *chip, const uint8_t *buf,
			      int oob_required, int page)
{}

static int fsl_ifc_attach_chip(struct nand_chip *chip)
{}

static const struct nand_controller_ops fsl_ifc_controller_ops =;

static int fsl_ifc_sram_init(struct fsl_ifc_mtd *priv)
{}

static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
{}

static int fsl_ifc_chip_remove(struct fsl_ifc_mtd *priv)
{}

static int match_bank(struct fsl_ifc_global __iomem *ifc_global, int bank,
		      phys_addr_t addr)
{}

static DEFINE_MUTEX(fsl_ifc_nand_mutex);

static int fsl_ifc_nand_probe(struct platform_device *dev)
{}

static void fsl_ifc_nand_remove(struct platform_device *dev)
{}

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

static struct platform_driver fsl_ifc_nand_driver =;

module_platform_driver();

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