ipipsu
Xilinx SDK Drivers API Documentation
Ipipsu_v2_3

Data Structures

struct  XIpiPsu_Target
 Data structure used to refer IPI Targets. More...
 
struct  XIpiPsu_Config
 This typedef contains configuration information for the device. More...
 
struct  XIpiPsu
 The XIpiPsu driver instance data. More...
 

Macros

#define XIpiPsu_ReadReg(BaseAddress, RegOffset)   Xil_In32((BaseAddress) + (RegOffset))
 Read the register specified by the base address and offset. More...
 
#define XIpiPsu_WriteReg(BaseAddress, RegOffset, Data)   Xil_Out32(((BaseAddress) + (RegOffset)), (Data))
 Write a value into a register specified by base address and offset. More...
 
#define XIpiPsu_InterruptEnable(InstancePtr, Mask)
 Enable interrupts specified in Mask. More...
 
#define XIpiPsu_InterruptDisable(InstancePtr, Mask)
 Disable interrupts specified in Mask. More...
 
#define XIpiPsu_GetInterruptStatus(InstancePtr)
 Get the STATUS REGISTER of the current IPI instance. More...
 
#define XIpiPsu_ClearInterruptStatus(InstancePtr, Mask)
 Clear the STATUS REGISTER of the current IPI instance. More...
 
#define XIpiPsu_GetObsStatus(InstancePtr)
 Get the OBSERVATION REGISTER of the current IPI instance. More...
 

Functions

XStatus XIpiPsu_CfgInitialize (XIpiPsu *InstancePtr, XIpiPsu_Config *CfgPtr, UINTPTR EffectiveAddress)
 Initialize the Instance pointer based on a given Config Pointer. More...
 
void XIpiPsu_Reset (XIpiPsu *InstancePtr)
 Reset the given IPI register set. More...
 
XStatus XIpiPsu_TriggerIpi (XIpiPsu *InstancePtr, u32 DestCpuMask)
 Trigger an IPI to a Destination CPU. More...
 
XStatus XIpiPsu_PollForAck (XIpiPsu *InstancePtr, u32 DestCpuMask, u32 TimeOutCount)
 Poll for an acknowledgement using Observation Register. More...
 
XStatus XIpiPsu_ReadMessage (XIpiPsu *InstancePtr, u32 SrcCpuMask, u32 *MsgPtr, u32 MsgLength, u8 BufferType)
 Read an Incoming Message from a Source. More...
 
XStatus XIpiPsu_WriteMessage (XIpiPsu *InstancePtr, u32 DestCpuMask, u32 *MsgPtr, u32 MsgLength, u8 BufferType)
 Send a Message to Destination. More...
 
void XIpiPsu_SetConfigTable (u32 DeviceId, XIpiPsu_Config *ConfigTblPtr)
 Set up the device configuration based on the unique device ID. More...
 
XIpiPsu_ConfigXIpiPsu_LookupConfig (u32 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 

Macro Definition Documentation

◆ XIpiPsu_ClearInterruptStatus

#define XIpiPsu_ClearInterruptStatus (   InstancePtr,
  Mask 
)

#include <xipipsu.h>

Value:
XIpiPsu_WriteReg((InstancePtr)->Config.BaseAddress, \
XIPIPSU_ISR_OFFSET, \
((Mask) & XIPIPSU_ALL_MASK));
#define XIpiPsu_WriteReg(BaseAddress, RegOffset, Data)
Write a value into a register specified by base address and offset.
Definition: xipipsu.h:178

Clear the STATUS REGISTER of the current IPI instance.

The corresponding interrupt status for each bit set to 1 in Mask, will be cleared

Parameters
InstancePtris a pointer to the instance to be worked on.
Maskcorresponding to the source CPU*
Note
This function should be used after handling the IPI. Clearing the status will automatically clear the corresponding bit in OBSERVATION register of Source CPU C-style signature void XIpiPsu_ClearInterruptStatus(XIpiPsu *InstancePtr, u32 Mask)

◆ XIpiPsu_GetInterruptStatus

#define XIpiPsu_GetInterruptStatus (   InstancePtr)

#include <xipipsu.h>

Value:
XIpiPsu_ReadReg((InstancePtr)->Config.BaseAddress, \
XIPIPSU_ISR_OFFSET)
#define XIpiPsu_ReadReg(BaseAddress, RegOffset)
Read the register specified by the base address and offset.
Definition: xipipsu.h:160

Get the STATUS REGISTER of the current IPI instance.

Parameters
InstancePtris a pointer to the instance to be worked on.
Returns
Returns the Interrupt Status register(ISR) contents
Note
User needs to parse this 32-bit value to check the source CPU C-style signature u32 XIpiPsu_GetInterruptStatus(XIpiPsu *InstancePtr)

◆ XIpiPsu_GetObsStatus

#define XIpiPsu_GetObsStatus (   InstancePtr)

#include <xipipsu.h>

Value:
XIpiPsu_ReadReg((InstancePtr)->Config.BaseAddress, \
XIPIPSU_OBS_OFFSET)
#define XIpiPsu_ReadReg(BaseAddress, RegOffset)
Read the register specified by the base address and offset.
Definition: xipipsu.h:160

Get the OBSERVATION REGISTER of the current IPI instance.

Parameters
InstancePtris a pointer to the instance to be worked on.
Returns
Returns the Observation register(OBS) contents
Note
User needs to parse this 32-bit value to check the status of individual CPUs C-style signature u32 XIpiPsu_GetObsStatus(XIpiPsu *InstancePtr)

◆ XIpiPsu_InterruptDisable

#define XIpiPsu_InterruptDisable (   InstancePtr,
  Mask 
)

#include <xipipsu.h>

Value:
XIpiPsu_WriteReg((InstancePtr)->Config.BaseAddress, \
XIPIPSU_IDR_OFFSET, \
((Mask) & XIPIPSU_ALL_MASK));
#define XIpiPsu_WriteReg(BaseAddress, RegOffset, Data)
Write a value into a register specified by base address and offset.
Definition: xipipsu.h:178

Disable interrupts specified in Mask.

The corresponding interrupt for each bit set to 1 in Mask, will be disabled.

Parameters
InstancePtris a pointer to the instance to be worked on.
Maskcontains a bit mask of interrupts to disable. The mask can be formed using a set of bitwise or'd values of individual CPU masks
Note
C-style signature void XIpiPsu_InterruptDisable(XIpiPsu *InstancePtr, u32 Mask)

◆ XIpiPsu_InterruptEnable

#define XIpiPsu_InterruptEnable (   InstancePtr,
  Mask 
)

#include <xipipsu.h>

Value:
XIpiPsu_WriteReg((InstancePtr)->Config.BaseAddress, \
XIPIPSU_IER_OFFSET, \
((Mask) & XIPIPSU_ALL_MASK));
#define XIpiPsu_WriteReg(BaseAddress, RegOffset, Data)
Write a value into a register specified by base address and offset.
Definition: xipipsu.h:178

Enable interrupts specified in Mask.

The corresponding interrupt for each bit set to 1 in Mask, will be enabled.

Parameters
InstancePtris a pointer to the instance to be worked on.
Maskcontains a bit mask of interrupts to enable. The mask can be formed using a set of bitwise or'd values of individual CPU masks
Note
C-style signature void XIpiPsu_InterruptEnable(XIpiPsu *InstancePtr, u32 Mask)

◆ XIpiPsu_ReadReg

#define XIpiPsu_ReadReg (   BaseAddress,
  RegOffset 
)    Xil_In32((BaseAddress) + (RegOffset))

#include <xipipsu.h>

Read the register specified by the base address and offset.

Parameters
BaseAddressis the base address of the IPI instance
RegOffsetis the offset of the register relative to base
Returns
Value of the specified register
Note
C-style signature u32 XIpiPsu_ReadReg(u32 BaseAddress, u32 RegOffset)

Referenced by XIpiPsu_PollForAck().

◆ XIpiPsu_WriteReg

#define XIpiPsu_WriteReg (   BaseAddress,
  RegOffset,
  Data 
)    Xil_Out32(((BaseAddress) + (RegOffset)), (Data))

#include <xipipsu.h>

Write a value into a register specified by base address and offset.

Parameters
BaseAddressis the base address of the IPI instance
RegOffsetis the offset of the register relative to base
Datais a 32-bit value that is to be written into the specified register
Note
C-style signature void XIpiPsu_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)

Referenced by XIpiPsu_Reset(), and XIpiPsu_TriggerIpi().

Function Documentation

◆ XIpiPsu_CfgInitialize()

XStatus XIpiPsu_CfgInitialize ( XIpiPsu InstancePtr,
XIpiPsu_Config CfgPtr,
UINTPTR  EffectiveAddress 
)

#include <xipipsu.c>

Initialize the Instance pointer based on a given Config Pointer.

Parameters
InstancePtris a pointer to the instance to be worked on
CfgPtris the device configuration structure containing required hardware build data
EffectiveAddressis the base address of the device. If address translation is not utilized, this parameter can be passed in using CfgPtr->Config.BaseAddress to specify the physical base address.
Returns
XST_SUCCESS if initialization was successful XST_FAILURE in case of failure

References XIpiPsu_Config::BaseAddress, XIpiPsu_Config::BitMask, XIpiPsu_Target::BufferIndex, XIpiPsu::Config, XIpiPsu_Config::DeviceId, XIpiPsu_Config::IntId, XIpiPsu::IsReady, XIpiPsu_Target::Mask, and XIpiPsu_Config::TargetCount.

◆ XIpiPsu_LookupConfig()

XIpiPsu_Config * XIpiPsu_LookupConfig ( u32  DeviceId)

#include <xipipsu.h>

Looks up the device configuration based on the unique device ID.

A table contains the configuration info for each device in the system.

Parameters
DeviceIdcontains the ID of the device to look up the configuration for.
Returns
A pointer to the configuration found or NULL if the specified device ID was not found. See xipipsu.h for the definition of XIpiPsu_Config.
Note
None.

Referenced by main().

◆ XIpiPsu_PollForAck()

XStatus XIpiPsu_PollForAck ( XIpiPsu InstancePtr,
u32  DestCpuMask,
u32  TimeOutCount 
)

#include <xipipsu.c>

Poll for an acknowledgement using Observation Register.

Parameters
InstancePtris the pointer to current IPI instance
DestCpuMaskis the Mask of the destination CPU from which ACK is expected
TimeOutCountis the Count after which the routines returns failure
Returns
XST_SUCCESS if successful XST_FAILURE if a timeout occurred

References XIpiPsu_Config::BaseAddress, XIpiPsu::Config, XIpiPsu::IsReady, and XIpiPsu_ReadReg.

◆ XIpiPsu_ReadMessage()

XStatus XIpiPsu_ReadMessage ( XIpiPsu InstancePtr,
u32  SrcCpuMask,
u32 *  MsgPtr,
u32  MsgLength,
u8  BufferType 
)

#include <xipipsu.c>

Read an Incoming Message from a Source.

Parameters
InstancePtris the pointer to current IPI instance
SrcCpuMaskis the Device Mask for the CPU which has sent the message
MsgPtris the pointer to Buffer to which the read message needs to be stored
MsgLengthis the length of the buffer/message
BufferTypeis the type of buffer (XIPIPSU_BUF_TYPE_MSG or XIPIPSU_BUF_TYPE_RESP)
Returns
XST_SUCCESS if successful XST_FAILURE if an error occurred

References XIpiPsu::IsReady.

◆ XIpiPsu_Reset()

void XIpiPsu_Reset ( XIpiPsu InstancePtr)

#include <xipipsu.c>

Reset the given IPI register set.

This function can be called to disable the IPIs from all the sources and clear any pending IPIs in status register

Parameters
InstancePtris the pointer to current IPI instance

References XIpiPsu_Config::BaseAddress, XIpiPsu::Config, XIpiPsu::IsReady, and XIpiPsu_WriteReg.

◆ XIpiPsu_SetConfigTable()

void XIpiPsu_SetConfigTable ( u32  DeviceId,
XIpiPsu_Config ConfigTblPtr 
)

#include <xipipsu.c>

Set up the device configuration based on the unique device ID.

A table contains the configuration info for each device in the system.

Parameters
DeviceIdcontains the ID of the device to set up the configuration for.
Returns
A pointer to the device configuration for the specified device ID. See xipipsu.h for the definition of XIpiPsu_Config.
Note
This is for safety use case where in this function has to be called before CfgInitialize. So that driver will be initialized with the provided configuration. For non-safe use cases, this is not needed.

References XIpiPsu_Config::BaseAddress, XIpiPsu_Config::BitMask, XIpiPsu_Config::BufferIndex, and XIpiPsu_Config::IntId.

◆ XIpiPsu_TriggerIpi()

XStatus XIpiPsu_TriggerIpi ( XIpiPsu InstancePtr,
u32  DestCpuMask 
)

#include <xipipsu.c>

Trigger an IPI to a Destination CPU.

Parameters
InstancePtris the pointer to current IPI instance
DestCpuMaskis the Mask of the CPU to which IPI is to be triggered
Returns
XST_SUCCESS if successful XST_FAILURE if an error occurred

References XIpiPsu_Config::BaseAddress, XIpiPsu::Config, XIpiPsu::IsReady, and XIpiPsu_WriteReg.

◆ XIpiPsu_WriteMessage()

XStatus XIpiPsu_WriteMessage ( XIpiPsu InstancePtr,
u32  DestCpuMask,
u32 *  MsgPtr,
u32  MsgLength,
u8  BufferType 
)

#include <xipipsu.c>

Send a Message to Destination.

Parameters
InstancePtris the pointer to current IPI instance
DestCpuMaskis the Device Mask for the destination CPU
MsgPtris the pointer to Buffer which contains the message to be sent
MsgLengthis the length of the buffer/message
BufferTypeis the type of buffer (XIPIPSU_BUF_TYPE_MSG or XIPIPSU_BUF_TYPE_RESP)
Returns
XST_SUCCESS if successful XST_FAILURE if an error occurred

References XIpiPsu::IsReady.