[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Raspberry PI GPIO interrupt support
From: |
Davide Berardi |
Subject: |
Re: [PATCH] Raspberry PI GPIO interrupt support |
Date: |
Wed, 10 Feb 2021 15:32:19 +0100 |
Dear Philippe, thank you for your kind response.
I will send a new version for the patch with the modifications you've
highlighted, but first I've some question on the best way to implement
them.
On Tue, Feb 09, 2021 at 12:30:32PM +0100, Philippe Mathieu-Daudé wrote:
Hi Davide,
On 2/9/21 12:02 PM, Davide Berardi wrote:
The bcm2835 GPIOs now generate interrupts.
This modification enables QTEST clients to trigger interrupt-based
interfaces.
Thanks for your patch!
Can you provide QTEST client example? Even better would be a qtest!
The minimal client I've developed can be found at
https://github.com/berdav/qemu-rpi-gpio
As I have introduced, I'm building a qtest but I've found a problem: In
my test, I want to check if the IRQs of the named GPIOs
/machine/soc/peripherals/ic/gpu-irq are correctly handled by the
controller. I was thinking to use irq_intercept_in to get the status of
the IRQ lines using something similar to the following:
qtest_irq_intercept_in(s, "/machine/soc/peripherals/ic");
And then check it using
qtest_get_irq(s, 49 + irqline);
But it isn't triggering.
Looking in the source of qtest I've found this check in the
qtest_irq_intercept_in function:
QLIST_FOREACH(ngl, &dev->gpios, node) {
/* We don't support intercept of named GPIOs yet */
if (ngl->name) {
continue;
}
I've removed the if and the qtests seems to work just fine.
Is there particular caveats or details to implement this part of the
framework?
I can send separated patches if you have some details on the desiderata
of the support, or maybe start a new thread with this question.
Otherwise, I can remove the part of my qtest to not check the
IRQs, but I don't know if it would be the best choice.
I wonder how you generated your patch, it doesn't apply:
Applying: Raspberry PI GPIO interrupt support
error: patch failed: hw/arm/bcm2835_peripherals.c:114
error: hw/arm/bcm2835_peripherals.c: patch does not apply
error: patch failed: hw/gpio/bcm2835_gpio.c:7
error: hw/gpio/bcm2835_gpio.c: patch does not apply
error: patch failed: hw/intc/bcm2835_ic.c:57
error: hw/intc/bcm2835_ic.c: patch does not apply
error: patch failed: include/hw/gpio/bcm2835_gpio.h:7
error: include/hw/gpio/bcm2835_gpio.h: patch does not apply
Patch failed at 0001 Raspberry PI GPIO interrupt support
You can find the guidelines here:
https://wiki.qemu.org/Contribute/SubmitAPatch#Submitting_your_Patches
I have just created the patch using git format patch -s , it does not
give me any error applying it over the master branch on
https://github.com/qemu/QEMU . I will take more care and apply it on the
master branch of https://git.qemu.org/git/qemu.git/ , thank you.
[... cut ...]
Regards,
Phil.
I'm adapting the patch using the Coding style script now.
I've also introduced a new costant for the number of GPIOs.
Thank you for your time,
D.