#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/sh_dma.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/sh_flctl.h>
static int flctl_4secc_ooblayout_sp_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static int flctl_4secc_ooblayout_sp_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static const struct mtd_ooblayout_ops flctl_4secc_oob_smallpage_ops = …;
static int flctl_4secc_ooblayout_lp_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static int flctl_4secc_ooblayout_lp_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static const struct mtd_ooblayout_ops flctl_4secc_oob_largepage_ops = …;
static uint8_t scan_ff_pattern[] = …;
static struct nand_bbt_descr flctl_4secc_smallpage = …;
static struct nand_bbt_descr flctl_4secc_largepage = …;
static void empty_fifo(struct sh_flctl *flctl)
{ … }
static void start_translation(struct sh_flctl *flctl)
{ … }
static void timeout_error(struct sh_flctl *flctl, const char *str)
{ … }
static void wait_completion(struct sh_flctl *flctl)
{ … }
static void flctl_dma_complete(void *param)
{ … }
static void flctl_release_dma(struct sh_flctl *flctl)
{ … }
static void flctl_setup_dma(struct sh_flctl *flctl)
{ … }
static void set_addr(struct mtd_info *mtd, int column, int page_addr)
{ … }
static void wait_rfifo_ready(struct sh_flctl *flctl)
{ … }
static void wait_wfifo_ready(struct sh_flctl *flctl)
{ … }
static enum flctl_ecc_res_t wait_recfifo_ready
(struct sh_flctl *flctl, int sector_number)
{ … }
static void wait_wecfifo_ready(struct sh_flctl *flctl)
{ … }
static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
int len, enum dma_data_direction dir)
{ … }
static void read_datareg(struct sh_flctl *flctl, int offset)
{ … }
static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
{ … }
static enum flctl_ecc_res_t read_ecfiforeg
(struct sh_flctl *flctl, uint8_t *buff, int sector)
{ … }
static void write_fiforeg(struct sh_flctl *flctl, int rlen,
unsigned int offset)
{ … }
static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,
unsigned int offset)
{ … }
static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_val)
{ … }
static int flctl_read_page_hwecc(struct nand_chip *chip, uint8_t *buf,
int oob_required, int page)
{ … }
static int flctl_write_page_hwecc(struct nand_chip *chip, const uint8_t *buf,
int oob_required, int page)
{ … }
static void execmd_read_page_sector(struct mtd_info *mtd, int page_addr)
{ … }
static void execmd_read_oob(struct mtd_info *mtd, int page_addr)
{ … }
static void execmd_write_page_sector(struct mtd_info *mtd)
{ … }
static void execmd_write_oob(struct mtd_info *mtd)
{ … }
static void flctl_cmdfunc(struct nand_chip *chip, unsigned int command,
int column, int page_addr)
{ … }
static void flctl_select_chip(struct nand_chip *chip, int chipnr)
{ … }
static void flctl_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)
{ … }
static uint8_t flctl_read_byte(struct nand_chip *chip)
{ … }
static void flctl_read_buf(struct nand_chip *chip, uint8_t *buf, int len)
{ … }
static int flctl_chip_attach_chip(struct nand_chip *chip)
{ … }
static const struct nand_controller_ops flctl_nand_controller_ops = …;
static irqreturn_t flctl_handle_flste(int irq, void *dev_id)
{ … }
struct flctl_soc_config { … };
static struct flctl_soc_config flctl_sh7372_config = …;
static const struct of_device_id of_flctl_match[] = …;
MODULE_DEVICE_TABLE(of, of_flctl_match);
static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
{ … }
static int flctl_probe(struct platform_device *pdev)
{ … }
static void flctl_remove(struct platform_device *pdev)
{ … }
static struct platform_driver flctl_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;