public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [rfc] new spiflash subsystem
@ 2008-01-28 20:00 Mike Frysinger
  2008-01-28 23:01 ` Ulf Samuelsson
  2008-01-28 23:26 ` Haavard Skinnemoen
  0 siblings, 2 replies; 27+ messages in thread
From: Mike Frysinger @ 2008-01-28 20:00 UTC (permalink / raw)
  To: u-boot

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 

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

end of thread, other threads:[~2008-01-30 23:48 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-28 20:00 [U-Boot-Users] [rfc] new spiflash subsystem Mike Frysinger
2008-01-28 23:01 ` 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

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