aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-12 23:38:26 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-12 23:38:26 -0400
commitaf3bf7fbe0148aadc8fedd6f5e5279cabef9ced5 (patch)
tree25e3b1099ecf851bb7b5f6e6d3ffcdeb33de32f0 /arch/powerpc/sysdev
parent10db8d212864cb6741df7d7fafda5ab6661f6f88 (diff)
parentb915341b4be29b3b2c02da932b69871e9b55ca4b (diff)
Merge remote-tracking branch 'kumar/next' into next
Freescale updates for 3.6
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c73
-rw-r--r--arch/powerpc/sysdev/fsl_pci.h8
-rw-r--r--arch/powerpc/sysdev/mpic.c2
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c3
4 files changed, 83 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 6073288fed29..a7b2a600d0a4 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 2 * MPC83xx/85xx/86xx PCI/PCIE support routing.
3 * 3 *
4 * Copyright 2007-2011 Freescale Semiconductor, Inc. 4 * Copyright 2007-2012 Freescale Semiconductor, Inc.
5 * Copyright 2008-2009 MontaVista Software, Inc. 5 * Copyright 2008-2009 MontaVista Software, Inc.
6 * 6 *
7 * Initial author: Xianghua Xiao <x.xiao@freescale.com> 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com>
@@ -36,7 +36,7 @@
36 36
37static int fsl_pcie_bus_fixup, is_mpc83xx_pci; 37static int fsl_pcie_bus_fixup, is_mpc83xx_pci;
38 38
39static void __init quirk_fsl_pcie_header(struct pci_dev *dev) 39static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev)
40{ 40{
41 u8 progif; 41 u8 progif;
42 42
@@ -807,3 +807,72 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
807 807
808 return 0; 808 return 0;
809} 809}
810
811#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
812static const struct of_device_id pci_ids[] = {
813 { .compatible = "fsl,mpc8540-pci", },
814 { .compatible = "fsl,mpc8548-pcie", },
815 { .compatible = "fsl,mpc8610-pci", },
816 { .compatible = "fsl,mpc8641-pcie", },
817 { .compatible = "fsl,p1022-pcie", },
818 { .compatible = "fsl,p1010-pcie", },
819 { .compatible = "fsl,p1023-pcie", },
820 { .compatible = "fsl,p4080-pcie", },
821 { .compatible = "fsl,qoriq-pcie-v2.3", },
822 { .compatible = "fsl,qoriq-pcie-v2.2", },
823 {},
824};
825
826struct device_node *fsl_pci_primary;
827
828void __devinit fsl_pci_init(void)
829{
830 struct device_node *node;
831 struct pci_controller *hose;
832 dma_addr_t max = 0xffffffff;
833
834 /* Callers can specify the primary bus using other means. */
835 if (!fsl_pci_primary) {
836 /* If a PCI host bridge contains an ISA node, it's primary. */
837 node = of_find_node_by_type(NULL, "isa");
838 while ((fsl_pci_primary = of_get_parent(node))) {
839 of_node_put(node);
840 node = fsl_pci_primary;
841
842 if (of_match_node(pci_ids, node))
843 break;
844 }
845 }
846
847 node = NULL;
848 for_each_node_by_type(node, "pci") {
849 if (of_match_node(pci_ids, node)) {
850 /*
851 * If there's no PCI host bridge with ISA, arbitrarily
852 * designate one as primary. This can go away once
853 * various bugs with primary-less systems are fixed.
854 */
855 if (!fsl_pci_primary)
856 fsl_pci_primary = node;
857
858 fsl_add_bridge(node, fsl_pci_primary == node);
859 hose = pci_find_hose_for_OF_device(node);
860 max = min(max, hose->dma_window_base_cur +
861 hose->dma_window_size);
862 }
863 }
864
865#ifdef CONFIG_SWIOTLB
866 /*
867 * if we couldn't map all of DRAM via the dma windows
868 * we need SWIOTLB to handle buffers located outside of
869 * dma capable memory region
870 */
871 if (memblock_end_of_DRAM() - 1 > max) {
872 ppc_swiotlb_enable = 1;
873 set_pci_dma_ops(&swiotlb_dma_ops);
874 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
875 }
876#endif
877}
878#endif
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index a39ed5cc2c5a..baa0fd18289f 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -93,5 +93,13 @@ extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
93extern int mpc83xx_add_bridge(struct device_node *dev); 93extern int mpc83xx_add_bridge(struct device_node *dev);
94u64 fsl_pci_immrbar_base(struct pci_controller *hose); 94u64 fsl_pci_immrbar_base(struct pci_controller *hose);
95 95
96extern struct device_node *fsl_pci_primary;
97
98#ifdef CONFIG_FSL_PCI
99void fsl_pci_init(void);
100#else
101static inline void fsl_pci_init(void) {}
102#endif
103
96#endif /* __POWERPC_FSL_PCI_H */ 104#endif /* __POWERPC_FSL_PCI_H */
97#endif /* __KERNEL__ */ 105#endif /* __KERNEL__ */
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 395af1347749..906f29c05c54 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1211,7 +1211,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1211 if (of_get_property(node, "single-cpu-affinity", NULL)) 1211 if (of_get_property(node, "single-cpu-affinity", NULL))
1212 flags |= MPIC_SINGLE_DEST_CPU; 1212 flags |= MPIC_SINGLE_DEST_CPU;
1213 if (of_device_is_compatible(node, "fsl,mpic")) 1213 if (of_device_is_compatible(node, "fsl,mpic"))
1214 flags |= MPIC_FSL; 1214 flags |= MPIC_FSL | MPIC_LARGE_VECTORS;
1215 1215
1216 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); 1216 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL);
1217 if (mpic == NULL) 1217 if (mpic == NULL)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 818e763f8265..b04367529729 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -395,6 +395,9 @@ static void qe_upload_microcode(const void *base,
395 395
396 for (i = 0; i < be32_to_cpu(ucode->count); i++) 396 for (i = 0; i < be32_to_cpu(ucode->count); i++)
397 out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i])); 397 out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i]));
398
399 /* Set I-RAM Ready Register */
400 out_be32(&qe_immr->iram.iready, be32_to_cpu(QE_IRAM_READY));
398} 401}
399 402
400/* 403/*