From patchwork Wed Mar 7 08:21:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 882466 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="crQk5sBk"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BLSN2Ga7"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zx67H6q1rz9s1l for ; Wed, 7 Mar 2018 19:21:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vAxbNth6XJ2zadN51h0BUTMTZ8pgqyE7bNfbGt5HpKI=; b=crQk5sBk6QzcDN Shk97W3yCkmbszrg+5rbeGErhsLEpuqMdnvve3c5r6EW8qEBiq4ks0m2CyNv/gVAHpbs7DHqntZrL jyovUOk+N+6Sf6BJoC0L5mZVj/lc1DuTmAeBjdjJkxfTW9wsUREY4B3toMzVMJIDfTihk7NjiFcHv R0SsGSlb3tAGxPac7Me+q07ayA0q+i/ddeODgIbANowf9DVKr0YR85NJh++BN7XCZZmCO5EhYUOyI lTHW3XsmcucWdea9cvACtWj7+ye2663t5e0mqn3SM7uE1kTVsljocvk5Q19uat5kE5WcnryVwj9Aj 3xNQTGqeRMExHr0EqHtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etUKU-0006DD-Dv; Wed, 07 Mar 2018 08:21:42 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etUKP-0006Al-9h for linux-arm-kernel@lists.infradead.org; Wed, 07 Mar 2018 08:21:39 +0000 Received: by mail-lf0-x241.google.com with SMTP id o145-v6so1969270lff.0 for ; Wed, 07 Mar 2018 00:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ftg04JmrUOImFw4T5nuv6N4sV237//MctluR9WnxIMI=; b=BLSN2Ga7lL4IrzbQT5wyR3BYP/zd65tnDFvWVdPXAEeosn/bmJndpeKvCOfYEuD/0I pHxW312npWN/uHs8keS9doucyeQP007ogsoc5XTcsObJhYcIqGm0L62lWtHpRqGltLPO hgy0JOfcBa8Bt47NtpIDD34WGAoJVjSo2pUNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ftg04JmrUOImFw4T5nuv6N4sV237//MctluR9WnxIMI=; b=ga1Pv5cgqnB3zYyXxGmIs485hLAzeFfTtZ/c2MhUi50WlHobjNgJjCF4/iyfGeVubc zl9AW8yjbNP5o2cHpD4kGSP9eXUZ6VFMldL/y3E1fPt132CSIEAUg2JzS5gGUWJrxTzr z7x8yzFubGoxNSnWkn2TyvtufX7aXsVUTB26pE8m39fN6aJhg+CLt4VR4XvhI3FbQtO5 5UyMtPhy9kC2dGYe+rXTSVnWCy7PLQUI+p4Y6FE39awI9bx0raAJUeMUrjaywZ2fI9k8 KXBRqPEYN0uhRGUI9Frfkj+6h0AXRaVPBEWu9Qt7cYuLLiKSbSuMUUWKzywtfnIAJfTJ crTA== X-Gm-Message-State: APf1xPATFnjVYk9YNn+Xqer+8mSbKxGE+4+b77Z9YY00WZt11h8HZaHQ UMNichBr28iRotGxtGozw3dbiQ== X-Google-Smtp-Source: AG47ELtkGXsf9qGdaRM+37ht0m6qPGjycop7D00cKd3at6axL0z9UE1jYN+AQDPCpjIG5GwMmWnKBQ== X-Received: by 10.46.54.12 with SMTP id d12mr14565751lja.31.1520410884726; Wed, 07 Mar 2018 00:21:24 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 70sm3577899lft.2.2018.03.07.00.21.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Mar 2018 00:21:23 -0800 (PST) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt , Liviu Dudau Subject: [PATCH] drm/pl111: Enable device-specific assigned memory Date: Wed, 7 Mar 2018 09:21:16 +0100 Message-Id: <20180307082116.13568-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180307_002137_443718_49CF3E83 X-CRM114-Status: GOOD ( 15.49 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4010:c07:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij , Mali DP Maintainers , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The Versatile Express has 8 MB of dedicated video RAM (VRAM) on the motherboard, which is what we should be using for the PL111 if available. On this platform, the memory backplane is constructed so that only this memory will work properly with the CLCD on the motherboard, using any other memory region just gives random snow on the display. The CA9 Versatile Express also has a PL111 instance on its core tile. This is OK, it has been tested with the motherboard VRAM and that works just as fine as regular CMA memory. The memory is assigned to the device using the memory-region device tree property and a "shared-dma-pool" reserved memory pool like this: reserved-memory { #address-cells = <1>; #size-cells = <1>; ranges; vram: vram@48000000 { compatible = "shared-dma-pool"; reg = <0x48000000 0x00800000>; no-map; }; }; clcd@1f000 { compatible = "arm,pl111", "arm,primecell"; (...) memory-region = <&vram>; }ยท; Cc: Liviu Dudau Cc: Mali DP Maintainers Signed-off-by: Linus Walleij --- drivers/gpu/drm/pl111/pl111_drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index b469aa317d9d..e301f2a719a3 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -262,6 +263,10 @@ static int pl111_amba_probe(struct amba_device *amba_dev, drm->dev_private = priv; priv->variant = variant; + ret = of_reserved_mem_device_init(dev); + if (!ret) + dev_info(dev, "using device-specific reserved memory\n"); + if (of_property_read_u32(dev->of_node, "max-memory-bandwidth", &priv->memory_bw)) { dev_info(dev, "no max memory bandwidth specified, assume unlimited\n");