ia64/xen-unstable

changeset 14072:2e2019e09e6c

[IA64] sn2 IO build fixes

Signed-off-by: Jes Sorensen <jes@sgi.com>
author awilliam@xenbuild2.aw
date Wed Feb 28 10:35:48 2007 -0700 (2007-02-28)
parents 21d0d23a2cca
children 347fb33790bd
files xen/arch/ia64/linux-xen/sn/kernel/io_init.c xen/arch/ia64/linux-xen/sn/kernel/irq.c
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/sn/kernel/io_init.c	Wed Feb 28 10:18:44 2007 -0700
     1.2 +++ b/xen/arch/ia64/linux-xen/sn/kernel/io_init.c	Wed Feb 28 10:35:48 2007 -0700
     1.3 @@ -20,9 +20,7 @@
     1.4  #include <asm/sn/module.h>
     1.5  #include <asm/sn/pcibr_provider.h>
     1.6  #include <asm/sn/pcibus_provider_defs.h>
     1.7 -#ifndef XEN
     1.8  #include <asm/sn/pcidev.h>
     1.9 -#endif
    1.10  #include <asm/sn/simulator.h>
    1.11  #include <asm/sn/sn_sal.h>
    1.12  #ifndef XEN
    1.13 @@ -41,6 +39,7 @@
    1.14  extern void sn_init_cpei_timer(void);
    1.15  extern void register_sn_procfs(void);
    1.16  #ifdef XEN
    1.17 +#define pci_dev_get(dev)	do{}while(0)
    1.18  extern void sn_irq_lh_init(void);
    1.19  #endif
    1.20  
    1.21 @@ -65,7 +64,6 @@ int sn_ioif_inited;		/* SN I/O infrastru
    1.22  
    1.23  struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES];	/* indexed by asic type */
    1.24  
    1.25 -#ifndef XEN
    1.26  static int max_segment_number;		 /* Default highest segment number */
    1.27  static int max_pcibus_number = 255;	/* Default highest pci bus number */
    1.28  
    1.29 @@ -97,7 +95,6 @@ static struct sn_pcibus_provider sn_pci_
    1.30  	.dma_unmap = sn_default_pci_unmap,
    1.31  	.bus_fixup = sn_default_pci_bus_fixup,
    1.32  };
    1.33 -#endif
    1.34  
    1.35  /*
    1.36   * Retrieve the DMA Flush List given nasid, widget, and device.
    1.37 @@ -148,7 +145,6 @@ static inline u64 sal_get_pcibus_info(u6
    1.38  	return ret_stuff.v0;
    1.39  }
    1.40  
    1.41 -#ifndef XEN
    1.42  /*
    1.43   * Retrieve the pci device information given the bus and device|function number.
    1.44   */
    1.45 @@ -168,6 +164,7 @@ sal_get_pcidev_info(u64 segment, u64 bus
    1.46  	return ret_stuff.v0;
    1.47  }
    1.48  
    1.49 +#ifndef XEN
    1.50  /*
    1.51   * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
    1.52   *			  device.
    1.53 @@ -185,6 +182,7 @@ sn_pcidev_info_get(struct pci_dev *dev)
    1.54  	}
    1.55  	return NULL;
    1.56  }
    1.57 +#endif
    1.58  
    1.59  /* Older PROM flush WAR
    1.60   *
    1.61 @@ -364,6 +362,7 @@ sn_pci_window_fixup(struct pci_dev *dev,
    1.62  	controller->window = new_window;
    1.63  }
    1.64  
    1.65 +#ifndef XEN
    1.66  void sn_pci_unfixup_slot(struct pci_dev *dev)
    1.67  {
    1.68  	struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev;
    1.69 @@ -372,7 +371,9 @@ void sn_pci_unfixup_slot(struct pci_dev 
    1.70  	pci_dev_put(host_pci_dev);
    1.71  	pci_dev_put(dev);
    1.72  }
    1.73 +#endif
    1.74  
    1.75 +#ifndef XEN
    1.76  /*
    1.77   * sn_pci_fixup_slot() - This routine sets up a slot's resources
    1.78   * consistent with the Linux PCI abstraction layer.  Resources acquired
    1.79 @@ -437,10 +438,12 @@ void sn_pci_fixup_slot(struct pci_dev *d
    1.80  		addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;
    1.81  		dev->resource[idx].start = addr;
    1.82  		dev->resource[idx].end = addr + size;
    1.83 +#ifndef XEN
    1.84  		if (dev->resource[idx].flags & IORESOURCE_IO)
    1.85  			dev->resource[idx].parent = &ioport_resource;
    1.86  		else
    1.87  			dev->resource[idx].parent = &iomem_resource;
    1.88 +#endif
    1.89  	}
    1.90  	/* Create a pci_window in the pci_controller struct for
    1.91  	 * each device resource.
    1.92 @@ -480,6 +483,7 @@ void sn_pci_fixup_slot(struct pci_dev *d
    1.93  		kfree(sn_irq_info);
    1.94  	}
    1.95  }
    1.96 +#endif
    1.97  
    1.98  /*
    1.99   * sn_pci_controller_fixup() - This routine sets up a bus's resources
   1.100 @@ -512,6 +516,7 @@ void sn_pci_controller_fixup(int segment
   1.101  	controller = &sn_controller->pci_controller;
   1.102  	controller->segment = segment;
   1.103  
   1.104 +#ifndef XEN
   1.105  	if (bus == NULL) {
   1.106   		bus = pci_scan_bus(busnum, &pci_root_ops, controller);
   1.107   		if (bus == NULL)
   1.108 @@ -533,6 +538,7 @@ void sn_pci_controller_fixup(int segment
   1.109  	if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
   1.110  		goto error_return; /* no further fixup necessary */
   1.111  
   1.112 +#endif
   1.113  	provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
   1.114  	if (provider == NULL)
   1.115  		goto error_return; /* no provider registerd for this asic */
   1.116 @@ -562,14 +568,18 @@ void sn_pci_controller_fixup(int segment
   1.117  	controller->window[0].resource.start = prom_bussoft_ptr->bs_legacy_io;
   1.118  	controller->window[0].resource.end =
   1.119  	    controller->window[0].resource.start + 0xffff;
   1.120 +#ifndef XEN
   1.121  	controller->window[0].resource.parent = &ioport_resource;
   1.122 +#endif
   1.123  	controller->window[1].offset = prom_bussoft_ptr->bs_legacy_mem;
   1.124  	controller->window[1].resource.name = "legacy_mem";
   1.125  	controller->window[1].resource.flags = IORESOURCE_MEM;
   1.126  	controller->window[1].resource.start = prom_bussoft_ptr->bs_legacy_mem;
   1.127  	controller->window[1].resource.end =
   1.128  	    controller->window[1].resource.start + (1024 * 1024) - 1;
   1.129 +#ifndef XEN
   1.130  	controller->window[1].resource.parent = &iomem_resource;
   1.131 +#endif
   1.132  	controller->windows = 2;
   1.133  
   1.134  	/*
   1.135 @@ -608,6 +618,7 @@ error_return:
   1.136  	return;
   1.137  }
   1.138  
   1.139 +#ifndef XEN
   1.140  void sn_bus_store_sysdata(struct pci_dev *dev)
   1.141  {
   1.142  	struct sysdata_el *element;
   1.143 @@ -644,17 +655,14 @@ void sn_bus_free_sysdata(void)
   1.144  
   1.145  #define PCI_BUSES_TO_SCAN 256
   1.146  
   1.147 -static int __init sn_pci_init(void)
   1.148 +static int __init sn_io_early_init(void)
   1.149  {
   1.150 -#ifndef XEN
   1.151  	int i, j;
   1.152  	struct pci_dev *pci_dev = NULL;
   1.153 -#endif
   1.154  
   1.155  	if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
   1.156  		return 0;
   1.157  
   1.158 -#ifndef XEN
   1.159  	/*
   1.160  	 * prime sn_pci_provider[].  Individial provider init routines will
   1.161  	 * override their respective default entries.
   1.162 @@ -663,6 +671,7 @@ static int __init sn_pci_init(void)
   1.163  	for (i = 0; i < PCIIO_ASIC_MAX_TYPES; i++)
   1.164  		sn_pci_provider[i] = &sn_pci_default_provider;
   1.165  
   1.166 +#ifndef XEN
   1.167  	pcibr_init_provider();
   1.168  	tioca_init_provider();
   1.169  	tioce_init_provider();
   1.170 @@ -683,7 +692,7 @@ static int __init sn_pci_init(void)
   1.171  #ifdef CONFIG_PROC_FS
   1.172  	register_sn_procfs();
   1.173  #endif
   1.174 -
   1.175 +#endif
   1.176  	/* busses are not known yet ... */
   1.177  	for (i = 0; i <= max_segment_number; i++)
   1.178  		for (j = 0; j <= max_pcibus_number; j++)
   1.179 @@ -695,6 +704,7 @@ static int __init sn_pci_init(void)
   1.180  	 * information.
   1.181  	 */
   1.182  
   1.183 +#ifndef XEN
   1.184  	while ((pci_dev =
   1.185  		pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) != NULL)
   1.186  		sn_pci_fixup_slot(pci_dev);
   1.187 @@ -769,9 +779,9 @@ void sn_generate_path(struct pci_bus *pc
   1.188  #endif
   1.189  
   1.190  #ifdef XEN
   1.191 -__initcall(sn_pci_init);
   1.192 +__initcall(sn_io_early_init);
   1.193  #else
   1.194 -subsys_initcall(sn_pci_init);
   1.195 +subsys_initcall(sn_io_early_init);
   1.196  #endif
   1.197  #ifndef XEN
   1.198  EXPORT_SYMBOL(sn_pci_fixup_slot);
     2.1 --- a/xen/arch/ia64/linux-xen/sn/kernel/irq.c	Wed Feb 28 10:18:44 2007 -0700
     2.2 +++ b/xen/arch/ia64/linux-xen/sn/kernel/irq.c	Wed Feb 28 10:35:48 2007 -0700
     2.3 @@ -223,6 +223,8 @@ static void sn_set_affinity_irq(unsigned
     2.4  struct hw_interrupt_type irq_type_sn = {
     2.5  #ifndef XEN
     2.6  	.name		= "SN hub",
     2.7 +#else
     2.8 +	.typename	= "SN hub",
     2.9  #endif
    2.10  	.startup	= sn_startup_irq,
    2.11  	.shutdown	= sn_shutdown_irq,
    2.12 @@ -242,19 +244,24 @@ unsigned int sn_local_vector_to_irq(u8 v
    2.13  
    2.14  void sn_irq_init(void)
    2.15  {
    2.16 -#ifndef XEN
    2.17  	int i;
    2.18  	irq_desc_t *base_desc = irq_desc;
    2.19  
    2.20 +#ifndef XEN
    2.21  	ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR;
    2.22  	ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR;
    2.23 +#endif
    2.24  
    2.25  	for (i = 0; i < NR_IRQS; i++) {
    2.26 +#ifdef XEN
    2.27 +		if (base_desc[i].handler == &no_irq_type) {
    2.28 +			base_desc[i].handler = &irq_type_sn;
    2.29 +#else
    2.30  		if (base_desc[i].chip == &no_irq_type) {
    2.31  			base_desc[i].chip = &irq_type_sn;
    2.32 +#endif
    2.33  		}
    2.34  	}
    2.35 -#endif
    2.36  }
    2.37  
    2.38  #ifndef XEN