diff mbox

[fix] mtd: nand: add support for Samsung K9LCG08U0B

Message ID 1389939446-20577-1-git-send-email-b32955@freescale.com
State Superseded
Headers show

Commit Message

Huang Shijie Jan. 17, 2014, 6:17 a.m. UTC
Assume that:
          tmp = ((extid >> 2) & 0x04) | (extid & 0x03));

From the K9LCG08U0B's datasheet, we know that:
  the oob size is 640 when tmp is 6;
  the oob size is 1024 when tmp is 7;

Signed-off-by: Huang Shijie <b32955@freescale.com>
---

[1] use the 1024, not the SZ_1k
[2] add back the default case for case 0.

---
 drivers/mtd/nand/nand_base.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Brian Norris Jan. 20, 2014, 7:27 p.m. UTC | #1
On Fri, Jan 17, 2014 at 02:17:26PM +0800, Huang Shijie wrote:
> Assume that:
>           tmp = ((extid >> 2) & 0x04) | (extid & 0x03));
> 
> From the K9LCG08U0B's datasheet, we know that:
>   the oob size is 640 when tmp is 6;
>   the oob size is 1024 when tmp is 7;
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
> 
> [1] use the 1024, not the SZ_1k
> [2] add back the default case for case 0.

I was already running a modified version of your previous patch through
some tests, so I have pushed it to l2-mtd.git. It's nearly identical to
this version.

Thanks,
Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index d388c7f..537afe0 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3285,9 +3285,12 @@  static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
 			mtd->oobsize = 512;
 			break;
 		case 6:
-		default: /* Other cases are "reserved" (unknown) */
 			mtd->oobsize = 640;
 			break;
+		default: /* Other cases are "reserved" (unknown) */
+		case 7:
+			mtd->oobsize = 1024;
+			break;
 		}
 		extid >>= 2;
 		/* Calc blocksize */