From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pratyush Yadav Subject: [PATCH v2 00/11] mtd: spi-nor: add xSPI Octal DTR support Date: Wed, 26 Feb 2020 15:06:52 +0530 Message-ID: <20200226093703.19765-1-p.yadav@ti.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Cc: Pratyush Yadav , , , , , Sekhar Nori To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mark Brown , Rob Herring , Mark Rutland Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-spi.vger.kernel.org Hi, This series adds support for octal DTR flashes in the spi-nor framework, and then adds hooks for the Cypress Semper flash which is an xSPI compliant Octal DTR flash. The Cadence QSPI controller driver is also updated to run in Octal DTR mode. Tested on TI J721e EVM with 1-bit ECC on the Cypress flash. This series depends on [0]. v1 can be found at [1]. [0] https://patchwork.kernel.org/patch/11355593/ [1] https://lore.kernel.org/linux-mtd/20200211133348.15558-1-p.yadav@ti.com/ Changes in v2: - Add DT properties "spi-rx-dtr" and "spi-tx-dtr" to allow expressing DTR capabilities. - Set the mode bits SPI_RX_DTR and SPI_TX_DTR when we discover the DT properties "spi-rx-dtr" and spi-tx-dtr". - spi_nor_cypress_octal_enable() was updating nor->params.read[] with the intention of setting the correct number of dummy cycles. But this function is called _after_ selecting the read so setting nor->params.read[] will have no effect. So, update nor->read_dummy directly. - Fix spi_nor_spimem_check_readop() and spi_nor_spimem_check_pp() passing nor->read_proto and nor->write_proto to spi_nor_spimem_setup_op() instead of read->proto and pp->proto respectively. - Move the call to cqspi_setup_opcode_ext() inside cqspi_enable_dtr(). This avoids repeating the 'if (f_pdata->is_dtr) cqspi_setup_opcode_ext()...` snippet multiple times. - Call the default 'supports_op()' from cqspi_supports_mem_op(). This makes sure the buswidth requirements are also enforced along with the DTR requirements. - Drop the 'is_dtr' argument from spi_check_dtr_req(). We only call it when a phase is DTR so it is redundant. Pratyush Yadav (11): dt-bindings: spi: allow expressing DTR capability spi: set mode bits for "spi-rx-dtr" and "spi-tx-dtr" spi: spi-mem: allow specifying whether an op is DTR or not spi: spi-mem: allow specifying a command's extension spi: cadence-quadspi: Add support for octal DTR flashes mtd: spi-nor: add support for DTR protocol mtd: spi-nor: get command opcode extension type from BFPT mtd: spi-nor: parse xSPI Profile 1.0 table mtd: spi-nor: use dummy cycle and address width info from SFDP mtd: spi-nor: enable octal DTR mode when possible mtd: spi-nor: add support for Cypress Semper flash .../bindings/spi/spi-controller.yaml | 10 + drivers/mtd/spi-nor/spi-nor.c | 594 ++++++++++++++++-- drivers/spi/spi-cadence-quadspi.c | 247 +++++++- drivers/spi/spi-mem.c | 46 ++ drivers/spi/spi.c | 10 +- include/linux/mtd/spi-nor.h | 55 +- include/linux/spi/spi-mem.h | 32 + include/linux/spi/spi.h | 2 + 8 files changed, 891 insertions(+), 105 deletions(-) -- 2.25.0