devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Xiaowei Bao <xiaowei.bao@nxp.com>
Cc: "Z.q. Hou" <zhiqiang.hou@nxp.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	Leo Li <leoyang.li@nxp.com>, "kishon@ti.com" <kishon@ti.com>,
	"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	"M.h. Lian" <minghuan.lian@nxp.com>,
	"andrew.murray@arm.com" <andrew.murray@arm.com>,
	Mingkai Hu <mingkai.hu@nxp.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/6] PCI: mobiveil: Add PCIe Gen4 EP driver for NXP Layerscape SoCs
Date: Tue, 15 Oct 2019 10:18:49 +0100	[thread overview]
Message-ID: <20191015091849.GT25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <AM5PR04MB3299919E5C4C8A764DB3A656F5930@AM5PR04MB3299.eurprd04.prod.outlook.com>

On Tue, Oct 15, 2019 at 09:14:00AM +0000, Xiaowei Bao wrote:
> > -----Original Message-----
> > From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
> > Sent: 2019年10月15日 17:08
> > To: Xiaowei Bao <xiaowei.bao@nxp.com>
> > Cc: Z.q. Hou <zhiqiang.hou@nxp.com>; bhelgaas@google.com;
> > robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org; Leo Li
> > <leoyang.li@nxp.com>; kishon@ti.com; lorenzo.pieralisi@arm.com; M.h. Lian
> > <minghuan.lian@nxp.com>; andrew.murray@arm.com; Mingkai Hu
> > <mingkai.hu@nxp.com>; linux-pci@vger.kernel.org;
> > linux-arm-kernel@lists.infradead.org; devicetree@vger.kernel.org;
> > linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 3/6] PCI: mobiveil: Add PCIe Gen4 EP driver for NXP
> > Layerscape SoCs
> > 
> > On Tue, Oct 15, 2019 at 07:46:12AM +0000, Xiaowei Bao wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
> > > > Sent: 2019年9月25日 0:39
> > > > To: Xiaowei Bao <xiaowei.bao@nxp.com>
> > > > Cc: Z.q. Hou <zhiqiang.hou@nxp.com>; bhelgaas@google.com;
> > > > robh+dt@kernel.org; mark.rutland@arm.com; shawnguo@kernel.org; Leo
> > > > robh+Li
> > > > <leoyang.li@nxp.com>; kishon@ti.com; lorenzo.pieralisi@arm.com; M.h.
> > > > Lian <minghuan.lian@nxp.com>; andrew.murray@arm.com; Mingkai Hu
> > > > <mingkai.hu@nxp.com>; linux-pci@vger.kernel.org;
> > > > linux-arm-kernel@lists.infradead.org; devicetree@vger.kernel.org;
> > > > linux-kernel@vger.kernel.org
> > > > Subject: Re: [PATCH 3/6] PCI: mobiveil: Add PCIe Gen4 EP driver for
> > > > NXP Layerscape SoCs
> > > >
> > > > On Mon, Sep 16, 2019 at 10:17:39AM +0800, Xiaowei Bao wrote:
> > > > > This PCIe controller is based on the Mobiveil GPEX IP, it work in
> > > > > EP mode if select this config opteration.
> > > > >
> > > > > Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
> > > > > ---
> > > > >  MAINTAINERS                                        |   2
> > +
> > > > >  drivers/pci/controller/mobiveil/Kconfig            |  17 ++-
> > > > >  drivers/pci/controller/mobiveil/Makefile           |   1 +
> > > > >  .../controller/mobiveil/pcie-layerscape-gen4-ep.c  | 156
> > > > > +++++++++++++++++++++
> > > > >  4 files changed, 173 insertions(+), 3 deletions(-)  create mode
> > > > > 100644 drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c
> > > > >
> > > > > diff --git a/MAINTAINERS b/MAINTAINERS index b997056..0858b54
> > > > > 100644
> > > > > --- a/MAINTAINERS
> > > > > +++ b/MAINTAINERS
> > > > > @@ -12363,11 +12363,13 @@ F:
> > > > 	drivers/pci/controller/dwc/*layerscape*
> > > > >
> > > > >  PCI DRIVER FOR NXP LAYERSCAPE GEN4 CONTROLLER
> > > > >  M:	Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> > > > > +M:	Xiaowei Bao <xiaowei.bao@nxp.com>
> > > > >  L:	linux-pci@vger.kernel.org
> > > > >  L:	linux-arm-kernel@lists.infradead.org
> > > > >  S:	Maintained
> > > > >  F:	Documentation/devicetree/bindings/pci/layerscape-pcie-gen4.txt
> > > > >  F:	drivers/pci/controller/mobibeil/pcie-layerscape-gen4.c
> > > > > +F:	drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c
> > > > >
> > > > >  PCI DRIVER FOR GENERIC OF HOSTS
> > > > >  M:	Will Deacon <will@kernel.org>
> > > > > diff --git a/drivers/pci/controller/mobiveil/Kconfig
> > > > > b/drivers/pci/controller/mobiveil/Kconfig
> > > > > index 2054950..0696b6e 100644
> > > > > --- a/drivers/pci/controller/mobiveil/Kconfig
> > > > > +++ b/drivers/pci/controller/mobiveil/Kconfig
> > > > > @@ -27,13 +27,24 @@ config PCIE_MOBIVEIL_PLAT
> > > > >  	  for address translation and it is a PCIe Gen4 IP.
> > > > >
> > > > >  config PCIE_LAYERSCAPE_GEN4
> > > > > -	bool "Freescale Layerscape PCIe Gen4 controller"
> > > > > +	bool "Freescale Layerscpe PCIe Gen4 controller in RC mode"
> > > > >  	depends on PCI
> > > > >  	depends on OF && (ARM64 || ARCH_LAYERSCAPE)
> > > > >  	depends on PCI_MSI_IRQ_DOMAIN
> > > > >  	select PCIE_MOBIVEIL_HOST
> > > > >  	help
> > > > >  	  Say Y here if you want PCIe Gen4 controller support on
> > > > > -	  Layerscape SoCs. The PCIe controller can work in RC or
> > > > > -	  EP mode according to RCW[HOST_AGT_PEX] setting.
> > > > > +	  Layerscape SoCs. And the PCIe controller work in RC mode
> > > > > +	  by setting the RCW[HOST_AGT_PEX] to 0.
> > > > > +
> > > > > +config PCIE_LAYERSCAPE_GEN4_EP
> > > > > +	bool "Freescale Layerscpe PCIe Gen4 controller in EP mode"
> > > > > +	depends on PCI
> > > > > +	depends on OF && (ARM64 || ARCH_LAYERSCAPE)
> > > > > +	depends on PCI_ENDPOINT
> > > > > +	select PCIE_MOBIVEIL_EP
> > > > > +	help
> > > > > +	  Say Y here if you want PCIe Gen4 controller support on
> > > > > +	  Layerscape SoCs. And the PCIe controller work in EP mode
> > > > > +	  by setting the RCW[HOST_AGT_PEX] to 1.
> > > > >  endmenu
> > > > > diff --git a/drivers/pci/controller/mobiveil/Makefile
> > > > > b/drivers/pci/controller/mobiveil/Makefile
> > > > > index 686d41f..6f54856 100644
> > > > > --- a/drivers/pci/controller/mobiveil/Makefile
> > > > > +++ b/drivers/pci/controller/mobiveil/Makefile
> > > > > @@ -4,3 +4,4 @@ obj-$(CONFIG_PCIE_MOBIVEIL_HOST) +=
> > > > > pcie-mobiveil-host.o
> > > > >  obj-$(CONFIG_PCIE_MOBIVEIL_EP) += pcie-mobiveil-ep.o
> > > > >  obj-$(CONFIG_PCIE_MOBIVEIL_PLAT) += pcie-mobiveil-plat.o
> > > > >  obj-$(CONFIG_PCIE_LAYERSCAPE_GEN4) += pcie-layerscape-gen4.o
> > > > > +obj-$(CONFIG_PCIE_LAYERSCAPE_GEN4_EP) +=
> > > > pcie-layerscape-gen4-ep.o
> > > > > diff --git
> > > > > a/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c
> > > > > b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c
> > > > > new file mode 100644
> > > > > index 0000000..7bfec51
> > > > > --- /dev/null
> > > > > +++ b/drivers/pci/controller/mobiveil/pcie-layerscape-gen4-ep.c
> > > > > @@ -0,0 +1,156 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0
> > > > > +/*
> > > > > + * PCIe controller EP driver for Freescale Layerscape SoCs
> > > > > + *
> > > > > + * Copyright (C) 2019 NXP Semiconductor.
> > > > > + *
> > > > > + * Author: Xiaowei Bao <xiaowei.bao@nxp.com>  */
> > > > > +
> > > > > +#include <linux/kernel.h>
> > > > > +#include <linux/init.h>
> > > > > +#include <linux/of_pci.h>
> > > > > +#include <linux/of_platform.h>
> > > > > +#include <linux/of_address.h>
> > > > > +#include <linux/pci.h>
> > > > > +#include <linux/platform_device.h> #include <linux/resource.h>
> > > > > +
> > > > > +#include "pcie-mobiveil.h"
> > > > > +
> > > > > +#define PCIE_LX2_BAR_NUM	4
> > > > > +
> > > > > +#define to_ls_pcie_g4_ep(x)	dev_get_drvdata((x)->dev)
> > > > > +
> > > > > +struct ls_pcie_g4_ep {
> > > > > +	struct mobiveil_pcie		*mv_pci;
> > > > > +};
> > > > > +
> > > > > +static const struct of_device_id ls_pcie_g4_ep_of_match[] = {
> > > > > +	{ .compatible = "fsl,lx2160a-pcie-ep",},
> > > > > +	{ },
> > > > > +};
> > > > > +
> > > > > +static const struct pci_epc_features ls_pcie_g4_epc_features = {
> > > > > +	.linkup_notifier = false,
> > > > > +	.msi_capable = true,
> > > > > +	.msix_capable = true,
> > > > > +	.reserved_bar = (1 << BAR_4) | (1 << BAR_5),
> > > >
> > > > 			BIT(BAR_4) | BIT(BAR_5) ?
> > >
> > > I think use .reserved_bar = (1 << BAR_4) | (1 << BAR_5), is better,
> > > because BAR_4 is not a bit of register.
> > 
> > Why is whether it's a register or not relevent?
> 
> My understand is that the BIT is used to register, refer to other EP driver files,
> it also use 1 << BAR_4 method.
> 
> [baoxw@titan controller]$ grep -r "reserved_bar" *
> dwc/pci-keystone.c:     .reserved_bar = 1 << BAR_0 | 1 << BAR_1,
> mobiveil/pcie-layerscape-gen4-ep.c:     .reserved_bar = (1 << BAR_4) | (1 << BAR_5),

$ grep '\<BIT(' fs kernel lib mm net -r

About 695 non-device driver instances at the very least seem to disagree.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

  reply	other threads:[~2019-10-15  9:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16  2:17 [PATCH 0/6] Add the Mobiveil EP and Layerscape Gen4 EP driver support Xiaowei Bao
2019-09-16  2:17 ` [PATCH 1/6] PCI: mobiveil: Add the " Xiaowei Bao
2019-09-16  2:17 ` [PATCH 2/6] dt-bindings: Add DT binding for PCIE GEN4 EP of the layerscape Xiaowei Bao
2019-09-30 22:22   ` Rob Herring
2019-10-08  1:26     ` Xiaowei Bao
2019-09-16  2:17 ` [PATCH 3/6] PCI: mobiveil: Add PCIe Gen4 EP driver for NXP Layerscape SoCs Xiaowei Bao
2019-09-24 16:38   ` Russell King - ARM Linux admin
2019-10-15  7:46     ` Xiaowei Bao
2019-10-15  9:07       ` Russell King - ARM Linux admin
2019-10-15  9:14         ` Xiaowei Bao
2019-10-15  9:18           ` Russell King - ARM Linux admin [this message]
2019-09-16  2:17 ` [PATCH 4/6] PCI: mobiveil: Add workaround for unsupported request error Xiaowei Bao
2019-09-24 16:49   ` Russell King - ARM Linux admin
2019-10-15  7:46     ` Xiaowei Bao
2019-09-16  2:17 ` [PATCH 5/6] arm64: dts: lx2160a: Add PCIe EP node Xiaowei Bao
2019-09-16  2:17 ` [PATCH 6/6] misc: pci_endpoint_test: Add the layerscape PCIe GEN4 EP device support Xiaowei Bao
2019-09-24 14:18 ` [PATCH 0/6] Add the Mobiveil EP and Layerscape Gen4 EP driver support Russell King - ARM Linux admin
2019-09-24 15:52   ` Russell King - ARM Linux admin
2019-10-02 21:14     ` Bjorn Helgaas
2019-10-02 21:59       ` Russell King - ARM Linux admin
2019-10-09  9:44 ` Andrew Murray
  -- strict thread matches above, loose matches on Subject: below --
2019-02-18  9:46 [PATCH 1/6] PCI: mobiveil: Add the EP mode support Xiaowei Bao
2019-02-18  9:46 ` [PATCH 3/6] PCI: mobiveil: Add PCIe Gen4 EP driver for NXP Layerscape SoCs Xiaowei Bao

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=20191015091849.GT25745@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew.murray@arm.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=minghuan.lian@nxp.com \
    --cc=mingkai.hu@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=xiaowei.bao@nxp.com \
    --cc=zhiqiang.hou@nxp.com \
    /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).