@@ -2210,7 +2210,12 @@ static int spi_nor_default_setup(struct spi_nor *nor,
static int spi_nor_set_addr_width(struct spi_nor *nor)
{
if (nor->addr_width) {
- /* already configured from SFDP */
+ /*
+ * Already configured from SFDP. Use an address width of 4 in
+ * case the device has 4byte opcodes.
+ */
+ if (nor->addr_width == 3 && nor->flags & SNOR_F_HAS_4BAIT)
+ nor->addr_width = 4;
} else if (nor->read_proto == SNOR_PROTO_8_8_8_DTR) {
/*
* In 8D-8D-8D mode, one byte takes half a cycle to transfer. So
@@ -1211,7 +1211,6 @@ static int spi_nor_parse_4bait(struct spi_nor *nor,
* Spansion memory. However this quirk is no longer needed with new
* SFDP compliant memories.
*/
- nor->addr_width = 4;
nor->flags |= SNOR_F_4B_OPCODES | SNOR_F_HAS_4BAIT;
/* fall through */