We have a system working with a imx25 and a FPGA and I have to adapt it to run with the IMX6QP.
I tried to adapt the driver however every time I try to perform a read or write operation on the EIM bus, the system hang and I have to perform a hard reset.
I am a little lost and I don't know what to check or what I am doing wrong.
Here is the configuration I put in the device tree:
status = "okay";
ranges = <0 0 0x08000000 0x04000000
1 0 0x0C000000 0x04000000>;
compatible = "driver_fpga";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fpga>;
interrupt-parent = <&gpio2>;
interrupts = <18 IRQ_TYPE_EDGE_RISING>;
reg = <1 0 0x30>;
fsl,weim-cs-timing = <0x00040001 0x00000100 0x00000000
0x00000000 0x00000000 0x00000000>; /* CSxGCR1, CSxGCR2, CSxRCR1, CSxRCR2, CSxWCR1, CSxWCR2*/
The FPGA is connected through a 8 bit data bus on the cs 1. I am able to register the interrupts in my driver and it enters in the handler correctly when I change the state manually.
In the driver initialization function, I register the platform and char device and use the ioremap to get the address range of my fpga:
fpga_base = ioremap_nocache(0x0C000000, 0x04000000);
As I said when I try to perform read or write operation the system hang and I have to reset it:
retval = ioread8(fpga_base + FPGA_REG_MODE);
retval = iowrite8(mode, fpga_base + FPGA_REG_MODE);
Thanks a lot for your help