1.1 --- a/pkg/devices/lib/dma/src/jz4780.cc Wed Jun 05 13:51:55 2024 +0200
1.2 +++ b/pkg/devices/lib/dma/src/jz4780.cc Thu Jun 06 23:57:07 2024 +0200
1.3 @@ -275,7 +275,10 @@
1.4 // Ensure an absence of address error and halt conditions globally and in this channel.
1.5
1.6 if (error() || halted())
1.7 - return 0;
1.8 + {
1.9 + printf("Cleared:%s%s\n", error() ? " error" : "", halted() ? " halted" : "");
1.10 + clear_errors();
1.11 + }
1.12
1.13 // Ensure a zero transfer count for this channel.
1.14
1.15 @@ -427,6 +430,15 @@
1.16 _chip->ack_irq(_channel);
1.17 }
1.18
1.19 +// Clear error conditions.
1.20 +
1.21 +void
1.22 +Dma_jz4780_channel::clear_errors()
1.23 +{
1.24 + _regs[Dma_control_status] = _regs[Dma_control_status] & ~(Dma_address_error | Dma_trans_halted);
1.25 + _chip->clear_errors();
1.26 +}
1.27 +
1.28 // Return whether a transfer has completed.
1.29
1.30 bool
1.31 @@ -510,6 +522,14 @@
1.32 _regs[Dma_irq_pending] = _regs[Dma_irq_pending] & ~(1 << channel);
1.33 }
1.34
1.35 +// Clear error conditions.
1.36 +
1.37 +void
1.38 +Dma_jz4780_chip::clear_errors()
1.39 +{
1.40 + _regs[Dma_control] = _regs[Dma_control] & ~(Dma_control_address_error | Dma_control_trans_halted);
1.41 +}
1.42 +
1.43 // Return whether an address error condition has arisen.
1.44
1.45 bool