Interrupt 'level high' with UIO driver #93
-
Hello, I am trying to trigger an interrupt level high using the uio driver, I have written the dts entry as follow:
For the field interrupts 128 = interrupt ID and the 4 = active high level-sensitive. The first interrupt is catched ok but not the second or following interrupt
and the counter is stuck at 1 on CPU0 I am guessing I am not clearing/acknowledging the UIO driver correctly. Can someone help?
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Hi, I think interrupts = <128>; is better than interrupts = <128 4>; in the device tree. The PolarFire SoC interrupts in device-tree just take the interrupt itself, no details about level - they are all level. I don't have docs to hand, but I suspect that you need to handle the interrupt on its own register map. I mean a combination of status and mask registers on the coreGPIO IP (working at an offset of a virt address based on 0x46000000). I suspect the first interrupt is not cleared and remains level high. |
Beta Was this translation helpful? Give feedback.
-
Hello, Thanks for your feedback. I have only managed to get the interrupt thing to work by sending a "pulse" type interrupt (a clock width - edge trigger) to the MSS_INT_F2M. But in some use case we could miss out some events and I was therefore trying to use the high level-sensitive interrupt but then I am not able to clear my interrupt in the UIO driver, even though I am clearing the source interrupt signal to 0.
This above code works "ok" with edge trigger interrupt (pulse) but NOT when I am using level-sensitive interrupt. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi, can you be more explicit on what you call the "interrupt controller". Is it the PLIC within the soc-polarfire? |
Beta Was this translation helpful? Give feedback.
-
Yes, I refer to the PLIC. The acknowledgement is done at low level by the irqchip driver. The UIO generic driver disable irqs before handing off control to user who is in charge to re-enable it. There is a CAN example here if u find it useful: |
Beta Was this translation helpful? Give feedback.
-
@eppidei Thanks for the link. Now looking in the DTS file, the CAN periph is declared like this:
So I conclude in the CAN example the interrupt is handle by a "mpfs-can-uio" driver when in my case I use the generic-uio (see the top of the thread). |
Beta Was this translation helpful? Give feedback.
-
If I look in the source code in the linux build. When I use generic-uio in my dts it is using the uio_pdrv_genirq driver/module.
In the CAN exemple my understanding microchip wrote their own specific driver
In the case of the CAN irq handler it is referencing to *base=dev_info->mss_can_io_vaddr... |
Beta Was this translation helpful? Give feedback.
-
yes, I think that would certainly be a reasonable way forward. You could start by copying the UIO CAN driver, including the Kconfig / Makefile in the same directory along with its device-tree stanza. Alternatively, you could try using the generic-uio driver and doing those writes in userspace. There are examples in /opt/microchip that show you how to access hardware registers from userspace. |
Beta Was this translation helpful? Give feedback.
yes, I think that would certainly be a reasonable way forward. You could start by copying the UIO CAN driver, including the Kconfig / Makefile in the same directory along with its device-tree stanza.
Alternatively, you could try using the generic-uio driver and doing those writes in userspace. There are examples in /opt/microchip that show you how to access hardware registers from userspace.