hi folks, I've come across a case on one of our PXA250 boards where the flash was getting corrupted when using the 1.3.2 version of cfi_flash.c, while the 1.2.0 version worked just fine.
Here's what happens: 1. Reprogram uboot. 2. Compare uboot in flash against uboot in DRAM. 3. Either run "reset" or press the reset button. 4. Compare the flash and DRAM, as well as a new copy of uboot re-read from CF for good measure. At this point the low byte in the word at offset 0x554 has switched from a 0x30 to a 0x10. This is the only change in the flash. The new value is always the same. I narrowed down the source of the problem to the loss of the volatile qualifier on the addr pointer in flash_write_cmd(). Adding the qualifier gets rid of the corruption. In the older 1.2.0 sources, addr was declared as "volatile cfiptr_t addr;". Has anyone else seen this? It seems like the safe thing to do is to restore the qualifier in general. Below is a diff, of the change for the 1.3.2. sources: diff -u -r1.1.1.2.2.2 cfi_flash.c --- cfi_flash.c 23 Apr 2008 17:02:47 -0000 1.1.1.2.2.2 +++ cfi_flash.c 29 Apr 2008 18:55:47 -0000 @@ -464,7 +464,7 @@ uint offset, uchar cmd) { - void *addr; + void *volatile addr; cfiword_t cword; addr = flash_map (info, sect, offset); Adrian -- Linux Software Engineer | EuroTech, Inc. | www.eurotech-inc.com ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users