![]() |
tmr_inject
Xilinx SDK Drivers API Documentation
|
Data Structures | |
struct | XTMR_Inject_Config |
This typedef contains configuration information for the device. More... | |
struct | XTMR_Inject |
The XTMR_Inject driver instance data. More... | |
Macros | |
#define | XTMR_Inject_WriteReg(BaseAddress, RegOffset, Data) XTMR_Inject_Out32((BaseAddress) + (RegOffset), (u32)(Data)) |
Write a value to a TMRInject register. More... | |
#define | XTMR_Inject_WriteReg64(BaseAddress, RegOffset, Data) XTMR_Inject_Out64((BaseAddress) + (RegOffset), (UINTPTR)(Data)) |
Write a value to a TMRInject register. More... | |
#define | XTMR_Inject_SetControlReg(BaseAddress, Mask) XTMR_Inject_WriteReg((BaseAddress), XTI_CONTROL_REG_OFFSET, (Mask)) |
Set the contents of the control register. More... | |
Functions | |
int | XTMR_Inject_CfgInitialize (XTMR_Inject *InstancePtr, XTMR_Inject_Config *Config, UINTPTR EffectiveAddr) |
Initialize a XTMR_Inject instance. More... | |
void | XTMR_Inject_Enable (XTMR_Inject *InstancePtr, u8 CpuId) |
This function enables fault injection for the indicated CPU. More... | |
void | XTMR_Inject_Disable (XTMR_Inject *InstancePtr) |
This function disables fault injection. More... | |
u32 | XTMR_Inject_InjectBit (XTMR_Inject *InstancePtr, u32 Value, u8 Bit) |
This function can be used to inject a fault in either: More... | |
u32 | XTMR_Inject_InjectMask (XTMR_Inject *InstancePtr, u32 Value, u32 Mask) |
This function can be used to inject any number of faults defined by the Mask parameter in either: More... | |
int | XTMR_Inject_Initialize (XTMR_Inject *InstancePtr, u16 DeviceId) |
Initialize a XTMR_Inject instance. More... | |
int | XTMR_Inject_SelfTest (XTMR_Inject *InstancePtr) |
Runs a self-test on the device hardware. More... | |
Variables | |
XTMR_Inject_Config | XTMR_Inject_ConfigTable [XPAR_XTMR_INJECT_NUM_INSTANCES] |
The configuration table for TMR Inject devices. More... | |
XTMR_Inject_Config | XTMR_Inject_ConfigTable [] |
The configuration table for TMR Inject devices. More... | |
#define XTMR_Inject_SetControlReg | ( | BaseAddress, | |
Mask | |||
) | XTMR_Inject_WriteReg((BaseAddress), XTI_CONTROL_REG_OFFSET, (Mask)) |
#include <xtmr_inject_l.h>
Set the contents of the control register.
Use the XUL_CR_* constants defined above to create the bit-mask to be written to the register.
BaseAddress | is the base address of the device |
Mask | is the 32-bit value to write to the control register |
#define XTMR_Inject_WriteReg | ( | BaseAddress, | |
RegOffset, | |||
Data | |||
) | XTMR_Inject_Out32((BaseAddress) + (RegOffset), (u32)(Data)) |
#include <xtmr_inject_l.h>
Write a value to a TMRInject register.
A 32 bit write is performed.
BaseAddress | is the base address of the TMRInject device. |
RegOffset | is the register offset from the base to write to. |
Data | is the data written to the register. |
Referenced by XTMR_Inject_Disable(), and XTMR_Inject_Enable().
#define XTMR_Inject_WriteReg64 | ( | BaseAddress, | |
RegOffset, | |||
Data | |||
) | XTMR_Inject_Out64((BaseAddress) + (RegOffset), (UINTPTR)(Data)) |
#include <xtmr_inject_l.h>
Write a value to a TMRInject register.
A 64 bit write is performed.
BaseAddress | is the base address of the TMRInject device. |
RegOffset | is the register offset from the base to write to. |
Data | is the data written to the register. |
int XTMR_Inject_CfgInitialize | ( | XTMR_Inject * | InstancePtr, |
XTMR_Inject_Config * | Config, | ||
UINTPTR | EffectiveAddr | ||
) |
#include <xtmr_inject.c>
Initialize a XTMR_Inject instance.
The receive and transmit FIFOs of the core are not flushed, so the user may want to flush them. The hardware device does not have any way to disable the receiver such that any valid data may be present in the receive FIFO. This function disables the core interrupt. The baudrate and format of the data are fixed in the hardware at hardware build time.
InstancePtr | is a pointer to the XTMR_Inject instance. |
Config | is a reference to a structure containing information about a specific TMR Inject device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call. |
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. |
References XTMR_Inject::Address, XTMR_Inject_Config::MagicByte, and XTMR_Inject::MagicByte.
void XTMR_Inject_Disable | ( | XTMR_Inject * | InstancePtr | ) |
#include <xtmr_inject.c>
This function disables fault injection.
InstancePtr | is a pointer to the XTMR_Inject instance. |
References XTMR_Inject_WriteReg.
void XTMR_Inject_Enable | ( | XTMR_Inject * | InstancePtr, |
u8 | CpuId | ||
) |
#include <xtmr_inject.c>
This function enables fault injection for the indicated CPU.
InstancePtr | is a pointer to the XTMR_Inject instance. |
CpuId | is the CPU ID of the CPU where faults are to be injected. Must be 1 to 3. |
References XTMR_Inject_WriteReg.
int XTMR_Inject_Initialize | ( | XTMR_Inject * | InstancePtr, |
u16 | DeviceId | ||
) |
#include <xtmr_inject.h>
Initialize a XTMR_Inject instance.
InstancePtr | is a pointer to the XTMR_Inject instance. |
DeviceId | is the unique id of the device controlled by this XTMR_Inject instance. Passing in a device id associates the generic XTMR_Inject instance to a specific device, as chosen by the caller or application developer. |
Referenced by TMR_InjectSelfTestExample().
u32 XTMR_Inject_InjectBit | ( | XTMR_Inject * | InstancePtr, |
u32 | Value, | ||
u8 | Bit | ||
) |
#include <xtmr_inject.c>
This function can be used to inject a fault in either:
InstancePtr | is a pointer to the XTMR_Inject instance. |
Value | is the memory or register address, oro the data. |
Bit | is the bit where the fault is injected. Must be 0 to 31. |
u32 XTMR_Inject_InjectMask | ( | XTMR_Inject * | InstancePtr, |
u32 | Value, | ||
u32 | Mask | ||
) |
#include <xtmr_inject.c>
This function can be used to inject any number of faults defined by the Mask parameter in either:
InstancePtr | is a pointer to the XTMR_Inject instance. |
Value | is the memory or register address, oro the data. |
Mask | defines the bits where faults are injected. A fault is injected for every bit in the mask set to 1. |
int XTMR_Inject_SelfTest | ( | XTMR_Inject * | InstancePtr | ) |
#include <xtmr_inject.h>
Runs a self-test on the device hardware.
Since there is no way to perform a loopback in the hardware, this test can only check the state of the status register to verify it is correct. This test assumes that the hardware device is still in its reset state, but has been initialized with the Initialize function.
InstancePtr | is a pointer to the XTMR_Inject instance. |
Referenced by TMR_InjectSelfTestExample().
XTMR_Inject_Config XTMR_Inject_ConfigTable[] |
#include <xtmr_inject_i.h>
The configuration table for TMR Inject devices.
XTMR_Inject_Config XTMR_Inject_ConfigTable[XPAR_XTMR_INJECT_NUM_INSTANCES] |
#include <xtmr_inject_g.c>
The configuration table for TMR Inject devices.