From 34c16e211f6135e8dfff58dd1155e240be010b4e Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 18 Dec 2018 16:02:49 -0800 Subject: [PATCH] warmboot: make remaining TODOs explicit --- exosphere/lp0fw/src/fuse.c | 4 ++++ exosphere/lp0fw/src/fuse.h | 2 ++ exosphere/lp0fw/src/secmon.c | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/exosphere/lp0fw/src/fuse.c b/exosphere/lp0fw/src/fuse.c index 84a64cfa6..cad33c8f3 100644 --- a/exosphere/lp0fw/src/fuse.c +++ b/exosphere/lp0fw/src/fuse.c @@ -28,6 +28,10 @@ bool fuse_check_downgrade_status(void) { return false; } +void fuse_disable_programming(void) { + FUSE_REGS->FUSE_DIS_PGM = 1; +} + static fuse_bypass_data_t g_fuse_bypass_entries[NUM_FUSE_BYPASS_ENTRIES] = { /* No entries here. */ }; diff --git a/exosphere/lp0fw/src/fuse.h b/exosphere/lp0fw/src/fuse.h index 39706bd89..6c3059680 100644 --- a/exosphere/lp0fw/src/fuse.h +++ b/exosphere/lp0fw/src/fuse.h @@ -197,4 +197,6 @@ bool fuse_check_downgrade_status(void); void fuse_configure_fuse_bypass(void); +void fuse_disable_programming(void); + #endif diff --git a/exosphere/lp0fw/src/secmon.c b/exosphere/lp0fw/src/secmon.c index d6ec9b1b8..142e7b447 100644 --- a/exosphere/lp0fw/src/secmon.c +++ b/exosphere/lp0fw/src/secmon.c @@ -20,6 +20,7 @@ #include "lp0.h" #include "secmon.h" #include "se.h" +#include "fuse.h" #include "pmc.h" /* "private" functions. */ @@ -47,7 +48,12 @@ void secmon_restore_to_tzram(const uint32_t target_firmware) { /* Make security engine require secure busmaster. */ se_get_regs()->_0x4 = 0; - /* TODO: stuff */ + /* TODO: se_verify_keys_unreadable(); */ + + /* TODO: pmc_lockout_wb_scratch_registers(); */ + + /* Disable fuse programming. */ + fuse_disable_programming(); } void secmon_decrypt_saved_image(void *dst, const void *src, size_t size) {