[U-Boot] [PATCH v3] Add 'sf update' command to do smart SPI flash update

Mike Frysinger vapier at gentoo.org
Sat Aug 20 00:28:04 CEST 2011


On Friday, August 19, 2011 17:25:10 Simon Glass wrote:
> On Fri, Aug 19, 2011 at 3:15 PM, Mike Frysinger wrote:
> > On Friday, August 19, 2011 15:28:48 Simon Glass wrote:
> >> This adds a new SPI flash command which only rewrites blocks if the
> >> contents need to change. This can speed up SPI flash programming when
> >> much of the data is unchanged from what is already there.
> > 
> > looks good to me.  i'll give it a spin on a board of mine and then push
> > into my sf branch.  i really should write a spi flash simulation so i
> > could just test this from gdb ...
> 
> Funny you should say that. I rather badly need a way of testing the
> higher level U-Boot code (from the commands down to where it calls
> architecture/driver code). I am drafting up an email to send to the
> list with some thoughts on the matter.

when i wrote the blackfin system level port of the gnu sim, it was so i could 
do this (and i thought it'd be bad-ass).  i often use the gnu sim to do 
initial testing (sometimes down to the driver level) before i get around to 
loading up on actual hardware.

$ bfin-elf-run --env operating --model bf537 ./u-boot


U-Boot 2011.06-00375-g23ffb39-dirty (Aug 14 2011 - 16:54:03)

CPU:   ADSP bf537-0.2 (Detected Rev: 0.0) (bypass boot)
Board: ADI BF537 stamp board
       Support: http://blackfin.uclinux.org/
Clock: VCO: 500 MHz, Core: 500 MHz, System: 125 MHz
RAM:   64 MiB
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
0 Bytes
MMC:   
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
KGDB:  [on serial] ready
Warning: Generating 'random' MAC address
Net:   bfin_mac
Hit any key to stop autoboot:  5  0 
bfin> help sf
sf - SPI flash sub-system

Usage:
sf probe [bus:]cs [hz] [mode]   - init flash device on given SPI bus
                                  and chip select
sf read addr offset len         - read `len' bytes starting at
                                  `offset' to memory at `addr'
sf write addr offset len        - write `len' bytes from memory
                                  at `addr' to flash at `offset'
sf erase offset [+]len          - erase `len' bytes from `offset'
                                  `+len' round up `len' to block size
bfin> 
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110819/4627a91d/attachment.pgp 


More information about the U-Boot mailing list