LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] powerpc: fsl_pci: Add forced PCI Agent enumeration
       [not found] <1335786600.106191.1409010734055.JavaMail.zimbra@xes-inc.com>
@ 2014-08-25 23:54 ` Aaron Sierra
  2014-08-26 20:52   ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Sierra @ 2014-08-25 23:54 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Scott Wood, Minghuan Lian

The following commit prevents the MPC8548E on the XPedite5200 PrPMC
module from enumerating its PCI/PCI-X bus:

    powerpc/fsl-pci: use 'Header Type' to identify PCIE mode

The previous patch prevents any Freescale PCI-X bridge from enumerating
the bus, if it is hardware strapped into Agent mode.

In PCI-X, the Host is responsible for driving the PCI-X initialization
pattern to devices on the bus, so that they know whether to operate in
conventional PCI or PCI-X mode as well as what the bus timing will be.
For a PCI-X PrPMC, the pattern is driven by the mezzanine carrier it is
installed onto. Therefore, PrPMCs are PCI-X Agents, but one per system
may still enumerate the bus.

This patch causes the device node of any PCI/PCI-X bridge strapped into
Agent mode to be checked for the fsl,pci-agent-force-enum property. If
the property is present in the node, the bridge will be allowed to
enumerate the bus.

Cc: Minghuan Lian <Minghuan.Lian@freescale.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
 .../bindings/pci/fsl,pci-agent-force-enum.txt      | 27 ++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pci.c                      |  3 ++-
 2 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt

diff --git a/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
new file mode 100644
index 0000000..d8ac4a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
@@ -0,0 +1,27 @@
+* Bus Enumeration by Freescale PCI-X Agent
+
+Typically any Freescale PCI-X bridge hardware strapped into Agent mode
+is prevented from enumerating the bus. The PrPMC form-factor requires
+all mezzanines to be PCI-X Agents, but one per system may still
+enumerate the bus.
+
+The property defined below will allow a PCI-X bridge to be used for bus
+enumeration despite being strapped into Agent mode.
+
+Required properties:
+- fsl,pci-agent-force-enum : There is no value associated with this
+  property. The property itself is treated as a boolean.
+
+Example:
+
+	/* PCI-X bridge known to be PrPMC Monarch */
+	pci0: pci@ef008000 {
+		fsl,pci-agent-force-enum;
+		#interrupt-cells = <1>;
+		#size-cells = <2>;
+		#address-cells = <3>;
+		compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
+		device_type = "pci";
+		...
+		...
+	};
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4bd091a..d13663f 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -522,7 +522,8 @@ int fsl_add_bridge(struct platform_device *pdev, int is_primary)
 	} else {
 		/* For PCI read PROG to identify controller mode */
 		early_read_config_byte(hose, 0, 0, PCI_CLASS_PROG, &progif);
-		if ((progif & 1) == 1)
+		if ((progif & 1) &&
+		    !of_property_read_bool(dev, "fsl,pci-agent-force-enum"))
 			goto no_bridge;
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] powerpc: fsl_pci: Add forced PCI Agent enumeration
  2014-08-25 23:54 ` [PATCH v2] powerpc: fsl_pci: Add forced PCI Agent enumeration Aaron Sierra
@ 2014-08-26 20:52   ` Scott Wood
  2014-08-26 21:12     ` Aaron Sierra
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2014-08-26 20:52 UTC (permalink / raw)
  To: Aaron Sierra; +Cc: Minghuan Lian, linuxppc-dev

On Mon, 2014-08-25 at 18:54 -0500, Aaron Sierra wrote:
> The following commit prevents the MPC8548E on the XPedite5200 PrPMC
> module from enumerating its PCI/PCI-X bus:
> 
>     powerpc/fsl-pci: use 'Header Type' to identify PCIE mode
> 
> The previous patch prevents any Freescale PCI-X bridge from enumerating
> the bus, if it is hardware strapped into Agent mode.
> 
> In PCI-X, the Host is responsible for driving the PCI-X initialization
> pattern to devices on the bus, so that they know whether to operate in
> conventional PCI or PCI-X mode as well as what the bus timing will be.
> For a PCI-X PrPMC, the pattern is driven by the mezzanine carrier it is
> installed onto. Therefore, PrPMCs are PCI-X Agents, but one per system
> may still enumerate the bus.
> 
> This patch causes the device node of any PCI/PCI-X bridge strapped into
> Agent mode to be checked for the fsl,pci-agent-force-enum property. If
> the property is present in the node, the bridge will be allowed to
> enumerate the bus.
> 
> Cc: Minghuan Lian <Minghuan.Lian@freescale.com>
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---
>  .../bindings/pci/fsl,pci-agent-force-enum.txt      | 27 ++++++++++++++++++++++
>  arch/powerpc/sysdev/fsl_pci.c                      |  3 ++-
>  2 files changed, 29 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> 
> diff --git a/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> new file mode 100644
> index 0000000..d8ac4a7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt

This ought to be part of a general fsl,pci binding, rather than its own
file.  Unfortunately there isn't such a binding yet, but let's call this
something like "fsl,pci.txt" anyway so that there's a place to add the
rest of the binding to.

Also, CC devicetree@vger.kernel.org on all device tree patches.

Otherwise it looks OK.

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] powerpc: fsl_pci: Add forced PCI Agent enumeration
  2014-08-26 20:52   ` Scott Wood
@ 2014-08-26 21:12     ` Aaron Sierra
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Sierra @ 2014-08-26 21:12 UTC (permalink / raw)
  To: Scott Wood; +Cc: Minghuan Lian, linuxppc-dev

----- Original Message -----
> From: "Scott Wood" <scottwood@freescale.com>
> Sent: Tuesday, August 26, 2014 3:52:56 PM
> 
> On Mon, 2014-08-25 at 18:54 -0500, Aaron Sierra wrote:
> > The following commit prevents the MPC8548E on the XPedite5200 PrPMC
> > module from enumerating its PCI/PCI-X bus:
> > 
> >     powerpc/fsl-pci: use 'Header Type' to identify PCIE mode
> > 
> > The previous patch prevents any Freescale PCI-X bridge from enumerating
> > the bus, if it is hardware strapped into Agent mode.
> > 
> > In PCI-X, the Host is responsible for driving the PCI-X initialization
> > pattern to devices on the bus, so that they know whether to operate in
> > conventional PCI or PCI-X mode as well as what the bus timing will be.
> > For a PCI-X PrPMC, the pattern is driven by the mezzanine carrier it is
> > installed onto. Therefore, PrPMCs are PCI-X Agents, but one per system
> > may still enumerate the bus.
> > 
> > This patch causes the device node of any PCI/PCI-X bridge strapped into
> > Agent mode to be checked for the fsl,pci-agent-force-enum property. If
> > the property is present in the node, the bridge will be allowed to
> > enumerate the bus.
> > 
> > Cc: Minghuan Lian <Minghuan.Lian@freescale.com>
> > Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> > ---
> >  .../bindings/pci/fsl,pci-agent-force-enum.txt      | 27
> >  ++++++++++++++++++++++
> >  arch/powerpc/sysdev/fsl_pci.c                      |  3 ++-
> >  2 files changed, 29 insertions(+), 1 deletion(-)
> >  create mode 100644
> >  Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> > b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> > new file mode 100644
> > index 0000000..d8ac4a7
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/pci/fsl,pci-agent-force-enum.txt
> 
> This ought to be part of a general fsl,pci binding, rather than its own
> file.  Unfortunately there isn't such a binding yet, but let's call this
> something like "fsl,pci.txt" anyway so that there's a place to add the
> rest of the binding to.

Ok, no problem.
 
> Also, CC devicetree@vger.kernel.org on all device tree patches.

Will do.

> Otherwise it looks OK.
> 
> -Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-26 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1335786600.106191.1409010734055.JavaMail.zimbra@xes-inc.com>
2014-08-25 23:54 ` [PATCH v2] powerpc: fsl_pci: Add forced PCI Agent enumeration Aaron Sierra
2014-08-26 20:52   ` Scott Wood
2014-08-26 21:12     ` Aaron Sierra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox