heathrow: add Ethernet DBDMA channels.

This commit is contained in:
Maxim Poliakovski 2023-09-22 00:11:19 +02:00
parent ae97d7bcc7
commit f4f7edcc28
2 changed files with 15 additions and 1 deletions

View File

@ -96,6 +96,8 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io/heathrow"), InterruptCtrl()
// connect Ethernet HW // connect Ethernet HW
this->bmac = dynamic_cast<BigMac*>(gMachineObj->get_comp_by_type(HWCompType::ETHER_MAC)); this->bmac = dynamic_cast<BigMac*>(gMachineObj->get_comp_by_type(HWCompType::ETHER_MAC));
this->enet_xmit_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
this->enet_rcv_dma = std::unique_ptr<DMAChannel> (new DMAChannel());
// set EMMO pin status (active low) // set EMMO pin status (active low)
this->emmo_pin = GET_BIN_PROP("emmo") ^ 1; this->emmo_pin = GET_BIN_PROP("emmo") ^ 1;
@ -122,6 +124,10 @@ uint32_t HeathrowIC::dma_read(uint32_t offset, int size) {
return this->scsi_dma->reg_read(offset & 0xFF, size); return this->scsi_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_FLOPPY: case MIO_OHARE_DMA_FLOPPY:
return this->floppy_dma->reg_read(offset & 0xFF, size); return this->floppy_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_ETH_XMIT:
return this->enet_xmit_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_ETH_RCV:
return this->enet_rcv_dma->reg_read(offset & 0xFF, size);
case MIO_OHARE_DMA_AUDIO_OUT: case MIO_OHARE_DMA_AUDIO_OUT:
return this->snd_out_dma->reg_read(offset & 0xFF, size); return this->snd_out_dma->reg_read(offset & 0xFF, size);
default: default:
@ -139,6 +145,12 @@ void HeathrowIC::dma_write(uint32_t offset, uint32_t value, int size) {
case MIO_OHARE_DMA_FLOPPY: case MIO_OHARE_DMA_FLOPPY:
this->floppy_dma->reg_write(offset & 0xFF, value, size); this->floppy_dma->reg_write(offset & 0xFF, value, size);
break; break;
case MIO_OHARE_DMA_ETH_XMIT:
this->enet_xmit_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_OHARE_DMA_ETH_RCV:
this->enet_rcv_dma->reg_write(offset & 0xFF, value, size);
break;
case MIO_OHARE_DMA_AUDIO_OUT: case MIO_OHARE_DMA_AUDIO_OUT:
this->snd_out_dma->reg_write(offset & 0xFF, value, size); this->snd_out_dma->reg_write(offset & 0xFF, value, size);
break; break;

View File

@ -299,8 +299,10 @@ private:
// DMA channels // DMA channels
std::unique_ptr<DMAChannel> scsi_dma; std::unique_ptr<DMAChannel> scsi_dma;
std::unique_ptr<DMAChannel> snd_out_dma;
std::unique_ptr<DMAChannel> floppy_dma; std::unique_ptr<DMAChannel> floppy_dma;
std::unique_ptr<DMAChannel> enet_xmit_dma;
std::unique_ptr<DMAChannel> enet_rcv_dma;
std::unique_ptr<DMAChannel> snd_out_dma;
}; };
#endif /* MACIO_H */ #endif /* MACIO_H */