2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
13 #ifndef __DRIVERS_NAND_DEVICE_INFO_H
14 #define __DRIVERS_NAND_DEVICE_INFO_H
17 * The number of ID bytes to read from the NAND Flash device and hand over to
18 * the identification system.
21 #define NAND_DEVICE_ID_BYTE_COUNT (6)
28 * The number of ID bytes to read from the NAND Flash device and hand over to
29 * the identification system.
32 enum nand_device_cell_technology {
33 NAND_DEVICE_CELL_TECH_SLC = 0,
34 NAND_DEVICE_CELL_TECH_MLC = 1,
38 * struct nand_device_info - Information about a single NAND Flash device.
40 * This structure contains all the *essential* information about a NAND Flash
41 * device, derived from the device's data sheet. For each manufacturer, we have
42 * an array of these structures.
44 * @end_of_table: If true, marks the end of a table of device
46 * @manufacturer_code: The manufacturer code (1st ID byte) reported by
48 * @device_code: The device code (2nd ID byte) reported by the
50 * @cell_technology: The storage cell technology.
51 * @chip_size_in_bytes: The total size of the storage behind a single
52 * chip select, in bytes. Notice that this is *not*
53 * necessarily the total size of the storage in a
54 * *package*, which may contain several chips.
55 * @block_size_in_pages: The number of pages in a block.
56 * @page_total_size_in_bytes: The total size of a page, in bytes, including
57 * both the data and the OOB.
58 * @ecc_strength_in_bits: The strength of the ECC called for by the
59 * manufacturer, in number of correctable bits.
60 * @ecc_size_in_bytes: The size of the data block over which the
61 * manufacturer calls for the given ECC algorithm
63 * @data_setup_in_ns: The data setup time, in nanoseconds. Usually the
64 * maximum of tDS and tWP. A negative value
65 * indicates this characteristic isn't known.
66 * @data_hold_in_ns: The data hold time, in nanoseconds. Usually the
67 * maximum of tDH, tWH and tREH. A negative value
68 * indicates this characteristic isn't known.
69 * @address_setup_in_ns: The address setup time, in nanoseconds. Usually
70 * the maximum of tCLS, tCS and tALS. A negative
71 * value indicates this characteristic isn't known.
72 * @gpmi_sample_delay_in_ns: A GPMI-specific timing parameter. A negative
73 * value indicates this characteristic isn't known.
74 * @tREA_in_ns: tREA, in nanoseconds, from the data sheet. A
75 * negative value indicates this characteristic
77 * @tRLOH_in_ns: tRLOH, in nanoseconds, from the data sheet. A
78 * negative value indicates this characteristic
80 * @tRHOH_in_ns: tRHOH, in nanoseconds, from the data sheet. A
81 * negative value indicates this characteristic
85 struct nand_device_info {
87 /* End of table marker */
91 /* Manufacturer and Device codes */
93 uint8_t manufacturer_code;
98 enum nand_device_cell_technology cell_technology;
102 uint64_t chip_size_in_bytes;
103 uint32_t block_size_in_pages;
104 uint16_t page_total_size_in_bytes;
108 uint8_t ecc_strength_in_bits;
109 uint16_t ecc_size_in_bytes;
113 int8_t data_setup_in_ns;
114 int8_t data_hold_in_ns;
115 int8_t address_setup_in_ns;
116 int8_t gpmi_sample_delay_in_ns;
123 const char *description;
128 * nand_device_get_info - Get info about a device based on ID bytes.
130 * @id_bytes: An array of NAND_DEVICE_ID_BYTE_COUNT ID bytes retrieved from the
134 struct nand_device_info *nand_device_get_info(const uint8_t id_bytes[]);
137 * nand_device_print_info - Prints information about a NAND Flash device.
139 * @info A pointer to a NAND Flash device information structure.
142 void nand_device_print_info(struct nand_device_info *info);