Lines Matching full:esp
2 /* sun3x_esp.c: ESP front-end for Sun3x systems.
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) in sun3x_esp_write8() argument
56 writeb(val, esp->regs + (reg * 4UL)); in sun3x_esp_write8()
59 static u8 sun3x_esp_read8(struct esp *esp, unsigned long reg) in sun3x_esp_read8() argument
61 return readb(esp->regs + (reg * 4UL)); in sun3x_esp_read8()
64 static int sun3x_esp_irq_pending(struct esp *esp) in sun3x_esp_irq_pending() argument
71 static void sun3x_esp_reset_dma(struct esp *esp) in sun3x_esp_reset_dma() argument
84 static void sun3x_esp_dma_drain(struct esp *esp) in sun3x_esp_dma_drain() argument
98 printk(KERN_ALERT PFX "esp%d: DMA will not drain!\n", in sun3x_esp_dma_drain()
99 esp->host->unique_id); in sun3x_esp_dma_drain()
106 static void sun3x_esp_dma_invalidate(struct esp *esp) in sun3x_esp_dma_invalidate() argument
114 printk(KERN_ALERT PFX "esp%d: DMA will not " in sun3x_esp_dma_invalidate()
115 "invalidate!\n", esp->host->unique_id); in sun3x_esp_dma_invalidate()
128 static void sun3x_esp_send_dma_cmd(struct esp *esp, u32 addr, u32 esp_count, in sun3x_esp_send_dma_cmd() argument
135 sun3x_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW); in sun3x_esp_send_dma_cmd()
136 sun3x_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED); in sun3x_esp_send_dma_cmd()
146 scsi_esp_cmd(esp, cmd); in sun3x_esp_send_dma_cmd()
149 static int sun3x_esp_dma_error(struct esp *esp) in sun3x_esp_dma_error() argument
174 struct esp *esp; in esp_sun3x_probe() local
178 host = scsi_host_alloc(tpnt, sizeof(struct esp)); in esp_sun3x_probe()
183 esp = shost_priv(host); in esp_sun3x_probe()
185 esp->host = host; in esp_sun3x_probe()
186 esp->dev = &dev->dev; in esp_sun3x_probe()
187 esp->ops = &sun3x_esp_ops; in esp_sun3x_probe()
193 esp->regs = ioremap(res->start, 0x20); in esp_sun3x_probe()
194 if (!esp->regs) in esp_sun3x_probe()
201 esp->dma_regs = ioremap(res->start, 0x10); in esp_sun3x_probe()
203 esp->command_block = dma_alloc_coherent(esp->dev, 16, in esp_sun3x_probe()
204 &esp->command_block_dma, in esp_sun3x_probe()
206 if (!esp->command_block) in esp_sun3x_probe()
213 "SUN3X ESP", esp); in esp_sun3x_probe()
217 esp->scsi_id = 7; in esp_sun3x_probe()
218 esp->host->this_id = esp->scsi_id; in esp_sun3x_probe()
219 esp->scsi_id_mask = (1 << esp->scsi_id); in esp_sun3x_probe()
220 esp->cfreq = 20000000; in esp_sun3x_probe()
222 dev_set_drvdata(&dev->dev, esp); in esp_sun3x_probe()
224 err = scsi_esp_register(esp); in esp_sun3x_probe()
231 free_irq(host->irq, esp); in esp_sun3x_probe()
233 dma_free_coherent(esp->dev, 16, in esp_sun3x_probe()
234 esp->command_block, in esp_sun3x_probe()
235 esp->command_block_dma); in esp_sun3x_probe()
237 iounmap(esp->dma_regs); in esp_sun3x_probe()
239 iounmap(esp->regs); in esp_sun3x_probe()
248 struct esp *esp = dev_get_drvdata(&dev->dev); in esp_sun3x_remove() local
249 unsigned int irq = esp->host->irq; in esp_sun3x_remove()
252 scsi_esp_unregister(esp); in esp_sun3x_remove()
258 free_irq(irq, esp); in esp_sun3x_remove()
259 dma_free_coherent(esp->dev, 16, in esp_sun3x_remove()
260 esp->command_block, in esp_sun3x_remove()
261 esp->command_block_dma); in esp_sun3x_remove()
263 scsi_host_put(esp->host); in esp_sun3x_remove()
277 MODULE_DESCRIPTION("Sun3x ESP SCSI driver");