#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/dmaengine.h>
#include <linux/dma-direction.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/nand.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/units.h>
#include <asm/unaligned.h>
#define EBU_CLC …
#define EBU_CLC_RST …
#define EBU_ADDR_SEL(n) …
#define EBU_ADDR_MASK(x) …
#define EBU_ADDR_SEL_REGEN …
#define EBU_BUSCON(n) …
#define EBU_BUSCON_CMULT_V4 …
#define EBU_BUSCON_RECOVC(n) …
#define EBU_BUSCON_HOLDC(n) …
#define EBU_BUSCON_WAITRDC(n) …
#define EBU_BUSCON_WAITWRC(n) …
#define EBU_BUSCON_BCGEN_CS …
#define EBU_BUSCON_SETUP_EN …
#define EBU_BUSCON_ALEC …
#define EBU_CON …
#define EBU_CON_NANDM_EN …
#define EBU_CON_NANDM_DIS …
#define EBU_CON_CSMUX_E_EN …
#define EBU_CON_ALE_P_LOW …
#define EBU_CON_CLE_P_LOW …
#define EBU_CON_CS_P_LOW …
#define EBU_CON_SE_P_LOW …
#define EBU_CON_WP_P_LOW …
#define EBU_CON_PRE_P_LOW …
#define EBU_CON_IN_CS_S(n) …
#define EBU_CON_OUT_CS_S(n) …
#define EBU_CON_LAT_EN_CS_P …
#define EBU_WAIT …
#define EBU_WAIT_RDBY …
#define EBU_WAIT_WR_C …
#define HSNAND_CTL1 …
#define HSNAND_CTL1_ADDR_SHIFT …
#define HSNAND_CTL2 …
#define HSNAND_CTL2_ADDR_SHIFT …
#define HSNAND_CTL2_CYC_N_V5 …
#define HSNAND_INT_MSK_CTL …
#define HSNAND_INT_MSK_CTL_WR_C …
#define HSNAND_INT_STA …
#define HSNAND_INT_STA_WR_C …
#define HSNAND_CTL …
#define HSNAND_CTL_ENABLE_ECC …
#define HSNAND_CTL_GO …
#define HSNAND_CTL_CE_SEL_CS(n) …
#define HSNAND_CTL_RW_READ …
#define HSNAND_CTL_RW_WRITE …
#define HSNAND_CTL_ECC_OFF_V8TH …
#define HSNAND_CTL_CKFF_EN …
#define HSNAND_CTL_MSG_EN …
#define HSNAND_PARA0 …
#define HSNAND_PARA0_PAGE_V8192 …
#define HSNAND_PARA0_PIB_V256 …
#define HSNAND_PARA0_BYP_EN_NP …
#define HSNAND_PARA0_BYP_DEC_NP …
#define HSNAND_PARA0_TYPE_ONFI …
#define HSNAND_PARA0_ADEP_EN …
#define HSNAND_CMSG_0 …
#define HSNAND_CMSG_1 …
#define HSNAND_ALE_OFFS …
#define HSNAND_CLE_OFFS …
#define HSNAND_CS_OFFS …
#define HSNAND_ECC_OFFSET …
#define MAX_CS …
#define USEC_PER_SEC …
struct ebu_nand_cs { … };
struct ebu_nand_controller { … };
static inline struct ebu_nand_controller *nand_to_ebu(struct nand_chip *chip)
{ … }
static int ebu_nand_waitrdy(struct nand_chip *chip, int timeout_ms)
{ … }
static u8 ebu_nand_readb(struct nand_chip *chip)
{ … }
static void ebu_nand_writeb(struct nand_chip *chip, u32 offset, u8 value)
{ … }
static void ebu_read_buf(struct nand_chip *chip, u_char *buf, unsigned int len)
{ … }
static void ebu_write_buf(struct nand_chip *chip, const u_char *buf, int len)
{ … }
static void ebu_nand_disable(struct nand_chip *chip)
{ … }
static void ebu_select_chip(struct nand_chip *chip)
{ … }
static int ebu_nand_set_timings(struct nand_chip *chip, int csline,
const struct nand_interface_config *conf)
{ … }
static int ebu_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static int ebu_nand_ooblayout_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static const struct mtd_ooblayout_ops ebu_nand_ooblayout_ops = …;
static void ebu_dma_rx_callback(void *cookie)
{ … }
static void ebu_dma_tx_callback(void *cookie)
{ … }
static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir,
const u8 *buf, u32 len)
{ … }
static void ebu_nand_trigger(struct ebu_nand_controller *ebu_host,
int page, u32 cmd)
{ … }
static int ebu_nand_read_page_hwecc(struct nand_chip *chip, u8 *buf,
int oob_required, int page)
{ … }
static int ebu_nand_write_page_hwecc(struct nand_chip *chip, const u8 *buf,
int oob_required, int page)
{ … }
static const u8 ecc_strength[] = …;
static int ebu_nand_attach_chip(struct nand_chip *chip)
{ … }
static int ebu_nand_exec_op(struct nand_chip *chip,
const struct nand_operation *op, bool check_only)
{ … }
static const struct nand_controller_ops ebu_nand_controller_ops = …;
static void ebu_dma_cleanup(struct ebu_nand_controller *ebu_host)
{ … }
static int ebu_nand_probe(struct platform_device *pdev)
{ … }
static void ebu_nand_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id ebu_nand_match[] = …;
MODULE_DEVICE_TABLE(of, ebu_nand_match);
static struct platform_driver ebu_nand_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;