aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-11-14 13:11:33 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-11-14 13:11:33 -0500
commit89000e89bf4df8b9a0a16e1d3856913907385bd5 (patch)
tree25bd1e3b55dc0ff6df1b76d61cf672f4fbbefdc7
parentaaea12f7fe4c309c8cfa9040cbb3cb02feae0b4d (diff)
parent84d897d69938a33f4ce3877c82d573e7a2b4e5a9 (diff)
Merge branch 'pci/host-layerscape' into next
* pci/host-layerscape: PCI: layerscape: Change default error response behavior PCI: Disable MSI for Freescale Layerscape PCIe RC mode arm64: dts: ls1046a: Add PCIe controller DT nodes arm64: dts: ls1012a: Add PCIe controller DT node PCI: layerscape: Add support for ls1012a arm64: dts: ls1012a: Add MSI controller DT node irqchip/ls-scfg-msi: Add LS1012a MSI support
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt1
-rw-r--r--Documentation/devicetree/bindings/pci/layerscape-pci.txt1
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi31
-rw-r--r--arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi75
-rw-r--r--drivers/irqchip/irq-ls-scfg-msi.c1
-rw-r--r--drivers/pci/dwc/pci-layerscape.c12
-rw-r--r--drivers/pci/quirks.c8
7 files changed, 129 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt
index 49ccabbfa6f3..a4ff93d6b7f3 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-scfg-msi.txt
@@ -8,6 +8,7 @@ Required properties:
8 "fsl,ls1043a-msi" 8 "fsl,ls1043a-msi"
9 "fsl,ls1046a-msi" 9 "fsl,ls1046a-msi"
10 "fsl,ls1043a-v1.1-msi" 10 "fsl,ls1043a-v1.1-msi"
11 "fsl,ls1012a-msi"
11- msi-controller: indicates that this is a PCIe MSI controller node 12- msi-controller: indicates that this is a PCIe MSI controller node
12- reg: physical base address of the controller and length of memory mapped. 13- reg: physical base address of the controller and length of memory mapped.
13- interrupts: an interrupt to the parent interrupt controller. 14- interrupts: an interrupt to the parent interrupt controller.
diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
index c0484da0f20d..66df1e81e0b8 100644
--- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt
+++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt
@@ -18,6 +18,7 @@ Required properties:
18 "fsl,ls2088a-pcie" 18 "fsl,ls2088a-pcie"
19 "fsl,ls1088a-pcie" 19 "fsl,ls1088a-pcie"
20 "fsl,ls1046a-pcie" 20 "fsl,ls1046a-pcie"
21 "fsl,ls1012a-pcie"
21- reg: base addresses and lengths of the PCIe controller register blocks. 22- reg: base addresses and lengths of the PCIe controller register blocks.
22- interrupts: A list of interrupt outputs of the controller. Must contain an 23- interrupts: A list of interrupt outputs of the controller. Must contain an
23 entry for each entry in the interrupt-names property. 24 entry for each entry in the interrupt-names property.
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
index df83915d6ea6..fe1ea5d707a8 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
@@ -471,5 +471,36 @@
471 dr_mode = "host"; 471 dr_mode = "host";
472 phy_type = "ulpi"; 472 phy_type = "ulpi";
473 }; 473 };
474
475 msi: msi-controller1@1572000 {
476 compatible = "fsl,ls1012a-msi";
477 reg = <0x0 0x1572000 0x0 0x8>;
478 msi-controller;
479 interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>;
480 };
481
482 pcie@3400000 {
483 compatible = "fsl,ls1012a-pcie", "snps,dw-pcie";
484 reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
485 0x40 0x00000000 0x0 0x00002000>; /* configuration space */
486 reg-names = "regs", "config";
487 interrupts = <0 118 0x4>, /* controller interrupt */
488 <0 117 0x4>; /* PME interrupt */
489 interrupt-names = "aer", "pme";
490 #address-cells = <3>;
491 #size-cells = <2>;
492 device_type = "pci";
493 num-lanes = <4>;
494 bus-range = <0x0 0xff>;
495 ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */
496 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
497 msi-parent = <&msi>;
498 #interrupt-cells = <1>;
499 interrupt-map-mask = <0 0 0 7>;
500 interrupt-map = <0000 0 0 1 &gic 0 110 IRQ_TYPE_LEVEL_HIGH>,
501 <0000 0 0 2 &gic 0 111 IRQ_TYPE_LEVEL_HIGH>,
502 <0000 0 0 3 &gic 0 112 IRQ_TYPE_LEVEL_HIGH>,
503 <0000 0 0 4 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>;
504 };
474 }; 505 };
475}; 506};
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
index c8ff0baddf1d..e8a478ca1485 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
@@ -661,6 +661,81 @@
661 <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>; 661 <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
662 }; 662 };
663 663
664 pcie@3400000 {
665 compatible = "fsl,ls1046a-pcie", "snps,dw-pcie";
666 reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
667 0x40 0x00000000 0x0 0x00002000>; /* configuration space */
668 reg-names = "regs", "config";
669 interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */
670 <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; /* PME interrupt */
671 interrupt-names = "aer", "pme";
672 #address-cells = <3>;
673 #size-cells = <2>;
674 device_type = "pci";
675 dma-coherent;
676 num-lanes = <4>;
677 bus-range = <0x0 0xff>;
678 ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */
679 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
680 msi-parent = <&msi1>, <&msi2>, <&msi3>;
681 #interrupt-cells = <1>;
682 interrupt-map-mask = <0 0 0 7>;
683 interrupt-map = <0000 0 0 1 &gic GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
684 <0000 0 0 2 &gic GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
685 <0000 0 0 3 &gic GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
686 <0000 0 0 4 &gic GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
687 };
688
689 pcie@3500000 {
690 compatible = "fsl,ls1046a-pcie", "snps,dw-pcie";
691 reg = <0x00 0x03500000 0x0 0x00100000 /* controller registers */
692 0x48 0x00000000 0x0 0x00002000>; /* configuration space */
693 reg-names = "regs", "config";
694 interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */
695 <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* PME interrupt */
696 interrupt-names = "aer", "pme";
697 #address-cells = <3>;
698 #size-cells = <2>;
699 device_type = "pci";
700 dma-coherent;
701 num-lanes = <2>;
702 bus-range = <0x0 0xff>;
703 ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */
704 0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
705 msi-parent = <&msi2>, <&msi3>, <&msi1>;
706 #interrupt-cells = <1>;
707 interrupt-map-mask = <0 0 0 7>;
708 interrupt-map = <0000 0 0 1 &gic GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
709 <0000 0 0 2 &gic GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
710 <0000 0 0 3 &gic GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
711 <0000 0 0 4 &gic GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
712 };
713
714 pcie@3600000 {
715 compatible = "fsl,ls1046a-pcie", "snps,dw-pcie";
716 reg = <0x00 0x03600000 0x0 0x00100000 /* controller registers */
717 0x50 0x00000000 0x0 0x00002000>; /* configuration space */
718 reg-names = "regs", "config";
719 interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>, /* controller interrupt */
720 <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>; /* PME interrupt */
721 interrupt-names = "aer", "pme";
722 #address-cells = <3>;
723 #size-cells = <2>;
724 device_type = "pci";
725 dma-coherent;
726 num-lanes = <2>;
727 bus-range = <0x0 0xff>;
728 ranges = <0x81000000 0x0 0x00000000 0x50 0x00010000 0x0 0x00010000 /* downstream I/O */
729 0x82000000 0x0 0x40000000 0x50 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
730 msi-parent = <&msi3>, <&msi1>, <&msi2>;
731 #interrupt-cells = <1>;
732 interrupt-map-mask = <0 0 0 7>;
733 interrupt-map = <0000 0 0 1 &gic GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
734 <0000 0 0 2 &gic GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
735 <0000 0 0 3 &gic GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
736 <0000 0 0 4 &gic GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
737 };
738
664 }; 739 };
665 740
666 reserved-memory { 741 reserved-memory {
diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index 119f4ef0d421..57e3d900f19e 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -316,6 +316,7 @@ static const struct of_device_id ls_scfg_msi_id[] = {
316 { .compatible = "fsl,1s1021a-msi", .data = &ls1021_msi_cfg}, 316 { .compatible = "fsl,1s1021a-msi", .data = &ls1021_msi_cfg},
317 { .compatible = "fsl,1s1043a-msi", .data = &ls1021_msi_cfg}, 317 { .compatible = "fsl,1s1043a-msi", .data = &ls1021_msi_cfg},
318 318
319 { .compatible = "fsl,ls1012a-msi", .data = &ls1021_msi_cfg },
319 { .compatible = "fsl,ls1021a-msi", .data = &ls1021_msi_cfg }, 320 { .compatible = "fsl,ls1021a-msi", .data = &ls1021_msi_cfg },
320 { .compatible = "fsl,ls1043a-msi", .data = &ls1021_msi_cfg }, 321 { .compatible = "fsl,ls1043a-msi", .data = &ls1021_msi_cfg },
321 { .compatible = "fsl,ls1043a-v1.1-msi", .data = &ls1043_v1_1_msi_cfg }, 322 { .compatible = "fsl,ls1043a-v1.1-msi", .data = &ls1043_v1_1_msi_cfg },
diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c
index 87fa486bee2c..8f34c2fdc600 100644
--- a/drivers/pci/dwc/pci-layerscape.c
+++ b/drivers/pci/dwc/pci-layerscape.c
@@ -33,6 +33,8 @@
33 33
34/* PEX Internal Configuration Registers */ 34/* PEX Internal Configuration Registers */
35#define PCIE_STRFMR1 0x71c /* Symbol Timer & Filter Mask Register1 */ 35#define PCIE_STRFMR1 0x71c /* Symbol Timer & Filter Mask Register1 */
36#define PCIE_ABSERR 0x8d0 /* Bridge Slave Error Response Register */
37#define PCIE_ABSERR_SETTING 0x9401 /* Forward error of non-posted request */
36 38
37#define PCIE_IATU_NUM 6 39#define PCIE_IATU_NUM 6
38 40
@@ -124,6 +126,14 @@ static int ls_pcie_link_up(struct dw_pcie *pci)
124 return 1; 126 return 1;
125} 127}
126 128
129/* Forward error response of outbound non-posted requests */
130static void ls_pcie_fix_error_response(struct ls_pcie *pcie)
131{
132 struct dw_pcie *pci = pcie->pci;
133
134 iowrite32(PCIE_ABSERR_SETTING, pci->dbi_base + PCIE_ABSERR);
135}
136
127static int ls_pcie_host_init(struct pcie_port *pp) 137static int ls_pcie_host_init(struct pcie_port *pp)
128{ 138{
129 struct dw_pcie *pci = to_dw_pcie_from_pp(pp); 139 struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
@@ -135,6 +145,7 @@ static int ls_pcie_host_init(struct pcie_port *pp)
135 * dw_pcie_setup_rc() will reconfigure the outbound windows. 145 * dw_pcie_setup_rc() will reconfigure the outbound windows.
136 */ 146 */
137 ls_pcie_disable_outbound_atus(pcie); 147 ls_pcie_disable_outbound_atus(pcie);
148 ls_pcie_fix_error_response(pcie);
138 149
139 dw_pcie_dbi_ro_wr_en(pci); 150 dw_pcie_dbi_ro_wr_en(pci);
140 ls_pcie_clear_multifunction(pcie); 151 ls_pcie_clear_multifunction(pcie);
@@ -253,6 +264,7 @@ static struct ls_pcie_drvdata ls2088_drvdata = {
253}; 264};
254 265
255static const struct of_device_id ls_pcie_of_match[] = { 266static const struct of_device_id ls_pcie_of_match[] = {
267 { .compatible = "fsl,ls1012a-pcie", .data = &ls1046_drvdata },
256 { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata }, 268 { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata },
257 { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata }, 269 { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata },
258 { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata }, 270 { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0e22cce05742..cbe85e921ede 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4814,3 +4814,11 @@ static void quirk_no_ats(struct pci_dev *pdev)
4814/* AMD Stoney platform GPU */ 4814/* AMD Stoney platform GPU */
4815DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_no_ats); 4815DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x98e4, quirk_no_ats);
4816#endif /* CONFIG_PCI_ATS */ 4816#endif /* CONFIG_PCI_ATS */
4817
4818/* Freescale PCIe doesn't support MSI in RC mode */
4819static void quirk_fsl_no_msi(struct pci_dev *pdev)
4820{
4821 if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT)
4822 pdev->no_msi = 1;
4823}
4824DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, quirk_fsl_no_msi);