This is a custom soft IP to interrupt the HPS example. The custom ir_receive IP receives the data from the IR remote controller and interrupt the HPS. The linux driver reponses the interrupt and reads the data. The application in the user space gets the IR identify data when interrupt reached then print the data on the screen.
Open the hardware project and compile the project to generate the .sof file.
Git clone the SoCFPGA linux source and compile the kernel. Copy the zImage file to the fat partion in your boot SD card.
The PIO button information must be added to the device tree. In the SoCEDS command shell, typing the following command and get the dtb file
sopc2dts --input soc_system.sopcinfo
--output socfpga.dts
--type dts
--board soc_system_board_info.xml
--board hps_common_board_info.xml
--bridge-removal all
--clocks
Open the socfpga.dts add the ir_receive IP description in the dts file. find the terasic_irda and change the content as follow:
terasic_irda: irm@0x100010010 {
compatible = "terasic,irm";
reg = <0x00000001 0x00010010 0x00000004>;
interrupt-parent = <&hps_0_arm_gic_0>;
interrupts = <0 43 4>;
}; //end irm@0x100010010 (terasic_irda)
dtc -I dts -o dtb -o socfpga.dtb socfpga.dts
copy the socfpga.dtb file to the fat partion in your boot SD card.
Edit the Makefile to change the correct kenel source directory before compiling the teraic_ir driver. Copy the terasic_ir.ko to the /home/root on your boot sd card.
Use the Make command in the SoCEDS command shell to compile the application. Copy the ir_read_test file to the /home/root on your boot sd card.