staticint
mx25l25635_post_bfpt_fixups(struct spi_nor *nor, conststruct sfdp_parameter_header *bfpt_header, conststruct sfdp_bfpt *bfpt)
{ /* * MX25L25635F supports 4B opcodes but MX25L25635E does not. * Unfortunately, Macronix has re-used the same JEDEC ID for both * variants which prevents us from defining a new entry in the parts * table. * We need a way to differentiate MX25L25635E and MX25L25635F, and it * seems that the F version advertises support for Fast Read 4-4-4 in * its BFPT table.
*/ if (bfpt->dwords[SFDP_DWORD(5)] & BFPT_DWORD5_FAST_READ_4_4_4)
nor->flags |= SNOR_F_4B_OPCODES;
return 0;
}
staticint
macronix_qpp4b_post_sfdp_fixups(struct spi_nor *nor)
{ /* PP_1_1_4_4B is supported but missing in 4BAIT. */ struct spi_nor_flash_parameter *params = nor->params;
/* * SFDP of MX25L3255E is JESD216, which does not include the Quad * Enable bit Requirement in BFPT. As a result, during BFPT parsing, * the quad_enable method is not set to spi_nor_sr1_bit6_quad_enable. * Therefore, it is necessary to correct this setting by late_init.
*/
params->quad_enable = spi_nor_sr1_bit6_quad_enable;
/* * In addition, MX25L3255E also supports 1-4-4 page program in 3-byte * address mode. However, since the 3-byte address 1-4-4 page program * is not defined in SFDP, it needs to be configured in late_init.
*/
params->hwcaps.mask |= SNOR_HWCAPS_PP_1_4_4;
spi_nor_set_pp_settings(¶ms->page_programs[SNOR_CMD_PP_1_4_4],
SPINOR_OP_PP_1_4_4, SNOR_PROTO_1_4_4);
/* Use dummy cycles which is parse by SFDP and convert to bit pattern. */
buf[0] = MXIC_NOR_REG_DC(nor->params->reads[SNOR_CMD_READ_8_8_8_DTR].num_wait_states);
op = (struct spi_mem_op)MXIC_NOR_WR_CR2(MXIC_NOR_ADDR_CR2_DC, 1, buf);
ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); if (ret) return ret;
/* Set the octal and DTR enable bits. */
buf[0] = MXIC_NOR_REG_DOPI_EN;
op = (struct spi_mem_op)MXIC_NOR_WR_CR2(MXIC_NOR_ADDR_CR2_MODE, 1, buf);
ret = spi_nor_write_any_volatile_reg(nor, &op, nor->reg_proto); if (ret) return ret;
/* Read flash ID to make sure the switch was successful. */
ret = spi_nor_read_id(nor, nor->addr_nbytes, 4, buf,
SNOR_PROTO_8_8_8_DTR); if (ret) {
dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret); return ret;
}
/* Macronix SPI-NOR flash 8D-8D-8D read ID would get 6 bytes data A-A-B-B-C-C */ for (i = 0; i < nor->info->id->len; i++) if (buf[i * 2] != buf[(i * 2) + 1] || buf[i * 2] != nor->info->id->bytes[i]) return -EINVAL;
/* * The register is 1-byte wide, but 1-byte transactions are not * allowed in 8D-8D-8D mode. Since there is no register at the * next location, just initialize the value to 0 and let the * transaction go on.
*/
buf[0] = MXIC_NOR_REG_SPI_EN;
buf[1] = 0x0;
op = (struct spi_mem_op)MXIC_NOR_WR_CR2(MXIC_NOR_ADDR_CR2_MODE, 2, buf);
ret = spi_nor_write_any_volatile_reg(nor, &op, SNOR_PROTO_8_8_8_DTR); if (ret) return ret;
/* Read flash ID to make sure the switch was successful. */
ret = spi_nor_read_id(nor, 0, 0, buf, SNOR_PROTO_1_1_1); if (ret) {
dev_dbg(nor->dev, "error %d reading JEDEC ID after disabling 8D-8D-8D mode\n", ret); return ret;
}
if (memcmp(buf, nor->info->id->bytes, nor->info->id->len)) return -EINVAL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.