Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7181249pxb; Thu, 18 Feb 2021 03:46:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuKK8yXZsvQE3TU6Nqi5fiP2O9V9pmlxlMn2+fHNIWR01KGm6lUlBf+LZGBo652YTuGxiw X-Received: by 2002:aa7:d98f:: with SMTP id u15mr3729145eds.267.1613648804276; Thu, 18 Feb 2021 03:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613648804; cv=none; d=google.com; s=arc-20160816; b=fmflQs0FFYb9ojhFQgl7Rot6J2IUHSev/3W2k22SanDdYeRbY0ICl/4wOhh+3Jz+q+ rg7f0SvkLpMrx+2OLfP0Qj5+uUvRcb+q7k8jnHHrInQ02aJM/efFJXXLKhQ2VEUCx8Bh pqmdL/k+Cs8Y2D4hTvZ0vtPxtn5vMYYIrzmwn7dwz6XzGK45TUqAU/vY7mwsOKM0cMzn po9bu4eWAHOGpqk4vrsM2ZAkvNuPvr3mmHJhx0AnalkXjGyRw+zHqsOGs/8g/FdGRxeC V8Puv+NlmyGUOLIaqTTQ9D5vR/am7Rq9GWHvUqhdKB2nbR0GJFGGQjC+NPbB3vfVYtJd q5tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=FKa4xEcTPs12+ueskI+hsW6cuEtSJrf/RWQAZq4ov7U=; b=EBaDy3eBruY00hJySCcbL5WcOb+ibyDTgsOSXwNhGt/9iqI7CVdDZuJDPqatYflbCZ 168KqsvFOsIOB4r9dEMsJaYQJ59N7YXGDwtW9Q2LBgjPoWBJiN+zTK5HJNjs8kzBnylG HBaNPQbsjaDP+qia4xABVCwtkGvzGkGWQJoftksqNoQDWbAyLHAWNkdQ52c0OkavUGpV ynMU0jWarsODE6Umfcr8TifnHPB+QiBItC1QwbXa97vf4wneez6ebRnvwBbO+uGDJmaD f5yDbWylWGLJB7tLKzk7rQNoG23Aq34Hf4PDROmSPW9pudMLRre26UX6BKbZEKQjbYoJ WL2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si3667717eje.712.2021.02.18.03.46.20; Thu, 18 Feb 2021 03:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232243AbhBRLpq (ORCPT + 99 others); Thu, 18 Feb 2021 06:45:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232076AbhBRKQW (ORCPT ); Thu, 18 Feb 2021 05:16:22 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78124C061756 for ; Thu, 18 Feb 2021 02:15:37 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCgL8-0002zv-7T; Thu, 18 Feb 2021 11:15:18 +0100 Message-ID: Subject: Re: [PATCH v1 03/18] arm64: dts: imx8mq-evk: add reserve memory node for CMA region From: Lucas Stach To: Ezequiel Garcia , Benjamin Gaignard , p.zabel@pengutronix.de, mchehab@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@siol.net, krzk@kernel.org, shengjiu.wang@nxp.com, adrian.ratiu@collabora.com, aisheng.dong@nxp.com, peng.fan@nxp.com, Anson.Huang@nxp.com, hverkuil-cisco@xs4all.nl Cc: devel@driverdev.osuosl.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, kernel@collabora.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Date: Thu, 18 Feb 2021 11:15:13 +0100 In-Reply-To: References: <20210217080306.157876-1-benjamin.gaignard@collabora.com> <20210217080306.157876-4-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, dem 17.02.2021 um 16:39 -0300 schrieb Ezequiel Garcia: > Hi Benjamin, > > On Wed, 2021-02-17 at 09:02 +0100, Benjamin Gaignard wrote: > > Define allocation range for the default CMA region. > > > > Signed-off-by: Benjamin Gaignard > > Signed-off-by: Ezequiel Garcia > > Despite it seems like I signed-off this one... > > > Signed-off-by: Adrian Ratiu > > --- > >  arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 15 +++++++++++++++ > >  1 file changed, 15 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts > > index 85b045253a0e..047dfd4a1ffd 100644 > > --- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts > > +++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts > > @@ -21,6 +21,21 @@ memory@40000000 { > >                 reg = <0x00000000 0x40000000 0 0xc0000000>; > >         }; > > > >   > > +       resmem: reserved-memory { > > +               #address-cells = <2>; > > +               #size-cells = <2>; > > +               ranges; > > + > > +               /* global autoconfigured region for contiguous allocations */ > > +               linux,cma { > > +                       compatible = "shared-dma-pool"; > > +                       reusable; > > +                       size = <0 0x3c000000>; > > +                       alloc-ranges = <0 0x40000000 0 0x40000000>; > > +                       linux,cma-default; > > +               }; > > ... I'm not a fan of the change :) > > Hopefully someone from NXP can provide some insight here? > > If it's absolutely needed for the VPU, then I guess it should > be 1) very well documented and 2) moved to the top-lovel dtsi. > > But if we can drop it, that'd be nicer. What's the justification for this CMA area? I could only imagine the DMA addressing restrictions on the platform. DMA masters on the i.MX8MQ can not access memory beyond the 4GB mark and 1GB of address space is reserved for MMIO, so if you have 4GB installed the upper 1GB of DRAM is only accessible to the CPU. But this restriction is already properly communicated to the Linux DMA framework by the dma-ranges in the top level SoC bus node in the DT, so I don't think this CMA setup is necessary. Regards, Lucas