Lines Matching +full:user +full:- +full:otp
1 // SPDX-License-Identifier: GPL-2.0
7 #include <linux/mtd/spi-nor.h>
37 if (bfpt_header->major == SFDP_JESD216_MAJOR && in w25q128_post_bfpt_fixups()
38 bfpt_header->minor == SFDP_JESD216_MINOR && in w25q128_post_bfpt_fixups()
39 nor->params->size == SZ_2M && in w25q128_post_bfpt_fixups()
40 nor->params->erase_map.regions[0].size == SZ_2M) { in w25q128_post_bfpt_fixups()
41 nor->params->size = SZ_16M; in w25q128_post_bfpt_fixups()
42 nor->params->erase_map.regions[0].size = SZ_16M; in w25q128_post_bfpt_fixups()
59 * Unfortunately, Winbond has re-used the same JEDEC ID for both in w25q256_post_bfpt_fixups()
65 if (bfpt_header->major == SFDP_JESD216_MAJOR && in w25q256_post_bfpt_fixups()
66 bfpt_header->minor == SFDP_JESD216A_MINOR) in w25q256_post_bfpt_fixups()
67 nor->flags |= SNOR_F_4B_OPCODES; in w25q256_post_bfpt_fixups()
77 * winbond_nor_select_die() - Set active die.
82 * to the user, except that some chips may experience time deviation when
87 * Return: 0 on success, -errno otherwise.
93 nor->bouncebuf[0] = die; in winbond_nor_select_die()
95 if (nor->spimem) { in winbond_nor_select_die()
96 struct spi_mem_op op = WINBOND_NOR_SELDIE_OP(nor->bouncebuf); in winbond_nor_select_die()
98 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in winbond_nor_select_die()
100 ret = spi_mem_exec_op(nor->spimem, &op); in winbond_nor_select_die()
104 nor->bouncebuf, 1); in winbond_nor_select_die()
108 dev_dbg(nor->dev, "error %d selecting die %d\n", ret, die); in winbond_nor_select_die()
117 for (i = 0; i < nor->params->n_dice; i++) { in winbond_nor_multi_die_ready()
139 nor->params->n_dice = nor->params->size / SZ_64M; in winbond_nor_multi_die_post_sfdp_fixups()
140 nor->params->ready = winbond_nor_multi_die_ready; in winbond_nor_multi_die_post_sfdp_fixups()
260 .otp = SNOR_OTP(256, 3, 0x1000, 0x1000),
281 .otp = SNOR_OTP(256, 3, 0x1000, 0x1000),
284 .name = "w25q16jv-im/jm",
323 .otp = SNOR_OTP(256, 3, 0x1000, 0x1000),
345 .otp = SNOR_OTP(256, 3, 0x1000, 0x1000),
350 * winbond_nor_write_ear() - Write Extended Address Register.
354 * Return: 0 on success, -errno otherwise.
360 nor->bouncebuf[0] = ear; in winbond_nor_write_ear()
362 if (nor->spimem) { in winbond_nor_write_ear()
363 struct spi_mem_op op = WINBOND_NOR_WREAR_OP(nor->bouncebuf); in winbond_nor_write_ear()
365 spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); in winbond_nor_write_ear()
367 ret = spi_mem_exec_op(nor->spimem, &op); in winbond_nor_write_ear()
371 nor->bouncebuf, 1); in winbond_nor_write_ear()
375 dev_dbg(nor->dev, "error %d writing EAR\n", ret); in winbond_nor_write_ear()
381 * winbond_nor_set_4byte_addr_mode() - Set 4-byte address mode for Winbond
384 * @enable: true to enter the 4-byte address mode, false to exit the 4-byte
387 * Return: 0 on success, -errno otherwise.
399 * Register to be set to 1, so all 3-byte-address reads come from the in winbond_nor_set_4byte_addr_mode()
423 struct spi_nor_flash_parameter *params = nor->params; in winbond_nor_late_init()
425 if (params->otp.org) in winbond_nor_late_init()
426 params->otp.ops = &winbond_nor_otp_ops; in winbond_nor_late_init()
430 * to zero when exiting the 4-Byte Address Mode, at least for W25Q256FV. in winbond_nor_late_init()
436 params->set_4byte_addr_mode = winbond_nor_set_4byte_addr_mode; in winbond_nor_late_init()