@@ -106,6 +106,24 @@ HeathrowIC::HeathrowIC() : PCIDevice("mac-io_heathrow"), InterruptCtrl()
106106 this ->emmo_pin = GET_BIN_PROP (" emmo" ) ^ 1 ;
107107}
108108
109+ static const char *get_name_dma (unsigned dma_channel) {
110+ switch (dma_channel) {
111+ case MIO_OHARE_DMA_MESH : return " DMA_MESH" ;
112+ case MIO_OHARE_DMA_FLOPPY : return " DMA_FLOPPY" ;
113+ case MIO_OHARE_DMA_ETH_XMIT : return " DMA_ETH_XMIT" ;
114+ case MIO_OHARE_DMA_ETH_RCV : return " DMA_ETH_RCV" ;
115+ case MIO_OHARE_DMA_ESCC_A_XMIT : return " DMA_ESCC_A_XMIT" ;
116+ case MIO_OHARE_DMA_ESCC_A_RCV : return " DMA_ESCC_A_RCV" ;
117+ case MIO_OHARE_DMA_ESCC_B_XMIT : return " DMA_ESCC_B_XMIT" ;
118+ case MIO_OHARE_DMA_ESCC_B_RCV : return " DMA_ESCC_B_RCV" ;
119+ case MIO_OHARE_DMA_AUDIO_OUT : return " DMA_AUDIO_OUT" ;
120+ case MIO_OHARE_DMA_AUDIO_IN : return " DMA_AUDIO_IN" ;
121+ case MIO_OHARE_DMA_IDE0 : return " DMA_IDE0" ;
122+ case MIO_OHARE_DMA_IDE1 : return " DMA_IDE1" ;
123+ default : return " unknown" ;
124+ }
125+ }
126+
109127void HeathrowIC::set_media_bay_id (uint8_t id) {
110128 this ->mb_id = id;
111129}
@@ -126,7 +144,8 @@ void HeathrowIC::notify_bar_change(int bar_num)
126144}
127145
128146uint32_t HeathrowIC::dma_read (uint32_t offset, int size) {
129- switch (offset >> 8 ) {
147+ int dma_channel = offset >> 8 ;
148+ switch (dma_channel) {
130149 case MIO_OHARE_DMA_MESH:
131150 if (this ->mesh_dma )
132151 return this ->mesh_dma ->reg_read (offset & 0xFF , size);
@@ -143,14 +162,19 @@ uint32_t HeathrowIC::dma_read(uint32_t offset, int size) {
143162 case MIO_OHARE_DMA_AUDIO_OUT:
144163 return this ->snd_out_dma ->reg_read (offset & 0xFF , size);
145164 default :
146- LOG_F (WARNING, " Unsupported DMA channel read, offset=0x%X" , offset);
165+ if (!(unsupported_dma_channel_read & (1 << dma_channel))) {
166+ unsupported_dma_channel_read |= (1 << dma_channel);
167+ LOG_F (WARNING, " %s: Unsupported DMA channel %d %s read @%02x.%c" , this ->name .c_str (),
168+ dma_channel, get_name_dma (dma_channel), offset & 0xFF , SIZE_ARG (size));
169+ }
147170 }
148171
149172 return 0 ;
150173}
151174
152175void HeathrowIC::dma_write (uint32_t offset, uint32_t value, int size) {
153- switch (offset >> 8 ) {
176+ int dma_channel = offset >> 8 ;
177+ switch (dma_channel) {
154178 case MIO_OHARE_DMA_MESH:
155179 if (this ->mesh_dma ) this ->mesh_dma ->reg_write (offset & 0xFF , value, size);
156180 break ;
@@ -170,7 +194,11 @@ void HeathrowIC::dma_write(uint32_t offset, uint32_t value, int size) {
170194 this ->snd_out_dma ->reg_write (offset & 0xFF , value, size);
171195 break ;
172196 default :
173- LOG_F (WARNING, " Unsupported DMA channel write, offset=0x%X, val=0x%X" , offset, value);
197+ if (!(unsupported_dma_channel_write & (1 << dma_channel))) {
198+ unsupported_dma_channel_write |= (1 << dma_channel);
199+ LOG_F (WARNING, " %s: Unsupported DMA channel %d %s write @%02x.%c = %0*x" , this ->name .c_str (),
200+ dma_channel, get_name_dma (dma_channel), offset & 0xFF , SIZE_ARG (size), size * 2 , value);
201+ }
174202 }
175203}
176204
0 commit comments