News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

ZynqBerry TE0726 - PetaLinux Driver Help (system-user.dtsi)

Started by hjm142, October 02, 2017, 04:27:54 PM

Previous topic - Next topic

hjm142

Hello,

I am using Vivado/SDK/PetaLinux v2017.1.  I have 3 external interrupt lines connected up to IRQ_F2P[2:0] and understand this maps to port [63:61].  Now, I am trying to read through my Linux application whenever these signals go high.  A polling method suffices.

From what I have read on several other forums, the easiest was to do this is with UIO driver.  I think I understand how to do that and will use the same method for access so other memory space on the AXI bus.  However, I am missing how to get the external interrupt lines to show up as UIO... and in general, I think this is the biggest point that I am missing with the whole Zynq / petalinux concept.

My understanding is that I want to change the compatible field in the DTSI file to "generic-uio".  My interrupt controller is declared in zynq-7000.dtsi (below).  When I change this field, it changes back after petalinux-build is issued.  This makes sense to me because it is an auto-generated file.

      intc: interrupt-controller@f8f01000 {
         compatible = "arm,cortex-a9-gic";
         #interrupt-cells = <3>;
         interrupt-controller;
         reg = <0xF8F01000 0x1000>,
               <0xF8F00100 0x100>;
      };

So, I thought I would change it in the system-user.dtsi.  I declared the following below:

   intc: interrupt-controller@f8f01000 {
      compatible = "generic-uio";
      #interrupt-cells = <3>;
      interrupt-controller;
      reg = <0xF8F01000 0x1000>,
            <0xF8F00100 0x100>;
   };

Naturally, this gave an error because it was declared elsewhere........ so how do I make this do what I want?  If the answer simply is that I cannot, what do I do to access the values?  Does it have to be done through "/dev/mem"?

I appreciate any help.  The device-tree seems to really be hanging me up.  I have been struggling to understand how people know what to add to the system-user.dtsi file.  The sample projects (I'm using a modified zynqberrydemo2 example) have most of what I thought was necessary filled out... until I needed to change some things.


JH

Hi,

try:

   &intc {
      compatible = "generic-uio";
      #interrupt-cells = <3>;
      interrupt-controller;
      reg = <0xF8F01000 0x1000>,
            <0xF8F00100 0x100>;
   };


See also :

br
John