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)
24
* The number of ID bytes to read from the NAND Flash device and hand over to
25
* the identification system.
28
enum nand_device_cell_technology {
29
NAND_DEVICE_CELL_TECH_SLC = 0,
30
NAND_DEVICE_CELL_TECH_MLC = 1,
34
* struct nand_device_info - Information about a single NAND Flash device.
36
* This structure contains all the *essential* information about a NAND Flash
37
* device, derived from the device's data sheet. For each manufacturer, we have
38
* an array of these structures.
40
* @end_of_table: If true, marks the end of a table of device
42
* @manufacturer_code: The manufacturer code (1st ID byte) reported by
44
* @device_code: The device code (2nd ID byte) reported by the
46
* @cell_technology: The storage cell technology.
47
* @chip_size_in_bytes: The total size of the storage behind a single
48
* chip select, in bytes. Notice that this is *not*
49
* necessarily the total size of the storage in a
50
* *package*, which may contain several chips.
51
* @block_size_in_pages: The number of pages in a block.
52
* @page_total_size_in_bytes: The total size of a page, in bytes, including
53
* both the data and the OOB.
54
* @ecc_strength_in_bits: The strength of the ECC called for by the
55
* manufacturer, in number of correctable bits.
56
* @ecc_size_in_bytes: The size of the data block over which the
57
* manufacturer calls for the given ECC algorithm
59
* @data_setup_in_ns: The data setup time, in nanoseconds. Usually the
60
* maximum of tDS and tWP. A negative value
61
* indicates this characteristic isn't known.
62
* @data_hold_in_ns: The data hold time, in nanoseconds. Usually the
63
* maximum of tDH, tWH and tREH. A negative value
64
* indicates this characteristic isn't known.
65
* @address_setup_in_ns: The address setup time, in nanoseconds. Usually
66
* the maximum of tCLS, tCS and tALS. A negative
67
* value indicates this characteristic isn't known.
68
* @gpmi_sample_delay_in_ns: A GPMI-specific timing parameter. A negative
69
* value indicates this characteristic isn't known.
70
* @tREA_in_ns: tREA, in nanoseconds, from the data sheet. A
71
* negative value indicates this characteristic
73
* @tRLOH_in_ns: tRLOH, in nanoseconds, from the data sheet. A
74
* negative value indicates this characteristic
76
* @tRHOH_in_ns: tRHOH, in nanoseconds, from the data sheet. A
77
* negative value indicates this characteristic
81
struct nand_device_info {
83
/* End of table marker */
87
/* Manufacturer and Device codes */
89
uint8_t manufacturer_code;
94
enum nand_device_cell_technology cell_technology;
98
uint64_t chip_size_in_bytes;
99
uint32_t block_size_in_pages;
100
uint16_t page_total_size_in_bytes;
104
uint8_t ecc_strength_in_bits;
105
uint16_t ecc_size_in_bytes;
109
int8_t data_setup_in_ns;
110
int8_t data_hold_in_ns;
111
int8_t address_setup_in_ns;
112
int8_t gpmi_sample_delay_in_ns;
119
const char *description;
124
* nand_device_get_info - Get info about a device based on ID bytes.
126
* @id_bytes: An array of NAND_DEVICE_ID_BYTE_COUNT ID bytes retrieved from the
130
struct nand_device_info *nand_device_get_info(const uint8_t id_bytes[]);
133
* nand_device_print_info - Prints information about a NAND Flash device.
135
* @info A pointer to a NAND Flash device information structure.
138
void nand_device_print_info(struct nand_device_info *info);