mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-15 23:54:24 -04:00
exo2: implement through boot config load/validate
This commit is contained in:
parent
cbcd1d87fb
commit
e11fad6598
26 changed files with 688 additions and 49 deletions
|
@ -26,7 +26,7 @@ namespace ams::secmon {
|
|||
/* Set library register addresses. */
|
||||
/* actmon::SetRegisterAddress(MemoryRegionVirtualDeviceActivityMonitor.GetAddress()); */
|
||||
clkrst::SetRegisterAddress(MemoryRegionVirtualDeviceClkRst.GetAddress());
|
||||
/* flowctrl::SetRegisterAddress(); */
|
||||
flow::SetRegisterAddress(MemoryRegionVirtualDeviceFlowController.GetAddress());
|
||||
fuse::SetRegisterAddress(MemoryRegionVirtualDeviceFuses.GetAddress());
|
||||
gic::SetRegisterAddress(MemoryRegionVirtualDeviceGicDistributor.GetAddress(), MemoryRegionVirtualDeviceGicCpuInterface.GetAddress());
|
||||
i2c::SetRegisterAddress(i2c::Port_1, MemoryRegionVirtualDeviceI2c1.GetAddress());
|
||||
|
@ -69,6 +69,26 @@ namespace ams::secmon {
|
|||
/* Initialize the random cache. */
|
||||
secmon::smc::FillRandomCache();
|
||||
}
|
||||
|
||||
/* Wait for NX Bootloader to finish loading the BootConfig. */
|
||||
secmon::boot::WaitForNxBootloader(secmon_params, pkg1::BootloaderState_LoadedBootConfig);
|
||||
hw::DataSynchronizationBarrierInnerShareable();
|
||||
|
||||
/* Load the bootconfig. */
|
||||
secmon::boot::LoadBootConfig(MemoryRegionPhysicalIramBootConfig.GetPointer());
|
||||
|
||||
/* Verify or clear the boot config. */
|
||||
secmon::boot::VerifyOrClearBootConfig();
|
||||
|
||||
/* Get the boot config. */
|
||||
const auto &bc = secmon::GetBootConfig();
|
||||
|
||||
/* Set the tsc value by the boot config. */
|
||||
{
|
||||
constexpr u64 TscMask = (static_cast<u64>(1) << 55) - 1;
|
||||
|
||||
secmon::boot::EnableTsc(bc.data.GetInitialTscValue() & TscMask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue