Scroll to navigation

STRUCT NAND_CHIP(9) Structures STRUCT NAND_CHIP(9)

NAME

struct_nand_chip - NAND Private Flash Chip Data

SYNOPSIS

struct nand_chip {
  struct mtd_info mtd;
  void __iomem * IO_ADDR_R;
  void __iomem * IO_ADDR_W;
  uint8_t (* read_byte) (struct mtd_info *mtd);
  u16 (* read_word) (struct mtd_info *mtd);
  void (* write_byte) (struct mtd_info *mtd, uint8_t byte);
  void (* write_buf) (struct mtd_info *mtd, const uint8_t *buf, int len);
  void (* read_buf) (struct mtd_info *mtd, uint8_t *buf, int len);
  void (* select_chip) (struct mtd_info *mtd, int chip);
  int (* block_bad) (struct mtd_info *mtd, loff_t ofs);
  int (* block_markbad) (struct mtd_info *mtd, loff_t ofs);
  void (* cmd_ctrl) (struct mtd_info *mtd, int dat, unsigned int ctrl);
  int (* dev_ready) (struct mtd_info *mtd);
  void (* cmdfunc) (struct mtd_info *mtd, unsigned command, int column,int page_addr);
  int(* waitfunc) (struct mtd_info *mtd, struct nand_chip *this);
  int (* erase) (struct mtd_info *mtd, int page);
  int (* scan_bbt) (struct mtd_info *mtd);
  int (* errstat) (struct mtd_info *mtd, struct nand_chip *this, int state,int status, int page);
  int (* onfi_set_features) (struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para);
  int (* onfi_get_features) (struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para);
  int (* setup_read_retry) (struct mtd_info *mtd, int retry_mode);
  int (* setup_data_interface) (struct mtd_info *mtd,const struct nand_data_interface *conf,bool check_only);
  int chip_delay;
  unsigned int options;
  unsigned int bbt_options;
  int page_shift;
  int phys_erase_shift;
  int bbt_erase_shift;
  int chip_shift;
  int numchips;
  uint64_t chipsize;
  int pagemask;
  int pagebuf;
  unsigned int pagebuf_bitflips;
  int subpagesize;
  uint8_t bits_per_cell;
  uint16_t ecc_strength_ds;
  uint16_t ecc_step_ds;
  int onfi_timing_mode_default;
  int badblockpos;
  int badblockbits;
  struct nand_id id;
  int onfi_version;
  int jedec_version;
  union manufacturer;
};  

MEMBERS

struct mtd_info mtd
MTD device registered to the MTD framework

void __iomem * IO_ADDR_R

[BOARDSPECIFIC] address to read the 8 I/O lines of the flash device

void __iomem * IO_ADDR_W

[BOARDSPECIFIC] address to write the 8 I/O lines of the flash device.

uint8_t (*)(struct mtd_info *mtd) read_byte

[REPLACEABLE] read one byte from the chip

u16 (*)(struct mtd_info *mtd) read_word

[REPLACEABLE] read one word from the chip

void (*)(struct mtd_info *mtd, uint8_t byte) write_byte

[REPLACEABLE] write a single byte to the chip on the low 8 I/O lines

void (*)(struct mtd_info *mtd, const uint8_t *buf, int len) write_buf

[REPLACEABLE] write data from the buffer to the chip

void (*)(struct mtd_info *mtd, uint8_t *buf, int len) read_buf

[REPLACEABLE] read data from the chip into the buffer

void (*)(struct mtd_info *mtd, int chip) select_chip

[REPLACEABLE] select chip nr

int (*)(struct mtd_info *mtd, loff_t ofs) block_bad

[REPLACEABLE] check if a block is bad, using OOB markers

int (*)(struct mtd_info *mtd, loff_t ofs) block_markbad

[REPLACEABLE] mark a block bad

void (*)(struct mtd_info *mtd, int dat, unsigned int ctrl) cmd_ctrl

[BOARDSPECIFIC] hardwarespecific function for controlling ALE/CLE/nCE. Also used to write command and address

int (*)(struct mtd_info *mtd) dev_ready

[BOARDSPECIFIC] hardwarespecific function for accessing device ready/busy line. If set to NULL no access to ready/busy is available and the ready/busy information is read from the chip status register.

void (*)(struct mtd_info *mtd, unsigned command, int column,int page_addr) cmdfunc

[REPLACEABLE] hardwarespecific function for writing commands to the chip.

int(*)(struct mtd_info *mtd, struct nand_chip *this) waitfunc

[REPLACEABLE] hardwarespecific function for wait on ready.

int (*)(struct mtd_info *mtd, int page) erase

[REPLACEABLE] erase function

int (*)(struct mtd_info *mtd) scan_bbt

[REPLACEABLE] function to scan bad block table

int (*)(struct mtd_info *mtd, struct nand_chip *this, int state,int status, int page) errstat

[OPTIONAL] hardware specific function to perform additional error status checks (determine if errors are correctable).

int (*)(struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para) onfi_set_features

[REPLACEABLE] set the features for ONFI nand

int (*)(struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para) onfi_get_features

[REPLACEABLE] get the features for ONFI nand

int (*)(struct mtd_info *mtd, int retry_mode) setup_read_retry

[FLASHSPECIFIC] flash (vendor) specific function for setting the read-retry mode. Mostly needed for MLC NAND.

int (*)(struct mtd_info *mtd,const struct nand_data_interface *conf,bool check_only) setup_data_interface

[OPTIONAL] setup the data interface and timing

int chip_delay

[BOARDSPECIFIC] chip dependent delay for transferring data from array to read regs (tR).

unsigned int options

[BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about special functionality. See the defines for further explanation.

unsigned int bbt_options

[INTERN] bad block specific options. All options used here must come from bbm.h. By default, these options will be copied to the appropriate nand_bbt_descr's.

int page_shift

[INTERN] number of address bits in a page (column address bits).

int phys_erase_shift

[INTERN] number of address bits in a physical eraseblock

int bbt_erase_shift

[INTERN] number of address bits in a bbt entry

int chip_shift

[INTERN] number of address bits in one chip

int numchips

[INTERN] number of physical chips

uint64_t chipsize

[INTERN] the size of one chip for multichip arrays

int pagemask

[INTERN] page number mask = number of (pages / chip) - 1

int pagebuf

[INTERN] holds the pagenumber which is currently in data_buf.

unsigned int pagebuf_bitflips

[INTERN] holds the bitflip count for the page which is currently in data_buf.

int subpagesize

[INTERN] holds the subpagesize

uint8_t bits_per_cell

[INTERN] number of bits per cell. i.e., 1 means SLC.

uint16_t ecc_strength_ds

[INTERN] ECC correctability from the datasheet. Minimum amount of bit errors per ecc_step_ds guaranteed to be correctable. If unknown, set to zero.

uint16_t ecc_step_ds

[INTERN] ECC step required by the ecc_strength_ds, also from the datasheet. It is the recommended ECC step size, if known; if unknown, set to zero.

int onfi_timing_mode_default

[INTERN] default ONFI timing mode. This field is set to the actually used ONFI mode if the chip is ONFI compliant or deduced from the datasheet if the NAND chip is not ONFI compliant.

int badblockpos

[INTERN] position of the bad block marker in the oob area.

int badblockbits

[INTERN] minimum number of set bits in a good block's bad block marker position; i.e., BBM == 11110111b is not bad when badblockbits == 7

struct nand_id id

[INTERN] holds NAND ID

int onfi_version

[INTERN] holds the chip ONFI version (BCD encoded), non 0 if ONFI supported.

int jedec_version

[INTERN] holds the chip JEDEC version (BCD encoded), non 0 if JEDEC supported.

union manufacturer

[INTERN] Contains manufacturer information

AUTHOR

Thomas Gleixner <tglx@linutronix.de>
Author.

COPYRIGHT

September 2017 Kernel Hackers Manual 4.12