深入分析SCU GIC驱动 1 ZEDBOARD,ZYNQ7000

Scu gic in depth – 1

Scu unit is a powerful unit to deal with the coherence of L2 and memory ,and contains a general interrupt controller pl390 :

It deal with the following several kinds of interrupt:

  • Private Peripheral interrupt of core 0 and 1: 5x2=10
  • Software generated interrupt: 16x2=32
  • I/O Peripherals interrupt: 44
  • PL logic interrupt: 16

In total , it deal with up to 92 interupts input . however

/*

* The maximum number of interrupts supported by the hardware.

*/

#define XSCUGIC_MAX_NUM_INTR_INPUTS 95

So what is the left 3 interupts?

 

NOTICE:

SCU GIC will depatch 16 kinds of interrupt to programmable logic unit to trigger hardware process and this is useful to communicate between cpu and FPGA .

 

Step 1: init the scu_gic module:

    Int XScuGic_CfgInitialize(XScuGic* InstancePtr,XGcuGic_Config* ConfigPtr,u32 EffectiveAddr)

The function will init some inner data struct and disable all interrupt source.

EffectiveAddr is relative to Physial Address, equals virtual address.

 

Step 2: connect interrupt routes:

    Int Connect( IntancePtr , Int_ID , InterruptHandler , void* CallBackRef )

Connect the interrupt route according to the specified interrupt ID number. The parameter CallBackRef contains some arguments.

Step 3 : Enable the interrupt :

    Void Enable ( InstancePtr , Int_ID )

Step 4: get the interrupt information:

    Void GetPriorityTriggerType(InstancePtr, Int_ID, Priority , Trigger )

原文地址:https://www.cnblogs.com/dragen/p/3131957.html