Skip to contentSkip to conversation

latest u-boot (1.3.2-rc2) and dataflash vs CFG_NO_FLASH

U-Boot-Users New Matt Gessner 3 participants 7 messages Feb 28, 2008 – Mar 3, 2008

lore
Share & tools
lore
#0 lore raw

Hi, again,

OK, I've got a NAND flash, SPI Dataflash, and no "real" flash (NOR, I suppose).

If I try to copy from Ram to dataflash, u-boot says "Copy to Flash..." and the CPU pukes; it's detecting what it thinks is flash.

If I #define CFG_NO_FLASH, other stuff breaks. If I fix that by changing include/flash.h to remove the #ifndef CFG_NO_FLASH, then everything compiles, but on the link, all of the flash stuff that I DO need (flash_info, flash_erase, etc) isn't defined because of CFG_NO_FLASH.

Has this been fixed ANYWHERE in someone's branch?

Wolfgang, I know you don't really care much about non-memory flash "devices" but is there some vision as to where all this is supposed to go?

Thanks in advance,

Matt Gessner
mgessner at avidyne.com
Avidyne Corp
Safety Systems Group
Columbus, OH

#1 lore raw
Quoted 2 lines

If I try to copy from Ram to dataflash, u-boot says "Copy to Flash..." and the CPU pukes; it's detecting what it thinks is flash.

This simple patch (for old 1.3.0) fixed this problem for me on DataFlash only system.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: common-copy_to_dataflash.patch
Type: text/x-patch
Size: 396 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080229/2172c454/attachment.bin

#2 lore raw
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines

If I try to copy from Ram to dataflash, u-boot says "Copy to Flash..." and the CPU pukes; it's detecting what it thinks is flash.

This simple patch (for old 1.3.0) fixed this problem for me on DataFlash only system.

Could you please submit this as a regular patch, i. e. inline instead of attachment, with a proper patch description (Subject line) and your Signed-off-by: line? Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 6 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
"Do we define evil as the absence of goodness? It seems only  logical
that shit happens--we discover this by the process of elimination."
                                                        -- Larry Wall
#3 lore raw

PATCH 1/1 fix copy from ram to dataflash

If I try to "cp.b <ram> <dataflash>", u-boot selects normal flash routines instead of dataflash. This is because it checks "if source address is not dataflash" instead of target address.

common/cmd_mem.c renamed from common/cmd_mem.c.foo +1 -1
@@ -417,7 +417,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int fl
 	/* check if we are copying to Flash */
 	if ( (addr2info(dest) != NULL)
 #ifdef CONFIG_HAS_DATAFLASH
-	   && (!addr_dataflash(addr))
+	   && (!addr_dataflash(dest))
 #endif
 	   ) {
 		int rc;
#4 lore raw

PATCH 1/1 fix copy from ram to dataflash

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

If I try to "cp.b <ram> <dataflash>", u-boot selects normal flash routines instead of dataflash. This is because it checks "if source address is not dataflash" instead of target address.

Applied, thanks.

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: wd at denx.de
There's an old proverb that says just about whatever you want it to.
#5 lore raw
In reply to Kim B. Heino

Thanks; I did something similar to this in my u-boot 1.2.0.

I sort of thought that this was an issue that was being hashed out a while back because of the conflict over all of the different devices vs flash memory.

I guess not.

Is there an effort under way to clean up or standardize all these things? Or was it deemed to be not useful enough?

Regards,

Matt

Quoted 9 lines

-----Original Message-----
From: Kim B. Heino [mailto:Kim.Heino at bluegiga.com]
Sent: Friday, February 29, 2008 12:54 AM
To: Matt Gessner
Cc: U-Boot-Users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] latest u-boot (1.3.2-rc2) and dataflash vs CFG_NO_FLASH

Quoted 1 line

If I try to copy from Ram to dataflash, u-boot says "Copy to

Flash..."

Quoted 3 lines
Quoted 1 line

and the CPU pukes; it's detecting what it thinks is flash.

This simple patch (for old 1.3.0) fixed this problem for me on

DataFlash

Quoted 1 line

only system.

#6 lore raw
In reply to Matt Gessner

Dear Matt,

Quoted 9 lines · in message <[email protected]>…

If I try to copy from Ram to dataflash, u-boot says "Copy to Flash..." and the CPU pukes; it's detecting what it thinks is flash.

If I #define CFG_NO_FLASH, other stuff breaks. If I fix that by changing include/flash.h to remove the #ifndef CFG_NO_FLASH, then everything compiles, but on the link, all of the flash stuff that I DO need (flash_info, flash_erase, etc) isn't defined because of CFG_NO_FLASH.

The current dataflash implementation really needs to be cleaned up.

Quoted 5 lines

Has this been fixed ANYWHERE in someone's branch?

Wolfgang, I know you don't really care much about non-memory flash "devices" but is there some vision as to where all this is supposed to go?

It's not exactly correct that I don't care. The situation is that we have no such hardware in our lab. That means I cannot even test it.

The "vision" is to add some proper device interface (similar to and/or unified with NAND, for example). But AFAIK no such work has been started yet.

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: wd at denx.de
Minds are like parachutes - they only function when open.