Enable DDR quad mode for Macronix qspi chip mx25l51245g by setting Quad
bit in status register and enabling in dts file.
The LUT for SPINOR_OP_READ_1_4_4_D was initially designed for Spansion
qspi chip, so there is one cycle for "mode" after address and before
dummy. While Macronix qspi chip doesn't have this feature, so we just
take off one cycle in dts file to bypass this problem.
Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked and merge from commit
e03fdad1c7713a7db70112e00c4ae96848accd34)
#size-cells = <1>;
compatible = "macronix,mx25l51245g";
spi-max-frequency = <29000000>;
+ /* take off one dummy cycle */
+ spi-nor,ddr-quad-read-dummy = <5>;
reg = <0>;
};
};
return status;
}
return status;
+ case CFI_MFR_MACRONIX:
+ status = macronix_quad_enable(nor);
+ if (status) {
+ dev_err(nor->dev,
+ "Macronix DDR quad-read not enabled\n");
+ return status;
+ }
+ return status;
case CFI_MFR_ST: /* Micron, actually */
/* DTR quad read works with the Extended SPI protocol. */
return 0;
nor->read_opcode = SPINOR_OP_READ_1_4_4_D;
} else if (JEDEC_MFR(info) == CFI_MFR_ST) {
nor->read_opcode = SPINOR_OP_READ_1_1_4_D;
+ } else if (JEDEC_MFR(info) == CFI_MFR_MACRONIX) {
+ nor->read_opcode = SPINOR_OP_READ_1_4_4_D;
} else {
dev_err(dev, "DDR Quad Read is not supported.\n");
return -EINVAL;