Skip to content

Commit b2ef1a2

Browse files
Hans-Christian EgtvedtDavid Woodhouse
authored andcommitted
mtd: move manufacturer to the common cfi.h header file
This patch moves the MANUFACTURER_ST and MANUFACTURER_INTEL to the include/linux/mtd/cfi.h header file and renames them to CFI_MFR_ST and CFI_MFR_INTEL. CFI_MFR_ST was already present there. All references in drivers/mtd/chips/cfi_cmdset_0001.c are updated to reflect this. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent 8dbaea4 commit b2ef1a2

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎drivers/mtd/chips/cfi_cmdset_0001.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
// debugging, turns off buffer write mode if set to 1
4444
#define FORCE_WORD_WRITE 0
4545

46-
#define MANUFACTURER_INTEL 0x0089
46+
/* Intel chips */
4747
#define I82802AB 0x00ad
4848
#define I82802AC 0x00ac
4949
#define PF38F4476 0x881c
50-
#define MANUFACTURER_ST 0x0020
50+
/* STMicroelectronics chips */
5151
#define M50LPW080 0x002F
5252
#define M50FLW080A 0x0080
5353
#define M50FLW080B 0x0081
@@ -308,16 +308,16 @@ static struct cfi_fixup cfi_fixup_table[] = {
308308
#endif
309309
{ CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL },
310310
{ CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL },
311-
{ MANUFACTURER_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock, NULL, },
311+
{ CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock, NULL, },
312312
{ 0, 0, NULL, NULL }
313313
};
314314

315315
static struct cfi_fixup jedec_fixup_table[] = {
316-
{ MANUFACTURER_INTEL, I82802AB, fixup_use_fwh_lock, NULL, },
317-
{ MANUFACTURER_INTEL, I82802AC, fixup_use_fwh_lock, NULL, },
318-
{ MANUFACTURER_ST, M50LPW080, fixup_use_fwh_lock, NULL, },
319-
{ MANUFACTURER_ST, M50FLW080A, fixup_use_fwh_lock, NULL, },
320-
{ MANUFACTURER_ST, M50FLW080B, fixup_use_fwh_lock, NULL, },
316+
{ CFI_MFR_INTEL, I82802AB, fixup_use_fwh_lock, NULL, },
317+
{ CFI_MFR_INTEL, I82802AC, fixup_use_fwh_lock, NULL, },
318+
{ CFI_MFR_ST, M50LPW080, fixup_use_fwh_lock, NULL, },
319+
{ CFI_MFR_ST, M50FLW080A, fixup_use_fwh_lock, NULL, },
320+
{ CFI_MFR_ST, M50FLW080B, fixup_use_fwh_lock, NULL, },
321321
{ 0, 0, NULL, NULL }
322322
};
323323
static struct cfi_fixup fixup_table[] = {
@@ -333,7 +333,7 @@ static struct cfi_fixup fixup_table[] = {
333333
static void cfi_fixup_major_minor(struct cfi_private *cfi,
334334
struct cfi_pri_intelext *extp)
335335
{
336-
if (cfi->mfr == MANUFACTURER_INTEL &&
336+
if (cfi->mfr == CFI_MFR_INTEL &&
337337
cfi->id == PF38F4476 && extp->MinorVersion == '3')
338338
extp->MinorVersion = '1';
339339
}
@@ -2249,7 +2249,7 @@ static int cfi_intelext_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
22492249

22502250
/* Some chips have OTP located in the _top_ partition only.
22512251
For example: Intel 28F256L18T (T means top-parameter device) */
2252-
if (cfi->mfr == MANUFACTURER_INTEL) {
2252+
if (cfi->mfr == CFI_MFR_INTEL) {
22532253
switch (cfi->id) {
22542254
case 0x880b:
22552255
case 0x880c:

‎include/linux/mtd/cfi.h‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,11 @@ struct cfi_fixup {
518518
#define CFI_MFR_ANY 0xffff
519519
#define CFI_ID_ANY 0xffff
520520

521-
#define CFI_MFR_AMD 0x0001
522-
#define CFI_MFR_ATMEL 0x001F
523-
#define CFI_MFR_SAMSUNG 0x00EC
524-
#define CFI_MFR_ST 0x0020 /* STMicroelectronics */
521+
#define CFI_MFR_AMD 0x0001
522+
#define CFI_MFR_INTEL 0x0089
523+
#define CFI_MFR_ATMEL 0x001F
524+
#define CFI_MFR_SAMSUNG 0x00EC
525+
#define CFI_MFR_ST 0x0020 /* STMicroelectronics */
525526

526527
void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);
527528

0 commit comments

Comments
 (0)