mtd: msmnand: Support for 2K page size devices with 128 spare bytes
This patch adds support for 2K pages sized devices which have 128 bytes
for spare data. The layout used is the same as that of 2K page sized
devices with 64 spare bytes so as to be compatible with current build
images with additional spare bytes information marked appropriately.
Change-Id: I1b3db3cc790f02dcf1c41be4c2c21add6e7f1b38
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
diff --git a/drivers/mtd/devices/msm_nand.c b/drivers/mtd/devices/msm_nand.c
index 2479a11..3675d2c 100644
--- a/drivers/mtd/devices/msm_nand.c
+++ b/drivers/mtd/devices/msm_nand.c
@@ -6720,6 +6720,14 @@
((devcfg >> 4) & 0x3);
supported_flash.oobsize = (8 << ((devcfg >> 2) & 0x3)) *
(supported_flash.pagesize >> 9);
+
+ if ((supported_flash.oobsize > 64) &&
+ (supported_flash.pagesize == 2048)) {
+ pr_info("msm_nand: Found a 2K page device with"
+ " %d oobsize - changing oobsize to 64 "
+ "bytes.\n", supported_flash.oobsize);
+ supported_flash.oobsize = 64;
+ }
} else {
supported_flash.flash_id = flash_id;
supported_flash.density = flashdev->chipsize << 20;