@@ -26,6 +26,24 @@ static const struct spi_nor_fixups mx25l3205d_fixups = {
.post_bfpt = mx25l3205d_post_bfpt_fixups,
};
+static int mx25l12805d_post_bfpt_fixups(struct spi_nor *nor,
+ const struct sfdp_parameter_header *bfpt_header,
+ const struct sfdp_bfpt *bfpt)
+{
+ /*
+ * Macronix has a bad habit of reusing flash IDs: MX25L12835F collides
+ * with MX25L12805D. MX25L12835F defines SFDP tables, while the older
+ * variant does not.
+ */
+ nor->name = "mx25l12835f";
+
+ return 0;
+}
+
+static const struct spi_nor_fixups mx25l12805d_fixups = {
+ .post_bfpt = mx25l12805d_post_bfpt_fixups,
+};
+
static int
mx25l25635_post_bfpt_fixups(struct spi_nor *nor,
const struct sfdp_parameter_header *bfpt_header,
@@ -70,8 +88,10 @@ static const struct flash_info macronix_parts[] = {
{ "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) },
{ "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) },
{ "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
- { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SECT_4K |
- SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) },
+ { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, SPI_NOR_PARSE_SFDP |
+ SECT_4K | SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP)
+ /* ID collision with mx25l12835f. */
+ .fixups = &mx25l12805d_fixups },
{ "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
{ "mx25r1635f", INFO(0xc22815, 0, 64 * 1024, 32,
SECT_4K | SPI_NOR_DUAL_READ |