|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH] Align Raspberry Pi DMA interrupts with Linux DTS |
Date: | Wed, 13 Jul 2022 00:30:35 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
+Pete/Jeremy On 26/6/22 12:16, Peter Maydell wrote:
On Fri, 24 Jun 2022 at 21:54, Andrey Makarov <ph.makarov@gmail.com> wrote:All Raspberry Pi models 1-3 (based on bcm2835) have Linux device tree (arch/arm/boot/dts/bcm2835-common.dtsi +25): /* dma channel 11-14 share one irq */ which mismatched the Qemu model. In this patch channels 0--10 and 11--14 are handled separately.Is there any hardware documentation that says whether QEMU or the DTB is correct? The device tree is at best a secondary source...
There are 10 DMA channels, one is labelled "reserved". EDK2 lists it too: https://github.com/tianocore/edk2-platforms/blob/master/Platform/RaspberryPi/AcpiTables/AcpiTables.h#L57 I couldn't find any precise information regarding channels 11-14.
Signed-off-by: Andrey Makarov <andrey.makarov@auriga.com> --- hw/arm/bcm2835_peripherals.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index 48538c9360..3d808b0e31 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -322,13 +322,21 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp) memory_region_add_subregion(&s->peri_mr, DMA15_OFFSET, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->dma), 1)); - for (n = 0; n <= 12; n++) { + for (n = 0; n <= 10; n++) { sysbus_connect_irq(SYS_BUS_DEVICE(&s->dma), n, qdev_get_gpio_in_named(DEVICE(&s->ic), BCM2835_IC_GPU_IRQ, INTERRUPT_DMA0 + n)); } + /* According to DTS, dma channels 11-14 share one irq */ + for (n = 11; n <= 14; n++) { + sysbus_connect_irq(SYS_BUS_DEVICE(&s->dma), n, + qdev_get_gpio_in_named(DEVICE(&s->ic), + BCM2835_IC_GPU_IRQ, + INTERRUPT_DMA0 + 11));You can't connect multiple qemu_irq lines to one like this. If the hardware behaves this way then you need to create an OR gate, wire all the lines from the devices to the OR gate inputs, and wire the OR gate output to the destination. thanks -- PMM
[Prev in Thread] | Current Thread | [Next in Thread] |