Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-13 Thread Jon Masters
On 12/06/2016 03:18 PM, Bjorn Helgaas wrote: > I just merged pci/ecam into my "next" branch, so as long as tomorrow's > linux-next boots out of the box, we should be set. I made the following > changes compared to v11: > > - dropped the x86 change to use acpi_resource_consumer() > - added pa

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-06 Thread Jon Masters
On 12/06/2016 03:18 PM, Bjorn Helgaas wrote: > On Tue, Dec 06, 2016 at 02:46:00PM -0500, Jon Masters wrote: >> On 12/05/2016 04:21 PM, Bjorn Helgaas wrote: >>> On Fri, Dec 02, 2016 at 07:33:46PM -0500, Jon Masters wrote: >> > Even without this patch, I don't think it's a show-stopper to have >>

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-06 Thread Bjorn Helgaas
On Tue, Dec 06, 2016 at 02:46:00PM -0500, Jon Masters wrote: > On 12/05/2016 04:21 PM, Bjorn Helgaas wrote: > > On Fri, Dec 02, 2016 at 07:33:46PM -0500, Jon Masters wrote: > > >>> Even without this patch, I don't think it's a show-stopper to have > >>> Linux mistakenly thinking this region is rou

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-06 Thread Jon Masters
On 12/05/2016 04:21 PM, Bjorn Helgaas wrote: > On Fri, Dec 02, 2016 at 07:33:46PM -0500, Jon Masters wrote: >>> Even without this patch, I don't think it's a show-stopper to have >>> Linux mistakenly thinking this region is routed to PCI, because the >>> driver does reserve it and the PCI core wil

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Jon Masters
On 12/05/2016 04:20 PM, Bjorn Helgaas wrote: > On Fri, Dec 02, 2016 at 11:06:30PM -0800, Duc Dang wrote: >> On Fri, Dec 2, 2016 at 3:39 PM, Bjorn Helgaas wrote: > >>> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c >>> index 8a177a1..a16fc8e 100644 >>> --- a/arch/arm64/kernel/pci.c

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Duc Dang
On Mon, Dec 5, 2016 at 1:53 PM, Bjorn Helgaas wrote: > On Thu, Dec 01, 2016 at 06:52:23PM -0800, Duc Dang wrote: >> On Thu, Dec 1, 2016 at 10:33 AM, Bjorn Helgaas wrote: > >> I made similar changes in v4 patch. The ECAM quirk will be built when >> ACPI and PCI_QUIRKS are enabled. >> >> When build

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Bjorn Helgaas
On Thu, Dec 01, 2016 at 06:52:23PM -0800, Duc Dang wrote: > On Thu, Dec 1, 2016 at 10:33 AM, Bjorn Helgaas wrote: > I made similar changes in v4 patch. The ECAM quirk will be built when > ACPI and PCI_QUIRKS are enabled. > > When building for DT only, the ECAM quirk won't be compiled. Perfect.

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Duc Dang
On Mon, Dec 5, 2016 at 1:20 PM, Bjorn Helgaas wrote: > On Fri, Dec 02, 2016 at 11:06:30PM -0800, Duc Dang wrote: >> On Fri, Dec 2, 2016 at 3:39 PM, Bjorn Helgaas wrote: > >> > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c >> > index 8a177a1..a16fc8e 100644 >> > --- a/arch/arm64/k

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Bjorn Helgaas
On Fri, Dec 02, 2016 at 07:33:46PM -0500, Jon Masters wrote: > On 12/02/2016 06:39 PM, Bjorn Helgaas wrote: > > On Thu, Dec 01, 2016 at 11:08:23PM -0500, Jon Masters wrote: > > >> Let's see if I summarized this correctly... > >> > >> 1. The MMIO registers for the host bridge itself need to be desc

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-05 Thread Bjorn Helgaas
On Fri, Dec 02, 2016 at 11:06:30PM -0800, Duc Dang wrote: > On Fri, Dec 2, 2016 at 3:39 PM, Bjorn Helgaas wrote: > > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c > > index 8a177a1..a16fc8e 100644 > > --- a/arch/arm64/kernel/pci.c > > +++ b/arch/arm64/kernel/pci.c > > @@ -114,6 +

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-02 Thread Duc Dang
On Fri, Dec 2, 2016 at 3:39 PM, Bjorn Helgaas wrote: > > On Thu, Dec 01, 2016 at 11:08:23PM -0500, Jon Masters wrote: > > Hi Bjorn, Duc, Mark, > > > > I switched my brain to the on mode and went and read some specs, and a few > > tables, so here's my 2 cents on this... > > > > On 12/01/2016 06:22

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-02 Thread Jon Masters
On 12/02/2016 06:39 PM, Bjorn Helgaas wrote: > On Thu, Dec 01, 2016 at 11:08:23PM -0500, Jon Masters wrote: >> Let's see if I summarized this correctly... >> >> 1. The MMIO registers for the host bridge itself need to be described >>somewhere, especially if we need to find those in a quirk and

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-02 Thread Bjorn Helgaas
On Thu, Dec 01, 2016 at 11:08:23PM -0500, Jon Masters wrote: > Hi Bjorn, Duc, Mark, > > I switched my brain to the on mode and went and read some specs, and a few > tables, so here's my 2 cents on this... > > On 12/01/2016 06:22 PM, Duc Dang wrote: > > On Thu, Dec 1, 2016 at 3:07 PM, Bjorn Helgaa

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-02 Thread Jon Masters
Quick reply - sorry for top posting (it's 3am...) - I would favor keeping the existing Fixed32Memory _CRS but switching over to prefer the PNP entry as a good citizen. The trouble is that it would be unfortunate if existing distros stopped working on newer firmware and it would lead to IMO more

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Duc Dang
On Thu, Dec 1, 2016 at 10:31 PM, Jon Masters wrote: > Bjorn, > > Although I think the below still applies (that we need to leave that > Memory32Fixed for existing deployments, and this is going to result > in /proc/iomem polution), I've done some more reading of your ecam > tree and the implementa

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Jon Masters
Bjorn, Although I think the below still applies (that we need to leave that Memory32Fixed for existing deployments, and this is going to result in /proc/iomem polution), I've done some more reading of your ecam tree and the implementation of acpi_get_rc_resources you mentioned, and in particular h

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Jon Masters
Hi Bjorn, Duc, Mark, I switched my brain to the on mode and went and read some specs, and a few tables, so here's my 2 cents on this... On 12/01/2016 06:22 PM, Duc Dang wrote: > On Thu, Dec 1, 2016 at 3:07 PM, Bjorn Helgaas wrote: >> On Thu, Dec 01, 2016 at 02:10:10PM -0800, Duc Dang wrote: >>>

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Duc Dang
On Thu, Dec 1, 2016 at 10:33 AM, Bjorn Helgaas wrote: > Hi Duc, > > On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang wrote: >> PCIe controllers in X-Gene SoCs is not ECAM compliant: software >> needs to configure additional controller's register to address >> device at bus:dev:function. >> >> Th

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Duc Dang
On Thu, Dec 1, 2016 at 3:07 PM, Bjorn Helgaas wrote: > On Thu, Dec 01, 2016 at 02:10:10PM -0800, Duc Dang wrote: >> On Thu, Dec 1, 2016 at 11:41 AM, Bjorn Helgaas wrote: >> > On Thu, Dec 01, 2016 at 02:20:53PM -0500, Mark Salter wrote: >> >> On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote:

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Bjorn Helgaas
On Thu, Dec 01, 2016 at 02:10:10PM -0800, Duc Dang wrote: > On Thu, Dec 1, 2016 at 11:41 AM, Bjorn Helgaas wrote: > > On Thu, Dec 01, 2016 at 02:20:53PM -0500, Mark Salter wrote: > >> On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote: > >> > On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Jon Masters
Thanks Duc! I will test quickly if you have it today :) -- Computer Architect | Sent from my 64-bit #ARM Powered phone > On Dec 1, 2016, at 17:10, Duc Dang wrote: > >> On Thu, Dec 1, 2016 at 11:41 AM, Bjorn Helgaas wrote: >>> On Thu, Dec 01, 2016 at 02:20:53PM -0500, Mark Salter wrote: O

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Duc Dang
On Thu, Dec 1, 2016 at 11:41 AM, Bjorn Helgaas wrote: > On Thu, Dec 01, 2016 at 02:20:53PM -0500, Mark Salter wrote: >> On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote: >> > On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang wrote: > >> > > +static struct resource xgene_v1_csr_res[] = { >>

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Duc Dang
On Thu, Dec 1, 2016 at 11:17 AM, Jon Masters wrote: > On 12/01/2016 10:08 AM, Mark Salter wrote: >> On Wed, 2016-11-30 at 15:42 -0800, Duc Dang wrote: > >>> +static int xgene_v1_pcie_ecam_init(struct pci_config_window *cfg) >>> +{ >>> +struct acpi_device *adev = to_acpi_device(cfg->parent); >>

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Bjorn Helgaas
On Thu, Dec 01, 2016 at 02:20:53PM -0500, Mark Salter wrote: > On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote: > > On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang wrote: > > > +static struct resource xgene_v1_csr_res[] = { > > > + [0] = DEFINE_RES_MEM_NAMED(0x1f2bUL, SZ_64K, "PCIe C

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Jon Masters
On 12/01/2016 02:20 PM, Mark Salter wrote: > On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote: >>> + csr = &xgene_v1_csr_res[root->segment]; >> This makes me nervous because root->segment comes from the ACPI _SEG, >> and if firmware gives us junk in _SEG, we will reference something in >>

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Mark Salter
On Thu, 2016-12-01 at 12:33 -0600, Bjorn Helgaas wrote: > Hi Duc, > > On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang wrote: > > > > PCIe controllers in X-Gene SoCs is not ECAM compliant: software > > needs to configure additional controller's register to address > > device at bus:dev:function

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Jon Masters
On 12/01/2016 10:08 AM, Mark Salter wrote: > On Wed, 2016-11-30 at 15:42 -0800, Duc Dang wrote: >> +static int xgene_v1_pcie_ecam_init(struct pci_config_window *cfg) >> +{ >> +struct acpi_device *adev = to_acpi_device(cfg->parent); >> +struct acpi_pci_root *root = acpi_driver_data(adev); >

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Bjorn Helgaas
Hi Duc, On Wed, Nov 30, 2016 at 03:42:53PM -0800, Duc Dang wrote: > PCIe controllers in X-Gene SoCs is not ECAM compliant: software > needs to configure additional controller's register to address > device at bus:dev:function. > > The quirk will only be applied for X-Gene PCIe MCFG table with > O

Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-12-01 Thread Mark Salter
On Wed, 2016-11-30 at 15:42 -0800, Duc Dang wrote: > PCIe controllers in X-Gene SoCs is not ECAM compliant: software > needs to configure additional controller's register to address > device at bus:dev:function. > > The quirk will only be applied for X-Gene PCIe MCFG table with > OEM revison 1, 2,

[PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller

2016-11-30 Thread Duc Dang
PCIe controllers in X-Gene SoCs is not ECAM compliant: software needs to configure additional controller's register to address device at bus:dev:function. The quirk will only be applied for X-Gene PCIe MCFG table with OEM revison 1, 2, 3 or 4 (PCIe controller v1 and v2 on X-Gene SoCs). The quirk