Expose w0 w1

This commit is contained in:
Ben V. Brown
2022-06-21 20:51:31 +10:00
parent 994f6d8381
commit b29bcb7cc3
2 changed files with 10 additions and 7 deletions

View File

@@ -39,7 +39,6 @@
#include "bl702_common.h" #include "bl702_common.h"
#include "ef_ctrl_reg.h" #include "ef_ctrl_reg.h"
/** @addtogroup BL702_Peripheral_Driver /** @addtogroup BL702_Peripheral_Driver
* @{ * @{
*/ */
@@ -276,7 +275,8 @@ BL_Err_Type EF_Ctrl_Read_MAC_Address_Opt(uint8_t slot, uint8_t mac[8], uint8_t r
BL_Err_Type EF_Ctrl_Read_Chip_ID(uint8_t id[8]); BL_Err_Type EF_Ctrl_Read_Chip_ID(uint8_t id[8]);
/*----------*/ /*----------*/
BL_Err_Type EF_Ctrl_Get_Chip_PIDVID(uint16_t pid[1], uint16_t vid[1]); BL_Err_Type EF_Ctrl_Get_Chip_PIDVID(uint16_t pid[1], uint16_t vid[1]);
uint64_t EF_Ctrl_Get_Key_Slot_w0w1(); uint32_t EF_Ctrl_Get_Key_Slot_w0();
uint32_t EF_Ctrl_Get_Key_Slot_w1();
BL_Err_Type EF_Ctrl_Get_Customer_PIDVID(uint16_t pid[1], uint16_t vid[1]); BL_Err_Type EF_Ctrl_Get_Customer_PIDVID(uint16_t pid[1], uint16_t vid[1]);
/*----------*/ /*----------*/
void EF_Ctrl_Read_Device_Info(Efuse_Device_Info_Type *deviceInfo); void EF_Ctrl_Read_Device_Info(Efuse_Device_Info_Type *deviceInfo);

View File

@@ -1065,16 +1065,19 @@ BL_Err_Type EF_Ctrl_Get_Chip_PIDVID(uint16_t pid[1], uint16_t vid[1]) {
return SUCCESS; return SUCCESS;
} }
uint64_t EF_Ctrl_Get_Key_Slot_w0w1() { uint32_t EF_Ctrl_Get_Key_Slot_w0() {
uint64_t tmpVal;
/* Trigger read data from efuse */ /* Trigger read data from efuse */
EF_CTRL_LOAD_BEFORE_READ_R0; EF_CTRL_LOAD_BEFORE_READ_R0;
tmpVal = BL_RD_REG(EF_DATA_BASE, EF_DATA_0_EF_KEY_SLOT_4_W0); return BL_RD_REG(EF_DATA_BASE, EF_DATA_0_EF_KEY_SLOT_4_W0);
tmpVal |= ((uint64_t)BL_RD_REG(EF_DATA_BASE, EF_DATA_0_EF_KEY_SLOT_4_W1)) << 32; }
uint32_t EF_Ctrl_Get_Key_Slot_w1() {
return tmpVal; /* Trigger read data from efuse */
EF_CTRL_LOAD_BEFORE_READ_R0;
return BL_RD_REG(EF_DATA_BASE, EF_DATA_0_EF_KEY_SLOT_4_W1);
} }
/**************************************************************************** /****************************************************************************