Here is a patch for programming SPI Flash memories.  Should also work with SPI 
EEPROMs.

This patch is rather large because "struct URJ_BUS_DRIVER" got 3 new functions: 
write_start, enable, and disable.  So, therefor I updated all of the existing 
bus drivers to include these three functions.  However, for the existing bus 
drivers, these are essentially just noops.

urj_bus_area_t Now has a class parameter to indicate the type of bus the memory 
is connected to.   Each of the bus drivers has been updated to initialize this 
parameter appropriately.


To use the new SPI bus driver works similar to the prototype bus driver.  It 
allows the user to specify the pins to use on the command line.  It also allows 
the user to specify the address size and data size.  The default address width 
is 16bits and the default data size is 8bits.
example:
        initbus spimem NCS=SPI_CS_N SCK=SPI_CLK MOSI=SPI_MOSI MISO=SPI_MISO 
AMODE=16 WIDTH=8

The AMODE and WIDTH are optional.

Now you can program the flash like you would any other flash memory.
example:

        detectflash 0
        flashmem 0 myfile.bin noverify


One other note.  This patch also breaks apart the flash programming and 
verifying into 2 separate functions.  The flashmem command will still verify if 
requested, however you can now also use the new "flashverify" command if you 
just want to verify.  The format of this command is identical to flashmem.

Attachment: spi.diff.gz
Description: GNU Zip compressed data



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to