fusee-cpp: Implement mbist workaround

This commit is contained in:
Michael Scire 2021-08-21 15:49:36 -07:00 committed by SciresM
parent 3e81796db7
commit c333a84b6b
19 changed files with 847 additions and 35 deletions

View file

@ -19,8 +19,41 @@ namespace ams::tsec {
namespace {
enum TsecResult {
TsecResult_Success = 0xB0B0B0B0,
TsecResult_Failure = 0xD0D0D0D0,
};
bool RunFirmwareImpl(const void *fw, size_t fw_size) {
/* Enable relevant clocks. */
clkrst::EnableHost1xClock();
clkrst::EnableTsecClock();
clkrst::EnableSorSafeClock();
clkrst::EnableSor0Clock();
clkrst::EnableSor1Clock();
clkrst::EnableKfuseClock();
/* Disable clocks once we're done. */
ON_SCOPE_EXIT {
clkrst::DisableHost1xClock();
clkrst::DisableTsecClock();
clkrst::DisableSorSafeClock();
clkrst::DisableSor0Clock();
clkrst::DisableSor1Clock();
clkrst::DisableKfuseClock();
};
/* TODO */
AMS_UNUSED(fw, fw_size);
return true;
}
}
bool RunTsecFirmware(const void *fw, size_t fw_size) {
/* TODO */
AMS_UNUSED(fw, fw_size);
return RunFirmwareImpl(fw, fw_size);
}
void Lock() {