Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5308094imm; Tue, 26 Jun 2018 09:05:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdOeuQSH9ZEvfvWmb/s1XL9IHrZq/C4YR0xcbi8OwEunxDoGRevbGVjz4cMy3KMlgziAoXQ X-Received: by 2002:a62:9513:: with SMTP id p19-v6mr2155179pfd.239.1530029142514; Tue, 26 Jun 2018 09:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530029142; cv=none; d=google.com; s=arc-20160816; b=Z+gEtiMn7PrEImY4g/FaWcRfq2WaLsxrTcWGYFaLjNCi/tBzxOzAqh2q6Axt66oYcD 2TqZ7ODDdqmf4slkJmDyBM1pL6cWv5CfqWBMD0ng20iB6bQUXOAsvGX4QWL1CnsLxzLg V7XaHGJj4OtPFGdTlcaSzr8z9ZGcwH/QWKkje+F8dlB3A0tM8KobEVHIG45GQ7AL1Yrm kaq1KtgIsoQbR/vtGEStHRWw5/PTeLvv6n4Be1RHyuACqKjpXV8oM9aQAX+SR5MMKcNz 98oi+Bcluh2kd/YvoQLD7N6B6vCEilC33TT97kvAH9DYKul7C+tTM4X2YWc2qTLiNXN8 ydoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=rMIf5v8KN0Mrdw6RsquqaCi7MR/DnnFhzmeZFVtVBWc=; b=wZCisSThU0oXo3FhCQpnPgWqEVV9vkB7ltji6uD2vafLfh4z0nCMC65iYpAFDeWYUq RP/4hnfrlN174NJDv48azA0BmWftp2Poi/v0kD9nAuhUC1DajKZg0hBEvqoYa0ZdYpOc Y//GrRXXePtw4e7H2fvvwq0S62BxmqllSN1td4uWc6u/faHI4phFLGg+lIEiVKwKnfRN zo+BPwWOhGwHW2/yjitvrinmZgmMql5wySz+rbNRCFBts2ZE3HzCWSwMExrqWN71P150 KqEPY3p9KKM5qejWqRQQlL0D8Qk17Xd5phXNBfRBIxR1UT195mw77ZS/8DvWrKed5rFW M2rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oaQA48ir; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22-v6si1750286plp.489.2018.06.26.09.05.20; Tue, 26 Jun 2018 09:05:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oaQA48ir; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934999AbeFZOmb (ORCPT + 99 others); Tue, 26 Jun 2018 10:42:31 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42431 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934936AbeFZOm3 (ORCPT ); Tue, 26 Jun 2018 10:42:29 -0400 Received: by mail-wr0-f195.google.com with SMTP id p1-v6so1944101wrs.9 for ; Tue, 26 Jun 2018 07:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rMIf5v8KN0Mrdw6RsquqaCi7MR/DnnFhzmeZFVtVBWc=; b=oaQA48irM72Jm90d71orxeXYW9mk30XgBVhXnY4i3W3QTyGnyPQjaFwqjZ+0VBXWsU 5txhFZxSFsB87LJmngv1P6qSOHcwqlZJENRuwojA9EkGT1eimTgCjJqEQgV6crne4Sgu dFPo273LdNQMBv/4jJKpLreMrgoL5xwmPxSTo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rMIf5v8KN0Mrdw6RsquqaCi7MR/DnnFhzmeZFVtVBWc=; b=DYvRC63kKqVOjqg4hOsP69rAdxoDcC5szQJgOZWgX9+RDywuA6m7s1WYcE7jMMwi/w RL2axuhufdaafg2EuYwkTsrhTOjUvZzFHrUNWy3cUfnPvkGU9GIpPXGfl6zMrZqjFoJP 5gYBFEwdshei2AqgrLJdEvY6y9N+TtAcXdiYt5gD3COUnGX7fuW22jdqWPGrPZqYeRt6 RALtKMcW+5yWyQUEwy72+ugJAzrT7EeQxUWo7w1MySAWAptSBxTD126ubL77kRa+CsqW 5U1TgTcsbM3Nw2Gn+94kqouWua7yANwvxTT3RD1GMUSSHlNNfSl5L1Kt53Zi43FyjsLm Ijgg== X-Gm-Message-State: APt69E2JvcsZe1NRM2VxiXfn56VixXiDQg5Un9dMR3OZOz8NU7ax8qlL 28xaCxBfiUdNaW3obtKrOF3nocbCzsaNqQHtRrwS0cP72t8= X-Received: by 2002:adf:bbc9:: with SMTP id z9-v6mr1324324wrg.183.1530024147824; Tue, 26 Jun 2018 07:42:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:8684:0:0:0:0:0 with HTTP; Tue, 26 Jun 2018 07:42:27 -0700 (PDT) In-Reply-To: References: <9fb661e6-482b-76e0-2af0-a62a70e5606d@redhat.com> <233d6808-4d44-9e47-7e3f-4f35cf731706@redhat.com> From: Michael Nazzareno Trimarchi Date: Tue, 26 Jun 2018 16:42:27 +0200 Message-ID: Subject: Re: simple-framebuffer enquire To: Hans de Goede Cc: artlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans On Tue, Jun 26, 2018 at 3:38 PM, Michael Nazzareno Trimarchi wrote: > Hi > > On Tue, Jun 26, 2018 at 3:36 PM, Hans de Goede wrote: >> Hi, >> >> >> On 26-06-18 15:29, Michael Nazzareno Trimarchi wrote: >>> >>> Hi >>> >>> to be more specific >>> >>> On Tue, Jun 26, 2018 at 3:06 PM, Michael Nazzareno Trimarchi >>> wrote: >>>> >>>> Hi >>>> >>>> On Tue., 26 Jun. 2018, 12:01 pm Hans de Goede, >>>> wrote: >>>>> >>>>> >>>>> Hi, >>>>> >>>>> On 25-06-18 15:29, Michael Nazzareno Trimarchi wrote: >>>>>> >>>>>> Hi Hans >>>>>> >>>>>> In order to let it even registered the simplefb I have added this >>>>>> change. According on what I understand >>>>>> from the code seems that this is the way to acquire memory with the >>>>>> correct attribute >>>>>> >>>>>> diff --git a/drivers/video/fbdev/simplefb.c >>>>>> b/drivers/video/fbdev/simplefb.c >>>>>> index a3c44ec..7e61ce3 100644 >>>>>> --- a/drivers/video/fbdev/simplefb.c >>>>>> +++ b/drivers/video/fbdev/simplefb.c >>>>>> @@ -466,8 +466,8 @@ static int simplefb_probe(struct platform_device >>>>>> *pdev) >>>>>> >>>>>> info->fbops = &simplefb_ops; >>>>>> info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE; >>>>>> - info->screen_base = ioremap_wc(info->fix.smem_start, >>>>>> - info->fix.smem_len); >>>>>> + info->screen_base = arch_memremap_wb(info->fix.smem_start, >>>>>> + info->fix.smem_len); >>>>> >>>>> >>>>> I'm not sure why you need this? wb certainly is not optimal >>>>> for a framebuffer, the existing wc mapping is really what you >>>>> want. >>>>> >>>> >>>> Well in this way raise a WARN and get a nice NULL on memory remap on >>>> imx6ull >>>> SoC >>>> >>> >>> [ 0.397484] WARNING: CPU: 0 PID: 1 at arch/arm/mm/ioremap.c:303 >>> __arm_ioremap_pfn_caller+0x80/0x1cc >> >> >> >> This is causes by a mismatch in memory attributes, which means the >> memory is already mapped by the kernel as regular RAM and may >> already be used for other purposes by the kernel! >> >> Memory used by a simplefb framebuffer must be reserved by the >> bootloader, so that it does not get used by the kernel as regular >> RAM. See e.g.: >> >> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/video/sunxi/sunxi_display.c >> >> Near the end of the file where the framebuffer RAM gets excluded from >> the memory-range reported to the kernel as usable RAM. Note this relies >> on the u-boot sunxi video code putting the framebuffer at the end of the >> RAM. + aliases { + display0 = &lcdif; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + display_reserved: framebuffer@86fd6080 { + reg = <0x86fd6080 (480 * 272 *4)>; + }; + This should do the trick but I have still the same problem on memory type. Any idea? + linux,cma { + compatible = "shared-dma-pool"; + reusable; + size = <0x1000000>; + linux,cma-default; + }; + }; + + chosen { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + stdout-path = &uart1; + framebuffer0: framebuffer@86fd6080 { + compatible = "simple-framebuffer"; + reg = <0x86fd6080 (480 * 272 * 4)>; Here I try to use the same. I will create in uboot a dynamic way to track down. I think that we can even add to the simple buffer a way to get hand of reserved region automatically Michael + width = <480>; + height = <272>; + stride = <(480 * 4)>; + format = "a8r8g8b8"; + clocks = <&clks IMX6UL_CLK_LCDIF_PIX>, + <&clks IMX6UL_CLK_LCDIF_APB>, + <&clks IMX6UL_CLK_DUMMY>, + <&clks IMX6UL_CLK_GPIO3>, + <&clks IMX6UL_CLK_GPIO4>; + nshut-supply = <®_lcd_nshut>; + nreset-supply = <®_lcd_nreset>; + display = <&lcdif>; + status = "okay"; + }; >> > > Thank you very much for this lesson ;). I will try to document better > after my tour ;) > > Michael > >> Regards, >> >> Hans > > > > -- > | Michael Nazzareno Trimarchi Amarula Solutions BV | > | COO - Founder Cruquiuskade 47 | > | +31(0)851119172 Amsterdam 1018 AM NL | > | [`as] http://www.amarulasolutions.com | -- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com |