mirror of https://github.com/ARMmbed/mbed-os.git
EFM32: Use SECURE_ACCESS to access the ROM table
To allow enabling of uVisor on EFM32, the ROM table must be accessed through the CMSIS-provided SECURE_ACCESS macro.pull/5634/head
parent
bc356a3ea5
commit
ba41480fd4
|
@ -33,6 +33,7 @@
|
||||||
#include "em_system.h"
|
#include "em_system.h"
|
||||||
#include "em_assert.h"
|
#include "em_assert.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include "core_cmSecureAccess.h"
|
||||||
|
|
||||||
/***************************************************************************//**
|
/***************************************************************************//**
|
||||||
* @addtogroup emlib
|
* @addtogroup emlib
|
||||||
|
@ -61,19 +62,24 @@ void SYSTEM_ChipRevisionGet(SYSTEM_ChipRevision_TypeDef *rev)
|
||||||
|
|
||||||
EFM_ASSERT(rev);
|
EFM_ASSERT(rev);
|
||||||
|
|
||||||
|
uint32_t pid0 = SECURE_READ(&(ROMTABLE->PID0));
|
||||||
|
uint32_t pid1 = SECURE_READ(&(ROMTABLE->PID1));
|
||||||
|
uint32_t pid2 = SECURE_READ(&(ROMTABLE->PID2));
|
||||||
|
uint32_t pid3 = SECURE_READ(&(ROMTABLE->PID3));
|
||||||
|
|
||||||
/* CHIP FAMILY bit [5:2] */
|
/* CHIP FAMILY bit [5:2] */
|
||||||
tmp = (((ROMTABLE->PID1 & _ROMTABLE_PID1_FAMILYMSB_MASK) >> _ROMTABLE_PID1_FAMILYMSB_SHIFT) << 2);
|
tmp = (((pid1 & _ROMTABLE_PID1_FAMILYMSB_MASK) >> _ROMTABLE_PID1_FAMILYMSB_SHIFT) << 2);
|
||||||
/* CHIP FAMILY bit [1:0] */
|
/* CHIP FAMILY bit [1:0] */
|
||||||
tmp |= ((ROMTABLE->PID0 & _ROMTABLE_PID0_FAMILYLSB_MASK) >> _ROMTABLE_PID0_FAMILYLSB_SHIFT);
|
tmp |= ((pid0 & _ROMTABLE_PID0_FAMILYLSB_MASK) >> _ROMTABLE_PID0_FAMILYLSB_SHIFT);
|
||||||
rev->family = tmp;
|
rev->family = tmp;
|
||||||
|
|
||||||
/* CHIP MAJOR bit [3:0] */
|
/* CHIP MAJOR bit [3:0] */
|
||||||
rev->major = (ROMTABLE->PID0 & _ROMTABLE_PID0_REVMAJOR_MASK) >> _ROMTABLE_PID0_REVMAJOR_SHIFT;
|
rev->major = (pid0 & _ROMTABLE_PID0_REVMAJOR_MASK) >> _ROMTABLE_PID0_REVMAJOR_SHIFT;
|
||||||
|
|
||||||
/* CHIP MINOR bit [7:4] */
|
/* CHIP MINOR bit [7:4] */
|
||||||
tmp = (((ROMTABLE->PID2 & _ROMTABLE_PID2_REVMINORMSB_MASK) >> _ROMTABLE_PID2_REVMINORMSB_SHIFT) << 4);
|
tmp = (((pid2 & _ROMTABLE_PID2_REVMINORMSB_MASK) >> _ROMTABLE_PID2_REVMINORMSB_SHIFT) << 4);
|
||||||
/* CHIP MINOR bit [3:0] */
|
/* CHIP MINOR bit [3:0] */
|
||||||
tmp |= ((ROMTABLE->PID3 & _ROMTABLE_PID3_REVMINORLSB_MASK) >> _ROMTABLE_PID3_REVMINORLSB_SHIFT);
|
tmp |= ((pid3 & _ROMTABLE_PID3_REVMINORLSB_MASK) >> _ROMTABLE_PID3_REVMINORLSB_SHIFT);
|
||||||
rev->minor = tmp;
|
rev->minor = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue