From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbcD3VRq (ORCPT ); Sat, 30 Apr 2016 17:17:46 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37921 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522AbcD3VRm (ORCPT ); Sat, 30 Apr 2016 17:17:42 -0400 Date: Sat, 30 Apr 2016 22:17:38 +0100 From: Matt Fleming To: Bjorn Helgaas Cc: Alexander Graf , Ard Biesheuvel , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-pci@vger.kernel.org, Lorenzo Pieralisi , Peter Jones , Matthew Garrett Subject: Re: [PATCH] arm64: Relocate screen_info.lfb_base on PCI BAR allocation Message-ID: <20160430211738.GN2839@codeblueprint.co.uk> References: <20160428180641.GA25125@localhost> <57228317.1030808@suse.de> <20160429134126.GA949@localhost> <20160429200609.GA28261@localhost> <35998183-0322-49D4-91CD-4D441577C44F@linaro.org> <5723C956.4040907@suse.de> <20160429213751.GB5359@localhost> <5723D7AF.3080108@suse.de> <20160429233119.GA10197@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160429233119.GA10197@localhost> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (Pulling in efifb maintainer, Peter) On Fri, 29 Apr, at 06:31:19PM, Bjorn Helgaas wrote: > > The efifb.c driver doesn't do anything at all with PCI (it includes > linux/pci.h, but probably doesn't need it). That's part of what I'm > suggesting -- if it *did* register as a PCI device driver, then it > would look at pci_dev->resource[n], which is populated by the PCI > core based on the BAR values. This discussion came up recently here, https://lkml.kernel.org/r/20160216151859.GB11373@redhat.com There's nothing PCI-specific about the EFI framebuffer per se, but in practice it's always a PCI device. > Is ConOut what you're after? I.e., is the whole point of this > exercise to get a framebuffer driver attached to the device that was > the firmware console? I would think the ConOut path should be > decodable -- it has to tell you how to navigate the interconnect from > the CPU to the device. But I don't know how to do it. > > It looks like on x86, at least, setup_gop32()/setup_gop64() might be > extracting the framebuffer address from the ConOut device and stuffing > it into screen_info, which is what efifb.c later looks at (maybe this > is what Ard was referring to). Matthew Garrett wrote the x86 code for guessing where the console is. We look for the ConOut protocol with a fallback to first GOP device if we can't find it. I think the heuristic was based on reading the implementation in EDK2. See commit 38cb5ef4473c ("X86: Improve GOP detection in the EFI boot stub"). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Sat, 30 Apr 2016 22:17:38 +0100 From: Matt Fleming To: Bjorn Helgaas Cc: Alexander Graf , Ard Biesheuvel , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-pci@vger.kernel.org, Lorenzo Pieralisi , Peter Jones , Matthew Garrett Subject: Re: [PATCH] arm64: Relocate screen_info.lfb_base on PCI BAR allocation Message-ID: <20160430211738.GN2839@codeblueprint.co.uk> References: <20160428180641.GA25125@localhost> <57228317.1030808@suse.de> <20160429134126.GA949@localhost> <20160429200609.GA28261@localhost> <35998183-0322-49D4-91CD-4D441577C44F@linaro.org> <5723C956.4040907@suse.de> <20160429213751.GB5359@localhost> <5723D7AF.3080108@suse.de> <20160429233119.GA10197@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20160429233119.GA10197@localhost> List-ID: (Pulling in efifb maintainer, Peter) On Fri, 29 Apr, at 06:31:19PM, Bjorn Helgaas wrote: > > The efifb.c driver doesn't do anything at all with PCI (it includes > linux/pci.h, but probably doesn't need it). That's part of what I'm > suggesting -- if it *did* register as a PCI device driver, then it > would look at pci_dev->resource[n], which is populated by the PCI > core based on the BAR values. This discussion came up recently here, https://lkml.kernel.org/r/20160216151859.GB11373@redhat.com There's nothing PCI-specific about the EFI framebuffer per se, but in practice it's always a PCI device. > Is ConOut what you're after? I.e., is the whole point of this > exercise to get a framebuffer driver attached to the device that was > the firmware console? I would think the ConOut path should be > decodable -- it has to tell you how to navigate the interconnect from > the CPU to the device. But I don't know how to do it. > > It looks like on x86, at least, setup_gop32()/setup_gop64() might be > extracting the framebuffer address from the ConOut device and stuffing > it into screen_info, which is what efifb.c later looks at (maybe this > is what Ard was referring to). Matthew Garrett wrote the x86 code for guessing where the console is. We look for the ConOut protocol with a fallback to first GOP device if we can't find it. I think the heuristic was based on reading the implementation in EDK2. See commit 38cb5ef4473c ("X86: Improve GOP detection in the EFI boot stub"). From mboxrd@z Thu Jan 1 00:00:00 1970 From: matt@codeblueprint.co.uk (Matt Fleming) Date: Sat, 30 Apr 2016 22:17:38 +0100 Subject: [PATCH] arm64: Relocate screen_info.lfb_base on PCI BAR allocation In-Reply-To: <20160429233119.GA10197@localhost> References: <20160428180641.GA25125@localhost> <57228317.1030808@suse.de> <20160429134126.GA949@localhost> <20160429200609.GA28261@localhost> <35998183-0322-49D4-91CD-4D441577C44F@linaro.org> <5723C956.4040907@suse.de> <20160429213751.GB5359@localhost> <5723D7AF.3080108@suse.de> <20160429233119.GA10197@localhost> Message-ID: <20160430211738.GN2839@codeblueprint.co.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org (Pulling in efifb maintainer, Peter) On Fri, 29 Apr, at 06:31:19PM, Bjorn Helgaas wrote: > > The efifb.c driver doesn't do anything at all with PCI (it includes > linux/pci.h, but probably doesn't need it). That's part of what I'm > suggesting -- if it *did* register as a PCI device driver, then it > would look at pci_dev->resource[n], which is populated by the PCI > core based on the BAR values. This discussion came up recently here, https://lkml.kernel.org/r/20160216151859.GB11373 at redhat.com There's nothing PCI-specific about the EFI framebuffer per se, but in practice it's always a PCI device. > Is ConOut what you're after? I.e., is the whole point of this > exercise to get a framebuffer driver attached to the device that was > the firmware console? I would think the ConOut path should be > decodable -- it has to tell you how to navigate the interconnect from > the CPU to the device. But I don't know how to do it. > > It looks like on x86, at least, setup_gop32()/setup_gop64() might be > extracting the framebuffer address from the ConOut device and stuffing > it into screen_info, which is what efifb.c later looks at (maybe this > is what Ard was referring to). Matthew Garrett wrote the x86 code for guessing where the console is. We look for the ConOut protocol with a fallback to first GOP device if we can't find it. I think the heuristic was based on reading the implementation in EDK2. See commit 38cb5ef4473c ("X86: Improve GOP detection in the EFI boot stub").