[U-Boot-Users] [PATCH] Fix SPI read/write length issue

Aubrey Li aubrey.adi at gmail.com
Fri Mar 23 06:57:52 CET 2007

On 3/23/07, Wolfgang Denk <wd at denx.de> wrote:
> In message <27d85ee10703220240i7f783984u6dcf6ff0da79a25f at mail.gmail.com> you wrote:
> > When the functions "eeprom_read" and "eeprom_write" works for the SPI
> > flash, the data length is limited to I2C_RXTX_LEN. See the following
> > piece of code.
> Umm... what do you mean with SPI flash?
> The "eeprom*" commands are intended to access EEPROM devices; for me,
> EEPROM and flash memory are two different things. Maybe you can
> explain what you are talking about?

The part number of the chip is M25P64, which is a serial flash memory
with SPI bus interface, since this flash and parallel NOR flash can
work at the same time on our board, I think using "eeprom*" commands
is correct for this kind of flash.

> > The following patch fixes this issue.
> Please also explain what "the issue" is? What exactly is not working
> as intended?
If I want to write kernel image to the SPI flash, I do the following steppes:
1) tftpboot 0x1000000 uImage

2) eeprom write 0x1000000 0x100000 $(filesize)

Here I encountered the problem, the length passed to the spi_write()
function is the kernel image size, far bigger than the macro
I2C_RXTX_LEN. So eeprom write doesn't work properly as intended. The
patch can fix it.
IMHO, when we do the spi operation, we shouldn't limit the data length
to a I2C macro.

Best Regards,

More information about the U-Boot mailing list