AM62Ax MCU+ SDK  10.01.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 WKUP ESM instance
static SDL_ESM_config MTOG_Example_esmInitConfig_WKUP =
{
.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_WKUP_ESM0, &MTOG_Example_esmInitConfig_WKUP, SDL_ESM_applicationCallbackFunction, &apparg);

Configure a TOG instance with a timeout value

uint32_t instance;
int32_t status=0;
uint32_t ESMEventNumber;
ESMEventNumber = SDLR_WKUP_R5FSS0_CORE0_INTR_GLUELOGIC_MGASKET_INTR_GLUE_OUT_0;
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

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: esm/sdl_esm.h:95
SDL_ESM_Inst
SDL_ESM_Inst
Definition: sdl_esm_soc.h:59
status
uint32_t status
Definition: tisci_lpm.h:1
SDL_MTOG_config::timeOut
SDL_MTOGVal timeOut
Definition: sdl_mtog.h:101
SDL_ESM_config
ESM init configuration.
Definition: esm/sdl_esm.h:189
index
uint16_t index
Definition: tisci_rm_proxy.h:3
SDL_MTOG_config
Definition: sdl_mtog.h:99
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:227
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_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: esm/sdl_esm.h:190
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.
SDL_ESM_INST_WKUP_ESM0
@ SDL_ESM_INST_WKUP_ESM0
Definition: sdl_esm_soc.h:61