aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-03-04 01:04:44 -0500
committerPaul Mackerras <paulus@samba.org>2007-03-08 23:03:26 -0500
commitbed59275810a55500e885cbdc5c2a0507f13c00e (patch)
tree9f0fba370b8a65a15c19ecab9e48df3f9264dc13
parentbe9e95b17e150c7b6933cb2f1e1c46a501976080 (diff)
[POWERPC] Allow pSeries to build without CONFIG_PCI
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/Kconfig5
-rw-r--r--arch/powerpc/kernel/Makefile4
-rw-r--r--arch/powerpc/platforms/pseries/Makefile5
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c53
-rw-r--r--arch/powerpc/platforms/pseries/setup.c5
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--include/asm-powerpc/ppc-pci.h7
7 files changed, 51 insertions, 30 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 6dfbd52694ab..e7205273ff37 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -89,7 +89,7 @@ config SCHED_NO_NO_OMIT_FRAME_POINTER
89 89
90config ARCH_MAY_HAVE_PC_FDC 90config ARCH_MAY_HAVE_PC_FDC
91 bool 91 bool
92 default y 92 default !PPC_PSERIES || PCI
93 93
94config PPC_OF 94config PPC_OF
95 def_bool y 95 def_bool y
@@ -1028,7 +1028,8 @@ config MCA
1028 1028
1029config PCI 1029config PCI
1030 bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \ 1030 bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
1031 || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) || MPC7448HPC2 || PPC_PS3 1031 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
1032 || MPC7448HPC2 || PPC_PS3
1032 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \ 1033 default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx \
1033 && !PPC_85xx && !PPC_86xx 1034 && !PPC_85xx && !PPC_86xx
1034 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS 1035 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 8120d428ebfd..e0fa80eca366 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -25,8 +25,8 @@ obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
25obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o 25obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o
26procfs-$(CONFIG_PPC64) := proc_ppc64.o 26procfs-$(CONFIG_PPC64) := proc_ppc64.o
27obj-$(CONFIG_PROC_FS) += $(procfs-y) 27obj-$(CONFIG_PROC_FS) += $(procfs-y)
28rtaspci-$(CONFIG_PPC64) := rtas_pci.o 28rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o
29obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y) 29obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y-y)
30obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o 30obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
31obj-$(CONFIG_RTAS_PROC) += rtas-proc.o 31obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
32obj-$(CONFIG_LPARCFG) += lparcfg.o 32obj-$(CONFIG_LPARCFG) += lparcfg.o
diff --git a/arch/powerpc/platforms/pseries/Makefile b/arch/powerpc/platforms/pseries/Makefile
index 2dfd05095a25..90235d598751 100644
--- a/arch/powerpc/platforms/pseries/Makefile
+++ b/arch/powerpc/platforms/pseries/Makefile
@@ -2,14 +2,15 @@ ifeq ($(CONFIG_PPC64),y)
2EXTRA_CFLAGS += -mno-minimal-toc 2EXTRA_CFLAGS += -mno-minimal-toc
3endif 3endif
4 4
5obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ 5obj-y := lpar.o hvCall.o nvram.o reconfig.o \
6 setup.o iommu.o ras.o rtasd.o pci_dlpar.o \ 6 setup.o iommu.o ras.o rtasd.o \
7 firmware.o power.o 7 firmware.o power.o
8obj-$(CONFIG_SMP) += smp.o 8obj-$(CONFIG_SMP) += smp.o
9obj-$(CONFIG_XICS) += xics.o 9obj-$(CONFIG_XICS) += xics.o
10obj-$(CONFIG_SCANLOG) += scanlog.o 10obj-$(CONFIG_SCANLOG) += scanlog.o
11obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o 11obj-$(CONFIG_EEH) += eeh.o eeh_cache.o eeh_driver.o eeh_event.o
12obj-$(CONFIG_KEXEC) += kexec.o 12obj-$(CONFIG_KEXEC) += kexec.o
13obj-$(CONFIG_PCI) += pci.o pci_dlpar.o
13 14
14obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o 15obj-$(CONFIG_HOTPLUG_CPU) += hotplug-cpu.o
15 16
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 9322f74e1d8b..f9510a5a3e21 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -242,6 +242,7 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
242 return tce_ret; 242 return tce_ret;
243} 243}
244 244
245#ifdef CONFIG_PCI
245static void iommu_table_setparms(struct pci_controller *phb, 246static void iommu_table_setparms(struct pci_controller *phb,
246 struct device_node *dn, 247 struct device_node *dn,
247 struct iommu_table *tbl) 248 struct iommu_table *tbl)
@@ -478,29 +479,6 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
478 pci_name(dev)); 479 pci_name(dev));
479} 480}
480 481
481static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
482{
483 int err = NOTIFY_OK;
484 struct device_node *np = node;
485 struct pci_dn *pci = PCI_DN(np);
486
487 switch (action) {
488 case PSERIES_RECONFIG_REMOVE:
489 if (pci && pci->iommu_table &&
490 get_property(np, "ibm,dma-window", NULL))
491 iommu_free_table(np);
492 break;
493 default:
494 err = NOTIFY_DONE;
495 break;
496 }
497 return err;
498}
499
500static struct notifier_block iommu_reconfig_nb = {
501 .notifier_call = iommu_reconfig_notifier,
502};
503
504static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) 482static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
505{ 483{
506 struct device_node *pdn, *dn; 484 struct device_node *pdn, *dn;
@@ -554,6 +532,35 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
554 532
555 dev->dev.archdata.dma_data = pci->iommu_table; 533 dev->dev.archdata.dma_data = pci->iommu_table;
556} 534}
535#else /* CONFIG_PCI */
536#define pci_dma_bus_setup_pSeries NULL
537#define pci_dma_dev_setup_pSeries NULL
538#define pci_dma_bus_setup_pSeriesLP NULL
539#define pci_dma_dev_setup_pSeriesLP NULL
540#endif /* !CONFIG_PCI */
541
542static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
543{
544 int err = NOTIFY_OK;
545 struct device_node *np = node;
546 struct pci_dn *pci = PCI_DN(np);
547
548 switch (action) {
549 case PSERIES_RECONFIG_REMOVE:
550 if (pci && pci->iommu_table &&
551 get_property(np, "ibm,dma-window", NULL))
552 iommu_free_table(np);
553 break;
554 default:
555 err = NOTIFY_DONE;
556 break;
557 }
558 return err;
559}
560
561static struct notifier_block iommu_reconfig_nb = {
562 .notifier_call = iommu_reconfig_notifier,
563};
557 564
558/* These are called very early. */ 565/* These are called very early. */
559void iommu_init_early_pSeries(void) 566void iommu_init_early_pSeries(void)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 34aff47b1f55..ff87b1ad8ce9 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -65,6 +65,7 @@
65#include <asm/udbg.h> 65#include <asm/udbg.h>
66#include <asm/smp.h> 66#include <asm/smp.h>
67#include <asm/firmware.h> 67#include <asm/firmware.h>
68#include <asm/eeh.h>
68 69
69#include "plpar_wrappers.h" 70#include "plpar_wrappers.h"
70#include "pseries.h" 71#include "pseries.h"
@@ -514,6 +515,10 @@ void pSeries_power_off(void)
514 for (;;); 515 for (;;);
515} 516}
516 517
518#ifndef CONFIG_PCI
519void pSeries_final_fixup(void) { }
520#endif
521
517define_machine(pseries) { 522define_machine(pseries) {
518 .name = "pSeries", 523 .name = "pSeries",
519 .probe = pSeries_probe, 524 .probe = pSeries_probe,
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 7f5a59836818..35d2abd1ed50 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -396,7 +396,7 @@ config FB_ATARI
396 396
397config FB_OF 397config FB_OF
398 bool "Open Firmware frame buffer device support" 398 bool "Open Firmware frame buffer device support"
399 depends on (FB = y) && (PPC64 || PPC_OF) 399 depends on (FB = y) && (PPC64 || PPC_OF) && (!PPC_PSERIES || PCI)
400 select FB_CFB_FILLRECT 400 select FB_CFB_FILLRECT
401 select FB_CFB_COPYAREA 401 select FB_CFB_COPYAREA
402 select FB_CFB_IMAGEBLIT 402 select FB_CFB_IMAGEBLIT
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index ab6eddb518c7..4a053404bf6b 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -10,6 +10,8 @@
10#define _ASM_POWERPC_PPC_PCI_H 10#define _ASM_POWERPC_PPC_PCI_H
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#ifdef CONFIG_PCI
14
13#include <linux/pci.h> 15#include <linux/pci.h>
14#include <asm/pci-bridge.h> 16#include <asm/pci-bridge.h>
15 17
@@ -126,5 +128,10 @@ struct device_node * find_device_pe(struct device_node *dn);
126 128
127#endif 129#endif
128 130
131#else /* CONFIG_PCI */
132static inline void find_and_init_phbs(void) { }
133static inline void init_pci_config_tokens(void) { }
134#endif /* !CONFIG_PCI */
135
129#endif /* __KERNEL__ */ 136#endif /* __KERNEL__ */
130#endif /* _ASM_POWERPC_PPC_PCI_H */ 137#endif /* _ASM_POWERPC_PPC_PCI_H */