ccio-dma.c (3d5271f9883cba7b54762bc4fe027d4172f06db7) ccio-dma.c (cb6fc18e9ca615f03d18e60c49855b434ca2e51e)
1/*
2** ccio-dma.c:
3** DMA management routines for first generation cache-coherent machines.
4** Program U2/Uturn in "Virtual Mode" and use the I/O MMU.
5**
6** (c) Copyright 2000 Grant Grundler
7** (c) Copyright 2000 Ryan Bradetich
8** (c) Copyright 2000 Hewlett-Packard Company

--- 1409 unchanged lines hidden (view full) ---

1418 }
1419}
1420
1421static void __init ccio_init_resources(struct ioc *ioc)
1422{
1423 struct resource *res = ioc->mmio_region;
1424 char *name = kmalloc(14, GFP_KERNEL);
1425
1/*
2** ccio-dma.c:
3** DMA management routines for first generation cache-coherent machines.
4** Program U2/Uturn in "Virtual Mode" and use the I/O MMU.
5**
6** (c) Copyright 2000 Grant Grundler
7** (c) Copyright 2000 Ryan Bradetich
8** (c) Copyright 2000 Hewlett-Packard Company

--- 1409 unchanged lines hidden (view full) ---

1418 }
1419}
1420
1421static void __init ccio_init_resources(struct ioc *ioc)
1422{
1423 struct resource *res = ioc->mmio_region;
1424 char *name = kmalloc(14, GFP_KERNEL);
1425
1426 sprintf(name, "GSC Bus [%d/]", ioc->hw_path);
1426 snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path);
1427
1428 ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
1429 ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
1430}
1431
1432static int new_ioc_area(struct resource *res, unsigned long size,
1433 unsigned long min, unsigned long max, unsigned long align)
1434{

--- 117 unchanged lines hidden (view full) ---

1552 * If so, initialize the chip and tell other partners in crime they
1553 * have work to do.
1554 */
1555static int ccio_probe(struct parisc_device *dev)
1556{
1557 int i;
1558 struct ioc *ioc, **ioc_p = &ioc_list;
1559
1427
1428 ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
1429 ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
1430}
1431
1432static int new_ioc_area(struct resource *res, unsigned long size,
1433 unsigned long min, unsigned long max, unsigned long align)
1434{

--- 117 unchanged lines hidden (view full) ---

1552 * If so, initialize the chip and tell other partners in crime they
1553 * have work to do.
1554 */
1555static int ccio_probe(struct parisc_device *dev)
1556{
1557 int i;
1558 struct ioc *ioc, **ioc_p = &ioc_list;
1559
1560 ioc = kmalloc(sizeof(struct ioc), GFP_KERNEL);
1560 ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
1561 if (ioc == NULL) {
1562 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
1563 return 1;
1564 }
1561 if (ioc == NULL) {
1562 printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
1563 return 1;
1564 }
1565 memset(ioc, 0, sizeof(struct ioc));
1566
1567 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
1568
1569 printk(KERN_INFO "Found %s at 0x%lx\n", ioc->name, dev->hpa.start);
1570
1571 for (i = 0; i < ioc_count; i++) {
1572 ioc_p = &(*ioc_p)->next;
1573 }
1574 *ioc_p = ioc;
1575
1576 ioc->hw_path = dev->hw_path;
1577 ioc->ioc_regs = ioremap(dev->hpa.start, 4096);
1578 ccio_ioc_init(ioc);
1579 ccio_init_resources(ioc);
1580 hppa_dma_ops = &ccio_ops;
1565
1566 ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
1567
1568 printk(KERN_INFO "Found %s at 0x%lx\n", ioc->name, dev->hpa.start);
1569
1570 for (i = 0; i < ioc_count; i++) {
1571 ioc_p = &(*ioc_p)->next;
1572 }
1573 *ioc_p = ioc;
1574
1575 ioc->hw_path = dev->hw_path;
1576 ioc->ioc_regs = ioremap(dev->hpa.start, 4096);
1577 ccio_ioc_init(ioc);
1578 ccio_init_resources(ioc);
1579 hppa_dma_ops = &ccio_ops;
1581 dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
1580 dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
1582
1583 /* if this fails, no I/O cards will work, so may as well bug */
1584 BUG_ON(dev->dev.platform_data == NULL);
1585 HBA_DATA(dev->dev.platform_data)->iommu = ioc;
1586
1587
1588 if (ioc_count == 0) {
1589 /* FIXME: Create separate entries for each ioc */

--- 24 unchanged lines hidden ---
1581
1582 /* if this fails, no I/O cards will work, so may as well bug */
1583 BUG_ON(dev->dev.platform_data == NULL);
1584 HBA_DATA(dev->dev.platform_data)->iommu = ioc;
1585
1586
1587 if (ioc_count == 0) {
1588 /* FIXME: Create separate entries for each ioc */

--- 24 unchanged lines hidden ---