Skip to content

Commit 8415f7f

Browse files
ananglcarlescufi
authored andcommitted
drivers: flash_mspi_nor: Omit quad_enable_set() when QER is set to NONE
When the quad-enable-requirements property is set to "NONE" or is not present, no Quad Enable operation should be performed. This fixes an issue with the mx25uw6345g flash chip that is present on the nRF54h20 DK and supports the Single I/O mode, but cannot be used in that mode. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 48bbbfe commit 8415f7f

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

drivers/flash/flash_mspi_nor.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,15 +567,20 @@ static int default_io_mode(const struct device *dev)
567567
enum mspi_io_mode io_mode = dev_config->mspi_nor_cfg.io_mode;
568568
int rc = 0;
569569

570-
/* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined in JEDEC216 BFP DW15 QER */
571-
if (io_mode == MSPI_IO_MODE_SINGLE) {
572-
rc = quad_enable_set(dev, false);
573-
} else if ((io_mode == MSPI_IO_MODE_QUAD_1_1_4) || (io_mode == MSPI_IO_MODE_QUAD_1_4_4)) {
574-
rc = quad_enable_set(dev, true);
575-
}
570+
if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE) {
571+
/* For Quad 1-1-4 and 1-4-4, entering or leaving mode is defined
572+
* in JEDEC216 BFP DW15 QER
573+
*/
574+
if (io_mode == MSPI_IO_MODE_SINGLE) {
575+
rc = quad_enable_set(dev, false);
576+
} else if (io_mode == MSPI_IO_MODE_QUAD_1_1_4 ||
577+
io_mode == MSPI_IO_MODE_QUAD_1_4_4) {
578+
rc = quad_enable_set(dev, true);
579+
}
576580

577-
if (rc < 0) {
578-
LOG_ERR("Failed to modify Quad Enable bit: %d", rc);
581+
if (rc < 0) {
582+
LOG_ERR("Failed to modify Quad Enable bit: %d", rc);
583+
}
579584
}
580585

581586
if ((dev_config->quirks != NULL) && (dev_config->quirks->post_switch_mode != NULL)) {
@@ -646,8 +651,10 @@ static int flash_chip_init(const struct device *dev)
646651
/* Some chips reuse RESET pin for data in Quad modes:
647652
* force single line mode before resetting.
648653
*/
649-
if ((io_mode == MSPI_IO_MODE_SINGLE) || (io_mode == MSPI_IO_MODE_QUAD_1_1_4) ||
650-
(io_mode == MSPI_IO_MODE_QUAD_1_4_4)) {
654+
if (dev_config->dw15_qer != JESD216_DW15_QER_VAL_NONE &&
655+
(io_mode == MSPI_IO_MODE_SINGLE ||
656+
io_mode == MSPI_IO_MODE_QUAD_1_1_4 ||
657+
io_mode == MSPI_IO_MODE_QUAD_1_4_4)) {
651658
rc = quad_enable_set(dev, false);
652659

653660
if (rc < 0) {

0 commit comments

Comments
 (0)