mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadym Kochan <vadym.kochan@plvision.eu>
To: Hu Ziji <huziji@marvell.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Vadym Kochan <vadym.kochan@plvision.eu>,
	linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Elad Nachman <enachman@marvell.com>
Subject: [PATCH 3/3] arm64: dts: marvell: Add DTSI to fix Xenon SDHCI 2G limitation on AC5 SoC
Date: Sat,  6 Aug 2022 11:58:14 +0300	[thread overview]
Message-ID: <20220806085818.9873-4-vadym.kochan@plvision.eu> (raw)
In-Reply-To: <20220806085818.9873-1-vadym.kochan@plvision.eu>

There is a limitation in Xenon SDHCI on AC5 SoC that it can address only
the first 2G of memory, so it was decided to use reserved-memory as
bounce buffer because swiotlb=force and SDMA mode did not help.

There is a custom property which is used to attach bounce memory region
to the device on demand (only if more 2G memory is used). This is a software
property only so it was not described in the dt-bindings.

Separate DTSI is added to reserve memory only for boards with eMMC cards.

Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
---
 .../boot/dts/marvell/ac5-98dx25xx-sdhci.dtsi  | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 arch/arm64/boot/dts/marvell/ac5-98dx25xx-sdhci.dtsi

diff --git a/arch/arm64/boot/dts/marvell/ac5-98dx25xx-sdhci.dtsi b/arch/arm64/boot/dts/marvell/ac5-98dx25xx-sdhci.dtsi
new file mode 100644
index 000000000000..cc5e53b64473
--- /dev/null
+++ b/arch/arm64/boot/dts/marvell/ac5-98dx25xx-sdhci.dtsi
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree Include file for AC5 with SDHCI support
+ *
+ * Copyright (C) 2022 Marvell
+ */
+
+/ {
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		/*
+		 * SDHCI controller in AC5 SoC has 2G address space
+		 * limitation, so in case if RAM has more 2G then use
+		 * this dedicated memory region.
+		 */
+		sdhci_dma_restricted_region: sdhci-dma-restricted-region@0 {
+			compatible = "restricted-dma-pool";
+			reg = <0x2 0x0 0x0 0x200000>;
+		};
+	};
+
+	sdhci_dma_bounce_pool: sdhci-dma-bounce-pool@0 {
+		memory-region = <&sdhci_dma_restricted_region>;
+	};
+
+	soc {
+		sdhci: sdhci@805c0000 {
+			compatible = "marvell,ac5-sdhci";
+			reg = <0x0 0x805c0000 0x0 0x300>;
+			interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cnm_clock>;
+			clock-names = "core";
+			marvell,ac5-sdhci-dma-bounce-pool = <&sdhci_dma_bounce_pool>;
+			status = "okay";
+		};
+	};
+};
-- 
2.17.1


  parent reply	other threads:[~2022-08-06  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06  8:58 [PATCH 0/3] mmc: xenon-sdhci: Try to fix 2G address " Vadym Kochan
2022-08-06  8:58 ` [PATCH 1/3] dt-bindings: mmc: xenon: Add compatible string for Xenon SDHCI " Vadym Kochan
2022-08-08  9:18   ` Krzysztof Kozlowski
2022-08-06  8:58 ` [PATCH 2/3] mmc: sdhci-xenon: Try to fix 2G address limitation " Vadym Kochan
2022-08-08  9:20   ` Krzysztof Kozlowski
2022-08-06  8:58 ` Vadym Kochan [this message]
2022-08-08  9:21   ` [PATCH 3/3] arm64: dts: marvell: Add DTSI to fix Xenon SDHCI 2G " Krzysztof Kozlowski

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=20220806085818.9873-4-vadym.kochan@plvision.eu \
    --to=vadym.kochan@plvision.eu \
    --cc=adrian.hunter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=enachman@marvell.com \
    --cc=huziji@marvell.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®