cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to handle more that 16 interrupts using the AXI Interrupt Controller

Xilinx Employee
Xilinx Employee
1 0 583

Introduction:

This Blog covers how to use the AXI Interrupt Controller (INTC) in cases where you need to route more that 16 interrupts to the PS from IP cores in the PL. We are using Xilinx peripherals including GPIOs, IIC, UART and timers in the Vivado design. 

The example design is created in the 2020.1 version of Vivado, targeting a ZCU106 evaluation board. Interrupts are tested on PetaLinux 2020.1, and the design Tcl and system-user.dtsi file are attached.

 

AXI GPIO:

The General Purpose Input/output (GPIO) core is an interface that provides easy access to the internal properties of the device. This core can also be used to control the behavior of the external devices.

Interrupts:

The Interrupts control gets the interrupt status from the GPIO channels and generates an interrupt to the host. It is enabled when the Enable Interrupt option is set in Vivado.

Gpio_Vivado.PNG

 

For input mode, gpio_input pins are connected to the PUSH BUTTONS of the ZCU106 as follows:

° gpio_input(0) = GPIO_SW15

° gpio_input(1) = GPIO_SW14

° gpio_input(2) = GPIO_SW16

° gpio_input(3) = GPIO_SW17

° gpio_input(3) = GPIO_SW18

 
 

push_buttons.PNG

 
 

AXI INTC:

The AXI Interrupt Controller (INTC) core concentrates multiple interrupt inputs from peripheral devices to a single interrupt output to the system processor. The registers are used for checking, enabling, and acknowledging interrupts.

AXI_INTC.PNG

The main purpose of this example is to connect more that 16 interrupts to the PS. The AXI INTC core allows us to fulfill this requirement. We can go up to 32 interrupts if using one AXI INTC block, and you can make use of cascading. (We might cover an example of this in another blog entry).

In the next couple of diagrams where we discuss the Concat IP, you can see how the interrupts are connected.

Block Design:

I have not added a diagram of the complete design all at once as it's too large, so the required connections are shown separately below.

Concat IP:

The Concat IP core provides a mechanism to combine bus signals of varying widths into a single bus.

Block_Concat.PNG

Add the Concat block from the IP catalog, and double-click the IP as shown below to open the Re-customize IP dialog box. 

Concat_settings.PNG

 Set the "Number of Posts" parameter to the number of input ports desired. In this example 18 are selected.

This is how it looks after customizing the IP; the 18th port is connected to the GPIO_PUSH_BUTTONS interrupt line as discussed previously.

 

concat_vivado.PNG

 dout is the output port whose bit width equals the combined bit widths of all of the input ports which is routed to the input intr port of the AXI INTC core.

Block_Concat_2.PNG

 

d_out.PNG

 

The output of the AXI INTC is connected to the pl_ps_irq_0 port of the Zynq MPSoC block:

pl_ps_irq.PNG

 

Validate the design and follow the remaining steps to generating the bitstream. Export the hardware for building the PetaLinux images.

PetaLinux:

Kernel Configuration:

The following options are enabled in the menuconfig. They are normally enabled by default but you should check just in case.

  • Device Drivers
    • GPIO Support
      • Memory Mapped GPIO Drivers
        • Xilinx GPIO support
        • Xilinx Zynq GPIO support
    • Input device support
      • Keyboards
        • GPIO Buttons
        • Polled GPIO buttons

Adding Push Buttons to the Device tree:

Push Buttons are available only for the Input GPIO application.

Each created sub-node controls a single bit of GPIO. Under the "gpio-keys" keys node in the dts file, create sub-nodes for Push Buttons as per the design with names shown below:

dtsi_file_1.png

Once this is done, boot Linux. You can see the labels of Push Buttons SW15 to SW18 in cat /proc/interrupts. 

ints.png

 

When you press the Push Buttons randomly, the trigger count increases as shown below:

ints_1.png