Skip to content

Commit 8b1bd67

Browse files
committed
[nrf fromtree] drivers: flash_mspi_nor: Remove undesirable initial Quad disabling
Using a GPIO reset for a flash chip that has a dual function pin (RESET# or SIO3) and is to be used in Quad mode is rather a bad idea and so is clearing of the Quad Enable bit at every initialization of the flash driver, since this bit is usually non-volatile, so such operation means unnecessary wearing of the flash chip. Soft Reset should be use instead in such case. Signed-off-by: Andrzej Głąbek <[email protected]> (cherry picked from commit c2b537f)
1 parent bdd7c43 commit 8b1bd67

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

drivers/flash/flash_mspi_nor.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ static int flash_chip_init(const struct device *dev)
962962
{
963963
const struct flash_mspi_nor_config *dev_config = dev->config;
964964
struct flash_mspi_nor_data *dev_data = dev->data;
965-
enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode;
966965
uint8_t id[JESD216_READ_ID_LEN] = {0};
967966
uint16_t dts_cmd = 0;
968967
uint32_t sfdp_signature;
@@ -978,28 +977,6 @@ static int flash_chip_init(const struct device *dev)
978977

979978
dev_data->in_target_io_mode = false;
980979

981-
/* Some chips reuse RESET pin for data in Quad modes:
982-
* force single line mode before resetting.
983-
*/
984-
if (dev_data->switch_info.quad_enable_req != JESD216_DW15_QER_VAL_NONE &&
985-
(io_mode == MSPI_IO_MODE_SINGLE ||
986-
io_mode == MSPI_IO_MODE_QUAD_1_1_4 ||
987-
io_mode == MSPI_IO_MODE_QUAD_1_4_4)) {
988-
rc = quad_enable_set(dev, false);
989-
990-
if (rc < 0) {
991-
LOG_ERR("Failed to switch to single line mode: %d", rc);
992-
return rc;
993-
}
994-
995-
rc = wait_until_ready(dev, K_USEC(1));
996-
997-
if (rc < 0) {
998-
LOG_ERR("Failed waiting for device after switch to single line: %d", rc);
999-
return rc;
1000-
}
1001-
}
1002-
1003980
#if defined(WITH_RESET_GPIO)
1004981
rc = gpio_reset(dev);
1005982

0 commit comments

Comments
 (0)