UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer mnanoop2014
Observer
174 Views
Registered: ‎10-29-2018

Help needed with creating custom modules and interrupt capability

I'm using Petlainux 2017.4, Vivado 2017.4 for Zynq Ultrascale+ MPSoC ZCU102 board, on Ubuntu 16.04.

tl;dr; Can anyone please point me to a highly detailed Petalinux flow documentation?

I am building a custom module for a hardware accelerator that used to work well with Linux on Microblaze. Now we have moved to the Zynq board and want to use Linux on it. I have exported the .hdf file successfully. Used the appropriate BSP (not sure if it's needed). And the pl.dtsi hadn't discovered the AXI peripheral in our accelerator. So manually added it as shown below. Not sure about how to set up the interrupt in it. Not even sure if that is where it has to be added or somewhere in system-user.dtsi.

The problem is I am (on some playing around) able to probe the driver and even register in the /dev and add a class in /sys/class. But I am unable to register the interrupt ("no irq found") and neither am I able to read or write to registers. I am not sure if I have to turn off UIO driver support in "petlainux-config -c kernel"

Tried searching far and wide for any similar example projects. Not able to find any. 

Kindly point me to some documentation or any tips.
Thanks in advance, 
Anoop

system-user.dtsi file:

/include/ "system-conf.dtsi"
/ {
	amba_pl: amba_pl@0 {
		#address-cells = <2>;
		#size-cells = <2>;
		compatible = "simple-bus";
		ranges ;
		axi_gpio_0: gpio@a0000000 {
			#gpio-cells = <2>;
			#interrupt-cells = <2>;
			compatible = "xlnx,xps-gpio-1.00.a";
			gpio-controller ;
			interrupt-controller ;
			interrupt-parent = <&gic>;
			interrupts = <0 89 4>;
			reg = <0x0 0xa0000000 0x0 0x1000>;
			xlnx,all-inputs = <0x0>;
			xlnx,all-inputs-2 = <0x1>;
			xlnx,all-outputs = <0x1>;
			xlnx,all-outputs-2 = <0x0>;
			xlnx,dout-default = <0x00000000>;
			xlnx,dout-default-2 = <0x00000000>;
			xlnx,gpio-width = <0x8>;
			xlnx,gpio2-width = <0x5>;
			xlnx,interrupt-present = <0x1>;
			xlnx,is-dual = <0x1>;
			xlnx,tri-default = <0xFFFFFFFF>;
			xlnx,tri-default-2 = <0xFFFFFFFF>;
		};
		redefine_0:redefine@A0010000 {
			compatible = "MM,redefine";
			reg = <0x0 0xA0010000 0x0 0x0C>;
			interrupt-parent = <&gic>;
			interrupts = <2 2>; 
		};
	};
};

 pl.dtsi (keeps deleting the redefine part after every kernel config change)

/ {
	amba_pl: amba_pl@0 {
		#address-cells = <2>;
		#size-cells = <2>;
		compatible = "simple-bus";
		ranges ;
		axi_gpio_0: gpio@a0000000 {
			#gpio-cells = <2>;
			#interrupt-cells = <2>;
			compatible = "xlnx,xps-gpio-1.00.a";
			gpio-controller ;
			interrupt-controller ;
			interrupt-parent = <&gic>;
			interrupts = <0 89 4>;
			reg = <0x0 0xa0000000 0x0 0x1000>;
			xlnx,all-inputs = <0x0>;
			xlnx,all-inputs-2 = <0x1>;
			xlnx,all-outputs = <0x1>;
			xlnx,all-outputs-2 = <0x0>;
			xlnx,dout-default = <0x00000000>;
			xlnx,dout-default-2 = <0x00000000>;
			xlnx,gpio-width = <0x8>;
			xlnx,gpio2-width = <0x5>;
			xlnx,interrupt-present = <0x1>;
			xlnx,is-dual = <0x1>;
			xlnx,tri-default = <0xFFFFFFFF>;
			xlnx,tri-default-2 = <0xFFFFFFFF>;
		};
		psu_ctrl_ipi: PERIPHERAL@ff380000 {
			compatible = "xlnx,PERIPHERAL-1.0";
			reg = <0x0 0xff380000 0x0 0x80000>;
		};
		psu_message_buffers: PERIPHERAL@ff990000 {
			compatible = "xlnx,PERIPHERAL-1.0";
			reg = <0x0 0xff990000 0x0 0x10000>;
		};
		redefine_0:redefine@A0010000 {
			compatible = "MM,redefine";
			reg = <0x0 0xA0010000 0x0 0x0C>;
			interrupt-parent = <&gic>;
			interrupts = <2 2>; 
		};

	};
};
0 Kudos