/** * * CfgInitialize a specific interrupt controller instance/driver. The * initialization entails: * * - Initialize fields of the XScuGic structure * - Initial vector table with stub function calls * - All interrupt sources are disabled * * @param InstancePtr is a pointer to the XScuGic instance to be worked on. * @param ConfigPtr is a pointer to a config table for the particular device * this driver is associated with. * @param EffectiveAddr is the device base address in the virtual memory address * space. The caller is responsible for keeping the address mapping * from EffectiveAddr to the device physical base address unchanged * once this function is invoked. Unexpected errors may occur if the * address mapping changes after this function is called. If address * translation is not used, use Config->BaseAddress for this parameters, * passing the physical address instead. * * @return * * - XST_SUCCESS if initialization was successful * * @note * * None. * ******************************************************************************/ int XScuGic_DeviceInitialize(u32 DeviceId) { XScuGic_Config *Config; Config = &XScuGic_ConfigTable[(u32 )DeviceId]; DistInit(Config, 0x01); CPUInit(Config); return XST_SUCCESS; }
/** * * CfgInitialize a specific interrupt controller instance/driver. The * initialization entails: * * - Initialize fields of the XScuGic structure * - Initial vector table with stub function calls * - All interrupt sources are disabled * * @param InstancePtr is a pointer to the XScuGic instance to be worked on. * @param ConfigPtr is a pointer to a config table for the particular device * this driver is associated with. * @param EffectiveAddr is the device base address in the virtual memory address * space. The caller is responsible for keeping the address mapping * from EffectiveAddr to the device physical base address unchanged * once this function is invoked. Unexpected errors may occur if the * address mapping changes after this function is called. If address * translation is not used, use Config->BaseAddress for this parameters, * passing the physical address instead. * * @return * * - XST_SUCCESS if initialization was successful * * @note * * None. * ******************************************************************************/ int XScuGic_DeviceInitialize(u32 DeviceId) { XScuGic_Config *Config; u8 Cpu_Id = XPAR_CPU_ID + 1; Config = &XScuGic_ConfigTable[(u32 )DeviceId]; DistInit(Config, Cpu_Id); CPUInit(Config); return XST_SUCCESS; }
/** * * CfgInitialize a specific interrupt controller instance/driver. The * initialization entails: * * - Initialize fields of the XScuGic structure * - Initial vector table with stub function calls * - All interrupt sources are disabled * * @param InstancePtr is a pointer to the XScuGic instance. * @param ConfigPtr is a pointer to a config table for the particular * device this driver is associated with. * @param EffectiveAddr is the device base address in the virtual memory * address space. The caller is responsible for keeping the address * mapping from EffectiveAddr to the device physical base address * unchanged once this function is invoked. Unexpected errors may * occur if the address mapping changes after this function is * called. If address translation is not used, use * Config->BaseAddress for this parameters, passing the physical * address instead. * * @return * - XST_SUCCESS if initialization was successful * * @note None. * ******************************************************************************/ int XScuGic_CfgInitialize(XScuGic *InstancePtr, XScuGic_Config *ConfigPtr, u32 EffectiveAddr) { u32 Int_Id; u8 Cpu_Id = XPAR_CPU_ID + 1; (void) EffectiveAddr; Xil_AssertNonvoid(InstancePtr != NULL); Xil_AssertNonvoid(ConfigPtr != NULL); if(InstancePtr->IsReady != XIL_COMPONENT_IS_READY) { InstancePtr->IsReady = 0; InstancePtr->Config = ConfigPtr; for (Int_Id = 0; Int_Id<XSCUGIC_MAX_NUM_INTR_INPUTS;Int_Id++) { /* * Initalize the handler to point to a stub to handle an * interrupt which has not been connected to a handler. Only * initialize it if the handler is 0 which means it was not * initialized statically by the tools/user. Set the callback * reference to this instance so that unhandled interrupts * can be tracked. */ if ((InstancePtr->Config->HandlerTable[Int_Id].Handler == 0)) { InstancePtr->Config->HandlerTable[Int_Id].Handler = StubHandler; } InstancePtr->Config->HandlerTable[Int_Id].CallBackRef = InstancePtr; } DistInit(InstancePtr, Cpu_Id); CPUInit(InstancePtr); InstancePtr->IsReady = XIL_COMPONENT_IS_READY; } return XST_SUCCESS; }