hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/mtd/cfi.h
....@@ -1,20 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- *
184 */
195
206 #ifndef __MTD_CFI_H__
....@@ -152,7 +138,7 @@
152138 uint16_t InterfaceDesc;
153139 uint16_t MaxBufWriteSize;
154140 uint8_t NumEraseRegions;
155
- uint32_t EraseRegionInfo[0]; /* Not host ordered */
141
+ uint32_t EraseRegionInfo[]; /* Not host ordered */
156142 } __packed;
157143
158144 /* Extended Query Structure for both PRI and ALT */
....@@ -179,7 +165,7 @@
179165 uint16_t ProtRegAddr;
180166 uint8_t FactProtRegSize;
181167 uint8_t UserProtRegSize;
182
- uint8_t extra[0];
168
+ uint8_t extra[];
183169 } __packed;
184170
185171 struct cfi_intelext_otpinfo {
....@@ -233,6 +219,13 @@
233219 uint8_t VppMin;
234220 uint8_t VppMax;
235221 uint8_t TopBottom;
222
+ /* Below field are added from version 1.5 */
223
+ uint8_t ProgramSuspend;
224
+ uint8_t UnlockBypass;
225
+ uint8_t SecureSiliconSector;
226
+ uint8_t SoftwareFeatures;
227
+#define CFI_POLL_STATUS_REG BIT(0)
228
+#define CFI_POLL_DQ BIT(1)
236229 } __packed;
237230
238231 /* Vendor-Specific PRI for Atmel chips (command set 0x0002) */
....@@ -293,7 +286,8 @@
293286 map_word sector_erase_cmd;
294287 unsigned long chipshift; /* Because they're of the same type */
295288 const char *im_name; /* inter_module name for cmdset_setup */
296
- struct flchip chips[0]; /* per-chip data structure for each chip */
289
+ unsigned long quirks;
290
+ struct flchip chips[]; /* per-chip data structure for each chip */
297291 };
298292
299293 uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs,
....@@ -377,6 +371,7 @@
377371 #define CFI_MFR_SHARP 0x00B0
378372 #define CFI_MFR_SST 0x00BF
379373 #define CFI_MFR_ST 0x0020 /* STMicroelectronics */
374
+#define CFI_MFR_MICRON 0x002C /* Micron */
380375 #define CFI_MFR_TOSHIBA 0x0098
381376 #define CFI_MFR_WINBOND 0x00DA
382377