From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Piotr Bugalski <bugalski.piotr@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Cyrille Pitchen <cyrille.pitchen@microchip.com>,
Tudor Ambarus <tudor.ambarus@microchip.com>
Subject: Re: [PATCH v3 0/6] New QuadSPI driver for Atmel SAMA5D2
Date: Mon, 5 Nov 2018 12:02:19 +0100 [thread overview]
Message-ID: <20181105120219.03ab3b4c@bbrezillon> (raw)
In-Reply-To: <20181105103625.9644-1-bugalski.piotr@gmail.com>
Hi Piotr,
On Mon, 5 Nov 2018 11:36:19 +0100
Piotr Bugalski <bugalski.piotr@gmail.com> wrote:
> Hello,
>
> Atmel SAMA5D2 is equipped with two QSPI interfaces. These interfaces can
> work as in SPI-compatible mode or use two / four lines to improve
> communication speed. At the moment there is QSPI driver strongly tied to
> NOR-flash memory and MTD subsystem.
> Intention of this change is to provide new driver which will not be tied
> to MTD and allows using QSPI with NAND-flash memory or other peripherals
> New spi-mem API provides abstraction layer which can disconnect QSPI
> from MTD. This driver doesn't support regular SPI interface, it should
> be used with spi-mem interface only.
> Unfortunately SAMA5D2 hardware by default supports only NOR-flash
> memory. It allows 24- and 32-bit addressing while NAND-flash requires
> 16-bit long. To workaround hardware limitation driver is a bit more
> complicated.
>
> Request to spi-mem contains three fiels: opcode (command), address,
> dummy bytes. SAMA5D2 QSPI hardware supports opcode, address, dummy and
> option byte where address field can only be 24- or 32- bytes long.
> Handling 8-bits long addresses is done using option field. For 16-bits
> address behaviour depends of number of requested dummy bits. If there
> are 8 or more dummy cycles, address is shifted and sent with first dummy
> byte. Otherwise opcode is disabled and first byte of address contains
> command opcode (works only if opcode and address use the same buswidth).
> The limitation is when 16-bit address is used without enough dummy
> cycles and opcode is using different buswidth than address. Other modes
> are supported with described workaround.
>
> It looks like hardware has some limitation in performance. The same issue
> exists in current QSPI driver (MTD/nor-flash) and soft-pack (bare-metal
> library from Atmel). Without using DMA read speed is much worse than
> maximum bandwidth (efficiency 30-40%). Any help with performance
> improvement is highly welcome, especially for NAND-flash memories which
> offers higher capacity than NOR-flash used with previous driver.
I think you can try to implement the dirmap interface proposed here [1]
and use DMA+TRSFR_READ/WRITE_MEMORY for such direct mappings. This
should optimize path where we really matter about perfs.
>
> Best Regards,
> Piotr
>
> v3 changes:
> - add get_name implementation
> - email address fix
>
> v2 changes:
> - driver is now replacement of existing atmel-quadspi
> - code was re-written to follow original code structure
> - deinitialization order fixed
> - empty atmel_qspi_adjust_op_size function removed
> - code formatting fixes
> - use spi_device->max_speed_hz to get spi speed
> - spi freqency set in spi_controller->setup() hook
> - address range checkng for 4-bytes addressing
> - use timeout to avoid infinite waiting
>
> Piotr Bugalski (6):
> mtd: spi-nor: atmel-quaspi: Typo fix
> mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi
> mtd: spi-nor: atmel-quadspi: Use spi-mem interface for atmel-quadspi
> driver
> mtd: spi-nor: atmel-quadspi: Remove unused code from atmel-quadspi
> driver
> spi: Add QuadSPI driver for Atmel SAMA5D2
> dt-bindings: spi: QuadSPI driver for Atmel SAMA5D2
The patch series is
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Mark, if you're okay with the new implementation, would you mind taking
those patches in the spi tree?
Thanks,
Boris
[1]http://patchwork.ozlabs.org/project/linux-mtd/list/?series=73235
WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@bootlin.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/6] New QuadSPI driver for Atmel SAMA5D2
Date: Mon, 5 Nov 2018 12:02:19 +0100 [thread overview]
Message-ID: <20181105120219.03ab3b4c@bbrezillon> (raw)
In-Reply-To: <20181105103625.9644-1-bugalski.piotr@gmail.com>
Hi Piotr,
On Mon, 5 Nov 2018 11:36:19 +0100
Piotr Bugalski <bugalski.piotr@gmail.com> wrote:
> Hello,
>
> Atmel SAMA5D2 is equipped with two QSPI interfaces. These interfaces can
> work as in SPI-compatible mode or use two / four lines to improve
> communication speed. At the moment there is QSPI driver strongly tied to
> NOR-flash memory and MTD subsystem.
> Intention of this change is to provide new driver which will not be tied
> to MTD and allows using QSPI with NAND-flash memory or other peripherals
> New spi-mem API provides abstraction layer which can disconnect QSPI
> from MTD. This driver doesn't support regular SPI interface, it should
> be used with spi-mem interface only.
> Unfortunately SAMA5D2 hardware by default supports only NOR-flash
> memory. It allows 24- and 32-bit addressing while NAND-flash requires
> 16-bit long. To workaround hardware limitation driver is a bit more
> complicated.
>
> Request to spi-mem contains three fiels: opcode (command), address,
> dummy bytes. SAMA5D2 QSPI hardware supports opcode, address, dummy and
> option byte where address field can only be 24- or 32- bytes long.
> Handling 8-bits long addresses is done using option field. For 16-bits
> address behaviour depends of number of requested dummy bits. If there
> are 8 or more dummy cycles, address is shifted and sent with first dummy
> byte. Otherwise opcode is disabled and first byte of address contains
> command opcode (works only if opcode and address use the same buswidth).
> The limitation is when 16-bit address is used without enough dummy
> cycles and opcode is using different buswidth than address. Other modes
> are supported with described workaround.
>
> It looks like hardware has some limitation in performance. The same issue
> exists in current QSPI driver (MTD/nor-flash) and soft-pack (bare-metal
> library from Atmel). Without using DMA read speed is much worse than
> maximum bandwidth (efficiency 30-40%). Any help with performance
> improvement is highly welcome, especially for NAND-flash memories which
> offers higher capacity than NOR-flash used with previous driver.
I think you can try to implement the dirmap interface proposed here [1]
and use DMA+TRSFR_READ/WRITE_MEMORY for such direct mappings. This
should optimize path where we really matter about perfs.
>
> Best Regards,
> Piotr
>
> v3 changes:
> - add get_name implementation
> - email address fix
>
> v2 changes:
> - driver is now replacement of existing atmel-quadspi
> - code was re-written to follow original code structure
> - deinitialization order fixed
> - empty atmel_qspi_adjust_op_size function removed
> - code formatting fixes
> - use spi_device->max_speed_hz to get spi speed
> - spi freqency set in spi_controller->setup() hook
> - address range checkng for 4-bytes addressing
> - use timeout to avoid infinite waiting
>
> Piotr Bugalski (6):
> mtd: spi-nor: atmel-quaspi: Typo fix
> mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi
> mtd: spi-nor: atmel-quadspi: Use spi-mem interface for atmel-quadspi
> driver
> mtd: spi-nor: atmel-quadspi: Remove unused code from atmel-quadspi
> driver
> spi: Add QuadSPI driver for Atmel SAMA5D2
> dt-bindings: spi: QuadSPI driver for Atmel SAMA5D2
The patch series is
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Mark, if you're okay with the new implementation, would you mind taking
those patches in the spi tree?
Thanks,
Boris
[1]http://patchwork.ozlabs.org/project/linux-mtd/list/?series=73235
next prev parent reply other threads:[~2018-11-05 11:02 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 10:36 [PATCH v3 0/6] New QuadSPI driver for Atmel SAMA5D2 Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-05 10:36 ` [PATCH v3 1/6] mtd: spi-nor: atmel-quaspi: Typo fix Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-05 10:36 ` [PATCH v3 2/6] mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-07 15:05 ` Applied "mtd: spi-nor: atmel-quadspi: Add spi-mem support to atmel-quadspi" to the spi tree Mark Brown
2018-11-07 15:05 ` Mark Brown
2018-11-07 15:05 ` Mark Brown
2018-11-07 15:05 ` Mark Brown
2018-11-05 10:36 ` [PATCH v3 3/6] mtd: spi-nor: atmel-quadspi: Use spi-mem interface for atmel-quadspi driver Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-05 10:36 ` [PATCH v3 4/6] mtd: spi-nor: atmel-quadspi: Remove unused code from " Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-07 15:03 ` Applied "mtd: spi-nor: atmel-quadspi: Remove unused code from atmel-quadspi driver" to the spi tree Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-05 10:36 ` [PATCH v3 5/6] spi: Add QuadSPI driver for Atmel SAMA5D2 Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-07 15:03 ` Applied "spi: Add QuadSPI driver for Atmel SAMA5D2" to the spi tree Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-07 15:03 ` Mark Brown
2018-11-07 15:18 ` Mark Brown
2018-11-07 15:18 ` Mark Brown
2018-11-08 8:50 ` Boris Brezillon
2018-11-08 8:50 ` Boris Brezillon
2018-11-08 12:07 ` Mark Brown
2018-11-08 12:07 ` Mark Brown
2018-11-05 10:36 ` [PATCH v3 6/6] dt-bindings: spi: QuadSPI driver for Atmel SAMA5D2 Piotr Bugalski
2018-11-05 10:36 ` Piotr Bugalski
2018-11-05 21:21 ` Rob Herring
2018-11-05 21:21 ` Rob Herring
2018-11-05 21:21 ` Rob Herring
2018-11-05 11:02 ` Boris Brezillon [this message]
2018-11-05 11:02 ` [PATCH v3 0/6] New " Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181105120219.03ab3b4c@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=broonie@kernel.org \
--cc=bugalski.piotr@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=mark.rutland@arm.com \
--cc=nicolas.ferre@microchip.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=tudor.ambarus@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.