Closed alistair23 closed 9 years ago
Some sore of Python Qtest thing?
Then you can make little guis in python specific to the lab etc.
Regards, Peter
From: Alistair Francis [notifications@github.com] Sent: Friday, August 08, 2014 11:58 AM To: alistair23/qemu Subject: [qemu] Externally Trigger Interrupts (#3)
Think of a method to externally trigger GPIO interrupts Ideas so far:
— Reply to this email directly or view it on GitHubhttps://github.com/alistair23/qemu/issues/3.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Yeah, I've just started looking into it and qtest.c looks like it has everything, should be simple to use
So does this just mean that you wiggle GPIOs from qtest, then the GPIO controller does the interrupt? I don't think you should directly intercept IRQs on the user level.
At the moment when the GPIO controller is read, it triggers an interrupt. It's a hack I have just for testing.
What ideally would be good is an external method to trigger the GPIO interrupt. The problem is that Qtest is an internal component and QMP and HMP don't have ways to do this (that I can see)
I'm struggling to understand the real hw setup though?
Is it a GPIO control that lets you trigger interrupts on state changes? Or is it a raw external input pin straight to the interrupt controller?
Regards, Peter
From: Alistair Francis [notifications@github.com] Sent: Thursday, August 14, 2014 1:04 PM To: alistair23/qemu Cc: Peter Crosthwaite Subject: Re: [qemu] Externally Trigger Interrupts (#3)
At the moment when the GPIO controller is read, it triggers an interrupt. It's a hack I have just for testing.
What ideally would be good is an external method to trigger the GPIO interrupt. The problem is that Qtest is an internal component and QMP and HMP don't have ways to do this (that I can see)
— Reply to this email directly or view it on GitHubhttps://github.com/alistair23/qemu/issues/3#issuecomment-52144140.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
It's an external pin, that can be configured to trigger an interrupt on an event
What does the “configuration” though? An interrupt controller or GPIO controller?
From: Alistair Francis [mailto:notifications@github.com] Sent: Thursday, August 14, 2014 11:21 PM To: alistair23/qemu Cc: Peter Crosthwaite Subject: Re: [qemu] Externally Trigger Interrupts (#3)
It's an external pin, that can be configured to trigger an interrupt on an event
— Reply to this email directly or view it on GitHubhttps://github.com/alistair23/qemu/issues/3#issuecomment-52181740.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
I think it's the GPIO controller
So I looked into it a bit more, it's actually an external device that handles the external interrupts. It's the EXTI device, so this will need to be added to handle interrupts. This should actually be easier as I was really confused how the GPIO controller was going to be configured. Still have the problem of externally triggering them though
Is it a button on the board?
From: Alistair Francis [notifications@github.com] Sent: Thursday, August 21, 2014 9:52 AM To: alistair23/qemu Cc: Peter Crosthwaite Subject: Re: [qemu] Externally Trigger Interrupts (#3)
So I looked into it a bit more, it's actually an external device that handles the external interrupts. It's the EXTI device, so this will need to be added to handle interrupts. This should actually be easier as I was really confused how the GPIO controller was going to be configured. Still have the problem of externally triggering them though
— Reply to this email directly or view it on GitHubhttps://github.com/alistair23/qemu/issues/3#issuecomment-52869510.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
There is one button on board, but the rest of the GPIOs will be buttons/lasers/etc connected via wires to the GPIO pins.
Most of the EXTI interrupts are from GPIO pins changing (there are also some reserved)
Some pretty old code... which does "external" control of GPIO.. https://lists.gnu.org/archive/html/qemu-devel/2009-09/msg00023.html
Not sure this is a good way to do it though.
The GPIO device now has GPIOs in and also sends signals out to the EXTI device to trigger interrupts. Just need an external way to trigger the GPIO in lines to the device
Based on Biffer's work I now have I/O access to the GPIO device via TCP. I can read and write strings into and out of QEMU. The next step is to expand the Python script to make it more automated and support the new QEMU strings
Using Biffer's code (but changing the port being used) Python has read/write access to QEMU. Unfortunately I don't know Python that well, so I haven't had a chance to edit the scripts to change values
Can now change the values of GPIO pins. The Python script isn't very robust at the moment, but the QEMU side is there. Interrupts don't work yet though
So this now works :) It still needs a bit of work and tidying up, but I'm going to close this issue and re-open one next week based on what the next steps are decided to be. This patch has some details: https://github.com/alistair23/qemu/commit/1d7783675d39001ff7fbae9cc1447253413b0da5 but I will write up a full explanation in the wiki when I get a chance
Think of a method to externally trigger GPIO interrupts Ideas so far: