int sgiwd93_release(struct Scsi_Host *instance) { free_irq(SGI_WD93_0_IRQ, sgiwd93_intr); free_page(KSEG0ADDR(hdata->dma_bounce_buffer)); wd33c93_release(); if(!sgi_guiness) { free_irq(SGI_WD93_1_IRQ, sgiwd93_intr); free_page(KSEG0ADDR(hdata1->dma_bounce_buffer)); wd33c93_release(); } return 1; }
int a3000_release(struct Scsi_Host *instance) { wd33c93_release(); DMA(instance)->CNTR = 0; release_mem_region(0xDD0000, 256); free_irq(IRQ_AMIGA_PORTS, a3000_intr); return 1; }
int mvme147_release(struct Scsi_Host *instance) { #ifdef MODULE /* XXX Make sure DMA is stopped! */ wd33c93_release(); free_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr); free_irq(MVME147_IRQ_SCSI_DMA, mvme147_intr); #endif return 1; }
static int a2091_release(struct Scsi_Host *instance) { #ifdef MODULE DMA(instance)->CNTR = 0; release_mem_region(ZTWO_PADDR(instance->base), 256); free_irq(IRQ_AMIGA_PORTS, instance); wd33c93_release(); #endif return 1; }
static int __init a2091_detect(struct scsi_host_template *tpnt) { static unsigned char called = 0; struct Scsi_Host *instance; unsigned long address; struct zorro_dev *z = NULL; wd33c93_regs regs; int num_a2091 = 0; if (!MACH_IS_AMIGA || called) return 0; called = 1; tpnt->proc_name = "A2091"; tpnt->proc_info = &wd33c93_proc_info; while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { if (z->id != ZORRO_PROD_CBM_A590_A2091_1 && z->id != ZORRO_PROD_CBM_A590_A2091_2) continue; address = z->resource.start; if (!request_mem_region(address, 256, "wd33c93")) continue; instance = scsi_register (tpnt, sizeof (struct WD33C93_hostdata)); if (instance == NULL) goto release; instance->base = ZTWO_VADDR(address); instance->irq = IRQ_AMIGA_PORTS; instance->unique_id = z->slotaddr; DMA(instance)->DAWR = DAWR_A2091; regs.SASR = &(DMA(instance)->SASR); regs.SCMD = &(DMA(instance)->SCMD); HDATA(instance)->no_sync = 0xff; HDATA(instance)->fast = 0; HDATA(instance)->dma_mode = CTRL_DMA; wd33c93_init(instance, regs, dma_setup, dma_stop, WD33C93_FS_8_10); if (request_irq(IRQ_AMIGA_PORTS, a2091_intr, IRQF_SHARED, "A2091 SCSI", instance)) goto unregister; DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN; num_a2091++; continue; unregister: scsi_unregister(instance); wd33c93_release(); release: release_mem_region(address, 256); } return num_a2091; }
int mvme147_detect(struct scsi_host_template *tpnt) { static unsigned char called = 0; wd33c93_regs regs; if (!MACH_IS_MVME147 || called) return 0; called++; tpnt->proc_name = "MVME147"; tpnt->proc_info = &wd33c93_proc_info; mvme147_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata)); if (!mvme147_host) goto err_out; mvme147_host->base = 0xfffe4000; mvme147_host->irq = MVME147_IRQ_SCSI_PORT; regs.SASR = (volatile unsigned char *)0xfffe4000; regs.SCMD = (volatile unsigned char *)0xfffe4001; HDATA(mvme147_host)->no_sync = 0xff; HDATA(mvme147_host)->fast = 0; HDATA(mvme147_host)->dma_mode = CTRL_DMA; wd33c93_init(mvme147_host, regs, dma_setup, dma_stop, WD33C93_FS_8_10); if (request_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr, 0, "MVME147 SCSI PORT", mvme147_intr)) goto err_unregister; if (request_irq(MVME147_IRQ_SCSI_DMA, mvme147_intr, 0, "MVME147 SCSI DMA", mvme147_intr)) goto err_free_irq; #if 0 /* Disabled; causes problems booting */ m147_pcc->scsi_interrupt = 0x10; /* Assert SCSI bus reset */ udelay(100); m147_pcc->scsi_interrupt = 0x00; /* Negate SCSI bus reset */ udelay(2000); m147_pcc->scsi_interrupt = 0x40; /* Clear bus reset interrupt */ #endif m147_pcc->scsi_interrupt = 0x09; /* Enable interrupt */ m147_pcc->dma_cntrl = 0x00; /* ensure DMA is stopped */ m147_pcc->dma_intr = 0x89; /* Ack and enable ints */ return 1; err_free_irq: free_irq(MVME147_IRQ_SCSI_PORT, mvme147_intr); err_unregister: wd33c93_release(); scsi_unregister(mvme147_host); err_out: return 0; }
int __init a3000_detect(struct scsi_host_template *tpnt) { wd33c93_regs regs; if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(A3000_SCSI)) return 0; if (!request_mem_region(0xDD0000, 256, "wd33c93")) return 0; tpnt->proc_name = "A3000"; tpnt->proc_info = &wd33c93_proc_info; a3000_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata)); if (a3000_host == NULL) goto fail_register; a3000_host->base = ZTWO_VADDR(0xDD0000); a3000_host->irq = IRQ_AMIGA_PORTS; DMA(a3000_host)->DAWR = DAWR_A3000; regs.SASR = &(DMA(a3000_host)->SASR); regs.SCMD = &(DMA(a3000_host)->SCMD); HDATA(a3000_host)->no_sync = 0xff; HDATA(a3000_host)->fast = 0; HDATA(a3000_host)->dma_mode = CTRL_DMA; wd33c93_init(a3000_host, regs, dma_setup, dma_stop, WD33C93_FS_12_15); if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI", a3000_intr)) goto fail_irq; DMA(a3000_host)->CNTR = CNTR_PDMD | CNTR_INTEN; return 1; fail_irq: wd33c93_release(); scsi_unregister(a3000_host); fail_register: release_mem_region(0xDD0000, 256); return 0; }
int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) { static unsigned char called = 0; struct hpc3_scsiregs *hregs = &hpc3c0->scsi_chan0; struct hpc3_scsiregs *hregs1 = &hpc3c0->scsi_chan1; struct WD33C93_hostdata *hdata; struct WD33C93_hostdata *hdata1; wd33c93_regs regs; uchar *buf; if(called) return 0; /* Should bitch on the console about this... */ SGIblows->proc_name = "SGIWD93"; sgiwd93_host = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata)); if(sgiwd93_host == NULL) return 0; sgiwd93_host->base = (unsigned long) hregs; sgiwd93_host->irq = SGI_WD93_0_IRQ; buf = (uchar *) get_zeroed_page(GFP_KERNEL); if (!buf) { printk(KERN_WARNING "sgiwd93: Could not allocate memory for host0 buffer.\n"); scsi_unregister(sgiwd93_host); return 0; } init_hpc_chain(buf); /* HPC_SCSI_REG0 | 0x03 | KSEG1 */ regs.SASR = (unsigned char*) KSEG1ADDR (0x1fbc0003); regs.SCMD = (unsigned char*) KSEG1ADDR (0x1fbc0007); wd33c93_init(sgiwd93_host, regs, dma_setup, dma_stop, WD33C93_FS_16_20); hdata = (struct WD33C93_hostdata *)sgiwd93_host->hostdata; hdata->no_sync = 0; hdata->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf)); if (request_irq(SGI_WD93_0_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host)) { printk(KERN_WARNING "sgiwd93: Could not register IRQ %d (for host 0).\n", SGI_WD93_0_IRQ); wd33c93_release(); free_page((unsigned long)buf); scsi_unregister(sgiwd93_host); return 0; } /* set up second controller on the Indigo2 */ if(!sgi_guiness) { sgiwd93_host1 = scsi_register(SGIblows, sizeof(struct WD33C93_hostdata)); if(sgiwd93_host1 != NULL) { sgiwd93_host1->base = (unsigned long) hregs1; sgiwd93_host1->irq = SGI_WD93_1_IRQ; buf = (uchar *) get_zeroed_page(GFP_KERNEL); if (!buf) { printk(KERN_WARNING "sgiwd93: Could not allocate memory for host1 buffer.\n"); scsi_unregister(sgiwd93_host1); called = 1; return 1; /* We registered host0 so return success*/ } init_hpc_chain(buf); /* HPC_SCSI_REG1 | 0x03 | KSEG1 */ regs.SASR = (unsigned char*) KSEG1ADDR(0x1fbc8003); regs.SCMD = (unsigned char*) KSEG1ADDR(0x1fbc8007); wd33c93_init(sgiwd93_host1, regs, dma_setup, dma_stop, WD33C93_FS_16_20); hdata1 = (struct WD33C93_hostdata *)sgiwd93_host1->hostdata; hdata1->no_sync = 0; hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf)); if (request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host1)) { printk(KERN_WARNING "sgiwd93: Could not allocate irq %d (for host1).\n", SGI_WD93_1_IRQ); wd33c93_release(); free_page((unsigned long)buf); scsi_unregister(sgiwd93_host1); /* Fall through since host0 registered OK */ } } } called = 1; return 1; /* Found one. */ }