[PATCH] m25p80: set the correct erasesize when we use OPCODE_BE_4K

Michael Grzeschik m.grzeschik at pengutronix.de
Thu Nov 24 09:33:24 EST 2011


Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
---
 drivers/nor/m25p80.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index e6fe75e..92b07af 100644
--- a/drivers/nor/m25p80.c
+++ b/drivers/nor/m25p80.c
@@ -778,10 +778,12 @@ static int m25p_probe(struct device_d *dev)
 		m25p80_ops.write = m25p80_write;
 
 	/* prefer "small sector" erase if possible */
-	if (info->flags & SECT_4K)
+	if (info->flags & SECT_4K) {
 		flash->erase_opcode = OPCODE_BE_4K;
-	else
+		flash->erasesize = 4096;
+	} else {
 		flash->erase_opcode = OPCODE_SE;
+	}
 
 	flash->page_size = info->page_size;
 
-- 
1.7.7.1




More information about the barebox mailing list