All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Vinod Koul <vinod.koul@intel.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Mark Brown <broonie@kernel.org>
Cc: Doug Anderson <dianders@chromium.org>,
	Olof Johansson <olofj@google.com>,
	Sonny Rao <sonnyrao@chromium.org>,
	Addy Ke <addy.ke@rock-chips.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org,
	linux-spi@vger.kernel.org, Shawn Lin <shawn.lin@rock-chips.com>
Subject: [PATCH v3 0/9] Fix broken DMAFLUSHP on Rockchips platform
Date: Tue,  1 Sep 2015 17:56:21 +0800	[thread overview]
Message-ID: <1441101381-1329-1-git-send-email-shawn.lin@rock-chips.com> (raw)


The purpose of the DMAFLUSHP instruction:
- Tell the peripheral to clear its status and control registers.
- Send a message to the peripheral to resend its level status.

There are 3 timings described in PL330 Technical Reference Manual:
- Timing 1: Burst request, can work well without DMAFLUSHP.
- Timing 2: Single and burst request, DMAC will ignore the single
	    transfer request. This timing happens if there are single
	    and burst request.
- Timing 3: Single transfers for a burst request, DMAC should signals
	    datype to request the peripheral to flush the contents of
	    any control registers. This timing happens if there is
	    not enough MFIFO to places the burst data.

A peripheral may signal a DMA request during the execution of
DMAFLUSHP instruction, that cause DMA request being ignored by DMAC.

But DMAC and all peripherals on RK3X SoCs DO NOT support DMAFLUSHP.
It can't send a message to the peripheral to resend DMA request,
and the peripheral can't acknowledge a flush request from DMAC.
So all DMA requests should NOT be ignored by DMAC, and DMAC will not
notify the peripheral to flush.

To fix this problem, we need:
- Do NOT execute DMAFLUSHP instruction.
- Timing 2 and timing 3 should not happen.

Because on RK3X SoCs, there are 6 or below  channels and 32 MFIFO depth
for DMAC_BUS, and 8 channels and 64 MFIFO depth for DMAC_PERI, it is
impossible to hit the timing 3 if burst length is equal or less than 4.

Since the request type signal by the peripheral can only be set by
software. We can set Rockchip Soc's GRF_PERIDMAC_CON0[2:1] to select single
or burst request, if it is set b01,  all of the peripharals will signal a brust
request. So the timing 2 will not happen, too.

So DMAC on RK3X can support single or burst transfer, but can't support
mixed transfer.

Because burst transfer is more efficient than single transfer, this is
confirmed by our ASIC team, who strongly suggest to use burst transfer.
And this is confirmed by Addy's test on RK3288-Pink2 board, the speed of
spi flash burst transfer will increase about two times than single transfer.
Also, I have tested dw_mmc with pl330 on RK3188 platform to double confirm
the result. That means burst transfer is reansonable.

So we need a quirk not to execute DMAFLUSHP instruction and to use burst
transfer.

Note:
- The Rockchip Soc default value of GRF_PERIDMAC_CON0[2:1] is b01. To
  support brust transfer, these bits should not be changed in bootloader.


Changes in v3:
- add more rockchip drivers' changes in this patchset
- add Reviewed-by: Sonny Rao <sonnyrao@chromium.org>

Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson <dianders@chromium.org> for
  rk3288.dtsi patch and arm-pl330.txt patch
- amend Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- add From original author.
- remove Sunny's tag

Addy Ke (3):
  DMA: pl330: add quirk for broken no flushp
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform
  spi: rockchip: modify DMA max burst to 1

Boojin Kim (1):
  DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit

Shawn Lin (4):
  Documentation: arm-pl330: add description of
    arm,pl330-broken-no-flushp
  Documentation: spi-rockchip: add description of
    rockchip,spi-broken-burst-len
  Documentation: rockchip-i2s: add description of
    rockchip,i2s-broken-burst-len
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform

Yiwei Cai (1):
  ASoC: rockchip_i2s: modify DMA max burst to 1

 .../devicetree/bindings/dma/arm-pl330.txt          |   1 +
 .../devicetree/bindings/sound/rockchip-i2s.txt     |   4 +
 .../devicetree/bindings/spi/spi-rockchip.txt       |   3 +-
 arch/arm/boot/dts/rk3288.dtsi                      |   7 ++
 arch/arm/boot/dts/rk3xxx.dtsi                      |   5 +
 drivers/dma/pl330.c                                | 101 +++++++++++++++------
 drivers/spi/spi-rockchip.c                         |  16 +++-
 sound/soc/rockchip/rockchip_i2s.c                  |  10 +-
 8 files changed, 113 insertions(+), 34 deletions(-)

-- 
2.3.7



WARNING: multiple messages have this Message-ID (diff)
From: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
	Takashi Iwai <tiwai-IBi9RG/b67k@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Olof Johansson <olofj-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Sonny Rao <sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Addy Ke <addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Subject: [PATCH v3 0/9] Fix broken DMAFLUSHP on Rockchips platform
Date: Tue,  1 Sep 2015 17:56:21 +0800	[thread overview]
Message-ID: <1441101381-1329-1-git-send-email-shawn.lin@rock-chips.com> (raw)


The purpose of the DMAFLUSHP instruction:
- Tell the peripheral to clear its status and control registers.
- Send a message to the peripheral to resend its level status.

There are 3 timings described in PL330 Technical Reference Manual:
- Timing 1: Burst request, can work well without DMAFLUSHP.
- Timing 2: Single and burst request, DMAC will ignore the single
	    transfer request. This timing happens if there are single
	    and burst request.
- Timing 3: Single transfers for a burst request, DMAC should signals
	    datype to request the peripheral to flush the contents of
	    any control registers. This timing happens if there is
	    not enough MFIFO to places the burst data.

A peripheral may signal a DMA request during the execution of
DMAFLUSHP instruction, that cause DMA request being ignored by DMAC.

But DMAC and all peripherals on RK3X SoCs DO NOT support DMAFLUSHP.
It can't send a message to the peripheral to resend DMA request,
and the peripheral can't acknowledge a flush request from DMAC.
So all DMA requests should NOT be ignored by DMAC, and DMAC will not
notify the peripheral to flush.

To fix this problem, we need:
- Do NOT execute DMAFLUSHP instruction.
- Timing 2 and timing 3 should not happen.

Because on RK3X SoCs, there are 6 or below  channels and 32 MFIFO depth
for DMAC_BUS, and 8 channels and 64 MFIFO depth for DMAC_PERI, it is
impossible to hit the timing 3 if burst length is equal or less than 4.

Since the request type signal by the peripheral can only be set by
software. We can set Rockchip Soc's GRF_PERIDMAC_CON0[2:1] to select single
or burst request, if it is set b01,  all of the peripharals will signal a brust
request. So the timing 2 will not happen, too.

So DMAC on RK3X can support single or burst transfer, but can't support
mixed transfer.

Because burst transfer is more efficient than single transfer, this is
confirmed by our ASIC team, who strongly suggest to use burst transfer.
And this is confirmed by Addy's test on RK3288-Pink2 board, the speed of
spi flash burst transfer will increase about two times than single transfer.
Also, I have tested dw_mmc with pl330 on RK3188 platform to double confirm
the result. That means burst transfer is reansonable.

So we need a quirk not to execute DMAFLUSHP instruction and to use burst
transfer.

Note:
- The Rockchip Soc default value of GRF_PERIDMAC_CON0[2:1] is b01. To
  support brust transfer, these bits should not be changed in bootloader.


Changes in v3:
- add more rockchip drivers' changes in this patchset
- add Reviewed-by: Sonny Rao <sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> for
  rk3288.dtsi patch and arm-pl330.txt patch
- amend Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- add From original author.
- remove Sunny's tag

Addy Ke (3):
  DMA: pl330: add quirk for broken no flushp
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform
  spi: rockchip: modify DMA max burst to 1

Boojin Kim (1):
  DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit

Shawn Lin (4):
  Documentation: arm-pl330: add description of
    arm,pl330-broken-no-flushp
  Documentation: spi-rockchip: add description of
    rockchip,spi-broken-burst-len
  Documentation: rockchip-i2s: add description of
    rockchip,i2s-broken-burst-len
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform

Yiwei Cai (1):
  ASoC: rockchip_i2s: modify DMA max burst to 1

 .../devicetree/bindings/dma/arm-pl330.txt          |   1 +
 .../devicetree/bindings/sound/rockchip-i2s.txt     |   4 +
 .../devicetree/bindings/spi/spi-rockchip.txt       |   3 +-
 arch/arm/boot/dts/rk3288.dtsi                      |   7 ++
 arch/arm/boot/dts/rk3xxx.dtsi                      |   5 +
 drivers/dma/pl330.c                                | 101 +++++++++++++++------
 drivers/spi/spi-rockchip.c                         |  16 +++-
 sound/soc/rockchip/rockchip_i2s.c                  |  10 +-
 8 files changed, 113 insertions(+), 34 deletions(-)

-- 
2.3.7


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: shawn.lin@rock-chips.com (Shawn Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/9] Fix broken DMAFLUSHP on Rockchips platform
Date: Tue,  1 Sep 2015 17:56:21 +0800	[thread overview]
Message-ID: <1441101381-1329-1-git-send-email-shawn.lin@rock-chips.com> (raw)


The purpose of the DMAFLUSHP instruction:
- Tell the peripheral to clear its status and control registers.
- Send a message to the peripheral to resend its level status.

There are 3 timings described in PL330 Technical Reference Manual:
- Timing 1: Burst request, can work well without DMAFLUSHP.
- Timing 2: Single and burst request, DMAC will ignore the single
	    transfer request. This timing happens if there are single
	    and burst request.
- Timing 3: Single transfers for a burst request, DMAC should signals
	    datype to request the peripheral to flush the contents of
	    any control registers. This timing happens if there is
	    not enough MFIFO to places the burst data.

A peripheral may signal a DMA request during the execution of
DMAFLUSHP instruction, that cause DMA request being ignored by DMAC.

But DMAC and all peripherals on RK3X SoCs DO NOT support DMAFLUSHP.
It can't send a message to the peripheral to resend DMA request,
and the peripheral can't acknowledge a flush request from DMAC.
So all DMA requests should NOT be ignored by DMAC, and DMAC will not
notify the peripheral to flush.

To fix this problem, we need:
- Do NOT execute DMAFLUSHP instruction.
- Timing 2 and timing 3 should not happen.

Because on RK3X SoCs, there are 6 or below  channels and 32 MFIFO depth
for DMAC_BUS, and 8 channels and 64 MFIFO depth for DMAC_PERI, it is
impossible to hit the timing 3 if burst length is equal or less than 4.

Since the request type signal by the peripheral can only be set by
software. We can set Rockchip Soc's GRF_PERIDMAC_CON0[2:1] to select single
or burst request, if it is set b01,  all of the peripharals will signal a brust
request. So the timing 2 will not happen, too.

So DMAC on RK3X can support single or burst transfer, but can't support
mixed transfer.

Because burst transfer is more efficient than single transfer, this is
confirmed by our ASIC team, who strongly suggest to use burst transfer.
And this is confirmed by Addy's test on RK3288-Pink2 board, the speed of
spi flash burst transfer will increase about two times than single transfer.
Also, I have tested dw_mmc with pl330 on RK3188 platform to double confirm
the result. That means burst transfer is reansonable.

So we need a quirk not to execute DMAFLUSHP instruction and to use burst
transfer.

Note:
- The Rockchip Soc default value of GRF_PERIDMAC_CON0[2:1] is b01. To
  support brust transfer, these bits should not be changed in bootloader.


Changes in v3:
- add more rockchip drivers' changes in this patchset
- add Reviewed-by: Sonny Rao <sonnyrao@chromium.org>

Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson <dianders@chromium.org> for
  rk3288.dtsi patch and arm-pl330.txt patch
- amend Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- add From original author.
- remove Sunny's tag

Addy Ke (3):
  DMA: pl330: add quirk for broken no flushp
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform
  spi: rockchip: modify DMA max burst to 1

Boojin Kim (1):
  DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit

Shawn Lin (4):
  Documentation: arm-pl330: add description of
    arm,pl330-broken-no-flushp
  Documentation: spi-rockchip: add description of
    rockchip,spi-broken-burst-len
  Documentation: rockchip-i2s: add description of
    rockchip,i2s-broken-burst-len
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform

Yiwei Cai (1):
  ASoC: rockchip_i2s: modify DMA max burst to 1

 .../devicetree/bindings/dma/arm-pl330.txt          |   1 +
 .../devicetree/bindings/sound/rockchip-i2s.txt     |   4 +
 .../devicetree/bindings/spi/spi-rockchip.txt       |   3 +-
 arch/arm/boot/dts/rk3288.dtsi                      |   7 ++
 arch/arm/boot/dts/rk3xxx.dtsi                      |   5 +
 drivers/dma/pl330.c                                | 101 +++++++++++++++------
 drivers/spi/spi-rockchip.c                         |  16 +++-
 sound/soc/rockchip/rockchip_i2s.c                  |  10 +-
 8 files changed, 113 insertions(+), 34 deletions(-)

-- 
2.3.7

             reply	other threads:[~2015-09-01  9:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  9:56 Shawn Lin [this message]
2015-09-01  9:56 ` [PATCH v3 0/9] Fix broken DMAFLUSHP on Rockchips platform Shawn Lin
2015-09-01  9:56 ` Shawn Lin
2015-09-01  9:56 ` [PATCH v3 1/9] DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit Shawn Lin
2015-09-01  9:56   ` Shawn Lin
2015-09-01  9:56   ` Shawn Lin
2015-09-01  9:57 ` [PATCH v3 2/9] Documentation: arm-pl330: add description of arm,pl330-broken-no-flushp Shawn Lin
2015-09-01  9:57   ` [PATCH v3 2/9] Documentation: arm-pl330: add description of arm, pl330-broken-no-flushp Shawn Lin
2015-09-01  9:57 ` [PATCH v3 3/9] Documentation: spi-rockchip: add description of rockchip,spi-broken-burst-len Shawn Lin
2015-09-01  9:57   ` [PATCH v3 3/9] Documentation: spi-rockchip: add description of rockchip, spi-broken-burst-len Shawn Lin
2015-09-01  9:57   ` [PATCH v3 3/9] Documentation: spi-rockchip: add description of rockchip,spi-broken-burst-len Shawn Lin
2015-09-01  9:57 ` [PATCH v3 4/9] Documentation: rockchip-i2s: add description of rockchip,i2s-broken-burst-len Shawn Lin
2015-09-01  9:57   ` [PATCH v3 4/9] Documentation: rockchip-i2s: add description of rockchip, i2s-broken-burst-len Shawn Lin
2015-09-01  9:57 ` [PATCH v3 5/9] DMA: pl330: add quirk for broken no flushp Shawn Lin
2015-09-01  9:57   ` Shawn Lin
2015-09-01  9:57 ` [PATCH v3 6/9] ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform Shawn Lin
2015-09-01  9:57   ` [PATCH v3 6/9] ARM: dts: Add arm, pl330-broken-no-flushp " Shawn Lin
2015-09-01  9:58 ` [PATCH v3 7/9] ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform Shawn Lin
2015-09-01  9:58   ` [PATCH v3 7/9] ARM: dts: Add arm, pl330-broken-no-flushp " Shawn Lin
2015-09-01  9:58 ` [PATCH v3 8/9] spi: rockchip: modify DMA max burst to 1 Shawn Lin
2015-09-01  9:58   ` Shawn Lin
2015-09-03 12:54   ` Mark Brown
2015-09-03 12:54     ` Mark Brown
2015-09-03 12:54     ` Mark Brown
2015-09-03 13:41     ` Shawn Lin
2015-09-03 13:41       ` Shawn Lin
2015-09-03 13:41       ` Shawn Lin
2015-09-03 17:45       ` Mark Brown
2015-09-03 17:45         ` Mark Brown
2015-09-03 17:45         ` Mark Brown
2015-09-04  0:03         ` Shawn Lin
2015-09-04  0:03           ` Shawn Lin
2015-09-04  0:03           ` Shawn Lin
2015-09-01  9:59 ` [PATCH v3 9/9] ASoC: rockchip_i2s: " Shawn Lin
2015-09-01  9:59   ` Shawn Lin
2015-09-01  9:59   ` Shawn Lin

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=1441101381-1329-1-git-send-email-shawn.lin@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=addy.ke@rock-chips.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dianders@chromium.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=olofj@google.com \
    --cc=perex@perex.cz \
    --cc=sonnyrao@chromium.org \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@intel.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.