Re: [U-Boot] [PATCH v5 1/4] dm: sf: Add Atmel DataFlash spi flash driver

On Tue, May 19, 2015 at 8:26 AM, Wang Haikun Haikun.Wang@freescale.com wrote:
On 5/18/2015 9:28 PM, Haikun Wang wrote:
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
Verified with AT45DB021B on LS1021AQDS. Changes in v5:
- Change CONFIG_DM_SF_DATAFLASH to CONFIG_SF_DATAFLASH
Changes in v4:
- Use dev_get_priv and dev_get_uclass_priv
- Add test log to commit message
Changes in v3:
- Rename file spi_dataflash.c to sf_dataflash.c
- Add comment for array "dataflash_data"
Changes in v2:
- Correct comment style
- Use get_timer in dataflash_waitready to check whether timeout
- Remove struct spi_flash * in struct dataflash, and get it from
udevice->uclass_priv
- Replace spi_flash_write_common with spi_flash_cmd_write
- Replace spi_flash_read with spi_flash_cmd_read
- Change type of varible "status" form char to u8 in dataflash_status
- Change add_dataflash's argument type due to <change 3>
- Add claim_bus and release_bus in erase/write/read due to <change 4
& 5>
Changes in v1: None drivers/mtd/spi/Makefile | 1 + drivers/mtd/spi/sf_dataflash.c | 711
+++++++++++++++++++++++++++++++++++++++++
2 files changed, 712 insertions(+) create mode 100644 drivers/mtd/spi/sf_dataflash.c
Reviewed by: Chakra Divi cdivi@openedev.com
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
participants (1)
-
Chakra D