mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrej Picej <andrej.picej@norik.com>
To: Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: kernel@pengutronix.de, Fabio Estevam <festevam@gmail.com>,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, upstream@lists.phytec.de,
	Andrej Picej <andrej.picej@norik.com>
Subject: [PATCH] arm64: dts: imx8mm-phycore-som: Add CMA reserved memory region
Date: Tue,  1 Dec 2026 12:04:41 +0100	[thread overview]
Message-ID: <20261201110441.3741481-1-andrej.picej@norik.com> (raw)

Without a linux,cma node the kernel falls back to CONFIG_CMA_SIZE_MBYTES,
which is only 32 MiB with the arm64 defconfig. That is not enough for the
display, GPU (etnaviv) and VPU (hantro) buffers and leads to failing
contiguous allocations on phyCORE-i.MX8MM based boards.

Thus add a 256 MiB default CMA pool. Allow it anywhere below 4 GiB, so it
fits all RAM variants of the SoM.

Signed-off-by: Andrej Picej <andrej.picej@norik.com>
---

Notes:
    Why in DT: the i.MX8MM has no IOMMU, so display and VPU buffers depend
    on CMA and the SoM should work without a special kernel config or
    bootloader setup. "cma=" still overrides it. Same approach as
    imx93-phycore-som.dtsi and imx8mm-tqma8mqml.dtsi.
    
    Peak CMA usage measured on phyBOARD-Polis-i.MX8MM:
      idle / display, GPU load    15 MiB
      1080p H.264 / HEVC decode   59 / 49 MiB
      4K HEVC decode             138 MiB
      4K VP9 decode              242 MiB

---

 .../boot/dts/freescale/imx8mm-phycore-som.dtsi     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi
index b764f7734868..e5b29fa75b95 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi
@@ -28,6 +28,20 @@ reg_vdd_3v3_s: regulator-vdd-3v3-s {
 		regulator-min-microvolt = <3300000>;
 		regulator-name = "VDD_3V3_S";
 	};
+
+	reserved-memory {
+		ranges;
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		linux,cma {
+			compatible = "shared-dma-pool";
+			reusable;
+			alloc-ranges = <0 0x40000000 0 0xc0000000>;
+			size = <0 0x10000000>;
+			linux,cma-default;
+		};
+	};
 };
 
 &A53_0 {

base-commit: 4fd36177c1281252290436f27a034d4473aa2744
-- 
2.34.1


                 reply	other threads:[~2026-12-01 11:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261201110441.3741481-1-andrej.picej@norik.com \
    --to=andrej.picej@norik.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=upstream@lists.phytec.de \
    /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®