On Sat, 18 Jan 2020 at 16:42, Guenter Roeck <li...@roeck-us.net> wrote: > > First parameter to exynos4210_get_irq() is not the SPI port number, > but the interrupt group number. Interrupt groups are 20 for mdma > and 21 for pdma. Interrupts are not inverted. Controllers support 32 > events (pdma) or 31 events (mdma). Events must all be routed to a single > interrupt line. Set other parameters as documented in Exynos4210 datasheet, > section 8 (DMA controller). > > Reduce the number of DMA events to 30 for both pdma and mdma. QEMU's OR > interrupt gates are currently limited to less than 32, and we would need > 33 gates to support 32 event interrupts plus the abort interrupt. > Operationally this should not make a difference since they are all > routed to a single interrupt line anyway. > > Fixes: 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") > Signed-off-by: Guenter Roeck <li...@roeck-us.net> > --- > v2: Use interrupt combiner instead of connecting all events to a > single interrupt. Limit number of events per DMA channel > to 31 to meet qemu interrupt combiner limitations. > [Not sure if "assert(s->num_lines < MAX_OR_LINES);" should be > "assert(s->num_lines <= MAX_OR_LINES);"]
Yes, that looks like a bug in or-irq.c -- it should be using <=, so 32 is permissible. As the comment in or-irq.h notes, we can safely simply bump the #define value without breaking anything if you need more input OR lines than 32. Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM