Hi,
We have a custom board with an i.MX8M-Mini QuadLite and an FPGA connected to SPI port 1. Our board is very similar to X-8MMINILPD4-EVK so we are using "fsl-imx8mm-evk.dts" as a start point for our Linux device tree. Our FPGA uses the SPIDEV driver, and drives an interrupt back to GPIO1_IO05 (pin AF12). Using Kernel imx_4.14.98_2.2.0.
We want to capture the FPGA interrupt in USER SPACE (not kernel driver), and therefore trying to instantiate a "generic-uio" node associated to GPIO1_IO05. I've seen many forum discussions about this on the web, with people trying to achieve the same thing but all these threads were abandoned with no confirmed solution.
I’ve tried to implement all the examples I’ve seen (and more), but in the end I see no UIO module being instantiated in /dev/uio. Can anyone advise on the correct way to do this?
Here’s what I have tried;
In fsl-imx8mm-evk.dts, I have modified bootargs;
chosen {
bootargs = "console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 uio_pdrv_genirq.of_id=fpga-intr,generic-uio,ui_pdrv";
stdout-path = &uart2;
};
In fsl-imx8mm-evk.dts, I have added a "user_io" node to my FPGA:
&ecspi1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
fpga@0 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&pinctrl_fpga>;
compatible = "spidev";
spi-max-frequency = <50000000>;
reg = <0>;
user_io@0 {
compatible = "fpga-intr,generic-uio,ui_pdrv";
status = "okay";
interrupt-parent = <&gpio1>;
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
pinctrl-names = "defaults";
pinctrl-0 = <&pinctrl_user_io>;
reg = <0>;
};
};
};
In fsl-imx8mm-evk.dts, I have added a pin configuration for GPIO1-5:
&iomuxc {
pinctrl-names = "default";
imx8mm-evk {
(More definitions here…)
pinctrl_user_io: useriogrp {
fsl,pins = <
MX8MM_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x19
>;
};
};
};
In “defconfig” I have enabled UIO and UIO_PDRV_GENIRQ;
CONFIG_UIO=y
CONFIG_UIO_PDRV_GENIRQ=y
Then recompiled the Kernel…
After boot I would expect to find a UIO device in /dev, but it is not there.
If I try to load the module with modprobe, it fails and reports “Module uio_pdrv_genirq not found in directory”;
$ modprobe uio_pdrv_genirq of_id="fpga-intr,generic-uio,ui_pdrv"
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.98-06466-g5910884f0fa2-dirty/modules.dep.bin'
modprobe: FATAL: Module uio_pdrv_genirq not found in directory /lib/modules/4.14.98-06466-g5910884f0fa2-dirty
I have verified that the UIO sources are present under /linux-imx/drivers/uio and they are being included in the Kernel compilation log.
Did anyone succeed in achieving this?
Any help welcome!
Thanks.
Yannick.