From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [rfc] new spiflash subsystem
Date: Mon, 28 Jan 2008 15:00:34 -0500 [thread overview]
Message-ID: <200801281500.34869.vapier@gentoo.org> (raw)
this isnt against u-boot mainline, so there will be a few things that are out
of date (like the CFG handling), so over look that part. what's up for
comments here is the general architecture. ive omitted the env_spiflash.c
portion as i think that'll be pretty cheesy.
basically ive laid it out like so:
- common/cmd_spiflash.c:
provides the user interface of the spiflash subsystem. depends on these
functions being implemented elsewhere:
* spiflash_info() - ask the spiflash driver for info
* spiflash_read() - ask the spiflash driver to read
* spiflash_write() - ask the spiflash driver to write
* spiflash_erase() - ask the spiflash driver to erase
no validation occurs in the common code since it has no idea about sector
sizes and such. i could add a spiflash_query() function and have it return a
struct describing the spiflash and use that to validate, but i dont think
it's really worth the effort.
relevant defines:
* CFG_CMD_SPIFLASH - include the "spiflash" command
* CFG_SPIFLASH_MULTI - support multiple parts (via "cs" parameter)
- drivers/mtd/spiflash_jedec.c:
provides the spiflash driver functions needed by the common layer. detects
and works with Spansion/ST/Atmel/Winbond parts. i've personally verified at
least one part from each family, but obviously not every part ;). it depends
on these functions being implemented elsewhere:
* spiflash_on() - turn on the SPI
* spiflash_off() - turn off the SPI
* spiflash_cs_set() - assert/deassert the specified chip select
* spiflash_exchange_byte() - send specified byte and return received byte
relevant defines:
* CFG_SPIFLASH_JEDEC_DRIVER - enable this driver
* CFG_SPIFLASH_MULTI - disable a small runtime opt to avoid redetection
- board/$BOARD/spiflash.c:
provides the board / cpu specific spiflash functions. ive included the
Blackfin one here as an example.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080128/13afe397/attachment.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmd_spiflash.c
Type: text/x-csrc
Size: 2389 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080128/13afe397/attachment.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spiflash_jedec.c
Type: text/x-csrc
Size: 11469 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080128/13afe397/attachment-0001.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spiflash.c
Type: text/x-csrc
Size: 2052 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080128/13afe397/attachment-0002.c
next reply other threads:[~2008-01-28 20:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 20:00 Mike Frysinger [this message]
2008-01-28 23:01 ` [U-Boot-Users] [rfc] new spiflash subsystem Ulf Samuelsson
2008-01-29 0:41 ` Mike Frysinger
2008-01-29 7:35 ` Ulf Samuelsson
2008-01-29 9:49 ` Haavard Skinnemoen
2008-01-29 14:07 ` Mike Frysinger
2008-01-30 0:39 ` Ulf Samuelsson
2008-01-30 0:51 ` Mike Frysinger
2008-01-30 7:35 ` Haavard Skinnemoen
2008-01-30 13:05 ` Mike Frysinger
2008-01-29 22:40 ` Wolfgang Denk
2008-01-29 22:42 ` Wolfgang Denk
2008-01-30 0:39 ` Ulf Samuelsson
2008-01-30 8:56 ` Wolfgang Denk
2008-01-30 9:34 ` Ulf Samuelsson
2008-01-30 23:48 ` Wolfgang Denk
2008-01-29 8:28 ` Jean-Christophe PLAGNIOL-VILLARD
2008-01-29 10:43 ` Scott McNutt
2008-01-30 0:16 ` Ulf Samuelsson
2008-01-29 22:32 ` Wolfgang Denk
2008-01-28 23:26 ` Haavard Skinnemoen
2008-01-29 0:29 ` Mike Frysinger
2008-01-29 9:12 ` Haavard Skinnemoen
2008-01-29 14:13 ` Mike Frysinger
2008-01-29 21:06 ` Haavard Skinnemoen
2008-01-29 0:44 ` Ben Warren
2008-01-29 9:14 ` Haavard Skinnemoen
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=200801281500.34869.vapier@gentoo.org \
--to=vapier@gentoo.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.