mbox series

[0/3] spi: spi-mtk-nor: make use of full capability of program mode

Message ID 20200924152730.733243-1-gch981213@gmail.com
Headers show
Series spi: spi-mtk-nor: make use of full capability of program mode | expand

Message

Chuanhong Guo Sept. 24, 2020, 3:27 p.m. UTC
"program" mode on this controller can trigger up to 56 bits of data
shifting. During the operation, data in PRGDATA[0-5] will be
shifted out from MOSI, and data from MISO will be continuously filling
SHREG[0-9].
Currently this mode is used to implement transfer_one_message for 6-byte
full-duplex transfer, but it can execute a transfer for up-to 7 bytes
as long as the last byte is read only.
transfer_one_message is expected to perform full-duplex transfer,
instead of transfer with specific format. mtk_nor_spi_mem_prg is
added here to use this extra byte.

Newer version of this controller can trigger longer data shifting with
shift bytes more than PRGDATA_MAX + SHREG_MAX. This patch is implemented
with that in mind and it checks against both SHREG_MAX and PRG_CNT_MAX
for future support of new controllers.

Patch 3/3 is a fix for:
commit a59b2c7c56bf7 ("spi: spi-mtk-nor: support standard spi properties")
which breaks supports_op logic. But it can't be separated as it depends
on patch 2/3. Fortuantely the broken commit isn't in stable yet.

Chuanhong Guo (3):
  spi: spi-mtk-nor: make use of full capability of prg mode
  spi: spi-mtk-nor: add helper for checking prg mode ops
  spi: spi-mtk-nor: fix op checks in supports_op

 drivers/spi/spi-mtk-nor.c | 179 +++++++++++++++++++++++++++++++++-----
 1 file changed, 158 insertions(+), 21 deletions(-)

Comments

Mark Brown Oct. 1, 2020, 10:47 p.m. UTC | #1
On Thu, 24 Sep 2020 23:27:27 +0800, Chuanhong Guo wrote:
> "program" mode on this controller can trigger up to 56 bits of data

> shifting. During the operation, data in PRGDATA[0-5] will be

> shifted out from MOSI, and data from MISO will be continuously filling

> SHREG[0-9].

> Currently this mode is used to implement transfer_one_message for 6-byte

> full-duplex transfer, but it can execute a transfer for up-to 7 bytes

> as long as the last byte is read only.

> transfer_one_message is expected to perform full-duplex transfer,

> instead of transfer with specific format. mtk_nor_spi_mem_prg is

> added here to use this extra byte.

> 

> [...]


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: spi-mtk-nor: make use of full capability of prg mode
      commit: e7edd2cf4c7d06c6ef3e2030f66eeefa5150f0ff
[2/3] spi: spi-mtk-nor: add helper for checking prg mode ops
      commit: fd806575921ab78c8f0ee7f4dd3d4bb7c16206c8
[3/3] spi: spi-mtk-nor: fix op checks in supports_op
      commit: 81f13f2116cd93910d958c58052ef7dc22f1e577

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark