From 70890e8687b3d99a575a58e21fe1d13dad157bfe Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Tue, 31 Dec 2013 16:47:48 +0100 Subject: [PATCH 765/765] mtd: cfi_cmdset_001.c: fixup for reading nr of hw partitions on Sharp LH28F640BF Signed-off-by: Andrea Adami --- drivers/mtd/chips/cfi_cmdset_0001.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index a5c984a..be0da9a 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -388,6 +388,14 @@ read_pri_intelext(struct map_info *map, __u16 adr) if (extp->MinorVersion >= '3') { int nb_parts, i; + /* Sharp LH28F640BFHE doesn't respect the nr of synch modes/fields + * the value is 0 but there are three fields: + * Synchronous mode read capability configuration 1,2,3 + * The first one seems always present, listed as reserved + */ + if (cfi->mfr == CFI_MFR_SHARP && cfi->id == 0x00b0) + extra_size += 3; + /* Number of hardware-partitions */ extra_size += 1; if (extp_size < sizeof(*extp) + extra_size) @@ -657,6 +665,14 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, /* Burst Read info */ offs += extp->extra[offs+1]+2; + /* Sharp LH28F640BFHE doesn't respect the nr of synch modes/fields + * the value is 0 but there are three fields: + * Synchronous mode read capability configuration 1,2,3 + * The first one seems always present, listed as reserved + */ + if (cfi->mfr == CFI_MFR_SHARP && cfi->id == 0x00b0) + offs += 3; + /* Number of partition regions */ numregions = extp->extra[offs]; offs += 1; -- 1.8.1.5