#ifndef __platform_common_h | |
#define __platform_common_h | |
#include "PlatformConfig.h" | |
#if BL_USE_SECURITY_CALLBACK | |
#include "SecurityCallBack.h" // Security Call Back functions address header | |
#endif | |
#if TRUSTED | |
#include "GEU.h" | |
#include "Security.h" | |
#endif | |
static inline void ConfigRegSetup( P_CS_REGISTER_PAIR_S regPtr) | |
{ | |
UINT32_T tmp; | |
while(regPtr->registerAddr != 0x0) | |
{ | |
tmp = *(regPtr->registerAddr); | |
tmp &= 0x000003F8; | |
*(regPtr->registerAddr) = regPtr->regValue | tmp; | |
tmp = *(regPtr->registerAddr); // ensure write complete | |
regPtr++; | |
} | |
} | |
static inline void ConfigRegWrite( P_CS_REGISTER_PAIR_S regPtr) | |
{ | |
volatile UINT32_T tmp; //-JML- declared volatile since it's not used and to resolve compiler warning #550 | |
while(regPtr->registerAddr != 0x0) | |
{ | |
*(regPtr->registerAddr) = regPtr->regValue; | |
tmp = *(regPtr->registerAddr); // ensure write complete | |
regPtr++; | |
} | |
} | |
static inline void ConfigRegResume( P_CS_REGISTER_PAIR_S regPtr) | |
{ | |
volatile UINT32_T tmp; //-JML- declared volatile since it's not used and to resolve compiler warning #550 | |
while(regPtr->registerAddr != 0x0) | |
{ | |
*(regPtr->registerAddr) &= 0xFFFFFFF7; | |
tmp = *(regPtr->registerAddr); // ensure write complete | |
regPtr++; | |
} | |
} | |
static inline void ConfigRegSave( P_CS_REGISTER_PAIR_S regPtr) | |
{ | |
while(regPtr->registerAddr != 0x0) | |
{ | |
regPtr->defaultValue = *(regPtr->registerAddr); | |
regPtr++; | |
} | |
} | |
static inline void ConfigRegRestore( P_CS_REGISTER_PAIR_S regPtr) | |
{ | |
volatile UINT32_T tmp; //-JML- declared volatile since it's not used and to resolve compiler warning #550 | |
while(regPtr->registerAddr != 0x0) | |
{ | |
*(regPtr->registerAddr) = regPtr->defaultValue; | |
tmp = *(regPtr->registerAddr); // ensure write complete | |
regPtr++; | |
} | |
} | |
#endif |