Lines Matching +full:irq +full:- +full:mirror

2  * Linux ARCnet driver - COM90xx chipset (memory-mapped buffers)
4 * Written 1994-1999 by Avery Pennarun.
49 * it on - I think it should be fine if you only have one ARCnet card
86 static int io; /* use the insmod io= irq= shmem= options */
87 static int irq; variable
92 module_param_hw(irq, int, irq, 0);
100 int ports[(0x3f0 - 0x200) / 16 + 1] = { 0 }; in com90xx_probe()
107 if (!io && !irq && !shmem && !*device && com90xx_skip_probe) in com90xx_probe()
110 shmems = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(unsigned long), in com90xx_probe()
114 iomem = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(void __iomem *), in com90xx_probe()
140 numprint = -1; in com90xx_probe()
141 for (port = &ports[0]; port - ports < numports; port++) { in com90xx_probe()
158 *port-- = ports[--numports]; in com90xx_probe()
167 *port-- = ports[--numports]; in com90xx_probe()
190 numprint = -1; in com90xx_probe()
204 * 0xD1 byte in the right place, or are read-only. in com90xx_probe()
206 numprint = -1; in com90xx_probe()
243 * sure no "mirror" shmem areas show up - if they occur in com90xx_probe()
264 *p-- = shmems[--numshmems]; in com90xx_probe()
265 index--; in com90xx_probe()
280 numprint = -1; in com90xx_probe()
293 * the RESET flag, and (if no irq is given) generate an autoirq, in com90xx_probe()
299 numprint = -1; in com90xx_probe()
321 *port-- = ports[--numports]; in com90xx_probe()
334 *port-- = ports[--numports]; in com90xx_probe()
337 /* skip this completely if an IRQ was given, because maybe in com90xx_probe()
340 if (!irq) { in com90xx_probe()
341 /* if we do this, we're sure to get an IRQ since the in com90xx_probe()
357 *port-- = ports[--numports]; in com90xx_probe()
361 airq = irq; in com90xx_probe()
398 numprint = -1; in com90xx_probe()
401 shmems[index] = shmems[--numshmems]; in com90xx_probe()
405 arc_cont(D_INIT_REASONS, "%Xh-", in com90xx_probe()
420 *port-- = ports[--numports]; in com90xx_probe()
439 int res = -1; in check_mirror()
442 return -1; in check_mirror()
474 return -ENOMEM; in com90xx_found()
479 /* guess the actual size of one "memory mirror" - the number of in com90xx_found()
485 check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 && in com90xx_found()
486 check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1) in com90xx_found()
489 first_mirror = shmem - mirror_size; in com90xx_found()
491 first_mirror -= mirror_size; in com90xx_found()
497 last_mirror -= mirror_size; in com90xx_found()
499 dev->mem_start = first_mirror; in com90xx_found()
500 dev->mem_end = last_mirror + MIRROR_SIZE - 1; in com90xx_found()
505 if (!request_mem_region(dev->mem_start, in com90xx_found()
506 dev->mem_end - dev->mem_start + 1, in com90xx_found()
510 /* reserve the irq */ in com90xx_found()
512 arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", airq); in com90xx_found()
515 dev->irq = airq; in com90xx_found()
518 lp->card_name = "COM90xx"; in com90xx_found()
519 lp->hw.command = com90xx_command; in com90xx_found()
520 lp->hw.status = com90xx_status; in com90xx_found()
521 lp->hw.intmask = com90xx_setmask; in com90xx_found()
522 lp->hw.reset = com90xx_reset; in com90xx_found()
523 lp->hw.owner = THIS_MODULE; in com90xx_found()
524 lp->hw.copy_to_card = com90xx_copy_to_card; in com90xx_found()
525 lp->hw.copy_from_card = com90xx_copy_from_card; in com90xx_found()
526 lp->mem_start = ioremap(dev->mem_start, in com90xx_found()
527 dev->mem_end - dev->mem_start + 1); in com90xx_found()
528 if (!lp->mem_start) { in com90xx_found()
534 arcnet_set_addr(dev, arcnet_readb(lp->mem_start, in com90xx_found()
537 dev->base_addr = ioaddr; in com90xx_found()
539 arc_printk(D_NORMAL, dev, "COM90xx station %02Xh found at %03lXh, IRQ %d, ShMem %lXh (%ld*%xh).\n", in com90xx_found()
540 dev->dev_addr[0], in com90xx_found()
541 dev->base_addr, dev->irq, dev->mem_start, in com90xx_found()
542 (dev->mem_end - dev->mem_start + 1) / mirror_size, in com90xx_found()
552 iounmap(lp->mem_start); in com90xx_found()
554 free_irq(dev->irq, dev); in com90xx_found()
556 release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1); in com90xx_found()
559 return -EIO; in com90xx_found()
564 short ioaddr = dev->base_addr; in com90xx_command()
571 short ioaddr = dev->base_addr; in com90xx_status()
578 short ioaddr = dev->base_addr; in com90xx_setmask()
593 short ioaddr = dev->base_addr; in com90xx_reset()
614 if (arcnet_readb(lp->mem_start, COM9026_REG_R_STATUS) != TESTvalue) { in com90xx_reset()
619 /* enable extended (512-byte) packets */ in com90xx_reset()
624 memset_io(lp->mem_start, 0x42, 2048); in com90xx_reset()
634 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; in com90xx_copy_to_card()
643 void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset; in com90xx_copy_from_card()
653 if (irq == 2) in com90xx_init()
654 irq = 9; in com90xx_init()
657 return -EIO; in com90xx_init()
672 free_irq(dev->irq, dev); in com90xx_exit()
673 iounmap(lp->mem_start); in com90xx_exit()
674 release_region(dev->base_addr, ARCNET_TOTAL_SIZE); in com90xx_exit()
675 release_mem_region(dev->mem_start, in com90xx_exit()
676 dev->mem_end - dev->mem_start + 1); in com90xx_exit()
702 case 2: /* IRQ */ in com90xx_setup()
703 irq = ints[2]; in com90xx_setup()