[PATCH] build without PCI or VIO

Stephen Rothwell sfr at canb.auug.org.au
Fri Feb 11 00:24:07 EST 2005


Hi Olof,

On Thu, 10 Feb 2005 00:39:42 -0600 olof at austin.ibm.com (Olof Johansson) wrote:
>
> I'm not sure just what to think about this patch. :-) It's neat to be
> able to boot pSeries without PCI configured, but how much does it really
> buy us?

We do it because we can? :-)

> * CONFIG_IBMIOMMU is somewhat misleading. We have IOMMU's on other
>   hardware than those with IBM badges, albeit we don't support hotplug
>   on them. I guess the IBM part might come from the fact that we call it
>   CONFIG_IBMVIO. :)
>   --> Is CONFIG_IOMMU too generic to use instead? It's not used anywhere
>       else yet.

I agree entirely and was thinking that as I posted the patch.  I have used
CONFIG_PPC_IOMMU in the new version.

> * I'm worried about the amount of new #ifdefs, for two reasons. First is
>   readability, second is risk of breaking non-PCI config with new
>   changes.
>   --> Maybe defining empty inline stubs but still call them is more
>       appropriate for the symbols that need to be considered? How is
>       this handled on other architectures?

OK, read the new patch, I have left most of the code alone now as you
suggested.

> * If you want to go the whole way, then there's more to do to save
>   space. For example, the iommu_table pointer in struct device_node
>   and some of the ppc_md pointers. They'd be removable only if both PCI
>   and VIO is disabled which I find highly unlikely in most production
>   configs. :-)

Again I agree, but I will look for more stuff to remove anyway.

Below is a new version of the patch.  It has been compiled on pSeries and
iSeries with PCI disabled and on pSeries with VIO disabled.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN linus-bk-dma.4/arch/ppc64/Kconfig linus-bk-dma.6/arch/ppc64/Kconfig
--- linus-bk-dma.4/arch/ppc64/Kconfig	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/Kconfig	2005-02-10 18:05:03.000000000 +1100
@@ -126,6 +126,11 @@
 
 config IBMVIO
 	depends on PPC_PSERIES || PPC_ISERIES
+	bool "Support for virtual I/O" if (EMBEDDED && PPC_PSERIES)
+	default y
+
+config PPC_IOMMU
+	depends on IBMVIO || PCI
 	bool
 	default y
 
@@ -236,7 +241,7 @@
 
 config EEH
 	bool "PCI Extended Error Handling (EEH)" if EMBEDDED
-	depends on PPC_PSERIES
+	depends on PPC_PSERIES && PCI
 	default y if !EMBEDDED
 
 #
@@ -295,7 +300,7 @@
 	bool
 
 config PCI
-	bool
+	bool "support for PCI devices" if (EMBEDDED && (PPC_PSERIES || PPC_ISERIES))
 	default y
 	help
 	  Find out whether your system includes a PCI bus. PCI is the name of
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/Makefile linus-bk-dma.6/arch/ppc64/kernel/Makefile
--- linus-bk-dma.4/arch/ppc64/kernel/Makefile	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/Makefile	2005-02-10 18:04:53.000000000 +1100
@@ -11,27 +11,32 @@
 			udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
 			ptrace32.o signal32.o rtc.o init_task.o \
 			lmb.o cputable.o cpu_setup_power4.o idle_power4.o \
-			iommu.o sysfs.o
+			sysfs.o
 
 obj-$(CONFIG_PPC_OF) +=	of_device.o
 
-pci-obj-$(CONFIG_PPC_ISERIES)	+= iSeries_pci.o iSeries_pci_reset.o
+pci-obj-$(CONFIG_PPC_PSERIES)	+= pSeries_pci.o
+pci-obj-$(CONFIG_PPC_ISERIES)	+= iSeries_pci.o iSeries_pci_reset.o \
+					XmPciLpEvent.o
 pci-obj-$(CONFIG_PPC_MULTIPLATFORM)	+= pci_dn.o pci_direct_iommu.o
 
 obj-$(CONFIG_PCI)	+= pci.o pci_iommu.o iomap.o $(pci-obj-y)
 
-obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
-			     iSeries_VpdInfo.o XmPciLpEvent.o \
+iommu-obj-$(CONFIG_PPC_PSERIES) += pSeries_iommu.o
+iommu-obj-$(CONFIG_PPC_ISERIES) += iSeries_iommu.o
+
+obj-$(CONFIG_PPC_IOMMU) += iommu.o $(iommu-obj-y)
+
+obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o iSeries_VpdInfo.o \
 			     HvCall.o HvLpConfig.o LparData.o \
 			     iSeries_setup.o ItLpQueue.o hvCall.o \
-			     mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \
-			     iSeries_iommu.o
+			     mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o
 
 obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o prom.o mpic.o
 
-obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \
+obj-$(CONFIG_PPC_PSERIES) += pSeries_lpar.o pSeries_hvCall.o \
 			     pSeries_nvram.o rtasd.o ras.o \
-			     xics.o rtas.o pSeries_setup.o pSeries_iommu.o
+			     xics.o rtas.o pSeries_setup.o
 
 obj-$(CONFIG_EEH)		+= eeh.o
 obj-$(CONFIG_PROC_FS)		+= proc_ppc64.o
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/dma.c linus-bk-dma.6/arch/ppc64/kernel/dma.c
--- linus-bk-dma.4/arch/ppc64/kernel/dma.c	2005-02-07 17:47:41.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/dma.c	2005-02-08 17:10:00.000000000 +1100
@@ -15,8 +15,10 @@
 
 static struct dma_mapping_ops *get_dma_ops(struct device *dev)
 {
+#ifdef CONFIG_PCI
 	if (dev->bus == &pci_bus_type)
 		return &pci_dma_ops;
+#endif
 #ifdef CONFIG_IBMVIO
 	if (dev->bus == &vio_bus_type)
 		return &vio_dma_ops;
@@ -37,8 +39,10 @@
 
 int dma_set_mask(struct device *dev, u64 dma_mask)
 {
+#ifdef CONFIG_PCI
 	if (dev->bus == &pci_bus_type)
 		return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
+#endif
 #ifdef CONFIG_IBMVIO
 	if (dev->bus == &vio_bus_type)
 		return -EIO;
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/iSeries_iommu.c linus-bk-dma.6/arch/ppc64/kernel/iSeries_iommu.c
--- linus-bk-dma.4/arch/ppc64/kernel/iSeries_iommu.c	2005-01-09 10:05:39.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/iSeries_iommu.c	2005-02-10 18:23:53.000000000 +1100
@@ -34,9 +34,6 @@
 #include <asm/iSeries/HvCallXm.h>
 #include <asm/iSeries/iSeries_pci.h>
 
-extern struct list_head iSeries_Global_Device_List;
-
-
 static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
 		unsigned long uaddr, enum dma_data_direction direction)
 {
@@ -84,6 +81,7 @@
 }
 
 
+#ifdef CONFIG_PCI
 /*
  * This function compares the known tables to find an iommu_table
  * that has already been built for hardware TCEs.
@@ -159,6 +157,7 @@
 	else
 		kfree(tbl);
 }
+#endif
 
 static void iommu_dev_setup_iSeries(struct pci_dev *dev) { }
 static void iommu_bus_setup_iSeries(struct pci_bus *bus) { }
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/iSeries_setup.c linus-bk-dma.6/arch/ppc64/kernel/iSeries_setup.c
--- linus-bk-dma.4/arch/ppc64/kernel/iSeries_setup.c	2005-01-09 10:05:39.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/iSeries_setup.c	2005-02-10 18:55:30.000000000 +1100
@@ -45,7 +45,7 @@
 #include <asm/naca.h>
 #include <asm/paca.h>
 #include <asm/cache.h>
-#include <asm/sections.h>
+#include <asm/iommu.h>
 #include <asm/iSeries/LparData.h>
 #include <asm/iSeries/HvCallHpt.h>
 #include <asm/iSeries/HvLpConfig.h>
@@ -73,7 +73,11 @@
 static void setup_iSeries_cache_sizes(void);
 static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr);
 extern void iSeries_setup_arch(void);
+#ifdef CONFIG_PCI
 extern void iSeries_pci_final_fixup(void);
+#else
+static void iSeries_pci_final_fixup(void) { }
+#endif
 
 /* Global Variables */
 static unsigned long procFreqHz;
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/pSeries_iommu.c linus-bk-dma.6/arch/ppc64/kernel/pSeries_iommu.c
--- linus-bk-dma.4/arch/ppc64/kernel/pSeries_iommu.c	2005-02-04 04:10:36.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/pSeries_iommu.c	2005-02-10 19:07:48.000000000 +1100
@@ -236,6 +236,7 @@
 	}
 }
 
+#ifdef CONFIG_PCI
 static void iommu_table_setparms(struct pci_controller *phb,
 				 struct device_node *dn,
 				 struct iommu_table *tbl) 
@@ -454,6 +455,11 @@
 		DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name);
 	}
 }
+#else
+#define iommu_bus_setup_pSeries		iommu_bus_setup_null
+#define iommu_bus_setup_pSeriesLP	iommu_bus_setup_null
+#define iommu_dev_setup_pSeries		iommu_dev_setup_null
+#endif
 
 static void iommu_bus_setup_null(struct pci_bus *b) { }
 static void iommu_dev_setup_null(struct pci_dev *d) { }
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/pSeries_setup.c linus-bk-dma.6/arch/ppc64/kernel/pSeries_setup.c
--- linus-bk-dma.4/arch/ppc64/kernel/pSeries_setup.c	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/pSeries_setup.c	2005-02-10 19:04:43.000000000 +1100
@@ -71,7 +71,11 @@
 #define DBG(fmt...)
 #endif
 
+#ifdef CONFIG_PCI
 extern void pSeries_final_fixup(void);
+#else
+static void pSeries_final_fixup(void) { }
+#endif
 
 extern void pSeries_get_boot_time(struct rtc_time *rtc_time);
 extern void pSeries_get_rtc_time(struct rtc_time *rtc_time);
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/pci.c linus-bk-dma.6/arch/ppc64/kernel/pci.c
--- linus-bk-dma.4/arch/ppc64/kernel/pci.c	2005-02-07 14:45:23.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/pci.c	2005-02-09 16:19:48.000000000 +1100
@@ -63,7 +63,9 @@
  * page is mapped and isa_io_limit prevents access to it.
  */
 unsigned long isa_io_base;	/* NULL if no ISA bus */
+EXPORT_SYMBOL(isa_io_base);
 unsigned long pci_io_base;
+EXPORT_SYMBOL(pci_io_base);
 
 void iSeries_pcibios_init(void);
 
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/pci.h linus-bk-dma.6/arch/ppc64/kernel/pci.h
--- linus-bk-dma.4/arch/ppc64/kernel/pci.h	2005-01-12 16:05:22.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/pci.h	2005-02-10 19:05:03.000000000 +1100
@@ -9,6 +9,7 @@
 #ifndef __PPC_KERNEL_PCI_H__
 #define __PPC_KERNEL_PCI_H__
 
+#include <linux/config.h>
 #include <linux/pci.h>
 #include <asm/pci-bridge.h>
 
@@ -23,7 +24,11 @@
 extern struct list_head hose_list;
 extern int global_phb_number;
 
+#ifdef CONFIG_PCI
 extern unsigned long find_and_init_phbs(void);
+#else
+static inline unsigned long find_and_init_phbs(void) { return 0; }
+#endif
 
 extern struct pci_dev *ppc64_isabridge_dev;	/* may be NULL if no ISA bus */
 
@@ -42,7 +47,11 @@
 void pci_addr_cache_remove_device(struct pci_dev *dev);
 
 /* From pSeries_pci.h */
-void init_pci_config_tokens (void);
+#ifdef CONFIG_PCI
+extern void init_pci_config_tokens (void);
+#else
+static inline void init_pci_config_tokens (void) { }
+#endif
 unsigned long get_phb_buid (struct device_node *);
 
 extern unsigned long pci_probe_only;
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/ppc_ksyms.c linus-bk-dma.6/arch/ppc64/kernel/ppc_ksyms.c
--- linus-bk-dma.4/arch/ppc64/kernel/ppc_ksyms.c	2005-01-12 16:05:22.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/ppc_ksyms.c	2005-02-09 16:20:07.000000000 +1100
@@ -49,9 +49,6 @@
 
 EXPORT_SYMBOL(do_signal);
 
-EXPORT_SYMBOL(isa_io_base);
-EXPORT_SYMBOL(pci_io_base);
-
 EXPORT_SYMBOL(strcpy);
 EXPORT_SYMBOL(strncpy);
 EXPORT_SYMBOL(strcat);
diff -ruN linus-bk-dma.4/arch/ppc64/kernel/sys_ppc32.c linus-bk-dma.6/arch/ppc64/kernel/sys_ppc32.c
--- linus-bk-dma.4/arch/ppc64/kernel/sys_ppc32.c	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/kernel/sys_ppc32.c	2005-02-08 17:26:43.000000000 +1100
@@ -741,6 +741,7 @@
 
 asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
 {
+#ifdef CONFIG_PCI
 	struct pci_controller* hose;
 	struct list_head *ln;
 	struct pci_bus *bus = NULL;
@@ -786,7 +787,7 @@
 	case IOBASE_ISA_MEM:
 		return -EINVAL;
 	}
-
+#endif
 	return -EOPNOTSUPP;
 }
 
diff -ruN linus-bk-dma.4/arch/ppc64/lib/Makefile linus-bk-dma.6/arch/ppc64/lib/Makefile
--- linus-bk-dma.4/arch/ppc64/lib/Makefile	2005-01-04 17:05:28.000000000 +1100
+++ linus-bk-dma.6/arch/ppc64/lib/Makefile	2005-02-08 17:34:53.000000000 +1100
@@ -12,7 +12,7 @@
 
 # e2a provides EBCDIC to ASCII conversions.
 ifdef CONFIG_PPC_ISERIES
-obj-$(CONFIG_PCI)	+= e2a.o
+obj-y	+= e2a.o
 endif
 
 lib-$(CONFIG_DEBUG_KERNEL) += sstep.o
diff -ruN linus-bk-dma.4/drivers/char/Kconfig linus-bk-dma.6/drivers/char/Kconfig
--- linus-bk-dma.4/drivers/char/Kconfig	2005-02-04 04:10:36.000000000 +1100
+++ linus-bk-dma.6/drivers/char/Kconfig	2005-02-09 16:33:37.000000000 +1100
@@ -557,7 +557,7 @@
 
 config HVC_CONSOLE
 	bool "pSeries Hypervisor Virtual Console support"
-	depends on PPC_PSERIES
+	depends on PPC_PSERIES && IBMVIO
 	help
 	  pSeries machines when partitioned support a hypervisor virtual
 	  console. This driver allows each pSeries partition to have a console
@@ -565,7 +565,7 @@
 
 config HVCS
 	tristate "IBM Hypervisor Virtual Console Server support"
-	depends on PPC_PSERIES
+	depends on PPC_PSERIES && IBMVIO
 	help
 	  Partitionable IBM Power5 ppc64 machines allow hosting of
 	  firmware virtual consoles from one Linux partition by
diff -ruN linus-bk-dma.4/drivers/net/Kconfig linus-bk-dma.6/drivers/net/Kconfig
--- linus-bk-dma.4/drivers/net/Kconfig	2005-01-20 07:06:57.000000000 +1100
+++ linus-bk-dma.6/drivers/net/Kconfig	2005-02-09 18:26:34.000000000 +1100
@@ -1171,7 +1171,7 @@
 
 config IBMVETH
 	tristate "IBM LAN Virtual Ethernet support"
-	depends on NETDEVICES && NET_ETHERNET && PPC_PSERIES
+	depends on NETDEVICES && NET_ETHERNET && PPC_PSERIES && IBMVIO
 	---help---
 	  This driver supports virtual ethernet adapters on newer IBM iSeries
 	  and pSeries systems.
diff -ruN linus-bk-dma.4/drivers/pci/hotplug/Makefile linus-bk-dma.6/drivers/pci/hotplug/Makefile
--- linus-bk-dma.4/drivers/pci/hotplug/Makefile	2004-11-20 12:05:26.000000000 +1100
+++ linus-bk-dma.6/drivers/pci/hotplug/Makefile	2005-02-09 16:46:14.000000000 +1100
@@ -42,8 +42,10 @@
 
 rpaphp-objs		:=	rpaphp_core.o	\
 				rpaphp_pci.o	\
-				rpaphp_slot.o	\
-				rpaphp_vio.o
+				rpaphp_slot.o
+ifdef CONFIG_IBMVIO
+rpaphp-objs		+=	rpaphp_vio.o
+endif
 
 rpadlpar_io-objs	:=	rpadlpar_core.o \
 				rpadlpar_sysfs.o
diff -ruN linus-bk-dma.4/drivers/pci/hotplug/rpaphp.h linus-bk-dma.6/drivers/pci/hotplug/rpaphp.h
--- linus-bk-dma.4/drivers/pci/hotplug/rpaphp.h	2005-02-04 06:05:19.000000000 +1100
+++ linus-bk-dma.6/drivers/pci/hotplug/rpaphp.h	2005-02-10 19:29:02.000000000 +1100
@@ -27,7 +27,9 @@
 #ifndef _PPC64PHP_H
 #define _PPC64PHP_H
 
+#include <linux/config.h>
 #include <linux/pci.h>
+#include <linux/errno.h>
 #include "pci_hotplug.h"
 
 #define	PHB     2
@@ -127,10 +129,16 @@
 		char **drc_name, char **drc_type, int *drc_power_domain);
 
 /* rpaphp_vio.c */
+#ifdef CONFIG_IBMVIO
 extern int rpaphp_get_vio_adapter_status(struct slot *slot, int is_init, u8 * value);
-extern int rpaphp_unconfig_vio_adapter(struct slot *slot);
 extern int register_vio_slot(struct device_node *dn);
 extern int rpaphp_enable_vio_slot(struct slot *slot);
+#else
+static inline int rpaphp_get_vio_adapter_status(struct slot *slot, int is_init, u8 * value) { return -EINVAL; }
+static inline int rpaphp_unconfig_vio_adapter(struct slot *slot) { return -ENODEV; }
+static inline int register_vio_slot(struct device_node *dn) { return 1; }
+static inline int rpaphp_enable_vio_slot(struct slot *slot) { return -EINVAL; }
+#endif
 
 /* rpaphp_slot.c */
 extern void dealloc_slot_struct(struct slot *slot);
diff -ruN linus-bk-dma.4/drivers/scsi/Kconfig linus-bk-dma.6/drivers/scsi/Kconfig
--- linus-bk-dma.4/drivers/scsi/Kconfig	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/drivers/scsi/Kconfig	2005-02-09 16:31:46.000000000 +1100
@@ -798,7 +798,7 @@
 
 config SCSI_IBMVSCSI
 	tristate "IBM Virtual SCSI support"
-	depends on PPC_PSERIES || PPC_ISERIES
+	depends on (PPC_PSERIES || PPC_ISERIES) && IBMVIO
 	help
 	  This is the IBM POWER Virtual SCSI Client
 
diff -ruN linus-bk-dma.4/drivers/serial/Kconfig linus-bk-dma.6/drivers/serial/Kconfig
--- linus-bk-dma.4/drivers/serial/Kconfig	2005-02-04 04:10:37.000000000 +1100
+++ linus-bk-dma.6/drivers/serial/Kconfig	2005-02-08 17:57:30.000000000 +1100
@@ -753,7 +753,7 @@
 
 config SERIAL_ICOM
 	tristate "IBM Multiport Serial Adapter"
-	depends on PPC_ISERIES || PPC_PSERIES
+	depends on PCI && (PPC_ISERIES || PPC_PSERIES)
 	select SERIAL_CORE
 	help
 	  This driver is for a family of multiport serial adapters
diff -ruN linus-bk-dma.4/include/asm-ppc64/floppy.h linus-bk-dma.6/include/asm-ppc64/floppy.h
--- linus-bk-dma.4/include/asm-ppc64/floppy.h	2004-10-25 18:18:34.000000000 +1000
+++ linus-bk-dma.6/include/asm-ppc64/floppy.h	2005-02-09 13:56:34.000000000 +1100
@@ -31,8 +31,6 @@
 				            "floppy", NULL)
 #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
 
-#ifdef CONFIG_PCI
-
 #include <linux/pci.h>
 
 #define fd_dma_setup(addr,size,mode,io) ppc64_fd_dma_setup(addr,size,mode,io)
@@ -40,6 +38,7 @@
 static __inline__ int 
 ppc64_fd_dma_setup(char *addr, unsigned long size, int mode, int io)
 {
+#ifdef CONFIG_PCI
 	static unsigned long prev_size;
 	static dma_addr_t bus_addr = 0;
 	static char *prev_addr;
@@ -71,11 +70,11 @@
 	fd_set_dma_count(size);
 	virtual_dma_port = io;
 	fd_enable_dma();
+#endif /* CONFIG_PCI */
 
 	return 0;
 }
 
-#endif /* CONFIG_PCI */
 
 __inline__ void virtual_dma_init(void)
 {
diff -ruN linus-bk-dma.4/include/asm-ppc64/iSeries/XmPciLpEvent.h linus-bk-dma.6/include/asm-ppc64/iSeries/XmPciLpEvent.h
--- linus-bk-dma.4/include/asm-ppc64/iSeries/XmPciLpEvent.h	2002-02-14 23:14:36.000000000 +1100
+++ linus-bk-dma.6/include/asm-ppc64/iSeries/XmPciLpEvent.h	2005-02-10 18:46:28.000000000 +1100
@@ -1,18 +1,13 @@
-
 #ifndef	__XMPCILPEVENT_H__
 #define	__XMPCILPEVENT_H__
 
+#include <linux/config.h>
 
-#ifdef __cplusplus
-extern "C" {
+#ifdef CONFIG_PCI
+extern int XmPciLpEvent_init(void);
+#else
+static inline int XmPciLpEvent_init(void) { return 0; }
 #endif
-
-int XmPciLpEvent_init(void);
 void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
 
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* __XMPCILPEVENT_H__ */
diff -ruN linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_io.h linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_io.h
--- linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_io.h	2004-09-14 21:06:08.000000000 +1000
+++ linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_io.h	2005-02-09 17:57:36.000000000 +1100
@@ -31,6 +31,7 @@
 /*   Created December 28, 2000                                          */
 /* End Change Activity                                                  */
 /************************************************************************/
+#ifdef CONFIG_PCI
 extern u8   iSeries_Read_Byte(const volatile void __iomem * IoAddress);
 extern u16  iSeries_Read_Word(const volatile void __iomem * IoAddress);
 extern u32  iSeries_Read_Long(const volatile void __iomem * IoAddress);
@@ -41,6 +42,15 @@
 extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n);
 extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t n);
 extern void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *source, size_t n);
+#else	/* CONFIG_PCI */
+static inline u8   iSeries_Read_Byte(const volatile void __iomem * IoAddress)
+{
+	return 0xff;
+}
+static inline void iSeries_Write_Byte(u8  IoData, volatile void __iomem * IoAddress)
+{
+}
+#endif	/* CONFIG_PCI */
 
 #endif /* CONFIG_PPC_ISERIES */
 #endif /* _ISERIES_IO_H */
diff -ruN linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_irq.h linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_irq.h
--- linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_irq.h	2004-01-20 08:20:26.000000000 +1100
+++ linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_irq.h	2005-02-10 18:37:57.000000000 +1100
@@ -1,19 +1,9 @@
 #ifndef	__ISERIES_IRQ_H__
 #define	__ISERIES_IRQ_H__
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void iSeries_init_IRQ(void);
 int  iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId);
 int  iSeries_assign_IRQ(int, HvBusNumber, HvSubBusNumber, HvAgentId);
 void iSeries_activate_IRQs(void);
 
-int XmPciLpEvent_init(void);
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* __ISERIES_IRQ_H__ */
diff -ruN linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_pci.h linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_pci.h
--- linus-bk-dma.4/include/asm-ppc64/iSeries/iSeries_pci.h	2005-01-22 06:09:02.000000000 +1100
+++ linus-bk-dma.6/include/asm-ppc64/iSeries/iSeries_pci.h	2005-02-10 18:54:48.000000000 +1100
@@ -101,6 +101,8 @@
 	char            Location[20];   /* Frame  1, Card C10          */
 };
 
+extern struct list_head iSeries_Global_Device_List;
+
 /************************************************************************/
 /* Functions                                                            */
 /************************************************************************/
diff -ruN linus-bk-dma.4/include/asm-ppc64/io.h linus-bk-dma.6/include/asm-ppc64/io.h
--- linus-bk-dma.4/include/asm-ppc64/io.h	2005-01-29 06:05:47.000000000 +1100
+++ linus-bk-dma.6/include/asm-ppc64/io.h	2005-02-09 15:53:33.000000000 +1100
@@ -1,4 +1,4 @@
- #ifndef _PPC64_IO_H
+#ifndef _PPC64_IO_H
 #define _PPC64_IO_H
 
 /* 
@@ -31,6 +31,7 @@
 
 #define SLOW_DOWN_IO
 
+#ifdef CONFIG_PCI
 extern unsigned long isa_io_base;
 extern unsigned long pci_io_base;
 extern unsigned long io_page_mask;
@@ -39,6 +40,10 @@
 
 #define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \
 			    & io_page_mask)
+#else
+#define pci_io_base		0
+#define _IO_IS_VALID(port)	1
+#endif
 
 #ifdef CONFIG_PPC_ISERIES
 /* __raw_* accessors aren't supported on iSeries */
diff -ruN linus-bk-dma.4/include/asm-ppc64/iommu.h linus-bk-dma.6/include/asm-ppc64/iommu.h
--- linus-bk-dma.4/include/asm-ppc64/iommu.h	2005-02-07 15:02:01.000000000 +1100
+++ linus-bk-dma.6/include/asm-ppc64/iommu.h	2005-02-10 19:12:15.000000000 +1100
@@ -109,7 +109,11 @@
 extern void iommu_setup_u3(void);
 
 /* Frees table for an individual device node */
+#ifdef CONFIG_PPC_IOMMU
 extern void iommu_free_table(struct device_node *dn);
+#else
+static inline void iommu_free_table(struct device_node *dn) { }
+#endif
 
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 
@@ -154,12 +158,22 @@
 extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
 		size_t size, enum dma_data_direction direction);
 
+#ifdef CONFIG_PPC_IOMMU
 extern void iommu_init_early_pSeries(void);
 extern void iommu_init_early_iSeries(void);
 extern void iommu_init_early_u3(void);
+#else
+static inline void iommu_init_early_pSeries(void) {}
+static inline void iommu_init_early_iSeries(void) {}
+#endif
 
+#ifdef CONFIG_PCI
 extern void pci_iommu_init(void);
 extern void pci_direct_iommu_init(void);
+#else
+static inline void pci_iommu_init(void) {}
+static inline void pci_direct_iommu_init(void) {}
+#endif
 
 extern void alloc_u3_dart_table(void);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050211/efaa9cfb/attachment.pgp 


More information about the Linuxppc64-dev mailing list