From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 25 Oct 2018 17:59:19 +0200 Subject: [U-Boot] [PATCH v3] sf: Add auto detection of 4-byte mode (vs standard 3-byte mode) In-Reply-To: References: <20181011144944.9011-1-sr@denx.de> Message-ID: <09d90cb0-7d34-6dbb-66fe-0643ff4c0d1c@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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