summaryrefslogtreecommitdiff
path: root/drivers/nor
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2011-11-24 15:33:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-25 12:41:18 +0100
commita2b6da5e666a99a3f5b178b0875039ba124dc0a6 (patch)
treefc20f212f69d7048c63638242fde245742f0c51d /drivers/nor
parent5da11da840283cc41b5ee71636e7173f8c062e5a (diff)
downloadbarebox-a2b6da5e666a99a3f5b178b0875039ba124dc0a6.tar.gz
m25p80: set the correct erasesize when we use OPCODE_BE_4K
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/nor')
-rw-r--r--drivers/nor/m25p80.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index e6fe75e9bf..92b07af7f7 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;