From: Michael Schwingen <rincewind@discworld.dascon.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Mixing CFI and non-CFI flashs?
Date: Fri, 02 Nov 2007 21:53:26 +0100 [thread overview]
Message-ID: <472B8E46.7000808@discworld.dascon.de> (raw)
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
next reply other threads:[~2007-11-02 20:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 20:53 Michael Schwingen [this message]
2007-11-03 7:13 ` [U-Boot-Users] Mixing CFI and non-CFI flashs? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=472B8E46.7000808@discworld.dascon.de \
--to=rincewind@discworld.dascon.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox