public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Mixing CFI and non-CFI flashs?
@ 2007-11-02 20:53 Michael Schwingen
  2007-11-03  7:13 ` Stefan Roese
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Schwingen @ 2007-11-02 20:53 UTC (permalink / raw)
  To: u-boot

Hi,

I am currently porting u-boot to multiple IXP425-based boards that have 
accumulated here over the time. One of them has a slight problem, 
because it uses a combination of two flash roms:
 - one 8-bit SST 39VF020 boot flash on a 8-bit chip select as boot flash
 - one 16-bit Intel 64MBit flash on a 16-bit chip select.

The intel flash is CFI, while the SST flash is not.
I want to use both flash roms, and I want to use as much of the existing 
flash code as possible. It seems that when using the CFI code, there is 
no easy way to add  a non-CFI flash - right?

What would be the best way to use both flash roms? I have come up with:

(1) provide a hook in cfi_flash.c to insert hardcoded values into the 
flash_info structure for the non-CFI flash rom. Due to differences 
between CFI-AMD and non-CFI AMD flash command cycles, I need to  add a 
new commandset (eg. CFI_CMDSET_AMD_LEGACY) plus a bit of handler code.

(2) rename all external-visible functions in flash_cfi.c and add wrapper 
functions that call either the CFI code or my own code for the non-CFI 
flash. This has the disadvantage that I need to duplicate code that is 
already present in cfi_flash.c, but is not exported. I have ssen this 
done on one chip vendor's u-boot port, and it does not really look nice.

(3) extend the code in cfi_flash.c so that external functions can be 
added via function pointers for non-CFI flashs. Same disadvantage as (2).

I have implemented solution (1) now, and it seems to work quite well, 
with minimal code needed in the board-setup file, but maybe there are 
better ways to do this - comments?

cu
Michael

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-12 20:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-02 20:53 [U-Boot-Users] Mixing CFI and non-CFI flashs? Michael Schwingen
2007-11-03  7:13 ` Stefan Roese
2007-11-03 15:00   ` Michael Schwingen
2007-11-05 11:21     ` Stefan Roese
2007-11-05 23:24       ` Michael Schwingen
2007-11-06  7:48         ` Stefan Roese
2007-11-06  8:26           ` Michael Schwingen
2007-11-06  8:59             ` Stefan Roese
2007-11-12 20:19               ` Michael Schwingen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox