[U-Boot] [PATCH v3] dm: sf: Add Atmel DataFlash spi flash driver

Jagan Teki jagannadh.teki at gmail.com
Wed May 6 13:43:05 CEST 2015


On 6 May 2015 at 08:36, Simon Glass <sjg at chromium.org> wrote:
> Hi,
>
> On 5 May 2015 at 05:10, Haikun Wang <haikun.wang at freescale.com> 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.
>>
>> Signed-off-by: Haikun Wang <haikun.wang at freescale.com>
>> ---
>> Verified with AT45DB021B.
>>
>> Changes in v3:
>> - 1. Rename file spi_dataflash.c to sf_dataflash.c
>> - 2. Add comment for array "dataflash_data"
>>
>> Changes in v2:
>> - 1. Correct comment style
>> - 2. Use get_timer in dataflash_waitready to check whether timeout
>> - 3. Remove struct spi_flash * in struct dataflash, and get it from udevice->uclass_priv
>> - 4. Replace spi_flash_write_common with spi_flash_cmd_write
>> - 5. Replace spi_flash_read with spi_flash_cmd_read
>> - 6. Change type of varible "status" form char to u8 in dataflash_status
>> - 7. Change add_dataflash's argument type due to <change 3>
>> - 8. 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
>
> I would prefer you use dev_get_priv() and friends instead of direct

Please do this, instead of updating it in future.

And also please add simple test case steps in commit message - probe,
erase, write
and read - Just to give some information that data flash driver is verified.

or if you want to add some more test cases on data flash just add a
test log file in
doc/SPI where we generally add spi-flash test logs here.

> access. But anyway:
>
> Acked-by: Simon Glass <sjg at chromium.org>
>
> Will this go through the spi tree?

thanks!
-- 
Jagan.


More information about the U-Boot mailing list