You're welcome! I found some more problems. But now it seems that the
DSP works for me!
Most problems i found were related to the interrupt system. It does not
reflect real behavior. I think i found most issues, but with this method
of doing interrupts we will run into further problems sooner or later. I
think it needs to be rewritten. My current patch is just a workaround.
Now it works like this:
The device sends the interrupt to the DSP like some kind of message. If
it is not masked, it is then added to a list. The DSP reads the
interrupt from the list, removes it and executes the interrupt service
routine. If a masked interrupt is unmasked, the interrupt message needs
to be re-sent. If an interrupt is on the list while it gets masked, it
needs to be removed from the list. If the service routine does not make
the device release the interrupt on first try, it needs to be sent
again, if it isn't masked.
How it should work:
The device asserts the interrupt line. The DSP samples the line and sees
the interrupt, if it is not masked. It executes the service routine,
which then makes the device release the interrupt line. If a masked
interrupt is unmasked, the DSP will start seeing it. If a pending
interrupt is masked, the DSP will no longer see it. If the service
routine does not make the device release the interrupt, the DSP will
keep on seeing it, unless it is masked.