2019-05-27 12:45:33

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v2 0/3] mmc: meson-gx: add dram-access-quirk support

On the Amlogic G12A SoC family, (only) the SDIO controller fails to access
the data from DRAM, leading to a broken controller.

Add the amlogic,ddr-access-quirk property so signal this particular
controller has this bug and needs a quirk to work properly.

But each MMC controller has 1,5KiB of SRAM after the registers, that can
be used as bounce buffer to avoid direct DDR access from the integrated
DMAs (this SRAM may be used by the boot ROM when DRAM is not yet initialized).

The quirk is to disable the chained descriptor for this controller, and
use this SRAM memory zone as buffer for the bounce buffer fallback mode.

The performance hit hasn't been evaluated, but the fix has been tested
using a WiFi AP6398S SDIO module, and the iperf3 Bandwidth measurement gave
55.2 Mbits/sec over a 63 Hours long test, with the SDIO ios set as High-Speed
at 50MHz clock. It gave around 170 Mbits/sec as SDR104 and 200MHz clock.

Changes since v1:
* use DRAM instead of DDR, added details in bindings on internal DMA controller
* fix probe() to not try to unallocate bounce buffer on error
* replace DT patch adding SDIO property to patch adding SDIO controller

Jerome Brunet (1):
arm64: dts: meson: g12a: add SDIO controller

Neil Armstrong (2):
dt-bindings: mmc: meson-gx: add dram-access-quirk property
mmc: meson-gx: add dram-access-quirk

.../bindings/mmc/amlogic,meson-gx.txt | 4 ++
arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 37 ++++++++++
drivers/mmc/host/meson-gx-mmc.c | 70 +++++++++++++++----
3 files changed, 96 insertions(+), 15 deletions(-)

--
2.21.0


2019-05-27 12:46:56

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH v2 1/3] dt-bindings: mmc: meson-gx: add dram-access-quirk property

On the Amlogic G12A SoC family, (only) the SDIO controller has a bug which
makes any DRAM access from the MMC controller fail.

Add the amlogic,dram-access-quirk property so signal this particular
controller has this bug and needs a quirk to work properly.

Reviewed-by: Martin Blumenstingl <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
---
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
index 13e70409e8ac..ccc5358db131 100644
--- a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
+++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
@@ -22,6 +22,10 @@ Required properties:
clock rate requested by the MMC core.
- resets : phandle of the internal reset line

+Optional properties:
+- amlogic,dram-access-quirk: set when controller's internal DMA engine cannot access the
+ DRAM memory, like on the G12A dedicated SDIO controller.
+
Example:

sd_emmc_a: mmc@70000 {
--
2.21.0

2019-05-28 08:55:44

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] dt-bindings: mmc: meson-gx: add dram-access-quirk property

On Mon, 27 May 2019 at 14:43, Neil Armstrong <[email protected]> wrote:
>
> On the Amlogic G12A SoC family, (only) the SDIO controller has a bug which
> makes any DRAM access from the MMC controller fail.
>
> Add the amlogic,dram-access-quirk property so signal this particular
> controller has this bug and needs a quirk to work properly.
>
> Reviewed-by: Martin Blumenstingl <[email protected]>
> Signed-off-by: Neil Armstrong <[email protected]>

Applied for next, thanks!

Kind regards
Uffe


> ---
> Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
> index 13e70409e8ac..ccc5358db131 100644
> --- a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
> +++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
> @@ -22,6 +22,10 @@ Required properties:
> clock rate requested by the MMC core.
> - resets : phandle of the internal reset line
>
> +Optional properties:
> +- amlogic,dram-access-quirk: set when controller's internal DMA engine cannot access the
> + DRAM memory, like on the G12A dedicated SDIO controller.
> +
> Example:
>
> sd_emmc_a: mmc@70000 {
> --
> 2.21.0
>