Lines Matching refs:esp

44 	readl(esp->dma_regs + (REG))
46 writel((VAL), esp->dma_regs + (REG))
49 *(volatile u32 *)(esp->dma_regs + (REG))
51 do { *(volatile u32 *)(esp->dma_regs + (REG)) = (VAL); } while (0)
54 static void sun3x_esp_write8(struct esp *esp, u8 val, unsigned long reg)
56 writeb(val, esp->regs + (reg * 4UL));
59 static u8 sun3x_esp_read8(struct esp *esp, unsigned long reg)
61 return readb(esp->regs + (reg * 4UL));
64 static int sun3x_esp_irq_pending(struct esp *esp)
71 static void sun3x_esp_reset_dma(struct esp *esp)
84 static void sun3x_esp_dma_drain(struct esp *esp)
98 printk(KERN_ALERT PFX "esp%d: DMA will not drain!\n",
99 esp->host->unique_id);
106 static void sun3x_esp_dma_invalidate(struct esp *esp)
114 printk(KERN_ALERT PFX "esp%d: DMA will not "
115 "invalidate!\n", esp->host->unique_id);
128 static void sun3x_esp_send_dma_cmd(struct esp *esp, u32 addr, u32 esp_count,
135 sun3x_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW);
136 sun3x_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED);
146 scsi_esp_cmd(esp, cmd);
149 static int sun3x_esp_dma_error(struct esp *esp)
174 struct esp *esp;
178 host = scsi_host_alloc(tpnt, sizeof(struct esp));
183 esp = shost_priv(host);
185 esp->host = host;
186 esp->dev = &dev->dev;
187 esp->ops = &sun3x_esp_ops;
193 esp->regs = ioremap(res->start, 0x20);
194 if (!esp->regs)
201 esp->dma_regs = ioremap(res->start, 0x10);
203 esp->command_block = dma_alloc_coherent(esp->dev, 16,
204 &esp->command_block_dma,
206 if (!esp->command_block)
213 "SUN3X ESP", esp);
217 esp->scsi_id = 7;
218 esp->host->this_id = esp->scsi_id;
219 esp->scsi_id_mask = (1 << esp->scsi_id);
220 esp->cfreq = 20000000;
222 dev_set_drvdata(&dev->dev, esp);
224 err = scsi_esp_register(esp);
231 free_irq(host->irq, esp);
233 dma_free_coherent(esp->dev, 16,
234 esp->command_block,
235 esp->command_block_dma);
237 iounmap(esp->dma_regs);
239 iounmap(esp->regs);
248 struct esp *esp = dev_get_drvdata(&dev->dev);
249 unsigned int irq = esp->host->irq;
252 scsi_esp_unregister(esp);
258 free_irq(irq, esp);
259 dma_free_coherent(esp->dev, 16,
260 esp->command_block,
261 esp->command_block_dma);
263 scsi_host_put(esp->host);