Interrupt Request (IRQ) Routing and Programming for CPM5 - 3.4 English

Versal Adaptive SoC CPM Mode for PCI Express Product Guide (PG346)

Document ID
PG346
Release Date
2023-11-20
Version
3.4 English

This appendix includes guidance on Interrupt Request (IRQ) pins routing and programming for CPM5. AMD Versal Adaptive SoC CPM Mode for PCIe provides three independent IRQ pins routed to the Programmable Logic (PL) region as well as three independent IRQ pins routed to the hardened Processing System (PS) region. These IRQ pins are shared between the two PCIe controllers and all CPM5 use modes and can be programmed by user to route one or many Interrupt sources.

The three IRQ pins routed to the PL region are named cpm_misc_irq, cpm_cor_irq, and cpm_uncor_irq and these signals are visible in the Vivado block diagram canvas on the AMD Versal CIPS IP boundary. Although, the IRQ pins are named after miscellaneous, correctable, and uncorrectable respectively, they function identically from each other and have the same list of interrupt source to select from. Therefore, you can assume these IRQ pins as three separate general purpose IRQ pins.

The three IRQ pins routed to the PS regions are named similarly. However, they are not visible in the Vivado block diagram canvas and they are using hardened silicon routing. These paths are always enabled and no extra customization is required during CIPS IP customization to use it. These IRQ pins also function identically and have the same list of Interrupt source to select from as the PL IRQ pins counterparts and can be used with the PL IRQ pins.

There are many Interrupt source to select from and the complete list is available in the Versal Adaptive SoC Register Reference (AM012). This appendix provides one use case example to showcase how the IRQ pins mux registers are programmed and includes firmware guidance to service the Interrupt Request.

Example: Generate Interrupt Request for PCIe Reset Event

In this example, generate interrupt whenever PCIe reset (PERST) is received for PCIe0 and PCIe1 controller. You route the interrupt generated from PCIe0 controller to the PS region while interrupt generated from PCIe1 controller to the PL region. You use the cpm_misc_irq pin as an example, but any other pins can also be used. A high level block diagram of the interrupt routing is shown in the following diagram:

Figure 1. Interrupt Request (IRQ) Routing Diagram

Register programming to enable PCIe reset (PERST) event interrupt
The following register is programmed at runtime to enable the interrupt:
  • For PCIe0 controller
    • CPM5_SLCR.PS_MISC_IR_ENABLE set to 0x2 to select "pcie0_err"
    • Read to confirm that CPM5_SLCR.PS_MISC_IR_MASK is cleared for bit[1] "pcie0_err"
    • CPM5_SLCR.PCIE0_IR_ENABLE set to 0x40 to select "perst_rcvd"
    • Read to confirm that CPM5_SLCR.PCIE0_IR_MASK is cleared for bit[6] "perst_rcvd"
  • For PCIe1 controller
    • CPM5_SLCR.PL_MISC_IR_ENABLE set to 0x4 to select "pcie1_err"
    • Read to confirm that CPM5_SLCR.PL_MISC_IR_MASK is cleared for bit[2] "pcie1_err"
    • CPM5_SLCR.PCIE1_IR_ENABLE set to 0x40 to select "perst_rcvd"
    • Read to confirm that CPM5_SLCR.PCIE1_IR_MASK is cleared for bit[6] "perst_rcvd"
Interrupt service routine
The following steps outline the recommended procedure to service the interrupt request:
  • For PCIe0 controller
    • Upon receiving interrupt, read CPM5_SLCR.PS_MISC_IR_STATUS to confirm bit[1] "pcie0_err" is asserted
    • CPM5_SLCR.PS_MISC_IR_DISABLE set to 0x2 to temporarily mask "pcie0_err" so further interrupt is not received while existing interrupt is being serviced
    • Read CPM5_SLCR.PCIE0_IR_STATUS to confirm bit[6] "perst_rcvd" is asserted
    • CPM5_SLCR.PCIE0_IR_DISABLE set to 0x40 to temporarily mask "perst_rcvd"
    • Execute user-defined task for servicing PCIe reset event
    • CPM5_SLCR.PCIE0_IR_STATUS set to 0x40 to clear "perst_rcvd"
    • CPM5_SLCR.PS_MISC_IR_STATUS set to 0x2 to clear "pcie0_err"
    • Re-enable / unmask PERST event interrupt source by programming the CPM5_SLCR.PS_MISC_IR_ENABLE and CPM5_SLCR.PCIE0_IR_ENABLE registers
  • For PCIe1 controller
    • Upon receiving interrupt, read CPM5_SLCR.PL_MISC_IR_STATUS to confirm bit[2] "pcie1_err" is asserted
    • CPM5_SLCR.PL_MISC_IR_DISABLE set to 0x4 to temporarily mask "pcie1_err" so further interrupt is not received while existing interrupt is being serviced
    • Read CPM5_SLCR.PCIE1_IR_STATUS to confirm bit[6] "perst_rcvd" is asserted
    • CPM5_SLCR.PCIE1_IR_DISABLE set to 0x40 to temporarily mask "perst_rcvd"
    • Execute user-defined task for servicing PCIe reset event
    • CPM5_SLCR.PCIE1_IR_STATUS set to 0x40 to clear "perst_rcvd"
    • CPM5_SLCR.PL_MISC_IR_STATUS set to 0x4 to clear "pcie1_err"
    • Re-enable / unmask PERST event interrupt source by programming the CPM5_SLCR.PL_MISC_IR_ENABLE and CPM5_SLCR.PCIE1_IR_ENABLE registers