Commit c57d1f3a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: New pci provider interfaces

From: Pat Gefre <pfg@sgi.com>

New pci provider interfaces
parent 8e00ee40
...@@ -31,6 +31,18 @@ void sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin, ...@@ -31,6 +31,18 @@ void sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin,
#define IS_OPUS(nasid) (cbrick_type_get_nasid(nasid) == MODULE_OPUSBRICK) #define IS_OPUS(nasid) (cbrick_type_get_nasid(nasid) == MODULE_OPUSBRICK)
#define IS_ALTIX(nasid) (cbrick_type_get_nasid(nasid) == MODULE_CBRICK) #define IS_ALTIX(nasid) (cbrick_type_get_nasid(nasid) == MODULE_CBRICK)
/*
* Init the provider asic for a given device
*/
static void
set_pci_provider(struct sn_device_sysdata *device_sysdata)
{
pciio_info_t pciio_info = pciio_info_get(device_sysdata->vhdl);
device_sysdata->pci_provider = pciio_info_pops_get(pciio_info);
}
/* /*
* pci_bus_cvlink_init() - To be called once during initialization before * pci_bus_cvlink_init() - To be called once during initialization before
* SGI IO Infrastructure init is called. * SGI IO Infrastructure init is called.
...@@ -329,6 +341,7 @@ sn_pci_fixup(int arg) ...@@ -329,6 +341,7 @@ sn_pci_fixup(int arg)
struct sn_widget_sysdata *widget_sysdata; struct sn_widget_sysdata *widget_sysdata;
struct sn_device_sysdata *device_sysdata; struct sn_device_sysdata *device_sysdata;
pcibr_intr_t intr_handle; pcibr_intr_t intr_handle;
pciio_provider_t *pci_provider;
int cpuid; int cpuid;
vertex_hdl_t device_vertex; vertex_hdl_t device_vertex;
pciio_intr_line_t lines; pciio_intr_line_t lines;
...@@ -404,6 +417,7 @@ sn_pci_fixup(int arg) ...@@ -404,6 +417,7 @@ sn_pci_fixup(int arg)
device_vertex = device_sysdata->vhdl; device_vertex = device_sysdata->vhdl;
device_dev->sysdata = (void *) device_sysdata; device_dev->sysdata = (void *) device_sysdata;
set_pci_provider(device_sysdata);
/* /*
* Set the xbridge Device(X) Write Buffer Flush and Xbow Flush * Set the xbridge Device(X) Write Buffer Flush and Xbow Flush
...@@ -448,14 +462,16 @@ sn_pci_fixup(int arg) ...@@ -448,14 +462,16 @@ sn_pci_fixup(int arg)
pci_read_config_byte(device_dev, PCI_INTERRUPT_PIN, pci_read_config_byte(device_dev, PCI_INTERRUPT_PIN,
(unsigned char *)&lines); (unsigned char *)&lines);
device_sysdata = (struct sn_device_sysdata *)device_dev->sysdata;
device_vertex = device_sysdata->vhdl;
pci_provider = device_sysdata->pci_provider;
irqpdaindr->curr = device_dev; irqpdaindr->curr = device_dev;
intr_handle = pcibr_intr_alloc(device_vertex, NULL, lines, device_vertex); intr_handle = (pci_provider->intr_alloc)(device_vertex, NULL, lines, device_vertex);
irq = intr_handle->bi_irq; irq = intr_handle->bi_irq;
irqpdaindr->device_dev[irq] = device_dev; irqpdaindr->device_dev[irq] = device_dev;
cpuid = intr_handle->bi_cpu; (pci_provider->intr_connect)(intr_handle, (intr_func_t)0, (intr_arg_t)0);
pcibr_intr_connect(intr_handle, (intr_func_t)0, (intr_arg_t)0);
device_dev->irq = irq; device_dev->irq = irq;
register_pcibr_intr(irq, intr_handle); register_pcibr_intr(irq, intr_handle);
......
...@@ -53,6 +53,7 @@ struct sn_device_sysdata { ...@@ -53,6 +53,7 @@ struct sn_device_sysdata {
int isa64; int isa64;
volatile unsigned int *dma_buf_sync; volatile unsigned int *dma_buf_sync;
volatile unsigned int *xbow_buf_sync; volatile unsigned int *xbow_buf_sync;
pciio_provider_t *pci_provider;
}; };
struct ioports_to_tlbs_s { struct ioports_to_tlbs_s {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment