All of lore.kernel.org
 help / color / mirror / Atom feed
* [FRC] [PATCH] MTD: nand_base.c: Enable support for Samsung E-die SLC NAND
@ 2014-06-20 10:12 David Jander
  2014-06-22 12:06 ` Ted Juan
  0 siblings, 1 reply; 13+ messages in thread
From: David Jander @ 2014-06-20 10:12 UTC (permalink / raw)
  To: linux-mtd; +Cc: sjhill, tglx, Brian Norris, David Woodhouse, David Jander

Samsung E-die SLC NAND doesn't support partial writes anymore and there
seems to be no other way of detecting this than looking at bits 0 & 1
of the 5th ID byte. Those bits were "reserved" and 00 for all older
chips. On E-die chips, "01" seems to indicate 21nm feature size. This
patch assumes that all later revisions (if they will ever come) will have
this characteristic as well and disables sub-page writes in this case.

Signed-off-by: David Jander <david@protonic.nl>
---
 drivers/mtd/nand/nand_base.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 41167e9..e68e0c7 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3468,6 +3468,16 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
 			mtd->oobsize = 32 * mtd->writesize >> 9;
 		}
 
+		/*
+		 * Samsung E-die SLC NAND doesn't support partial writes
+		 * anymore. The only way to distinguish this die-revision
+		 * is by checking bits 0 and 1 of id_data[4], which seem
+		 * to indicate feature size (previous => 00, 21nm => 01).
+		 */
+		if (id_data[0] == NAND_MFR_SAMSUNG && nand_is_slc(chip) &&
+				(id_data[4] & 0x03) /* 21nm or newer */) {
+			chip->options |= NAND_NO_SUBPAGE_WRITE;
+		}
 	}
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-06-30 11:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 10:12 [FRC] [PATCH] MTD: nand_base.c: Enable support for Samsung E-die SLC NAND David Jander
2014-06-22 12:06 ` Ted Juan
2014-06-23  4:05   ` Gupta, Pekon
2014-06-23  8:15     ` Ted Juan
2014-06-25  6:17       ` Ted Juan
2014-06-25 10:04         ` Gupta, Pekon
2014-06-25 11:31           ` David Jander
2014-06-25 11:55             ` Gupta, Pekon
2014-06-25 12:11               ` David Jander
2014-06-30 11:06                 ` Gupta, Pekon
2014-06-26  4:02           ` Ted Juan
2014-06-27  9:13             ` Ted Juan
2014-06-27 10:03               ` Gupta, Pekon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.