staticint
w25q128_post_bfpt_fixups(struct spi_nor *nor, conststruct sfdp_parameter_header *bfpt_header, conststruct sfdp_bfpt *bfpt)
{ /* * Zetta ZD25Q128C is a clone of the Winbond device. But the encoded * size is really wrong. It seems that they confused Mbit with MiB. * Thus the flash is discovered as a 2MiB device.
*/ if (bfpt_header->major == SFDP_JESD216_MAJOR &&
bfpt_header->minor == SFDP_JESD216_MINOR &&
nor->params->size == SZ_2M &&
nor->params->erase_map.regions[0].size == SZ_2M) {
nor->params->size = SZ_16M;
nor->params->erase_map.regions[0].size = SZ_16M;
}
staticint
w25q256_post_bfpt_fixups(struct spi_nor *nor, conststruct sfdp_parameter_header *bfpt_header, conststruct sfdp_bfpt *bfpt)
{ /* * W25Q256JV supports 4B opcodes but W25Q256FV does not. * Unfortunately, Winbond has re-used the same JEDEC ID for both * variants which prevents us from defining a new entry in the parts * table. * To differentiate between W25Q256JV and W25Q256FV check SFDP header * version: only JV has JESD216A compliant structure (version 5).
*/ if (bfpt_header->major == SFDP_JESD216_MAJOR &&
bfpt_header->minor == SFDP_JESD216A_MINOR)
nor->flags |= SNOR_F_4B_OPCODES;
/** * winbond_nor_select_die() - Set active die. * @nor: pointer to 'struct spi_nor'. * @die: die to set active. * * Certain Winbond chips feature more than a single die. This is mostly hidden * to the user, except that some chips may experience time deviation when * modifying the status bits between dies, which in some corner cases may * produce problematic races. Being able to explicitly select a die to check its * state in this case may be useful. * * Return: 0 on success, -errno otherwise.
*/ staticint winbond_nor_select_die(struct spi_nor *nor, u8 die)
{ int ret;
nor->bouncebuf[0] = die;
if (nor->spimem) { struct spi_mem_op op = WINBOND_NOR_SELDIE_OP(nor->bouncebuf);
ret = spi_mem_exec_op(nor->spimem, &op);
} else {
ret = spi_nor_controller_ops_write_reg(nor,
WINBOND_NOR_OP_SELDIE,
nor->bouncebuf, 1);
}
if (ret)
dev_dbg(nor->dev, "error %d selecting die %d\n", ret, die);
return ret;
}
staticint winbond_nor_multi_die_ready(struct spi_nor *nor)
{ int ret, i;
for (i = 0; i < nor->params->n_dice; i++) {
ret = winbond_nor_select_die(nor, i); if (ret) return ret;
ret = spi_nor_sr_ready(nor); if (ret <= 0) return ret;
}
return 1;
}
staticint
winbond_nor_multi_die_post_sfdp_fixups(struct spi_nor *nor)
{ /* * SFDP supports dice numbers, but this information is only available in * optional additional tables which are not provided by these chips. * Dice number has an impact though, because these devices need extra * care when reading the busy bit.
*/
nor->params->n_dice = nor->params->size / SZ_64M;
nor->params->ready = winbond_nor_multi_die_ready;
ret = spi_mem_exec_op(nor->spimem, &op);
} else {
ret = spi_nor_controller_ops_write_reg(nor,
WINBOND_NOR_OP_WREAR,
nor->bouncebuf, 1);
}
if (ret)
dev_dbg(nor->dev, "error %d writing EAR\n", ret);
return ret;
}
/** * winbond_nor_set_4byte_addr_mode() - Set 4-byte address mode for Winbond * flashes. * @nor: pointer to 'struct spi_nor'. * @enable: true to enter the 4-byte address mode, false to exit the 4-byte * address mode. * * Return: 0 on success, -errno otherwise.
*/ staticint winbond_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
{ int ret;
ret = spi_nor_set_4byte_addr_mode_en4b_ex4b(nor, enable); if (ret || enable) return ret;
/* * On Winbond W25Q256FV, leaving 4byte mode causes the Extended Address * Register to be set to 1, so all 3-byte-address reads come from the * second 16M. We must clear the register to enable normal behavior.
*/
ret = spi_nor_write_enable(nor); if (ret) return ret;
ret = winbond_nor_write_ear(nor, 0); if (ret) return ret;
if (params->otp.org)
params->otp.ops = &winbond_nor_otp_ops;
/* * Winbond seems to require that the Extended Address Register to be set * to zero when exiting the 4-Byte Address Mode, at least for W25Q256FV. * This requirement is not described in the JESD216 SFDP standard, thus * it is Winbond specific. Since we do not know if other Winbond flashes * have the same requirement, play safe and overwrite the method parsed * from BFPT, if any.
*/
params->set_4byte_addr_mode = winbond_nor_set_4byte_addr_mode;
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.