#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/rslib.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/doc2000.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/inftl.h>
#include <linux/module.h>
#ifndef CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS
#define CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS …
#endif
static unsigned long doc_locations[] __initdata = …;
static struct mtd_info *doclist = …;
struct doc_priv { … };
static u_char empty_write_ecc[6] = …;
#define INFTL_BBT_RESERVED_BLOCKS …
#define DoC_is_MillenniumPlus(doc) …
#define DoC_is_Millennium(doc) …
#define DoC_is_2000(doc) …
static int debug = …;
module_param(debug, int, 0);
static int try_dword = …;
module_param(try_dword, int, 0);
static int no_ecc_failures = …;
module_param(no_ecc_failures, int, 0);
static int no_autopart = …;
module_param(no_autopart, int, 0);
static int show_firmware_partition = …;
module_param(show_firmware_partition, int, 0);
#ifdef CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE
static int inftl_bbt_write = …;
#else
static int inftl_bbt_write = 0;
#endif
module_param(inftl_bbt_write, int, 0);
static unsigned long doc_config_location = …;
module_param(doc_config_location, ulong, 0);
MODULE_PARM_DESC(…) …;
#define SECTOR_SIZE …
#define NB_DATA …
#define NROOTS …
#define FCR …
#define NN …
static int doc_ecc_decode(struct rs_control *rs, uint8_t *data, uint8_t *ecc)
{ … }
static void DoC_Delay(struct doc_priv *doc, unsigned short cycles)
{ … }
#define CDSN_CTRL_FR_B_MASK …
static int _DoC_WaitReady(struct doc_priv *doc)
{ … }
static inline int DoC_WaitReady(struct doc_priv *doc)
{ … }
static void doc2000_write_byte(struct nand_chip *this, u_char datum)
{ … }
static void doc2000_writebuf(struct nand_chip *this, const u_char *buf,
int len)
{ … }
static void doc2000_readbuf(struct nand_chip *this, u_char *buf, int len)
{ … }
static void doc200x_readid(struct nand_chip *this, unsigned int cs, u8 *id)
{ … }
static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr)
{ … }
static void __init doc2000_count_chips(struct mtd_info *mtd)
{ … }
static void doc2001_write_byte(struct nand_chip *this, u_char datum)
{ … }
static void doc2001_writebuf(struct nand_chip *this, const u_char *buf, int len)
{ … }
static void doc2001_readbuf(struct nand_chip *this, u_char *buf, int len)
{ … }
static void doc2001plus_writebuf(struct nand_chip *this, const u_char *buf, int len)
{ … }
static void doc2001plus_readbuf(struct nand_chip *this, u_char *buf, int len)
{ … }
static void doc200x_write_control(struct doc_priv *doc, u8 value)
{ … }
static void doc200x_exec_instr(struct nand_chip *this,
const struct nand_op_instr *instr)
{ … }
static int doc200x_exec_op(struct nand_chip *this,
const struct nand_operation *op,
bool check_only)
{ … }
static void doc2001plus_write_pipe_term(struct doc_priv *doc)
{ … }
static void doc2001plus_exec_instr(struct nand_chip *this,
const struct nand_op_instr *instr)
{ … }
static int doc2001plus_exec_op(struct nand_chip *this,
const struct nand_operation *op,
bool check_only)
{ … }
static void doc200x_enable_hwecc(struct nand_chip *this, int mode)
{ … }
static void doc2001plus_enable_hwecc(struct nand_chip *this, int mode)
{ … }
static int doc200x_calculate_ecc(struct nand_chip *this, const u_char *dat,
unsigned char *ecc_code)
{ … }
static int doc200x_correct_data(struct nand_chip *this, u_char *dat,
u_char *read_ecc, u_char *isnull)
{ … }
static int doc200x_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static int doc200x_ooblayout_free(struct mtd_info *mtd, int section,
struct mtd_oob_region *oobregion)
{ … }
static const struct mtd_ooblayout_ops doc200x_ooblayout_ops = …;
static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const char *id, int findmirror)
{ … }
static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partition *parts)
{ … }
static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partition *parts)
{ … }
static int __init nftl_scan_bbt(struct mtd_info *mtd)
{ … }
static int __init inftl_scan_bbt(struct mtd_info *mtd)
{ … }
static inline int __init doc2000_init(struct mtd_info *mtd)
{ … }
static inline int __init doc2001_init(struct mtd_info *mtd)
{ … }
static inline int __init doc2001plus_init(struct mtd_info *mtd)
{ … }
static int doc200x_attach_chip(struct nand_chip *chip)
{ … }
static const struct nand_controller_ops doc200x_ops = …;
static const struct nand_controller_ops doc2001plus_ops = …;
static int __init doc_probe(unsigned long physadr)
{ … }
static void release_nanddoc(void)
{ … }
static int __init init_nanddoc(void)
{ … }
static void __exit cleanup_nanddoc(void)
{ … }
module_init(…) …;
module_exit(cleanup_nanddoc);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;