Skip to contentSkip to conversation

SPI Flash: Support the ST Microelectronics M25P80 and M25P40 SPI Flash

PATCH New Jason McMullan 4 participants 4 messages Jun 10, 2008 – Aug 21, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SPI Flash: Support the ST Microelectronics M25P80 and M25P40 SPI Flash

This commit adds MTD support for the M25P80 (1Mx8) and the M25P40 (512kx8) SPI Flash components from ST Microelectronics.

Tested with the M25P40, but should work for the M25P80 according to the spec sheet.

---
 drivers/mtd/spi/Makefile             |    1 +
 drivers/mtd/spi/spi_flash.c          |    5 +
 drivers/mtd/spi/spi_flash_internal.h |    1 +
 drivers/mtd/spi/stmicro.c            |  326 ++++++++++++++++++++++++++++++++++
 4 files changed, 333 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/stmicro.c
drivers/mtd/spi/Makefile +1 -0
index af6af97..01b288a 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libspi_flash.a
 
 COBJS-$(CONFIG_SPI_FLASH)	+= spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)	+= atmel.o
+COBJS-$(CONFIG_SPI_FLASH_STMICRO) += stmicro.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/mtd/spi/spi_flash.c +5 -0
index d581cb3..dd4d130 100644
@@ -134,6 +134,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 		flash = spi_flash_probe_atmel(spi, idcode);
 		break;
 #endif
+#ifdef CONFIG_SPI_FLASH_STMICRO
+	case 0xff:
+		flash = spi_flash_probe_stmicro(spi, idcode);
+		break;
+#endif
 	default:
 		debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
 		flash = NULL;
drivers/mtd/spi/spi_flash_internal.h +1 -0
index 1438050..e5f758e 100644
@@ -43,3 +43,4 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
 /* Manufacturer-specific probe functions */
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode);
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
+struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
drivers/mtd/spi/stmicro.c new file +326 -0

326 lines not on this page · raw message

Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 SPI Flash: Support the ST Microelectronics M25P80 and M25P40 SPI Flash

Quoted 2 lines · In message <[email protected]> you wrote:

This commit adds MTD support for the M25P80 (1Mx8) and the M25P40 (512kx8) SPI Flash components from ST Microelectronics.

...

drivers/mtd/spi/stmicro.c line 3

Quoted 6 lines
drivers/mtd/spi/stmicro.c new file +3 -0
@@ -0,0 +1,326 @@
+/*
+ * $Id$
+ *

Please remove these two lines.

drivers/mtd/spi/stmicro.c line 96

Quoted 9 lines
drivers/mtd/spi/stmicro.c new file +9 -0
+	do {
+		ret = spi_xfer(spi, 8, NULL, &status, 0);
+		if (ret)
+			return -1;
+
+		if ((status & STMICRO_SR_WIP) == 0)
+			break;
+
+	} while (1 || get_timer(timebase) < timeout);

Hm... the timeout code seems to be disabled here?

I think you should remove either the first or the second expression.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Mistakes are often the stepping stones to utter failure.
#2 lore raw

PATCH 1/1 SPI Flash: Support the STMicroelectronics M25P80 and M25P40 SPI Flash

Hi,

May I know the status of this patch back in mid-June? I haven't
seen it has been committed last time. I have two platforms that need this driver. If not, I can re-send the patch again.

Thanks!

Regards,
TsiChung

-----Original Message-----
From: [email protected] [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Wolfgang Denk
Sent: Tuesday, June 10, 2008 5:02 AM
To: Jason McMullan
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] [PATCH] SPI Flash: Support the STMicroelectronics M25P80 and M25P40 SPI Flash

In message <[email protected]> you

Quoted 2 lines · wrote:

This commit adds MTD support for the M25P80 (1Mx8) and the M25P40 (512kx8) SPI Flash components from ST Microelectronics.

...

drivers/mtd/spi/stmicro.c line 3

Quoted 6 lines
drivers/mtd/spi/stmicro.c new file +3 -0
@@ -0,0 +1,326 @@
+/*
+ * $Id$
+ *

Please remove these two lines.

drivers/mtd/spi/stmicro.c line 96

Quoted 9 lines
drivers/mtd/spi/stmicro.c new file +9 -0
+	do {
+		ret = spi_xfer(spi, 8, NULL, &status, 0);
+		if (ret)
+			return -1;
+
+		if ((status & STMICRO_SR_WIP) == 0)
+			break;
+
+	} while (1 || get_timer(timebase) < timeout);

Hm... the timeout code seems to be disabled here?

I think you should remove either the first or the second expression.

Best regards,

Wolfgang Denk

Signature · 15 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Mistakes are often the stepping stones to utter failure.

------------------------------------------------------------------------
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for just about anything Open
Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users
#3 lore raw

PATCH 1/1 SPI Flash: Support the STMicroelectronics M25P80 and M25P40 SPI Flash

Quoted 3 lines · Liew Tsi Chung

May I know the status of this patch back in mid-June? I haven't
seen it has been committed last time. I have two platforms that need this driver. If not, I can re-send the patch again.

It has been reviewed, some issues have been pointed out, but no one has further commented on them or fixed them. Resending is somewhat pointless until the issues have been addressed in some way.

Haavard