Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5193809imm; Tue, 26 Jun 2018 07:23:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJLJH2MBCFj5hF3PR7F8i4hxCOI0Q5UkGZFHqD535GzGkwFfdxcZcaeCOpPErTSBlZUxHF X-Received: by 2002:a17:902:b788:: with SMTP id e8-v6mr1860087pls.339.1530023032304; Tue, 26 Jun 2018 07:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530023032; cv=none; d=google.com; s=arc-20160816; b=nvuk/ZNTaT3FfpwZpNO3BvuwUG1P2hCJANY4pVasnr1TGiNt5Un2/fu5yrhkIgKxBQ Tqlj5hCGvDk9p+AXIxWcbI1buWZXxyWPQIdTZUUFqZoIBbDo68AGwMFMnbyZX8YkX2gh L4I9gDrGWm13LPI4dMuerBpgnTRWKwCQVQCTSQ1PBYTHK/C2X5nKbbmmMtXl6s33kmIt +bUeP7rpt4J7Cp+zCcEg6aebesxB2t0Iid2TZ6IPhVdJxcxGM8mL8LamCba0giMpitn4 rP1Z9ED6ryA4hKzq7+E4P00ahOf2pgBIjBiZ+IFF3I8Gcc+De4so0jQ0sP4ga+K56tbb RD9Q== 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=7dRVgX+D+YzRT8Eu6vm/4OkT6lsQA+ky7Rza9h5k484=; b=BLKLAQd3C/1b9azcyxcdvZfHaHH2cPb7wdFPpZ04E72OEy885+VToiGYbEGXOaMssW qcwjh4fkhR0hpGlhASUrkRLP7iLGWoLSo2sfCAaPLQjXrItwlPSnREmF+n84XhnlZW+9 aZDvC5Eqyjwyam377SL9+wNBq4m+yjylqK59Jm1myHCW2J1J4aFO72jfh/Nq+L075FuP IU3fGiy+yExnbxniEysNDRPUEK8YUYr/L6NjW+Bybk/GB8RVMsSQy/j3N5C8NlB86lDq MRzbhpLzs6gDZypRp0RWNCj9W9ukGWCDaw1uNP05XSJLggENZN6RuAoCPP2Oyid3aaPb 2Qrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=p8N9fUZc; 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 z11-v6si1560555pgz.264.2018.06.26.07.23.37; Tue, 26 Jun 2018 07:23:52 -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=p8N9fUZc; 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 S965645AbeFZNiy (ORCPT + 99 others); Tue, 26 Jun 2018 09:38:54 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:46504 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965108AbeFZNiw (ORCPT ); Tue, 26 Jun 2018 09:38:52 -0400 Received: by mail-wr0-f170.google.com with SMTP id l14-v6so12242480wrq.13 for ; Tue, 26 Jun 2018 06:38:52 -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=7dRVgX+D+YzRT8Eu6vm/4OkT6lsQA+ky7Rza9h5k484=; b=p8N9fUZc392h6QYU3rWhdF4OnmIuTg4CdXUbZSTSoVSOTa39sMP4ImeG5OZbjFi2Zs 1XLHXOrVa67JhhMB7xAuZItx4xel76K4PyANx9cA/w7a2WqeKAS5E0TKtHrYtmjMQxzu bXg7P36ulIWNRdan1sXlqPY0p8l+GW5u+oAQE= 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=7dRVgX+D+YzRT8Eu6vm/4OkT6lsQA+ky7Rza9h5k484=; b=DcUO45p1CNm4mXx08dIKzlML+k6pkSJsetpDH5SCHQc5K4elZLNZoSWbmEsZt0JSll fksER3N9MVAjcNjgJEvjnZ9ZXMf8G8c+6fEfftCvbbIOSQ+PJRiqnyehf9qbuT90wfoU 7TwtBJVqj/fGqVXKOBsXKP7GXFqTun0WUNpAcMS2QcFL+fi5iq1DqPT1vU8oMyh+ChR3 TIKzCcqtcNhckil1PMVNS7LX7+M0S9N4xrubJguGg4OcA4hIoDb45flnaknArffnXfxb J1bOznvspri39F2NcfSpv9ksOFR80VKcOZCPtYhXV0s24YsVhtvWmIEVTz+HYU7hKeYn AZGA== X-Gm-Message-State: APt69E1xW1v7Utp3qY50DMhlZSzfc0mfNFWlwoVcruTPF0pmFABctTik IRMpCqns0HZE9tAzXKgGhV0OX6wuGuc7m7QPyIbn0Q== X-Received: by 2002:adf:f181:: with SMTP id h1-v6mr1653873wro.214.1530020331562; Tue, 26 Jun 2018 06:38:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:8684:0:0:0:0:0 with HTTP; Tue, 26 Jun 2018 06:38:50 -0700 (PDT) In-Reply-To: <233d6808-4d44-9e47-7e3f-4f35cf731706@redhat.com> References: <9fb661e6-482b-76e0-2af0-a62a70e5606d@redhat.com> <233d6808-4d44-9e47-7e3f-4f35cf731706@redhat.com> From: Michael Nazzareno Trimarchi Date: Tue, 26 Jun 2018 15:38:50 +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 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. > 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 |