mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-13 06:34:23 -04:00
fusee_cpp: implement tsec_keygen firmware execution
This commit is contained in:
parent
80999988d4
commit
51cf28339b
11 changed files with 270 additions and 53 deletions
|
@ -14,13 +14,40 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <exosphere.hpp>
|
||||
#include "fusee_secondary_archive.hpp"
|
||||
#include "fusee_setup_horizon.hpp"
|
||||
#include "fusee_fatal.hpp"
|
||||
|
||||
namespace ams::nxboot {
|
||||
|
||||
namespace {
|
||||
|
||||
void DeriveAllKeys(const fuse::SocType soc_type) {
|
||||
/* If on erista, run the TSEC keygen firmware. */
|
||||
if (soc_type == fuse::SocType_Erista) {
|
||||
clkrst::SetBpmpClockRate(clkrst::BpmpClockRate_408MHz);
|
||||
|
||||
if (!tsec::RunTsecFirmware(GetSecondaryArchive().tsec_keygen, sizeof(GetSecondaryArchive().tsec_keygen))) {
|
||||
ShowFatalError("Failed to run tsec_keygen firmware!\n");
|
||||
}
|
||||
|
||||
clkrst::SetBpmpClockRate(clkrst::BpmpClockRate_576MHz);
|
||||
}
|
||||
|
||||
ShowFatalError("DeriveAllKeys not fully implemented\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SetupAndStartHorizon() {
|
||||
/* TODO */
|
||||
/* Get soc/hardware type. */
|
||||
const auto soc_type = fuse::GetSocType();
|
||||
const auto hw_type = fuse::GetHardwareType();
|
||||
|
||||
/* Derive all keys. */
|
||||
DeriveAllKeys(soc_type);
|
||||
|
||||
AMS_UNUSED(hw_type);
|
||||
ShowFatalError("SetupAndStartHorizon not fully implemented\n");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue