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!
04-13-2018 05:55 PM
I'm used to older kernels where the IRQ argument passed to request_irq( ) is just the cpu's IRQ number + some constant offset. I've heard that the newer kernels now map the chip's IRQ numbers dynamically and I have to obtain it from the device tree using a platform driver.
I'm using petalinux 2017.4 on a zcu102. Does anyone know of a simple example of a platform driver for the zcu102, preferably one that obtains the IRQ number from the device tree to pass to request_irq()? Thanks!
04-16-2018 12:45 AM
Hi @kallensf,
You can refer Xilinx GPIO driver and you can find device tree summary i2c xilinx wiki
it uses Platform driver ""drivers/i2c/busses/i2c-cadence.c"" and when compatible name(xps-iic-2.00.a is matched then it will parse the device tree node mentioned in below,
i2c@81600000 { compatible = "xlnx,xps-iic-2.00.a"; interrupt-parent = <&xps_intc_0>; interrupts = <0x0 0x11 0x4>; #address-cells = <1>; #size-cells = <0>;
where interrupts = <0x0 0x11 0x4> where
first number represents category of interrupt (SPI or not)
second number is interrupt ID
third number is type of interrupt(edge or level trigger).
you can get description about interrupts member in device tree node in below wiki tutorial
http://xillybus.com/tutorials/device-tree-zynq-4
04-16-2018 12:45 AM
Hi @kallensf,
You can refer Xilinx GPIO driver and you can find device tree summary i2c xilinx wiki
it uses Platform driver ""drivers/i2c/busses/i2c-cadence.c"" and when compatible name(xps-iic-2.00.a is matched then it will parse the device tree node mentioned in below,
i2c@81600000 { compatible = "xlnx,xps-iic-2.00.a"; interrupt-parent = <&xps_intc_0>; interrupts = <0x0 0x11 0x4>; #address-cells = <1>; #size-cells = <0>;
where interrupts = <0x0 0x11 0x4> where
first number represents category of interrupt (SPI or not)
second number is interrupt ID
third number is type of interrupt(edge or level trigger).
you can get description about interrupts member in device tree node in below wiki tutorial
http://xillybus.com/tutorials/device-tree-zynq-4