diff options
author | Heiko Schocher <hs@denx.de> | 2015-04-27 07:42:06 +0200 |
---|---|---|
committer | Jagan Teki <jteki@openedev.com> | 2015-06-30 00:40:11 +0530 |
commit | 2ec1a4059cd0421653b19979a046e9fb7296652f (patch) | |
tree | 2d2621d60218d6820825a7ad8c0c1673d79c2128 /common/env_sf.c | |
parent | 09c3280754f8f68a4d7fc0ee397a92b38c4f59e4 (diff) |
spi, sf: Use offset and size in sf cmd from mtdpartition
With this patch, it is possible to get the offset and size information
from the mtdpartiton setting in "mtdparts", similiar to the
"nand" commandos.
=> 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|partition len - read `len' bytes starting at
`offset' to memory at `addr'
sf write addr offset|partition len - write `len' bytes from memory
at `addr' to flash at `offset'
sf erase offset|partition [+]len - erase `len' bytes from `offset'
`+len' round up `len' to block size
sf update addr offset|partition len - erase and write `len' bytes from memory
at `addr' to flash at `offset'
=>
for example "env" is defined in mtdparts:
=> sf read 13000000 env
device 0 offset 0xd0000, size 0x10000
SF: 65536 bytes @ 0xd0000 Read: OK
zynq-uboot> mtdparts add nor0 0x10000@0x0 env
zynq-uboot> sf erase env 0x10000
SF: 65536 bytes @ 0x0 Erased: OK
zynq-uboot> sf write 0x100 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Written: OK
zynq-uboot> sf read 0x40000 env
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Read: OK
Signed-off-by: Heiko Schocher <hs@denx.de>
Tested-by: Jagannadh Teki <jteki@openedev.com>
Reviewed-by: Jagannadh Teki <jteki@openedev.com>
Diffstat (limited to 'common/env_sf.c')
0 files changed, 0 insertions, 0 deletions