[#3909] eeprom read/write command does not work with Atmel dataflash (at45db642d) and standard dataflash page size (1056 bytes)

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

[#3909] eeprom read/write command does not work with Atmel dataflash (at45db642d) and standard dataflash page size (1056 bytes)

Submitted By: Robert Selberg

Open Date

2008-02-18 10:24:43     Close Date

2008-10-13 03:35:35

Priority:

Low     Assignee:

Mike Frysinger

Category:

N/A     Fixed In Release:

N/A

Found In Release:

snaps     Status:

Closed

Board:

N/A     Processor:

N/A

Silicon Revision:

    Resolution:

Duplicated

Is the bug repeatable?:

yes     

Summary: eeprom read/write command does not work with Atmel dataflash (at45db642d) and standard dataflash page size (1056 bytes)

Details:

 

The spi flash driver (/trunk/u-boot-1.1.6/board/bf537-stamp/spi_flash.c) in the nightly snapshot of u-boot (u-boot-trunk-svn-997) does not work correctly with Atmel at45db642d dataflash if the flash has the standard dataflash page size (1056 bytes per page). The driver works if the chip is set in power-of-two addressing mode.

 

Reading and writing of the first page works with page size 1056 but when writing more than 1056 bytes with e.g. "eeprom write 0x1000000 0x0 0x1000" other pages will be written over.

 

Follow-ups

 

--- Mike Frysinger                                           2008-02-18 10:35:07

i dont have any dataflash parts which are in 1056 byte mode, so i cannot

explicitly test, but the code does check for it (look at the detect routine)

 

you'll have to debug it to find out where things are breaking

 

also note, the Blackfin cannot boot off dataflashes unless they are in power of

2 mode

 

--- Robert Selberg                                           2008-02-20 04:59:57

Sorry, I can't debug the chips anymore as they are in power of two mode now...

(I needed to boot from them).

 

--- Mike Frysinger                                           2008-02-26 14:53:52

a fix was proposed in [#3934]:

http://blackfin.uclinux.org/gf/download/trackeritem/3934/4131/spi_flash.c.diff

 

but that involves modifying the transmit_address() function ... the address at

that point should already be aligned according to sector as the higher levels

broke it up according to address_to_sector()

 

this will probably have to wait until i get a dataflash that isnt in the power

of 2 mode

 

--- Robin Getz                                               2008-02-26 17:39:47

Robert:

 

Since the Blackfin can not boot from the non-power of 2 mode - is this really

necessary?

 

Is it likely that someone would put a part down that the Blackfin can't boot

from?

 

-Robin

 

--- Mike Frysinger                                           2008-02-26 18:24:44

i tried to factor the code to take the page size into account, but it doesnt

appear to work.  i'll also need it to work when moving to the common spiflash

subsystem in order for it to be adopted into u-boot.

 

--- Robert Selberg                                           2008-02-27 03:41:23

Robin:

I reported it since it's bug.

The BF can boot from a 1056 bytes/page dataflash with a small hack (if you have

a custom bootloader in the first page of the flash that loads u-boot).

 

--- Alexander Kochetkov                                      2008-02-27 08:24:52

The other side I see, is that the kernel can't work with Atmel flashes in 'power

of 2 mode' (see file /trunk/drivers/mtd/devices/mtd_dataflash.c). We can boot

from the Atmel flash, but kernel will not work with it. Does it mean, that

kernel should contains some check of flash mode as u-boot have?

 

Should we add command 'eeprom power-of-two' into u-boot console for switching

Atmel flashes into 'power of two' mode?

 

--- Robert Selberg                                           2008-03-10 04:51:05

Alexander: The kernel can be patched with

 

--- Robert Selberg                                           2008-03-10 04:52:08

Alexander: The kernel driver can be patched with the patch i attached under the

"files" tab.

 

--- Ivan Kuten                                               2008-07-30 05:22:26

I have bf537 and at45db642d, u-boot eeprom read/write in not working, does not

matter in 1056 or 1024 mode. Kernel driver provided by Robert works for me.

 

--- Mike Frysinger                                           2008-10-13 03:35:35

latest kernel should work OK.  u-boot issues are tracked at [#4367].

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

mtd_dataflash.patch    text/x-patch    511    Robert Selberg

mtd_dataflash.patch    text/x-patch    511    Robert Selberg

Outcomes