diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2016-12-12 12:25:09 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-12-12 12:25:09 -0500 |
commit | 46275d43c8dbf13d8b0c6e7a455608eeb220a677 (patch) | |
tree | b4d4725f448181dc0f587310ebfd782909227027 | |
parent | f887e24e0544cb239531c171f835e7e7aac4863b (diff) | |
parent | 1d77040bde2d21dc7db575d4b43c1da24c94cca1 (diff) |
Merge branch 'pci/host-layerscape' into next
* pci/host-layerscape:
PCI: layerscape: Add LS1046a support
PCI: layerscape: Remove redundant error message from ls_pcie_probe()
-rw-r--r-- | Documentation/devicetree/bindings/pci/layerscape-pci.txt | 1 | ||||
-rw-r--r-- | drivers/pci/host/pci-layerscape.c | 20 |
2 files changed, 14 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt b/Documentation/devicetree/bindings/pci/layerscape-pci.txt index 41e9f55a1467..ee1c72d5162e 100644 --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt | |||
@@ -15,6 +15,7 @@ Required properties: | |||
15 | - compatible: should contain the platform identifier such as: | 15 | - compatible: should contain the platform identifier such as: |
16 | "fsl,ls1021a-pcie", "snps,dw-pcie" | 16 | "fsl,ls1021a-pcie", "snps,dw-pcie" |
17 | "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie" | 17 | "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie" |
18 | "fsl,ls1046a-pcie" | ||
18 | - reg: base addresses and lengths of the PCIe controller | 19 | - reg: base addresses and lengths of the PCIe controller |
19 | - interrupts: A list of interrupt outputs of the controller. Must contain an | 20 | - interrupts: A list of interrupt outputs of the controller. Must contain an |
20 | entry for each entry in the interrupt-names property. | 21 | entry for each entry in the interrupt-names property. |
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c index 2cb7315e26d0..ca48ceb6ebaf 100644 --- a/drivers/pci/host/pci-layerscape.c +++ b/drivers/pci/host/pci-layerscape.c | |||
@@ -35,12 +35,10 @@ | |||
35 | #define PCIE_STRFMR1 0x71c /* Symbol Timer & Filter Mask Register1 */ | 35 | #define PCIE_STRFMR1 0x71c /* Symbol Timer & Filter Mask Register1 */ |
36 | #define PCIE_DBI_RO_WR_EN 0x8bc /* DBI Read-Only Write Enable Register */ | 36 | #define PCIE_DBI_RO_WR_EN 0x8bc /* DBI Read-Only Write Enable Register */ |
37 | 37 | ||
38 | /* PEX LUT registers */ | ||
39 | #define PCIE_LUT_DBG 0x7FC /* PEX LUT Debug Register */ | ||
40 | |||
41 | struct ls_pcie_drvdata { | 38 | struct ls_pcie_drvdata { |
42 | u32 lut_offset; | 39 | u32 lut_offset; |
43 | u32 ltssm_shift; | 40 | u32 ltssm_shift; |
41 | u32 lut_dbg; | ||
44 | struct pcie_host_ops *ops; | 42 | struct pcie_host_ops *ops; |
45 | }; | 43 | }; |
46 | 44 | ||
@@ -134,7 +132,7 @@ static int ls_pcie_link_up(struct pcie_port *pp) | |||
134 | struct ls_pcie *pcie = to_ls_pcie(pp); | 132 | struct ls_pcie *pcie = to_ls_pcie(pp); |
135 | u32 state; | 133 | u32 state; |
136 | 134 | ||
137 | state = (ioread32(pcie->lut + PCIE_LUT_DBG) >> | 135 | state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >> |
138 | pcie->drvdata->ltssm_shift) & | 136 | pcie->drvdata->ltssm_shift) & |
139 | LTSSM_STATE_MASK; | 137 | LTSSM_STATE_MASK; |
140 | 138 | ||
@@ -196,18 +194,28 @@ static struct ls_pcie_drvdata ls1021_drvdata = { | |||
196 | static struct ls_pcie_drvdata ls1043_drvdata = { | 194 | static struct ls_pcie_drvdata ls1043_drvdata = { |
197 | .lut_offset = 0x10000, | 195 | .lut_offset = 0x10000, |
198 | .ltssm_shift = 24, | 196 | .ltssm_shift = 24, |
197 | .lut_dbg = 0x7fc, | ||
198 | .ops = &ls_pcie_host_ops, | ||
199 | }; | ||
200 | |||
201 | static struct ls_pcie_drvdata ls1046_drvdata = { | ||
202 | .lut_offset = 0x80000, | ||
203 | .ltssm_shift = 24, | ||
204 | .lut_dbg = 0x407fc, | ||
199 | .ops = &ls_pcie_host_ops, | 205 | .ops = &ls_pcie_host_ops, |
200 | }; | 206 | }; |
201 | 207 | ||
202 | static struct ls_pcie_drvdata ls2080_drvdata = { | 208 | static struct ls_pcie_drvdata ls2080_drvdata = { |
203 | .lut_offset = 0x80000, | 209 | .lut_offset = 0x80000, |
204 | .ltssm_shift = 0, | 210 | .ltssm_shift = 0, |
211 | .lut_dbg = 0x7fc, | ||
205 | .ops = &ls_pcie_host_ops, | 212 | .ops = &ls_pcie_host_ops, |
206 | }; | 213 | }; |
207 | 214 | ||
208 | static const struct of_device_id ls_pcie_of_match[] = { | 215 | static const struct of_device_id ls_pcie_of_match[] = { |
209 | { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata }, | 216 | { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata }, |
210 | { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata }, | 217 | { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata }, |
218 | { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata }, | ||
211 | { .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata }, | 219 | { .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata }, |
212 | { .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata }, | 220 | { .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata }, |
213 | { }, | 221 | { }, |
@@ -251,10 +259,8 @@ static int __init ls_pcie_probe(struct platform_device *pdev) | |||
251 | 259 | ||
252 | dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 260 | dbi_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
253 | pcie->pp.dbi_base = devm_ioremap_resource(dev, dbi_base); | 261 | pcie->pp.dbi_base = devm_ioremap_resource(dev, dbi_base); |
254 | if (IS_ERR(pcie->pp.dbi_base)) { | 262 | if (IS_ERR(pcie->pp.dbi_base)) |
255 | dev_err(dev, "missing *regs* space\n"); | ||
256 | return PTR_ERR(pcie->pp.dbi_base); | 263 | return PTR_ERR(pcie->pp.dbi_base); |
257 | } | ||
258 | 264 | ||
259 | pcie->drvdata = match->data; | 265 | pcie->drvdata = match->data; |
260 | pcie->lut = pcie->pp.dbi_base + pcie->drvdata->lut_offset; | 266 | pcie->lut = pcie->pp.dbi_base + pcie->drvdata->lut_offset; |