AnsweredAssumed Answered

S25FS128S driver support?

Question asked by Tim Hammer on Sep 13, 2018
Latest reply on Sep 17, 2018 by Cyril Strejc

Our custom board design is based on the LS1012A Freedom reference design. One change is the QSPI flash part is  16Mbyte (S25FS128SAGNFI103) rather than 64Mbyte (S25FS512SAGNFI011). To get cwflash.py to work with the  different part, I initially just used the CW4NET_v2018.01/CW_ARMv8/Config/flash/devices/S25FS256S.xml description file and this works fine for the CW TAP/JTAG connection (Does anyone have the flash programmer .xml files for S25FS128S QSPI part?).

 

The part ID was being interpreted by U-Boot as s25fl128s_64k because 0x4d0181 was not in the ID table but the logic allows it to match 0x4d01:

{"s25fl128s_64k", INFO(0x012018, 0x4d01, 64 * 1024, 256, RD_FULL | WR_QPP) },


With that part description, U-Boot is able to read the QSPI flash, but not write- although a write does not indicate an error (e.g. saveenv result indicates that the environment was written/saved, but resetting/restarting U-Boot still gets a CRC error reading the environment from flash!).

Since the S25FS256S description worked for cwflash, I created a new ID entry in U-Boot matching the s25fs256s_64k but with the s25fs128s name/id:

{"s25fs128s_64k", INFO6(0x012018, 0x4d0181, 64 * 1024, 256, RD_FULL | WR_QPP | SECT_4K) },
{"s25fs256s_64k", INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },


I have confirmed that U-Boot is now identifying the part as my new s25fs128s_64k entry:

SF: Detected s25fs128s_64k with page size 256 Bytes, erase size 4 KiB, total 16 MiB

but saveenv/reset still fails to work as expected.

 

I did find a previous discussion about this QSPI part and the LS1012A: Spansion S25FS128S and fsl-quadspi driver where the author was reporting a problem reading the part from Linux. They added an equivalent entry to the ID table in the Linux driver.

Bacem Daassi from Cypress Semi responded with a pointer to a Cypress KB article and suggested removing the SECT_4K flag.

There is no response from the original poster, so it is not obvious if this was the solution for them or not.

I have removed the SECT_4K flag, but still am not able to write to the QSPI flash from U-Boot.

 

Has anyone successfully written to the S25FS128S part (or the S25FS256S part which is essentially the same) from U-Boot or Linux drivers?

 

Thanks!

.Tim

Outcomes