All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bharat Kumar Gogada <bharatku@xilinx.com>
To: "lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>
Cc: PCI <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Marc Zyngier <maz@kernel.org>
Subject: RE: [PATCH v9 2/2] PCI: xilinx-cpm: Add Versal CPM Root Port driver
Date: Mon, 13 Jul 2020 12:24:44 +0000	[thread overview]
Message-ID: <BYAPR02MB5559FBB8597F3B0CD5EF0F22A5600@BYAPR02MB5559.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20200713112613.GB25865@e121166-lin.cambridge.arm.com>

> Subject: Re: [PATCH v9 2/2] PCI: xilinx-cpm: Add Versal CPM Root Port driver
> 
> On Fri, Jul 10, 2020 at 09:16:57AM -0600, Rob Herring wrote:
> > On Tue, Jun 16, 2020 at 6:57 AM Bharat Kumar Gogada
> > <bharat.kumar.gogada@xilinx.com> wrote:
> > >
> > > - Add support for Versal CPM as Root Port.
> > > - The Versal ACAP devices include CCIX-PCIe Module (CPM). The
> integrated
> > >   block for CPM along with the integrated bridge can function
> > >   as PCIe Root Port.
> > > - Bridge error and legacy interrupts in Versal CPM are handled using
> > >   Versal CPM specific interrupt line.
> > >
> > > Signed-off-by: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
> > > ---
> > >  drivers/pci/controller/Kconfig           |   8 +
> > >  drivers/pci/controller/Makefile          |   1 +
> > >  drivers/pci/controller/pcie-xilinx-cpm.c | 617
> > > +++++++++++++++++++++++++++++++
> > >  3 files changed, 626 insertions(+)
> > >  create mode 100644 drivers/pci/controller/pcie-xilinx-cpm.c
> >
> > [...]
> >
> > > +static int xilinx_cpm_pcie_probe(struct platform_device *pdev) {
> > > +       struct xilinx_cpm_pcie_port *port;
> > > +       struct device *dev = &pdev->dev;
> > > +       struct pci_host_bridge *bridge;
> > > +       struct resource *bus_range;
> > > +       int err;
> > > +
> > > +       bridge = devm_pci_alloc_host_bridge(dev, sizeof(*port));
> > > +       if (!bridge)
> > > +               return -ENODEV;
> > > +
> > > +       port = pci_host_bridge_priv(bridge);
> > > +
> > > +       port->dev = dev;
> > > +
> > > +       err = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
> > > +                                             &bridge->dma_ranges, &bus_range);
> > > +       if (err) {
> > > +               dev_err(dev, "Getting bridge resources failed\n");
> > > +               return err;
> > > +       }
> > > +
> > > +       err = xilinx_cpm_pcie_init_irq_domain(port);
> > > +       if (err)
> > > +               return err;
> > > +
> > > +       err = xilinx_cpm_pcie_parse_dt(port, bus_range);
> > > +       if (err) {
> > > +               dev_err(dev, "Parsing DT failed\n");
> > > +               goto err_parse_dt;
> > > +       }
> > > +
> > > +       xilinx_cpm_pcie_init_port(port);
> > > +
> > > +       err = xilinx_cpm_setup_irq(port);
> > > +       if (err) {
> > > +               dev_err(dev, "Failed to set up interrupts\n");
> > > +               goto err_setup_irq;
> > > +       }
> >
> > All the h/w init here can be moved to an .init() function in ecam ops
> > and then use pci_host_common_probe. Given this is v9, that can be a
> > follow-up I guess.
> 
> I think there is time to get it done, Bharat please let me know if you can
> repost it shortly with Rob's requested change implemented.
>
Thanks Rob for your time.
Thanks Lorenzo, the reason I cannot use pci_host_common_probe is, 
I need pci_config_window locally as the we use same ecam space for local bridge register access.
In xilinx_cpm_pcie_parse_dt funciton
port->reg_base = port->cfg->win;

If we move to pci_host_common_probe, I will not be able to access controller registers.
So can we please proceed with existing flow. 

Regards,
Bharat

> >
> > > +
> > > +       bridge->dev.parent = dev;
> > > +       bridge->sysdata = port->cfg;
> > > +       bridge->busnr = port->cfg->busr.start;
> > > +       bridge->ops = &pci_generic_ecam_ops.pci_ops;
> > > +       bridge->map_irq = of_irq_parse_and_map_pci;
> > > +       bridge->swizzle_irq = pci_common_swizzle;
> > > +
> > > +       err = pci_host_probe(bridge);
> > > +       if (err < 0)
> > > +               goto err_host_bridge;
> > > +
> > > +       return 0;
> > > +
> > > +err_host_bridge:
> > > +       xilinx_cpm_free_interrupts(port);
> > > +err_setup_irq:
> > > +       pci_ecam_free(port->cfg);
> > > +err_parse_dt:
> > > +       xilinx_cpm_free_irq_domains(port);
> > > +       return err;
> > > +}

  reply	other threads:[~2020-07-13 12:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 12:56 [PATCH v9 0/2] Adding support for Versal CPM as Root Port driver Bharat Kumar Gogada
2020-06-16 12:56 ` [PATCH v9 1/2] PCI: xilinx-cpm: Add YAML schemas for Versal CPM Root Port Bharat Kumar Gogada
2020-07-10 15:04   ` Rob Herring
2020-06-16 12:56 ` [PATCH v9 2/2] PCI: xilinx-cpm: Add Versal CPM Root Port driver Bharat Kumar Gogada
2020-06-25 11:47   ` Bharat Kumar Gogada
2020-07-10 15:16   ` Rob Herring
2020-07-13 11:26     ` Lorenzo Pieralisi
2020-07-13 12:24       ` Bharat Kumar Gogada [this message]
2020-07-14 14:17         ` Rob Herring
2020-08-05 20:43   ` Bjorn Helgaas
2020-08-05 21:39     ` Lorenzo Pieralisi
2020-08-05 22:03       ` Bjorn Helgaas
2020-08-05 23:30         ` Bjorn Helgaas
2020-08-06  9:54           ` Lorenzo Pieralisi
2020-08-06 13:13             ` Bjorn Helgaas
2020-07-13 13:56 ` [PATCH v9 0/2] Adding support for Versal CPM as " Lorenzo Pieralisi

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=BYAPR02MB5559FBB8597F3B0CD5EF0F22A5600@BYAPR02MB5559.namprd02.prod.outlook.com \
    --to=bharatku@xilinx.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=robh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.