
Chapter 11: Interrupts
11–7
Interrupts for Endpoints Using the Avalon-MM Interface to the Application Layer
June 2012
Altera Corporation
Stratix V Hard IP for PCI Express
Enabling MSI or Legacy Interrupts
The PCI Express Avalon-MM bridge selects either MSI or legacy interrupts
automatically based on the standard interrupt controls in the PCI Express
Configuration Space registers. Software can write the
Interrupt
Disable
bit, which is
bit 10 of the
Command
register (at Configuration Space offset 0x4) to disable legacy
interrupts. Software can write the
MSI Enable
bit, which is bit 0 of the
MSI
Control
Status
register in the MSI capability register (bit 16 at configuration space offset
0x50), to enable MSI interrupts.
Software can only enable one type of interrupt at a time. However, to change the
selection of MSI or legacy interrupts during operation, software must ensure that no
interrupt request is dropped. Therefore, software must first enable the new selection
and then disable the old selection. To set up legacy interrupts, software must first
clear the
Interrupt
Disable
bit and then clear the
MSI enable
bit. To set up MSI
interrupts, software must first set the
MSI enable
bit and then set the
Interrupt
Disable
bit.
Generation of Avalon-MM Interrupts
Generation of Avalon-MM interrupts requires the instantiation of the CRA slave
module where the interrupt registers and control logic are implemented. The CRA
slave port has an Avalon-MM Interrupt output signal,
cra_Irq_irq
. A write access to
an Avalon-MM mailbox register sets one of the
P2A_MAILBOX_INT<n>
bits in the
Express to Avalon-MM Interrupt Status Register 0x3060” on page 7–16
and asserts
the
cra_Irq_o
or
cra_Irq_irq
output, if enabled. Software can enable the interrupt by
writing to the
“PCI Express to Avalon-MM Interrupt Enable Register 0x3070” on
through the CRA slave. After servicing the interrupt, software must clear
the appropriate serviced interrupt
status
bit in the PCI-Express-to-Avalon-MM
Interrupt Status
register and ensure that no other interrupt is pending.