devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Bjorn Helgaas <helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-pci <linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Marcin Wojtas <mw-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org>,
	Leif Lindholm
	<leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Graeme Gregory
	<graeme.gregory-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Jingoo Han <jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Joao Pinto <Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH v3 1/2] pci: designware: add driver for DWC controller in ECAM shift mode
Date: Thu, 28 Sep 2017 17:00:20 +0100	[thread overview]
Message-ID: <20170928160019.GC9892@arm.com> (raw)
In-Reply-To: <CAKv+Gu-7OWG0=7VcWxaVqtAYoWrmNd1xhweS+EhSZES3cNJ+Kw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Sep 28, 2017 at 08:57:28AM -0700, Ard Biesheuvel wrote:
> On 28 September 2017 at 02:03, Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> wrote:
> > On Tue, Sep 26, 2017 at 12:32:00PM -0500, Bjorn Helgaas wrote:
> >> [+cc Will]
> >>
> >> On Mon, Aug 28, 2017 at 07:04:36PM +0100, Ard Biesheuvel wrote:
> >> > Some implementations of the Synopsys Designware PCIe controller implement
> >> > a so-called ECAM shift mode, which allows a static memory window to be
> >> > configured that covers the configuration space of the entire bus range.
> >> >
> >> > If the firmware performs all the low level configuration that is required
> >> > to expose this controller in a fully ECAM compatible manner, we can
> >> > simply describe it as "pci-host-ecam-generic" and be done with it.
> >> > However, it appears that in some cases (one of which is the Armada 80x0),
> >> > the IP is synthesized with an ATU window size that does not allow the
> >> > first bus to be mapped in a way that prevents the device on the
> >> > downstream port from appearing more than once.
> >> >
> >> > So implement a driver that relies on the firmware to perform all low
> >> > level initialization, and drives the controller in ECAM mode, but
> >> > overrides the config space accessors to take the above quirk into
> >> > account.
> >> >
> >> > Note that, unlike most drivers for this IP, this driver does not expose
> >> > a fake bridge device at B/D/F 00:00.0. There is no point in doing so,
> >> > given that this is not a true bridge, and does not require any windows
> >> > to be configured in order for the downstream device to operate correctly.
> >> > Omitting it also prevents the PCI resource allocation routines from
> >> > handing out BAR space to it unnecessarily.
> >>
> >> This is a tangent, but does this mean the other drivers do not need to
> >> expose a fake 00:00.0 device either?
> >>
> >> s/Designware/DesignWare/ in comments, changelogs, Kconfig text, etc.
> >>
> >> > Cc: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> >> > Cc: Jingoo Han <jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >> > Cc: Joao Pinto <Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
> >> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> >> > ---
> >> >  drivers/pci/dwc/Kconfig                | 11 +++
> >> >  drivers/pci/dwc/Makefile               |  1 +
> >> >  drivers/pci/dwc/pcie-designware-ecam.c | 77 ++++++++++++++++++++
> >>
> >> This really doesn't have any DesignWare specifics in it, and it seems
> >> more related to drivers/pci/host/pci-host-generic.c than to anything
> >> in drivers/pci/dwc.  Maybe it should be
> >> drivers/pci/host/pci-host-generic-quirks.c or something?  That's
> >> unwieldy, I admit.
> >>
> >> Putting it in pci/dwc would make Jingoo and Joao the default
> >> maintainers; I don't know how they feel about that.  We would probably
> >> have to tweak MAINTAINERS if we *didn't* put it in pci/dwc.
> >>
> >> Any thoughts on this, Will?
> >
> > The idea of a "generic quirk" makes me smile, I must admit :)
> >
> > I think there are two options:
> >
> >   1. Use the full DWC driver, and don't rely on firmware
> > -or-
> >   2. Rely on firmware, but teach pci-host-generic to deal with the funny
> >      config space
> >
> > For (2), we probably want to describe this as generically as possible
> > in case some other SoCs run into the same problem.
> >
> 
> I take it this implies a DT property. I could add one that consists of
> an array of val/mask tuples or base/size tuples that allow us to
> disable arbitrary subregions of the config space. I could also add a
> simple boolean property that implements this exact quirk. Do you have
> any preference?

I'd say either a boolean property or a new compatible string. I think Rob
prefers the latter, from what he said recently on an SMMU thread.

Will
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-09-28 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 18:04 [PATCH v3 0/2] pci: add support for firmware initialized designware RCs Ard Biesheuvel
     [not found] ` <20170828180437.2646-1-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-08-28 18:04   ` [PATCH v3 1/2] pci: designware: add driver for DWC controller in ECAM shift mode Ard Biesheuvel
2017-09-26 17:32     ` Bjorn Helgaas
     [not found]       ` <20170926173200.GL15970-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-09-28  9:03         ` Will Deacon
2017-09-28 15:57           ` Ard Biesheuvel
     [not found]             ` <CAKv+Gu-7OWG0=7VcWxaVqtAYoWrmNd1xhweS+EhSZES3cNJ+Kw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-28 16:00               ` Will Deacon [this message]
2017-09-28 16:04                 ` Ard Biesheuvel
2017-09-28 15:51         ` Ard Biesheuvel
     [not found]           ` <CAKv+Gu8CCcm_R3S1PbXZFqzvjAJVfU_bKpimVxbeQ78ciAgJyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-28 17:48             ` Bjorn Helgaas
     [not found]               ` <20170928174847.GW15970-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-09-28 18:33                 ` Ard Biesheuvel
2017-09-29  3:29                 ` Jingoo Han
2017-10-06 14:52             ` Ard Biesheuvel
     [not found]               ` <CAKv+Gu_MM--uHwQk_brJh1bPOdsUTH4j+aJUDyS1um3mHDdsEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-06 22:45                 ` Bjorn Helgaas
     [not found]                   ` <20171006224503.GH25517-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-10-06 23:10                     ` Ard Biesheuvel
2017-08-28 18:04   ` [PATCH v3 2/2] dt-bindings: designware: add binding for Designware PCIe in ECAM mode Ard Biesheuvel
2017-08-31 14:23     ` Rob Herring
2017-08-29 15:40 ` [PATCH v3 0/2] pci: add support for firmware initialized designware RCs Marcin Wojtas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170928160019.GC9892@arm.com \
    --to=will.deacon-5wv7dgnigg8@public.gmane.org \
    --cc=Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=graeme.gregory-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=helgaas-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mw-nYOzD4b6Jr9Wk0Htik3J/w@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).