@@ -870,21 +870,22 @@ static int spi_nor_write_16bit_sr_and_check(struct spi_nor *nor, u8 sr1)
870
870
ret = spi_nor_read_cr (nor , & sr_cr [1 ]);
871
871
if (ret )
872
872
return ret ;
873
- } else if (nor -> params -> quad_enable ) {
873
+ } else if (spi_nor_get_protocol_width (nor -> read_proto ) == 4 &&
874
+ spi_nor_get_protocol_width (nor -> write_proto ) == 4 &&
875
+ nor -> params -> quad_enable ) {
874
876
/*
875
877
* If the Status Register 2 Read command (35h) is not
876
878
* supported, we should at least be sure we don't
877
879
* change the value of the SR2 Quad Enable bit.
878
880
*
879
- * We can safely assume that when the Quad Enable method is
880
- * set, the value of the QE bit is one, as a consequence of the
881
- * nor->params->quad_enable() call.
881
+ * When the Quad Enable method is set and the buswidth is 4, we
882
+ * can safely assume that the value of the QE bit is one, as a
883
+ * consequence of the nor->params->quad_enable() call.
882
884
*
883
- * We can safely assume that the Quad Enable bit is present in
884
- * the Status Register 2 at BIT(1). According to the JESD216
885
- * revB standard, BFPT DWORDS[15], bits 22:20, the 16-bit
886
- * Write Status (01h) command is available just for the cases
887
- * in which the QE bit is described in SR2 at BIT(1).
885
+ * According to the JESD216 revB standard, BFPT DWORDS[15],
886
+ * bits 22:20, the 16-bit Write Status (01h) command is
887
+ * available just for the cases in which the QE bit is
888
+ * described in SR2 at BIT(1).
888
889
*/
889
890
sr_cr [1 ] = SR2_QUAD_EN_BIT1 ;
890
891
} else {
0 commit comments