Patchwork mtd: Correct 4-byte address mode enable

login
register
mail settings
Submitter Jonas Andersson
Date May 23, 2013, 12:23 p.m.
Message ID <1369311813-31606-1-git-send-email-jonas@microbit.se>
Download mbox | patch
Permalink /patch/245931/
State New
Headers show

Comments

Jonas Andersson - May 23, 2013, 12:23 p.m.
Micron SPI flashes uses command B7/E9 to enter/exit 4-byte mode. Write enable must be issued before command.

Signed-off-by: Jonas Andersson <jonas@microbit.se>
---
 drivers/mtd/devices/m25p80.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 2f3d2a5..c296cb7
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -160,6 +160,8 @@  static inline int write_disable(struct m25p *flash)
 static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable)
 {
 	switch (JEDEC_MFR(jedec_id)) {
+	case 0x20:
+		write_enable(flash);
 	case CFI_MFR_MACRONIX:
 	case 0xEF /* winbond */:
 		flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B;