#define CMD_ERASE_4K 0x20
#define CMD_ERASE_CHIP 0xc7
#define CMD_ERASE_64K 0xd8
+#define CMD_ERASE_64K_4B 0xdc
/* Write commands */
#define CMD_WRITE_STATUS 0x01
#define CMD_PAGE_PROGRAM 0x02
+#define CMD_PAGE_PROGRAM_4B 0x12
#define CMD_WRITE_DISABLE 0x04
#define CMD_WRITE_ENABLE 0x06
#define CMD_QUAD_PAGE_PROGRAM 0x32
#define CMD_READ_QUAD_OUTPUT_FAST 0x6b
#define CMD_READ_QUAD_IO_FAST 0xeb
#define CMD_READ_OCTAL_OUTPUT_FAST 0x8B
+#define CMD_READ_OCTAL_OUTPUT_FAST_4B 0x7C
#define CMD_READ_ID 0x9f
#define CMD_READ_STATUS 0x05
#define CMD_READ_STATUS1 0x35
flash->write_cmd = CMD_PAGE_PROGRAM;
}
+ if (spi->mode & SPI_RX_OCTAL && info->flags & RD_OCTAL &&
+ flash->spi->bytemode) {
+ flash->read_cmd = CMD_READ_OCTAL_OUTPUT_FAST_4B;
+ flash->write_cmd = CMD_PAGE_PROGRAM_4B;
+ flash->erase_cmd = CMD_ERASE_64K_4B;
+ }
/* Set the quad enable bit - only for quad commands */
if ((flash->read_cmd == CMD_READ_QUAD_OUTPUT_FAST) ||
return 0;
}
+static int cadence_spi_child_pre_probe(struct udevice *bus)
+{
+ struct spi_slave *slave = dev_get_parent_priv(bus);
+
+ slave->bytemode = SPI_4BYTE_MODE;
+
+ return 0;
+}
+
static int cadence_spi_probe(struct udevice *bus)
{
struct cadence_spi_platdata *plat = bus->platdata;
.platdata_auto_alloc_size = sizeof(struct cadence_spi_platdata),
.priv_auto_alloc_size = sizeof(struct cadence_spi_priv),
.probe = cadence_spi_probe,
+ .child_pre_probe = cadence_spi_child_pre_probe,
};