Skip to content

Commit fefae48

Browse files
grandwolfDavid Woodhouse
authored andcommitted
[MTD] CFI: remove major/minor version check for command set 0x0002
The NOR Flash memory K8P2815UQB from Samsung uses the major version number '0'. Add a quirk to cope with it. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent a808ad3 commit fefae48

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎drivers/mtd/chips/cfi_cmdset_0002.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ static struct cfi_fixup fixup_table[] = {
322322
};
323323

324324

325+
static void cfi_fixup_major_minor(struct cfi_private *cfi,
326+
struct cfi_pri_amdstd *extp)
327+
{
328+
if (cfi->mfr == CFI_MFR_SAMSUNG && cfi->id == 0x257e &&
329+
extp->MajorVersion == '0')
330+
extp->MajorVersion = '1';
331+
}
332+
325333
struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
326334
{
327335
struct cfi_private *cfi = map->fldrv_priv;
@@ -363,6 +371,8 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
363371
return NULL;
364372
}
365373

374+
cfi_fixup_major_minor(cfi, extp);
375+
366376
if (extp->MajorVersion != '1' ||
367377
(extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
368378
printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query "

‎include/linux/mtd/cfi.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ struct cfi_fixup {
520520

521521
#define CFI_MFR_AMD 0x0001
522522
#define CFI_MFR_ATMEL 0x001F
523+
#define CFI_MFR_SAMSUNG 0x00EC
523524
#define CFI_MFR_ST 0x0020 /* STMicroelectronics */
524525

525526
void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);

0 commit comments

Comments
 (0)