]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/vio.c
[POWERPC] Add new interrupt mapping core and change platforms to use it
[karo-tx-linux.git] / arch / powerpc / kernel / vio.c
index 2cda65b8171b77f44c67a3a7bbeedac49b8849e7..fad8580f9081cef38f6e6612d4de18e09047d763 100644 (file)
@@ -60,9 +60,9 @@ static void __init iommu_vio_init(void)
        vio_iommu_table = veth_iommu_table;
        vio_iommu_table.it_offset += veth_iommu_table.it_size;
 
-       if (!iommu_init_table(&veth_iommu_table))
+       if (!iommu_init_table(&veth_iommu_table, -1))
                printk("Virtual Bus VETH TCE table failed.\n");
-       if (!iommu_init_table(&vio_iommu_table))
+       if (!iommu_init_table(&vio_iommu_table, -1))
                printk("Virtual Bus VIO TCE table failed.\n");
 }
 #endif
@@ -71,7 +71,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
 {
 #ifdef CONFIG_PPC_ISERIES
        if (firmware_has_feature(FW_FEATURE_ISERIES)) {
-               if (strcmp(dev->type, "vlan") == 0)
+               if (strcmp(dev->type, "network") == 0)
                        return &veth_iommu_table;
                return &vio_iommu_table;
        } else
@@ -98,7 +98,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
                tbl->it_busno = 0;
                tbl->it_type = TCE_VB;
 
-               return iommu_init_table(tbl);
+               return iommu_init_table(tbl, -1);
        }
 }
 
@@ -218,7 +218,6 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 {
        struct vio_dev *viodev;
        unsigned int *unit_address;
-       unsigned int *irq_p;
 
        /* we need the 'device_type' property, in order to match with drivers */
        if (of_node->type == NULL) {
@@ -243,16 +242,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 
        viodev->dev.platform_data = of_node_get(of_node);
 
-       viodev->irq = NO_IRQ;
-       irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
-       if (irq_p) {
-               int virq = virt_irq_create_mapping(*irq_p);
-               if (virq == NO_IRQ) {
-                       printk(KERN_ERR "Unable to allocate interrupt "
-                              "number for %s\n", of_node->full_name);
-               } else
-                       viodev->irq = irq_offset_up(virq);
-       }
+       viodev->irq = irq_of_parse_and_map(of_node, 0);
 
        snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
        viodev->name = of_node->name;
@@ -394,7 +384,7 @@ static void *vio_alloc_coherent(struct device *dev, size_t size,
                           dma_addr_t *dma_handle, gfp_t flag)
 {
        return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size,
-                       dma_handle, ~0ul, flag);
+                       dma_handle, ~0ul, flag, -1);
 }
 
 static void vio_free_coherent(struct device *dev, size_t size,