Repository navigation
SPI NOR of Macronix: not taken for SPI NAND, and it erases and writes - #57
Merged
Merged
Conversation
MX25L chips with the ID c2 20 xx matched the 2-byte SPI NAND entry MX35LF2G14AC, tried first, so they were a 256 MB SPI NAND. An ID of the NOR table now wins over a 2-byte entry, and a chip whose feature registers all read 0xff is not a SPI NAND; both before any write to the chip. Past that, -u, erases and writes failed: 0x35 and 0x15 read something else on Macronix chips, and the 0x07 of the MX25L12805D was taken for WPS. Only status register 1 is theirs now, with BP3 in bit 5. Version 1.21.1.
PR Summary by QodoFix Macronix SPI NOR detection and write protection
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Macronix SPI NOR chips with the ID
c2 20 xx(MX25L4005A up to MX25L51245G, 8 chips of the table) could not be used since 1.10.0.Detection. The SPI NAND entry MX35LF2G14AC compares only
c2 20, and SPI NAND is tried first, so these chips were a 256 MB SPI NAND, and an erase or a write would have gone out as SPI NAND commands. Now an ID of the NOR table wins over a 2-byte SPI NAND entry, and a chip whose registers A0, B0 and C0 all read 0xff is not a SPI NAND, whatever its ID. Both come before any write to the chip. It is the only overlap between the two tables, checked for all three ways of reading the ID.Protection. Past the detection,
-u, erases and writes failed withstatus register 3 stays 0x07: on Macronix chips 0x35 and 0x15 read something else, and bit 2 of the MX25L12805D's 0x07 was taken for WPS. Only status register 1 counts on them now, and BP3 (bit 5) is cleared with the other BP bits. The reads themselves stay in the output.Version 1.21.1.
Tests:
nandsimcovers the 8 IDs, nothing written to the chip, MX35LF2G14AC still found with its own third byte, the 0xff rule;norsimgives Macronix the answers of a real chip (ff, 07).Hardware: two MX25L12805D, on CH341A and CH347T. Release 1.21.0: both a SPI NAND of 256 MB. This branch: MX25L12805D, 16 MB,
-uOK (SR1 0x80 to 0x00 on the one with SRP0),-tOK on both, full dumps before and after identical. A real MX35LF2G14AC is not at hand: only the simulator covers it.