1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>struct nand_chip</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="MTD NAND Driver Programming Interface"><link rel="up" href="structs.html" title="Chapter 9. Structures"><link rel="prev" href="API-struct-nand-buffers.html" title="struct nand_buffers"><link rel="next" href="API-struct-nand-flash-dev.html" title="struct nand_flash_dev"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct nand_chip</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-nand-buffers.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Structures</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-nand-flash-dev.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-nand-chip"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct nand_chip — 
2     NAND Private Flash Chip Data
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting">
4struct nand_chip {
5  void __iomem * IO_ADDR_R;
6  void __iomem * IO_ADDR_W;
7  struct device_node * flash_node;
8  uint8_t (* read_byte) (struct mtd_info *mtd);
9  u16 (* read_word) (struct mtd_info *mtd);
10  void (* write_byte) (struct mtd_info *mtd, uint8_t byte);
11  void (* write_buf) (struct mtd_info *mtd, const uint8_t *buf, int len);
12  void (* read_buf) (struct mtd_info *mtd, uint8_t *buf, int len);
13  void (* select_chip) (struct mtd_info *mtd, int chip);
14  int (* block_bad) (struct mtd_info *mtd, loff_t ofs, int getchip);
15  int (* block_markbad) (struct mtd_info *mtd, loff_t ofs);
16  void (* cmd_ctrl) (struct mtd_info *mtd, int dat, unsigned int ctrl);
17  int (* dev_ready) (struct mtd_info *mtd);
18  void (* cmdfunc) (struct mtd_info *mtd, unsigned command, int column,int page_addr);
19  int(* waitfunc) (struct mtd_info *mtd, struct nand_chip *this);
20  int (* erase) (struct mtd_info *mtd, int page);
21  int (* scan_bbt) (struct mtd_info *mtd);
22  int (* errstat) (struct mtd_info *mtd, struct nand_chip *this, int state,int status, int page);
23  int (* write_page) (struct mtd_info *mtd, struct nand_chip *chip,uint32_t offset, int data_len, const uint8_t *buf,int oob_required, int page, int cached, int raw);
24  int (* onfi_set_features) (struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para);
25  int (* onfi_get_features) (struct mtd_info *mtd, struct nand_chip *chip,int feature_addr, uint8_t *subfeature_para);
26  int (* setup_read_retry) (struct mtd_info *mtd, int retry_mode);
27  int chip_delay;
28  unsigned int options;
29  unsigned int bbt_options;
30  int page_shift;
31  int phys_erase_shift;
32  int bbt_erase_shift;
33  int chip_shift;
34  int numchips;
35  uint64_t chipsize;
36  int pagemask;
37  int pagebuf;
38  unsigned int pagebuf_bitflips;
39  int subpagesize;
40  uint8_t bits_per_cell;
41  uint16_t ecc_strength_ds;
42  uint16_t ecc_step_ds;
43  int onfi_timing_mode_default;
44  int badblockpos;
45  int badblockbits;
46  int onfi_version;
47  int jedec_version;
48  union {unnamed_union};
49  int read_retries;
50  flstate_t state;
51  uint8_t * oob_poi;
52  struct nand_hw_control * controller;
53  struct nand_ecc_ctrl ecc;
54  struct nand_buffers * buffers;
55  struct nand_hw_control hwcontrol;
56  uint8_t * bbt;
57  struct nand_bbt_descr * bbt_td;
58  struct nand_bbt_descr * bbt_md;
59  struct nand_bbt_descr * badblock_pattern;
60  void * priv;
61};  </pre></div><div class="refsect1"><a name="id-1.11.6.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">IO_ADDR_R</span></dt><dd><p>
62   [BOARDSPECIFIC] address to read the 8 I/O lines of the
63   flash device
64      </p></dd><dt><span class="term">IO_ADDR_W</span></dt><dd><p>
65   [BOARDSPECIFIC] address to write the 8 I/O lines of the
66   flash device.
67      </p></dd><dt><span class="term">flash_node</span></dt><dd><p>
68   [BOARDSPECIFIC] device node describing this instance
69      </p></dd><dt><span class="term">read_byte</span></dt><dd><p>
70   [REPLACEABLE] read one byte from the chip
71      </p></dd><dt><span class="term">read_word</span></dt><dd><p>
72   [REPLACEABLE] read one word from the chip
73      </p></dd><dt><span class="term">write_byte</span></dt><dd><p>
74   [REPLACEABLE] write a single byte to the chip on the
75   low 8 I/O lines
76      </p></dd><dt><span class="term">write_buf</span></dt><dd><p>
77   [REPLACEABLE] write data from the buffer to the chip
78      </p></dd><dt><span class="term">read_buf</span></dt><dd><p>
79   [REPLACEABLE] read data from the chip into the buffer
80      </p></dd><dt><span class="term">select_chip</span></dt><dd><p>
81   [REPLACEABLE] select chip nr
82      </p></dd><dt><span class="term">block_bad</span></dt><dd><p>
83   [REPLACEABLE] check if a block is bad, using OOB markers
84      </p></dd><dt><span class="term">block_markbad</span></dt><dd><p>
85   [REPLACEABLE] mark a block bad
86      </p></dd><dt><span class="term">cmd_ctrl</span></dt><dd><p>
87   [BOARDSPECIFIC] hardwarespecific function for controlling
88   ALE/CLE/nCE. Also used to write command and address
89      </p></dd><dt><span class="term">dev_ready</span></dt><dd><p>
90   [BOARDSPECIFIC] hardwarespecific function for accessing
91   device ready/busy line. If set to NULL no access to
92   ready/busy is available and the ready/busy information
93   is read from the chip status register.
94      </p></dd><dt><span class="term">cmdfunc</span></dt><dd><p>
95   [REPLACEABLE] hardwarespecific function for writing
96   commands to the chip.
97      </p></dd><dt><span class="term">waitfunc</span></dt><dd><p>
98   [REPLACEABLE] hardwarespecific function for wait on
99   ready.
100      </p></dd><dt><span class="term">erase</span></dt><dd><p>
101   [REPLACEABLE] erase function
102      </p></dd><dt><span class="term">scan_bbt</span></dt><dd><p>
103   [REPLACEABLE] function to scan bad block table
104      </p></dd><dt><span class="term">errstat</span></dt><dd><p>
105   [OPTIONAL] hardware specific function to perform
106   additional error status checks (determine if errors are
107   correctable).
108      </p></dd><dt><span class="term">write_page</span></dt><dd><p>
109   [REPLACEABLE] High-level page write function
110      </p></dd><dt><span class="term">onfi_set_features</span></dt><dd><p>
111   [REPLACEABLE] set the features for ONFI nand
112      </p></dd><dt><span class="term">onfi_get_features</span></dt><dd><p>
113   [REPLACEABLE] get the features for ONFI nand
114      </p></dd><dt><span class="term">setup_read_retry</span></dt><dd><p>
115   [FLASHSPECIFIC] flash (vendor) specific function for
116   setting the read-retry mode. Mostly needed for MLC NAND.
117      </p></dd><dt><span class="term">chip_delay</span></dt><dd><p>
118   [BOARDSPECIFIC] chip dependent delay for transferring
119   data from array to read regs (tR).
120      </p></dd><dt><span class="term">options</span></dt><dd><p>
121   [BOARDSPECIFIC] various chip options. They can partly
122   be set to inform nand_scan about special functionality.
123   See the defines for further explanation.
124      </p></dd><dt><span class="term">bbt_options</span></dt><dd><p>
125   [INTERN] bad block specific options. All options used
126   here must come from bbm.h. By default, these options
127   will be copied to the appropriate nand_bbt_descr's.
128      </p></dd><dt><span class="term">page_shift</span></dt><dd><p>
129   [INTERN] number of address bits in a page (column
130   address bits).
131      </p></dd><dt><span class="term">phys_erase_shift</span></dt><dd><p>
132   [INTERN] number of address bits in a physical eraseblock
133      </p></dd><dt><span class="term">bbt_erase_shift</span></dt><dd><p>
134   [INTERN] number of address bits in a bbt entry
135      </p></dd><dt><span class="term">chip_shift</span></dt><dd><p>
136   [INTERN] number of address bits in one chip
137      </p></dd><dt><span class="term">numchips</span></dt><dd><p>
138   [INTERN] number of physical chips
139      </p></dd><dt><span class="term">chipsize</span></dt><dd><p>
140   [INTERN] the size of one chip for multichip arrays
141      </p></dd><dt><span class="term">pagemask</span></dt><dd><p>
142   [INTERN] page number mask = number of (pages / chip) - 1
143      </p></dd><dt><span class="term">pagebuf</span></dt><dd><p>
144   [INTERN] holds the pagenumber which is currently in
145   data_buf.
146      </p></dd><dt><span class="term">pagebuf_bitflips</span></dt><dd><p>
147   [INTERN] holds the bitflip count for the page which is
148   currently in data_buf.
149      </p></dd><dt><span class="term">subpagesize</span></dt><dd><p>
150   [INTERN] holds the subpagesize
151      </p></dd><dt><span class="term">bits_per_cell</span></dt><dd><p>
152   [INTERN] number of bits per cell. i.e., 1 means SLC.
153      </p></dd><dt><span class="term">ecc_strength_ds</span></dt><dd><p>
154   [INTERN] ECC correctability from the datasheet.
155   Minimum amount of bit errors per <em class="parameter"><code>ecc_step_ds</code></em> guaranteed
156   to be correctable. If unknown, set to zero.
157      </p></dd><dt><span class="term">ecc_step_ds</span></dt><dd><p>
158   [INTERN] ECC step required by the <em class="parameter"><code>ecc_strength_ds</code></em>,
159   also from the datasheet. It is the recommended ECC step
160   size, if known; if unknown, set to zero.
161      </p></dd><dt><span class="term">onfi_timing_mode_default</span></dt><dd><p>
162   [INTERN] default ONFI timing mode. This field is
163   either deduced from the datasheet if the NAND
164   chip is not ONFI compliant or set to 0 if it is
165   (an ONFI chip is always configured in mode 0
166   after a NAND reset)
167      </p></dd><dt><span class="term">badblockpos</span></dt><dd><p>
168   [INTERN] position of the bad block marker in the oob
169   area.
170      </p></dd><dt><span class="term">badblockbits</span></dt><dd><p>
171   [INTERN] minimum number of set bits in a good block's
172   bad block marker position; i.e., BBM == 11110111b is
173   not bad when badblockbits == 7
174      </p></dd><dt><span class="term">onfi_version</span></dt><dd><p>
175   [INTERN] holds the chip ONFI version (BCD encoded),
176   non 0 if ONFI supported.
177      </p></dd><dt><span class="term">jedec_version</span></dt><dd><p>
178   [INTERN] holds the chip JEDEC version (BCD encoded),
179   non 0 if JEDEC supported.
180      </p></dd><dt><span class="term">{unnamed_union}</span></dt><dd><p>
181   anonymous
182      </p></dd><dt><span class="term">read_retries</span></dt><dd><p>
183   [INTERN] the number of read retry modes supported
184      </p></dd><dt><span class="term">state</span></dt><dd><p>
185   [INTERN] the current state of the NAND device
186      </p></dd><dt><span class="term">oob_poi</span></dt><dd><p>
187   "poison value buffer," used for laying out OOB data
188   before writing
189      </p></dd><dt><span class="term">controller</span></dt><dd><p>
190   [REPLACEABLE] a pointer to a hardware controller
191   structure which is shared among multiple independent
192   devices.
193      </p></dd><dt><span class="term">ecc</span></dt><dd><p>
194   [BOARDSPECIFIC] ECC control structure
195      </p></dd><dt><span class="term">buffers</span></dt><dd><p>
196   buffer structure for read/write
197      </p></dd><dt><span class="term">hwcontrol</span></dt><dd><p>
198   platform-specific hardware control structure
199      </p></dd><dt><span class="term">bbt</span></dt><dd><p>
200   [INTERN] bad block table pointer
201      </p></dd><dt><span class="term">bbt_td</span></dt><dd><p>
202   [REPLACEABLE] bad block table descriptor for flash
203   lookup.
204      </p></dd><dt><span class="term">bbt_md</span></dt><dd><p>
205   [REPLACEABLE] bad block table mirror descriptor
206      </p></dd><dt><span class="term">badblock_pattern</span></dt><dd><p>
207   [REPLACEABLE] bad block scan pattern used for initial
208   bad block scan.
209      </p></dd><dt><span class="term">priv</span></dt><dd><p>
210   [OPTIONAL] pointer to private chip data
211      </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-nand-buffers.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="structs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-nand-flash-dev.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct nand_buffers</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct nand_flash_dev</span></td></tr></table></div></body></html>
212