grandcentral: Add escc DMA.

This commit is contained in:
joevt 2023-11-21 20:45:26 -08:00 committed by dingusdev
parent 5f316dc7a4
commit 2c097da12d
2 changed files with 39 additions and 0 deletions

View File

@ -93,6 +93,18 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl()
// connect serial HW
this->escc = dynamic_cast<EsccController*>(gMachineObj->get_comp_by_name("Escc"));
this->escc_a_tx_dma = std::unique_ptr<DMAChannel> (new DMAChannel("Escc_a_tx"));
this->escc_a_rx_dma = std::unique_ptr<DMAChannel> (new DMAChannel("Escc_a_rx"));
this->escc_b_tx_dma = std::unique_ptr<DMAChannel> (new DMAChannel("Escc_b_tx"));
this->escc_b_rx_dma = std::unique_ptr<DMAChannel> (new DMAChannel("Escc_b_rx"));
this->escc_a_tx_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCCA_Tx));
this->escc_a_rx_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCCA_Rx));
this->escc_b_tx_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCCB_Tx));
this->escc_b_rx_dma->register_dma_int(this, this->register_dma_int(IntSrc::DMA_SCCB_Rx));
this->escc->set_dma_channel(0, this->escc_a_tx_dma.get());
this->escc->set_dma_channel(1, this->escc_a_rx_dma.get());
this->escc->set_dma_channel(2, this->escc_b_tx_dma.get());
this->escc->set_dma_channel(3, this->escc_b_rx_dma.get());
// connect MESH (internal SCSI)
this->mesh = dynamic_cast<MeshController*>(gMachineObj->get_comp_by_name("MeshTnt"));
@ -206,6 +218,14 @@ uint32_t GrandCentral::read(uint32_t rgn_start, uint32_t offset, int size)
return this->curio_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_FLOPPY:
return this->floppy_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_ESCC_A_XMIT:
return this->escc_a_tx_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_ESCC_A_RCV:
return this->escc_a_rx_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_ESCC_B_XMIT:
return this->escc_b_tx_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_ESCC_B_RCV:
return this->escc_b_rx_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_AUDIO_OUT:
return this->snd_out_dma->reg_read(offset & 0xFF, size);
case MIO_GC_DMA_AUDIO_IN:
@ -308,6 +328,18 @@ void GrandCentral::write(uint32_t rgn_start, uint32_t offset, uint32_t value, in
case MIO_GC_DMA_FLOPPY:
this->floppy_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_ESCC_A_XMIT:
this->escc_a_tx_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_ESCC_A_RCV:
this->escc_a_rx_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_ESCC_B_XMIT:
this->escc_b_tx_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_ESCC_B_RCV:
this->escc_b_rx_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_GC_DMA_AUDIO_OUT:
this->snd_out_dma->reg_write(offset & 0xFF, value, size);
break;

View File

@ -187,6 +187,13 @@ private:
std::unique_ptr<DMAChannel> snd_out_dma;
std::unique_ptr<DMAChannel> snd_in_dma;
std::unique_ptr<DMAChannel> floppy_dma;
std::unique_ptr<DMAChannel> escc_a_tx_dma;
std::unique_ptr<DMAChannel> escc_a_rx_dma;
std::unique_ptr<DMAChannel> escc_b_tx_dma;
std::unique_ptr<DMAChannel> escc_b_rx_dma;
uint16_t unsupported_dma_channel_read = 0;
uint16_t unsupported_dma_channel_write = 0;
};
class OHare : public PCIDevice, public InterruptCtrl {