#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;
struct fsl_ifc_mtd { … };
struct fsl_ifc_nand_ctrl { … };
static struct fsl_ifc_nand_ctrl *ifc_nand_ctrl;
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 = …;
static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob)
{ … }
static int check_read_ecc(struct mtd_info *mtd, struct fsl_ifc_ctrl *ctrl,
u32 eccstat, unsigned int bufnum)
{ … }
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)
{ … }
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)
{ … }
static void fsl_ifc_write_buf(struct nand_chip *chip, const u8 *buf, int len)
{ … }
static uint8_t fsl_ifc_read_byte(struct nand_chip *chip)
{ … }
static uint8_t fsl_ifc_read_byte16(struct nand_chip *chip)
{ … }
static void fsl_ifc_read_buf(struct nand_chip *chip, u8 *buf, int len)
{ … }
static int fsl_ifc_wait(struct nand_chip *chip)
{ … }
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)
{ … }
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(…) …;