@@ -926,6 +926,8 @@ static int micron_quad_enable(struct spi_flash *flash)
static int set_quad_mode(struct spi_flash *flash, u8 idcode0) {
+ struct spi_slave *spi = flash->spi;
+
switch (idcode0) {
#ifdef CONFIG_SPI_FLASH_MACRONIX
case SPI_FLASH_CFI_MFR_MACRONIX:
@@ -938,7 +940,16 @@ static int set_quad_mode(struct spi_flash *flash, u8 idcode0) #endif #ifdef CONFIG_SPI_FLASH_STMICRO
case SPI_FLASH_CFI_MFR_STMICRO:
- return micron_quad_enable(flash);
+ /*
+ * Set quad enable for micron only
+ * if controller supports sending of
+ * all commands on quad lines, otherwise
+ * dont enable it
+ */
+ if (spi->no_all_quad)
+ return 0;
+ else
+ return micron_quad_enable(flash);
#endif
default:
printf("SF: Need set QEB func for %02x flash\n", idcode0); diff --git a/include/spi.h b/include/spi.h index 4b88d39..17c6e4d 100644
@@ -117,7 +117,7 @@ struct spi_slave {
unsigned int max_write_size;
void *memory_map;
u8 option;
-
+ u8 no_all_quad;
u8 flags;
#define SPI_XFER_BEGIN BIT(0) /* Assert CS before transfer */
#define SPI_XFER_END BIT(1) /* Deassert CS after transfer */