diff mbox

PCI: layerscape: Add support for ls2088a and ls1088a

Message ID 1499333984-17668-1-git-send-email-Zhiqiang.Hou@nxp.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Z.Q. Hou July 6, 2017, 9:39 a.m. UTC
From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

The ls1088a and ls2088a has the same PCIe controller, so the ls1088a
will reuse the ls2088a's pcie compatible.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
---
 Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 +
 drivers/pci/dwc/pci-layerscape.c                         | 9 +++++++++
 2 files changed, 10 insertions(+)

Comments

Bjorn Helgaas Aug. 2, 2017, 9:29 p.m. UTC | #1
[+cc Minghuan, Mingkai, Roy]

On Thu, Jul 06, 2017 at 05:39:44PM +0800, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> 
> The ls1088a and ls2088a has the same PCIe controller, so the ls1088a
> will reuse the ls2088a's pcie compatible.
> 
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> ---
>  Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 +
>  drivers/pci/dwc/pci-layerscape.c                         | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> index ee1c72d5..cb735e1 100644
> --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> @@ -15,6 +15,7 @@ Required properties:
>  - compatible: should contain the platform identifier such as:
>          "fsl,ls1021a-pcie", "snps,dw-pcie"
>          "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie"
> +        "fsl,ls2088a-pcie", "fsl,ls1088a-pcie"

You add "fsl,ls1088a-pcie" here, but not in the ls_pcie_of_match[]
table in the driver, so I don't think this will actually make the
driver claim ls1088a devices, will it?

I'm also waiting for an ack from the layerscape maintainers (added to
cc list).

>          "fsl,ls1046a-pcie"
>  - reg: base addresses and lengths of the PCIe controller
>  - interrupts: A list of interrupt outputs of the controller. Must contain an
> diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c
> index 9bed3cd..0df8189 100644
> --- a/drivers/pci/dwc/pci-layerscape.c
> +++ b/drivers/pci/dwc/pci-layerscape.c
> @@ -239,12 +239,21 @@ static struct ls_pcie_drvdata ls2080_drvdata = {
>  	.dw_pcie_ops = &dw_ls_pcie_ops,
>  };
>  
> +static struct ls_pcie_drvdata ls2088_drvdata = {
> +	.lut_offset = 0x80000,
> +	.ltssm_shift = 0,
> +	.lut_dbg = 0x407fc,
> +	.ops = &ls_pcie_host_ops,
> +	.dw_pcie_ops = &dw_ls_pcie_ops,
> +};
> +
>  static const struct of_device_id ls_pcie_of_match[] = {
>  	{ .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata },
>  	{ .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata },
>  	{ .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
>  	{ .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },
>  	{ .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
> +	{ .compatible = "fsl,ls2088a-pcie", .data = &ls2088_drvdata },
>  	{ },
>  };
>  
> -- 
> 2.1.0.27.g96db324
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Z.Q. Hou Aug. 3, 2017, 3:35 a.m. UTC | #2
Hi Bjorn,

Thanks a lot for your comments!

> -----Original Message-----

> From: Bjorn Helgaas [mailto:helgaas@kernel.org]

> Sent: 2017年8月3日 5:30

> To: Z.q. Hou <zhiqiang.hou@nxp.com>

> Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;

> bhelgaas@google.com; robh+dt@kernel.org; Minghuan Lian

> <minghuan.Lian@freescale.com>; Mingkai Hu <mingkai.hu@freescale.com>;

> Roy Zang <tie-fei.zang@freescale.com>

> Subject: Re: [PATCH] PCI: layerscape: Add support for ls2088a and ls1088a

> 

> [+cc Minghuan, Mingkai, Roy]

> 

> On Thu, Jul 06, 2017 at 05:39:44PM +0800, Zhiqiang Hou wrote:

> > From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

> >

> > The ls1088a and ls2088a has the same PCIe controller, so the ls1088a

> > will reuse the ls2088a's pcie compatible.

> >

> > Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

> > ---

> >  Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 +

> >  drivers/pci/dwc/pci-layerscape.c                         | 9

> +++++++++

> >  2 files changed, 10 insertions(+)

> >

> > diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > b/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > index ee1c72d5..cb735e1 100644

> > --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > @@ -15,6 +15,7 @@ Required properties:

> >  - compatible: should contain the platform identifier such as:

> >          "fsl,ls1021a-pcie", "snps,dw-pcie"

> >          "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie"

> > +        "fsl,ls2088a-pcie", "fsl,ls1088a-pcie"

> 

> You add "fsl,ls1088a-pcie" here, but not in the ls_pcie_of_match[] table in the

> driver, so I don't think this will actually make the driver claim ls1088a devices,

> will it?


I mean the ls1088a pcie DT nodes will use the "fsl,ls2088a-pcie" too, so I didn't add an entry for ls1088a pcie to ls_pcie_of_match[].
Is it reasonable? Or it's better to add "fsl,ls1088a-pcie" to ls_pcie_of_match[], then ls1088a pcie DT nodes use the compatible string "fsl,ls1088a-pcie"?

> I'm also waiting for an ack from the layerscape maintainers (added to cc list).

> 

> >          "fsl,ls1046a-pcie"

> >  - reg: base addresses and lengths of the PCIe controller

> >  - interrupts: A list of interrupt outputs of the controller. Must

> > contain an diff --git a/drivers/pci/dwc/pci-layerscape.c

> > b/drivers/pci/dwc/pci-layerscape.c

> > index 9bed3cd..0df8189 100644

> > --- a/drivers/pci/dwc/pci-layerscape.c

> > +++ b/drivers/pci/dwc/pci-layerscape.c

> > @@ -239,12 +239,21 @@ static struct ls_pcie_drvdata ls2080_drvdata = {

> >  	.dw_pcie_ops = &dw_ls_pcie_ops,

> >  };

> >

> > +static struct ls_pcie_drvdata ls2088_drvdata = {

> > +	.lut_offset = 0x80000,

> > +	.ltssm_shift = 0,

> > +	.lut_dbg = 0x407fc,

> > +	.ops = &ls_pcie_host_ops,

> > +	.dw_pcie_ops = &dw_ls_pcie_ops,

> > +};

> > +

> >  static const struct of_device_id ls_pcie_of_match[] = {

> >  	{ .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata },

> >  	{ .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata },

> >  	{ .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },

> >  	{ .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },

> >  	{ .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },

> > +	{ .compatible = "fsl,ls2088a-pcie", .data = &ls2088_drvdata },

> >  	{ },

> >  };

> >

> > --

> > 2.1.0.27.g96db324

> >

> >

> > _______________________________________________

> > linux-arm-kernel mailing list

> > linux-arm-kernel@lists.infradead.org

> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


Thanks,
Zhiqiang
Bjorn Helgaas Aug. 3, 2017, 6:19 p.m. UTC | #3
On Thu, Aug 03, 2017 at 03:35:46AM +0000, Z.q. Hou wrote:
> Hi Bjorn,
> 
> Thanks a lot for your comments!
> 
> > -----Original Message-----
> > From: Bjorn Helgaas [mailto:helgaas@kernel.org]
> > Sent: 2017年8月3日 5:30
> > To: Z.q. Hou <zhiqiang.hou@nxp.com>
> > Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > bhelgaas@google.com; robh+dt@kernel.org; Minghuan Lian
> > <minghuan.Lian@freescale.com>; Mingkai Hu <mingkai.hu@freescale.com>;
> > Roy Zang <tie-fei.zang@freescale.com>
> > Subject: Re: [PATCH] PCI: layerscape: Add support for ls2088a and ls1088a
> > 
> > [+cc Minghuan, Mingkai, Roy]
> > 
> > On Thu, Jul 06, 2017 at 05:39:44PM +0800, Zhiqiang Hou wrote:
> > > From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> > >
> > > The ls1088a and ls2088a has the same PCIe controller, so the ls1088a
> > > will reuse the ls2088a's pcie compatible.
> > >
> > > Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> > > ---
> > >  Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 +
> > >  drivers/pci/dwc/pci-layerscape.c                         | 9
> > +++++++++
> > >  2 files changed, 10 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> > > b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> > > index ee1c72d5..cb735e1 100644
> > > --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> > > +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
> > > @@ -15,6 +15,7 @@ Required properties:
> > >  - compatible: should contain the platform identifier such as:
> > >          "fsl,ls1021a-pcie", "snps,dw-pcie"
> > >          "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie"
> > > +        "fsl,ls2088a-pcie", "fsl,ls1088a-pcie"
> > 
> > You add "fsl,ls1088a-pcie" here, but not in the ls_pcie_of_match[]
> > table in the driver, so I don't think this will actually make the
> > driver claim ls1088a devices, will it?
> 
> I mean the ls1088a pcie DT nodes will use the "fsl,ls2088a-pcie"
> too, so I didn't add an entry for ls1088a pcie to
> ls_pcie_of_match[].  Is it reasonable? Or it's better to add
> "fsl,ls1088a-pcie" to ls_pcie_of_match[], then ls1088a pcie DT nodes
> use the compatible string "fsl,ls1088a-pcie"?

Your binding says "fsl,ls1088a-pcie" is a valid value for
"compatible".  But if a DT actually *uses* that, I don't think the
driver will claim it.

If you want to describe ls1088a devices with "fsl,ls2088a-pcie", I
think you could do that, but then why would you even mention
"fsl,ls1088a-pcie" in the binding?

Personally, if ls1088a and ls2088a are different in any way, I would
think you should use different identifiers for them (and add them both
to the binding and to the driver).  That way if a future feature
depends on the difference, you'll have a way to test for it.

But I'm not a DT guy.  Maybe Rob has a better recommendation?

Bjorn
Roy Zang Aug. 3, 2017, 6:22 p.m. UTC | #4
On 08/02/2017 10:36 PM, Z.q. Hou wrote:
> add "fsl,ls1088a-pcie" to ls_pcie_of_match[], then ls1088a pcie DT nodes use the compatible string "fsl,ls1088a-pcie"?

I'd suggest going this way.

Roy
Z.Q. Hou Aug. 4, 2017, 3:45 a.m. UTC | #5
Hi Bjorn,

Thanks a lot for your comments!

> -----Original Message-----

> From: Bjorn Helgaas [mailto:helgaas@kernel.org]

> Sent: 2017年8月4日 2:19

> To: Z.q. Hou <zhiqiang.hou@nxp.com>

> Cc: linux-pci@vger.kernel.org; Minghuan Lian

> <minghuan.Lian@freescale.com>; robh+dt@kernel.org;

> bhelgaas@google.com; Mingkai Hu <mingkai.hu@freescale.com>; Roy Zang

> <tie-fei.zang@freescale.com>; linux-arm-kernel@lists.infradead.org

> Subject: Re: [PATCH] PCI: layerscape: Add support for ls2088a and ls1088a

> 

> On Thu, Aug 03, 2017 at 03:35:46AM +0000, Z.q. Hou wrote:

> > Hi Bjorn,

> >

> > Thanks a lot for your comments!

> >

> > > -----Original Message-----

> > > From: Bjorn Helgaas [mailto:helgaas@kernel.org]

> > > Sent: 2017年8月3日 5:30

> > > To: Z.q. Hou <zhiqiang.hou@nxp.com>

> > > Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;

> > > bhelgaas@google.com; robh+dt@kernel.org; Minghuan Lian

> > > <minghuan.Lian@freescale.com>; Mingkai Hu

> > > <mingkai.hu@freescale.com>; Roy Zang <tie-fei.zang@freescale.com>

> > > Subject: Re: [PATCH] PCI: layerscape: Add support for ls2088a and

> > > ls1088a

> > >

> > > [+cc Minghuan, Mingkai, Roy]

> > >

> > > On Thu, Jul 06, 2017 at 05:39:44PM +0800, Zhiqiang Hou wrote:

> > > > From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

> > > >

> > > > The ls1088a and ls2088a has the same PCIe controller, so the

> > > > ls1088a will reuse the ls2088a's pcie compatible.

> > > >

> > > > Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

> > > > ---

> > > >  Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 +

> > > >  drivers/pci/dwc/pci-layerscape.c                         | 9

> > > +++++++++

> > > >  2 files changed, 10 insertions(+)

> > > >

> > > > diff --git

> > > > a/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > > > b/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > > > index ee1c72d5..cb735e1 100644

> > > > --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > > > +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt

> > > > @@ -15,6 +15,7 @@ Required properties:

> > > >  - compatible: should contain the platform identifier such as:

> > > >          "fsl,ls1021a-pcie", "snps,dw-pcie"

> > > >          "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie"

> > > > +        "fsl,ls2088a-pcie", "fsl,ls1088a-pcie"

> > >

> > > You add "fsl,ls1088a-pcie" here, but not in the ls_pcie_of_match[]

> > > table in the driver, so I don't think this will actually make the

> > > driver claim ls1088a devices, will it?

> >

> > I mean the ls1088a pcie DT nodes will use the "fsl,ls2088a-pcie"

> > too, so I didn't add an entry for ls1088a pcie to ls_pcie_of_match[].

> > Is it reasonable? Or it's better to add "fsl,ls1088a-pcie" to

> > ls_pcie_of_match[], then ls1088a pcie DT nodes use the compatible

> > string "fsl,ls1088a-pcie"?

> 

> Your binding says "fsl,ls1088a-pcie" is a valid value for "compatible".  But if a

> DT actually *uses* that, I don't think the driver will claim it.

> 

> If you want to describe ls1088a devices with "fsl,ls2088a-pcie", I think you

> could do that, but then why would you even mention "fsl,ls1088a-pcie" in the

> binding?

> 

> Personally, if ls1088a and ls2088a are different in any way, I would think you

> should use different identifiers for them (and add them both to the binding and

> to the driver).  That way if a future feature depends on the difference, you'll

> have a way to test for it.


Got it, will add both of them to driver and the bingding doc.
Thanks for the suggestion!

> But I'm not a DT guy.  Maybe Rob has a better recommendation?

> 


Thanks,
Zhiqiang
Z.Q. Hou Aug. 4, 2017, 3:46 a.m. UTC | #6
Hi Roy,

Thanks a lot for your comments!

> -----Original Message-----

> From: Roy Zang

> Sent: 2017年8月4日 2:23

> To: Z.q. Hou <zhiqiang.hou@nxp.com>; Bjorn Helgaas <helgaas@kernel.org>

> Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org;

> bhelgaas@google.com; robh+dt@kernel.org; Minghuan Lian

> <minghuan.Lian@freescale.com>; Mingkai Hu <mingkai.hu@freescale.com>;

> Roy Zang <tie-fei.zang@freescale.com>

> Subject: Re: [PATCH] PCI: layerscape: Add support for ls2088a and ls1088a

> 

> On 08/02/2017 10:36 PM, Z.q. Hou wrote:

> > add "fsl,ls1088a-pcie" to ls_pcie_of_match[], then ls1088a pcie DT nodes use

> the compatible string "fsl,ls1088a-pcie"?

> 

> I'd suggest going this way.


Yes, thanks for the suggestion.

Thanks,
Zhiqiang
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
index ee1c72d5..cb735e1 100644
--- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt
+++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
@@ -15,6 +15,7 @@  Required properties:
 - compatible: should contain the platform identifier such as:
         "fsl,ls1021a-pcie", "snps,dw-pcie"
         "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie"
+        "fsl,ls2088a-pcie", "fsl,ls1088a-pcie"
         "fsl,ls1046a-pcie"
 - reg: base addresses and lengths of the PCIe controller
 - interrupts: A list of interrupt outputs of the controller. Must contain an
diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c
index 9bed3cd..0df8189 100644
--- a/drivers/pci/dwc/pci-layerscape.c
+++ b/drivers/pci/dwc/pci-layerscape.c
@@ -239,12 +239,21 @@  static struct ls_pcie_drvdata ls2080_drvdata = {
 	.dw_pcie_ops = &dw_ls_pcie_ops,
 };
 
+static struct ls_pcie_drvdata ls2088_drvdata = {
+	.lut_offset = 0x80000,
+	.ltssm_shift = 0,
+	.lut_dbg = 0x407fc,
+	.ops = &ls_pcie_host_ops,
+	.dw_pcie_ops = &dw_ls_pcie_ops,
+};
+
 static const struct of_device_id ls_pcie_of_match[] = {
 	{ .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata },
 	{ .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata },
 	{ .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
 	{ .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },
 	{ .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
+	{ .compatible = "fsl,ls2088a-pcie", .data = &ls2088_drvdata },
 	{ },
 };