[U-Boot-Users] help for cfi_flash

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Tue Jun 7 16:20:59 CEST 2005


Yusuf Ibrahim Ozkok wrote:
> Hi all,
> 
> I'm in trouble with cfi_flash driver. Can you please help me?
> 
> We have ported u-boot to our custom MPC8245 board, except the flash 
> driver. Now I'm trying to use cfi_flash driver of u-boot. But until now 
> (with more then a week of work) I couldn't succedded. So I need some 
> help!!!
> 
> We have an Intel 28F640C3T flash on our custom MPC8245 board. Four flash 
> chips are connected to 64 bit address bus.

In my experience, when the hardware engineers have given me a 64 data 
(not address - I assume that is a typo) bus, they _REQUIRE_ writes to be 
64 bits at a time.  In other words, you CANNOT write 8/16/32 bits (less 
than a full databus width) at a time.  It saves them a gate or two, for 
some reason they think that is a big deal (it is, but not beneficial for 
software).

In my experience, I've always had to write 64 bits at a time.  Writing 
32 bits at a time (which is probably what you are currently doing) 
doesn't work because only half of your chips are going into write mode 
and everybody gets massively confused.

The solution is to load a floating point register (which is 64 bits) 
with the flash-destined data and write _that_, which does a single 
transaction 64 bit write (as opposed to two 32 bit writes).  This is a 
pain to write initially, but once you get the technique working it 
really isn't a big deal.

Notes:
* Check your processor documentation fine print: IIRC, you can do 
floating point loads and stores with the floating point unit "disabled" 
(which it probably is).  Otherwise, you need to enable the FPU (no big 
deal).

* Reads work fine 8/16/32/64 bits at a time.  Don't worry about reads, 
only writes.

* On the PowerPC, you cannot move data to/from integer registers to a FP 
register.  You need to store it to RAM and load it in the FP register 
(or load constants directly).

* I don't know if the u-boot cfi driver knows how to do the 64 bit write 
trick.  IIRC, other people have had this hardware limitation and have 
made u-boot work with it.  Brows or use grep on the various boards and 
see what others have done.

[snip]

> After this brief describtion of my problem I want to list below, what I 
> have done, and clues I obtained;
> 
> I want to state out that this board is also being used with vxworks. And 
> vxworks flash driver works well. So there shouldn't be any hardware 
> problem.

How does the vxworks code do the flash writing?  You need to do it in a 
_very_ similar way.

[snip]

> Thank you very much.
> 
> Yusuf.
> 
> Software Eng. - Aselsan Inc.

Hope this helps.  You're welcome.
gvb




More information about the U-Boot mailing list