mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
From Paul Brook:
The ESP SCSI driver currently doesn't check whether a DMA requests has completed before checking its status. On older qemu versions this works ok because DMA happens instantly. On never qemu DMA can take an indeterminate amount of time ooto complete, just like on real hardware. The patch waits for the controller to raise the DMA interrupt after initiating a DMA request. git-svn-id: svn://coreboot.org/openbios/openbios-devel@73 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -113,6 +113,8 @@ do_command(esp_private_t *esp, sd_private_t *sd, int cmdlen, int replylen)
|
||||
esp->espdma.regs->cond_reg = 0;
|
||||
// Set ATN, issue command
|
||||
esp->ll->regs[ESP_CMD] = ESP_CMD_SELA | ESP_CMD_DMA;
|
||||
// Wait for DMA to complete. Can this fail?
|
||||
while ((esp->espdma.regs->cond_reg & DMA_HNDL_INTR) == 0) /* no-op */;
|
||||
// Check status
|
||||
status = esp->ll->regs[ESP_STATUS];
|
||||
|
||||
@@ -129,6 +131,8 @@ do_command(esp_private_t *esp, sd_private_t *sd, int cmdlen, int replylen)
|
||||
esp->espdma.regs->cond_reg = DMA_ST_WRITE;
|
||||
// Transfer
|
||||
esp->ll->regs[ESP_CMD] = ESP_CMD_TI | ESP_CMD_DMA;
|
||||
// Wait for DMA to complete
|
||||
while ((esp->espdma.regs->cond_reg & DMA_HNDL_INTR) == 0) /* no-op */;
|
||||
// Check status
|
||||
status = esp->ll->regs[ESP_STATUS];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user