bdk: fuse: add sense function
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <mem/heap.h>
|
||||
#include <sec/se.h>
|
||||
#include <sec/se_t210.h>
|
||||
#include <soc/clock.h>
|
||||
#include <soc/fuse.h>
|
||||
#include <soc/hw_init.h>
|
||||
#include <soc/pmc.h>
|
||||
@@ -173,6 +174,25 @@ void fuse_wait_idle()
|
||||
;
|
||||
}
|
||||
|
||||
void fuse_sense()
|
||||
{
|
||||
clock_enable_fuse(false);
|
||||
|
||||
FUSE(FUSE_CTRL) = (FUSE(FUSE_CTRL) & (~FUSE_CMD_MASK)) | FUSE_SENSE;
|
||||
usleep(1);
|
||||
|
||||
fuse_wait_idle();
|
||||
|
||||
FUSE(FUSE_PRIV2INTFC) = FUSE_PRIV2INTFC_SKIP_RECORDS | FUSE_PRIV2INTFC_START_DATA;
|
||||
usleep(1);
|
||||
|
||||
while (!(FUSE(FUSE_CTRL) & BIT(30)) || ((FUSE(FUSE_CTRL) >> 16) & 0x1F) != FUSE_STATUS_IDLE)
|
||||
;
|
||||
|
||||
|
||||
clock_enable_fuse(true);
|
||||
}
|
||||
|
||||
u32 fuse_read(u32 addr)
|
||||
{
|
||||
FUSE(FUSE_ADDR) = addr;
|
||||
|
||||
@@ -316,6 +316,8 @@ u32 fuse_read_hw_state();
|
||||
u32 fuse_read_hw_type();
|
||||
int fuse_set_sbk();
|
||||
void fuse_wait_idle();
|
||||
void fuse_sense();
|
||||
u32 fuse_read(u32 addr);
|
||||
int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value));
|
||||
int fuse_read_evp_thunk(u32 *iram_evp_thunks, u32 *iram_evp_thunks_len);
|
||||
void fuse_read_array(u32 *words);
|
||||
|
||||
Reference in New Issue
Block a user