aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/fsl_pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
commit16e024f30ce96ef5fa651e2914e19d175a924cab (patch)
treed68106151a0b36e22625d7af7b23081a48c92e87 /arch/powerpc/sysdev/fsl_pci.c
parentc36e0501ee91d7616a188efbf9714b1fce150032 (diff)
parent376bddd34433065aeb9b9a140870537feecf90ef (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc update from Benjamin Herrenschmidt: "The main highlight is probably some base POWER8 support. There's more to come such as transactional memory support but that will wait for the next one. Overall it's pretty quiet, or rather I've been pretty poor at picking things up from patchwork and reviewing them this time around and Kumar no better on the FSL side it seems..." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (73 commits) powerpc+of: Rename and fix OF reconfig notifier error inject module powerpc: mpc5200: Add a3m071 board support powerpc/512x: don't compile any platform DIU code if the DIU is not enabled powerpc/mpc52xx: use module_platform_driver macro powerpc+of: Export of_reconfig_notifier_[register,unregister] powerpc/dma/raidengine: add raidengine device powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct powerpc/mpc85xx: Change spin table to cached memory powerpc/fsl-pci: Add PCI controller ATMU PM support powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers powerpc: Disable relocation on exceptions when kexecing powerpc: Enable relocation on during exceptions at boot powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function powerpc: Add wrappers to enable/disable relocation on exceptions powerpc: Add set_mode hcall powerpc: Setup relocation on exceptions for bare metal systems powerpc: Move initial mfspr LPCR out of __init_LPCR powerpc: Add relocation on exception vector handlers ...
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pci.c')
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 01b62a62c635..5ba325bff3a2 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask)
89 return 0; 89 return 0;
90} 90}
91 91
92static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, 92static int setup_one_atmu(struct ccsr_pci __iomem *pci,
93 unsigned int index, const struct resource *res, 93 unsigned int index, const struct resource *res,
94 resource_size_t offset) 94 resource_size_t offset)
95{ 95{
@@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci,
126} 126}
127 127
128/* atmu setup for fsl pci/pcie controller */ 128/* atmu setup for fsl pci/pcie controller */
129static void __init setup_pci_atmu(struct pci_controller *hose, 129static void setup_pci_atmu(struct pci_controller *hose,
130 struct resource *rsrc) 130 struct resource *rsrc)
131{ 131{
132 struct ccsr_pci __iomem *pci; 132 struct ccsr_pci __iomem *pci;
@@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
902 return 0; 902 return 0;
903} 903}
904 904
905#ifdef CONFIG_PM
906static int fsl_pci_resume(struct device *dev)
907{
908 struct pci_controller *hose;
909 struct resource pci_rsrc;
910
911 hose = pci_find_hose_for_OF_device(dev->of_node);
912 if (!hose)
913 return -ENODEV;
914
915 if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) {
916 dev_err(dev, "Get pci register base failed.");
917 return -ENODEV;
918 }
919
920 setup_pci_atmu(hose, &pci_rsrc);
921
922 return 0;
923}
924
925static const struct dev_pm_ops pci_pm_ops = {
926 .resume = fsl_pci_resume,
927};
928
929#define PCI_PM_OPS (&pci_pm_ops)
930
931#else
932
933#define PCI_PM_OPS NULL
934
935#endif
936
905static struct platform_driver fsl_pci_driver = { 937static struct platform_driver fsl_pci_driver = {
906 .driver = { 938 .driver = {
907 .name = "fsl-pci", 939 .name = "fsl-pci",
940 .pm = PCI_PM_OPS,
908 .of_match_table = pci_ids, 941 .of_match_table = pci_ids,
909 }, 942 },
910 .probe = fsl_pci_probe, 943 .probe = fsl_pci_probe,