]> git.sur5r.net Git - u-boot/commit
dm: sf: Add Atmel DataFlash spi flash driver
authorHaikun Wang <Haikun.Wang@freescale.com>
Fri, 26 Jun 2015 11:30:27 +0000 (19:30 +0800)
committerJagan Teki <jteki@openedev.com>
Mon, 29 Jun 2015 19:10:10 +0000 (00:40 +0530)
commit79b4c08fc42cd7f6b51183b5338f337116c6fdf3
treec8dbdeeb1dfce1a2ed8bc614f77f957b8cacc7e3
parent7853d76b0bdab9b1a4da0bba8da6d12b5b8a303f
dm: sf: Add Atmel DataFlash spi flash driver

Atmel DataFlash chips have commands different from common spi
flash commands.
Atmel DataFlash also have special page-size.
This driver add support for accessing Atmel DataFlash.
It is based on the Driver Model.
Example:
=> sf probe 1:0
SPI DataFlash: Detected AT45DB021B with page size 264 Bytes, erase size 264 Bytes, total 264 KiB, revision d
=> sf erase 0 42000
SF: 270336 bytes @ 0x0 Erased: OK
=> mw.l 82000000 45444342 20000
=> sf write 82000000 0 42000
SF: 270336 bytes @ 0x0 Written: OK
=> sf read 83000000 0 42000
SF: 270336 bytes @ 0x0 Read: OK
=> cmp.b 82000000 83000000 42000
Total of 270336 byte(s) were the same

Signed-off-by: Haikun Wang <haikun.wang@freescale.com>
Tested-by: Haikun Wang <haikun.wang@freescale.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Chakra Divi <cdivi@openedev.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
drivers/mtd/spi/Makefile
drivers/mtd/spi/sf_dataflash.c [new file with mode: 0644]