
On Wednesday, June 09, 2010 03:06:26 Thomas Petazzoni wrote:
On Tue, 8 Jun 2010 15:20:57 -0400 Mike Frysinger wrote:
speaking historically, the dataflash code absolutely has its place. it existed long before the SPI flash framework. but i'm looking forward only now.
Yes, of course, understood.
However, the Dataflash aren't normal SPI flash, they don't have the same opcodes. For example, drivers/mtd/spi/spi_flash.c assumes that it can probe the "ID code" of the SPI flash by sending the CMD_READ_ID (0x9F) command (in spi_flash_probe()). This works for SPI flashes, but not for Dataflashes. The identification of Dataflashes takes place with command GET_STATUS (0xD7) in drivers/mtd/at45.c, which has a different return value than the 0x9F command of SPI flashes. Am I missing something ?
i see drivers/mtd/spi/atmel.c with all the same IDs as drivers/mtd/dataflash.c so presumably it works. i also vaguely recall having tested one or two myself with the SPI flash subsystem.
according to the datasheet for the AT45DB642D, 0x9F is the "get the ID code" while 0xDF is the "get flash status". i dont see how you can get the flash id info out of the flash status register. perhaps you're confusing the code bases ? -mike