[U-Boot] [PATCH v3] sf: Add auto detection of 4-byte mode (vs standard 3-byte mode)
Stefan Roese
sr at denx.de
Thu Oct 25 15:59:19 UTC 2018
Hi York,
On 25.10.18 17:49, York Sun wrote:
> Guys,
>
> Let get back to the original thread. Since Rajat's first reply, the
> message id has been changed. All the comments were not captured by
> patchwork.
I also wondered about this. Seems to have happened at some top-posting
quite at the beginning of this thread.
> On 10/11/18 07:50, Stefan Roese wrote:
>> Some SPI NOR chips only support 4-byte mode addressing. Here the default
>> 3-byte mode does not work and leads to incorrect accesses. This patch
>> now reads the 4-byte mode status bit (in this case in the CR register
>> of the Macronix SPI NOR) and configures the SPI transfers accordingly.
>>
>> This was noticed on the LinkIt Smart 7688 modul, which is equipped with
>> an Macronix MX25L25635F device. But this device does *NOT* support
>> switching to 3-byte mode via the EX4B command.
>>
>> This should also work when the bootrom configures the SPI flash to
>> 4-byte mode and runs U-Boot after this. U-Boot should dectect this
>> mode (if the 4-byte mode detection is available for this chip) and
>> use the correct OPs in this case.
>
> From what I read, Rajat's method is to extend the controller driver to
> support read SFDP and default to 4-byte mode if supported, or
> overwritten by user's flag. Stefan's method is to read 4-byte status bit
> and doesn't change controller driver.
Yes, the last sentence it correct.
> Is the default value of this 4-byte status bit valid and correct for all
> cases?
This 4-byte address status bit implementation is SPI NOR chip
specific (vendor specific?). With Simon's help we already support
2 vendors now. Extending for other vendors / chips is fairly
easy.
Thanks,
Stefan
More information about the U-Boot
mailing list