[U-Boot] [PATCH] mtd: SPI Flash: Support the STMicro Flash

From: TsiChung Liew Tsi-Chung.Liew@freescale.com
Add MTD SPI Flash support for M25P16, M25P40, M25P64, and M25P80.
Signed-off-by: Jason McMullan mcmullan@netapp.com Signed-off-by: TsiChung Liew Tsi-Chung.Liew@freescale.com --- drivers/mtd/spi/stmicro.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c index 3854cbe..6e5ce7a 100644 --- a/drivers/mtd/spi/stmicro.c +++ b/drivers/mtd/spi/stmicro.c @@ -2,7 +2,7 @@ * (C) Copyright 2000-2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * Copyright 2008, Network Appliance Inc. + * Network Appliance Inc. * Jason McMullan mcmullan@netapp.com * * See file CREDITS for list of people who contributed to this @@ -129,7 +129,7 @@ static int stmicro_wait_ready(struct spi_flash *flash, unsigned long timeout) if ((status & STMICRO_SR_WIP) == 0) break;
- } while (1 || get_timer(timebase) < timeout); + } while (get_timer(timebase) < timeout);
spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);

Tsi-Chung Liew Tsi-Chung.Liew@freescale.com wrote:
From: TsiChung Liew Tsi-Chung.Liew@freescale.com
Add MTD SPI Flash support for M25P16, M25P40, M25P64, and M25P80.
Signed-off-by: Jason McMullan mcmullan@netapp.com Signed-off-by: TsiChung Liew Tsi-Chung.Liew@freescale.com
Ok, good...that should address the timeout issue. But still nobody has commented on my concerns here:
http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg07628.html
Also,
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c index 3854cbe..6e5ce7a 100644 --- a/drivers/mtd/spi/stmicro.c +++ b/drivers/mtd/spi/stmicro.c @@ -2,7 +2,7 @@
- (C) Copyright 2000-2002
- Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- Copyright 2008, Network Appliance Inc.
- Network Appliance Inc.
why do you do this?
Haavard

Haavard,
- Copyright 2008, Network Appliance Inc.
- Network Appliance Inc.
why do you do this?
It must be accidentally deleted which is not intended to, I will resend it again.
Mail-archive:
...which means that you can make these operations cheaper by using shift and mask instead of divide and modulo. Though I suppose a clever compiler might figure that out on its own...
The u-boot optimize option is set for space (-Os) not speed (-O#n). The OPTFLAGS= -Os in <u-boot>/config.mk. If set to -O#n, the compiler will figure it out.
I can't find anything in the M25P80 indicating that the page size can be different from 256...
I will fix it. It is always 0x100, for future proof I will keep the l2_page_size in struct member, but rename to page_size.
This comment is misleading. The below code only works for power-of-two page sizes
I think the code is based on atmel.c.
Regards, TsiChung
participants (3)
-
Haavard Skinnemoen
-
Liew Tsi Chung-R5AAHP
-
Tsi-Chung Liew