spi-nor dummy bytes for fast read command

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Wed Jan 13 05:04:23 EST 2021


On 1/13/21 4:06 AM, Bin Meng wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Hi,

Hi,

> 
> It seems both U-Boot and Linux kernel spi-nor drivers have the same
> assumption on dummy cycles required in a fast read command.
> 
> In U-Boot spi_nor_read_data(), there is a logic to calculate the dummy
> bytes needed for fast read command:
> 
>     /* convert the dummy cycles to the number of bytes */
>     op.dummy.nbytes = (nor->read_dummy * op.dummy.buswidth) / 8;
> 
> This logic assumes the (nor->read_dummy * op.dummy.buswidth) is a
> multiple of 8, otherwise this won't work.
> 
> In Linux, the same logic exists in spi_nor_spimem_read_data().
> 
> Note on most flashes this is not a problem, however on some flashes
> the dummy cycles for the fast read command is configurable. If the
> dummy cycle is configured to some odd value which makes this
> assumption false, then we get a non-working driver.
> 

Right. We should use dummy cycles directly and get rid of the
dummy bytes logic. I have this in my todo queue for linux.

Cheers,
ta


More information about the linux-mtd mailing list