All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: bcm283x: Enable DMA support for SPI controller
@ 2019-05-09 17:03 Lukas Wunner
  2019-05-09 17:25 ` Eric Anholt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lukas Wunner @ 2019-05-09 17:03 UTC (permalink / raw)
  To: Stefan Wahren, Eric Anholt, Florian Fainelli, Ray Jui, Scott Branden
  Cc: Nicolas Saenz Julienne, Martin Sperl, Noralf Tronnes,
	linux-rpi-kernel, Rob Herring, Mark Rutland,
	bcm-kernel-feedback-list, devicetree

Without this, the driver for the BCM2835 SPI controller uses interrupt
mode instead of DMA mode, incurring a significant performance penalty.
The Foundation's device tree has had these attributes for years, but for
some reason they were never upstreamed.

They were originally contributed by Noralf Trønnes and Martin Sperl:
https://github.com/raspberrypi/linux/commit/25f3e064afc8
https://github.com/raspberrypi/linux/commit/e0edb52b47e6

The DREQ numbers 6 and 7 are documented in section 4.2.1.3 of:
https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf

Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Martin Sperl <kernel@martin.sperl.org>
Cc: Noralf Trønnes <noralf@tronnes.org>
---
 arch/arm/boot/dts/bcm283x.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 9777644..4b21ddb 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -431,6 +431,8 @@
 			reg = <0x7e204000 0x1000>;
 			interrupts = <2 22>;
 			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			dmas = <&dma 6>, <&dma 7>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: bcm283x: Enable DMA support for SPI controller
  2019-05-09 17:03 [PATCH] ARM: bcm283x: Enable DMA support for SPI controller Lukas Wunner
@ 2019-05-09 17:25 ` Eric Anholt
  2019-05-09 18:08 ` kernel
  2019-05-25 11:06 ` Stefan Wahren
  2 siblings, 0 replies; 5+ messages in thread
From: Eric Anholt @ 2019-05-09 17:25 UTC (permalink / raw)
  To: Lukas Wunner, Stefan Wahren, Florian Fainelli, Ray Jui, Scott Branden
  Cc: Nicolas Saenz Julienne, Martin Sperl, Noralf Tronnes,
	linux-rpi-kernel, Rob Herring, Mark Rutland,
	bcm-kernel-feedback-list, devicetree

[-- Attachment #1: Type: text/plain, Size: 813 bytes --]

Lukas Wunner <lukas@wunner.de> writes:

> Without this, the driver for the BCM2835 SPI controller uses interrupt
> mode instead of DMA mode, incurring a significant performance penalty.
> The Foundation's device tree has had these attributes for years, but for
> some reason they were never upstreamed.
>
> They were originally contributed by Noralf Trønnes and Martin Sperl:
> https://github.com/raspberrypi/linux/commit/25f3e064afc8
> https://github.com/raspberrypi/linux/commit/e0edb52b47e6
>
> The DREQ numbers 6 and 7 are documented in section 4.2.1.3 of:
> https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
>
> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Reviewed-by: Eric Anholt <eric@anholt.net>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: bcm283x: Enable DMA support for SPI controller
  2019-05-09 17:03 [PATCH] ARM: bcm283x: Enable DMA support for SPI controller Lukas Wunner
  2019-05-09 17:25 ` Eric Anholt
@ 2019-05-09 18:08 ` kernel
  2019-05-11 18:00   ` Stefan Wahren
  2019-05-25 11:06 ` Stefan Wahren
  2 siblings, 1 reply; 5+ messages in thread
From: kernel @ 2019-05-09 18:08 UTC (permalink / raw)
  To: Lukas Wunner
  Cc: Stefan Wahren, Eric Anholt, Florian Fainelli, Ray Jui,
	Scott Branden, Nicolas Saenz Julienne, Noralf Tronnes,
	linux-rpi-kernel, Rob Herring, Mark Rutland,
	bcm-kernel-feedback-list, devicetree


> On 09.05.2019, at 19:03, Lukas Wunner <lukas@wunner.de> wrote:
> 
> Without this, the driver for the BCM2835 SPI controller uses interrupt
> mode instead of DMA mode, incurring a significant performance penalty.
> The Foundation's device tree has had these attributes for years, but for
> some reason they were never upstreamed.
> 
> They were originally contributed by Noralf Trønnes and Martin Sperl:
> https://github.com/raspberrypi/linux/commit/25f3e064afc8
> https://github.com/raspberrypi/linux/commit/e0edb52b47e6
I believe the the original patch that I had provided has been turned down
was because:
* we do not want to “consume” dma resources automatically
* to use spi correctly you have to apply several changes to the dt already 
  (think GPIO mode for CS and status=enable).

If this mindset has changed, then I am happy.

> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: Martin Sperl <kernel@martin.sperl.org>
> Cc: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Martin Sperl <kernel@martin.sperl.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: bcm283x: Enable DMA support for SPI controller
  2019-05-09 18:08 ` kernel
@ 2019-05-11 18:00   ` Stefan Wahren
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2019-05-11 18:00 UTC (permalink / raw)
  To: kernel, Lukas Wunner
  Cc: Eric Anholt, Florian Fainelli, Ray Jui, Scott Branden,
	Nicolas Saenz Julienne, Noralf Tronnes, linux-rpi-kernel,
	Rob Herring, Mark Rutland, bcm-kernel-feedback-list, devicetree

Hi,

Am 09.05.19 um 20:08 schrieb kernel@martin.sperl.org:
>> On 09.05.2019, at 19:03, Lukas Wunner <lukas@wunner.de> wrote:
>>
>> Without this, the driver for the BCM2835 SPI controller uses interrupt
>> mode instead of DMA mode, incurring a significant performance penalty.
>> The Foundation's device tree has had these attributes for years, but for
>> some reason they were never upstreamed.
>>
>> They were originally contributed by Noralf Trønnes and Martin Sperl:
>> https://github.com/raspberrypi/linux/commit/25f3e064afc8
>> https://github.com/raspberrypi/linux/commit/e0edb52b47e6
> I believe the the original patch that I had provided has been turned down
> was because:
> * we do not want to “consume” dma resources automatically
as long as we don't enable SPI per default, this shouldn't be a problem.
I remember that the downstream MMC driver "wasted" a DMA channel at the
beginning, so we were a little bit careful in the past.
> * to use spi correctly you have to apply several changes to the dt already 
>   (think GPIO mode for CS and status=enable).

This is something we can't provide, since the GPIO header should be
flexible as possible. But this has nothing to do with Lukas patch,
because i consider the patch as SoC related and common practice.

Yes, overlays are a big improvement to define a SPI bus here.

Thanks
Stefan

>
> If this mindset has changed, then I am happy.
>
>> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>> Signed-off-by: Lukas Wunner <lukas@wunner.de>
>> Cc: Martin Sperl <kernel@martin.sperl.org>
>> Cc: Noralf Trønnes <noralf@tronnes.org>
> Reviewed-by: Martin Sperl <kernel@martin.sperl.org>
>
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: bcm283x: Enable DMA support for SPI controller
  2019-05-09 17:03 [PATCH] ARM: bcm283x: Enable DMA support for SPI controller Lukas Wunner
  2019-05-09 17:25 ` Eric Anholt
  2019-05-09 18:08 ` kernel
@ 2019-05-25 11:06 ` Stefan Wahren
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2019-05-25 11:06 UTC (permalink / raw)
  To: Lukas Wunner, Eric Anholt, Florian Fainelli, Ray Jui, Scott Branden
  Cc: Nicolas Saenz Julienne, Martin Sperl, Noralf Tronnes,
	linux-rpi-kernel, Rob Herring, Mark Rutland,
	bcm-kernel-feedback-list, devicetree

Am 09.05.19 um 19:03 schrieb Lukas Wunner:
> Without this, the driver for the BCM2835 SPI controller uses interrupt
> mode instead of DMA mode, incurring a significant performance penalty.
> The Foundation's device tree has had these attributes for years, but for
> some reason they were never upstreamed.
>
> They were originally contributed by Noralf Trønnes and Martin Sperl:
> https://github.com/raspberrypi/linux/commit/25f3e064afc8
> https://github.com/raspberrypi/linux/commit/e0edb52b47e6
>
> The DREQ numbers 6 and 7 are documented in section 4.2.1.3 of:
> https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
>
> Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: Martin Sperl <kernel@martin.sperl.org>
> Cc: Noralf Trønnes <noralf@tronnes.org>
Applied to bcm2835-dt-next

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-25 11:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 17:03 [PATCH] ARM: bcm283x: Enable DMA support for SPI controller Lukas Wunner
2019-05-09 17:25 ` Eric Anholt
2019-05-09 18:08 ` kernel
2019-05-11 18:00   ` Stefan Wahren
2019-05-25 11:06 ` Stefan Wahren

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.