AM64x MCU+ SDK  09.02.00
MTOG

The Interconnect Isolation Gasket is a TI proprietary IP that is used to prevent a hang caused by target, which can hold up the interconnect and terminate such a transaction safely. It tracks transactions, and times out if outstanding too long, and reports the error via interrupt that can be monitored. The TOGs help to achieve Freedom From Interference by monitoring the various VBUS transactions and providing a way to detect any errors, and helping to avoid the bus to be locked up due to a transaction error.

Features Supported

These TOGs have the following functions, to avoid these concerns:

  1. Monitors various VBUS transaction and provide a way to detect errors
  2. Helps avoid the bus to be locked up due to a transaction in error.
  3. Tracks outstanding transactions and allows for timeout/recovery.

Each of the Timeout gaskets can be programmed to a specific timeout and any transaction exceeding the timeout will result in abort of the transaction. This will also result in an error event triggered through ESM, which will in turn can be programmed to interrupt the CPU.

In addition the timeout gasket can be stopped, started and reset at anytime.

Safety diagnostics are provided for TOG module through API’s

  1. Configure the TOG
  2. Read the static registers
  3. Verify the written configuration

SysConfig Features

  • None

Features NOT Supported

  • None

Important Usage Guidelines

  • None

Example Usage

The following shows an example of SDL TOG API usage by the application to set up the TOG for monitoring for events. Events can be monitored by enabling the events in the associated ESM instance.

Include the below file to access the APIs

#include <sdl/sdlr_mtog.h>
Initialization structure for MCU ESM instance
static SDL_ESM_config MTOG_Example_esmInitConfig_MCU =
{
.esmErrorConfig = {0u, 3u}, /* Self test error config */
.enableBitmap = {0x04000000u, 0x00000000u, 0x00000000u, 0x00000000u,
},
/* and Main ESM output.Configured based off esmErrorConfig to test high or low priorty events.*/
.priorityBitmap = {0x04000000u, 0x00000000u, 0x00000000u, 0x00000000u,
},
.errorpinBitmap = {0x04000000u, 0x00000000u, 0x00000000u, 0x00000000u,
},
};

Event handler API

void MTOG_eventHandler( uint32_t instanceIndex )
{
int32_t status = SDL_PASS;
/* Reset the Timeout gasket */
status = SDL_MTOG_reset( instanceIndex );
if (status == SDL_PASS)
{
DebugP_log("\n MTOG Reset done\n");
}
else{
DebugP_log("\n MTOG Reset failed");
}
doneFlag = true;
return;
}

ESM callback function.

int32_t SDL_ESM_applicationCallbackFunction(SDL_ESM_Inst esmInst, SDL_ESM_IntType esmIntrType,
uint32_t grpChannel, uint32_t index, uint32_t intSrc, void *arg)
{
int32_t retVal = SDL_PASS;
MTOG_eventHandler(instanceIndex);
DebugP_log("\nInterrupt is generated to ESM\n");
DebugP_log(" ESM Call back function called : instType 0x%x, intType 0x%x, " \
"grpChannel 0x%x, index 0x%x, intSrc 0x%x \n",
esmInst, esmIntrType, grpChannel, index, intSrc);
DebugP_log(" Take action \n");
/* For clearing the interrupt */
IntrDisable(intSrc);
return retVal;
}

Initialize ESM

SDL_ESM_init(SDL_ESM_INST_MCU_ESM0, &MTOG_Example_esmInitConfig_MCU, SDL_ESM_applicationCallbackFunction, &apparg);

Configure a TOG instance with a timeout value

uint32_t instance;
int32_t status=0;
uint32_t ESMEventNumber;
ESMEventNumber = SDLR_MCU_ESM0_ESM_LVL_EVENT_MCU_MASTER_SAFETY_GASKET0_TIMED_OUT_0;
instanceIndex = SDL_INSTANCE_MCU_MTOG0;
result = SDL_MTOG_init(instanceIndex, &config);
if (status != SDL_PASS)
{
DebugP_log(" SDL_MTOG_init Failed \n");
result = -1;
}

Call SDL API to enable Timeout Gasket

status = SDL_MTOG_start(instanceIndex);
if (status != SDL_PASS)
{
DebugP_log(" SDL_MTOG_start Failed \n");
result = -1;
}

Inject master timeout error

status = SDL_MTOG_forceTimeout(instanceIndex);
if (status != SDL_PASS)
{
DebugP_log("\n SDL_MTOG_forceTimeout Failed \n");
result = -1;
}

Wait for MTOG Interrupt

/* Timeout if exceeds time */
while ((!doneFlag)
&& (timeoutCount++ < MTOG_MAX_TIMEOUT_VALUE))
{
/* Use Polling */
MTOG_eventHandler(instanceIndex);
}
if(timeoutCount >= MTOG_MAX_TIMEOUT_VALUE)
{
DebugP_log("\n MTOG Timed out \n");
result = -1;
}

Disable ESM Interrupts

status=SDL_ESM_disableIntr(SDL_ESM_INST_MCU_ESM0, ESMEventNumber);
if (status != SDL_PASS)
{
DebugP_log(" sdlAppEsmDisable Failed \n");
result = -1;
}

API

APIs for SDL MTOG

SDL_MTOG_VAL_1K
#define SDL_MTOG_VAL_1K
Definition: sdl_ip_mtog.h:61
SDL_ESM_IntType
SDL_ESM_IntType
Definition: sdl_esm.h:89
SDL_MTOG_config::timeOut
SDL_MTOGVal timeOut
Definition: sdl_mtog.h:96
SDL_ESM_config
ESM init configuration.
Definition: sdl_esm.h:179
index
uint16_t index
Definition: tisci_rm_proxy.h:3
SDL_MTOG_config
Definition: sdl_mtog.h:94
SDL_MTOG_reset
int32_t SDL_MTOG_reset(SDL_MTOG_Inst instance)
Reset the timeout functionality.
SDL_MTOG_forceTimeout
int32_t SDL_MTOG_forceTimeout(SDL_MTOG_Inst instance)
Force a timeout.
DebugP_log
#define DebugP_log(format,...)
Function to log a string to the enabled console.
Definition: DebugP.h:225
SDL_MTOG_init
int32_t SDL_MTOG_init(SDL_MTOG_Inst instance, const SDL_MTOG_config *pConfig)
Initialize Master TOG module with respect of instance.
SDL_INSTANCE_MCU_MTOG0
#define SDL_INSTANCE_MCU_MTOG0
Definition: sdl_soc_mtog.h:60
SDL_ESM_disableIntr
int32_t SDL_ESM_disableIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to disable interrupt.
SDL_ESM_config::esmErrorConfig
SDL_ESM_ErrorConfig_t esmErrorConfig
Definition: sdl_esm.h:180
SDL_ESM_init
int32_t SDL_ESM_init(SDL_ESM_Inst instance, const SDL_ESM_config *pConfig, SDL_ESM_applicationCallback applicationCallback, void *appArg)
SDL ESM API to initialize an ESM instance. The API initializes the specified ESM instance with the pr...
SDL_MTOG_start
int32_t SDL_MTOG_start(SDL_MTOG_Inst instance)
Start the timeout function.