mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-14 07:04:24 -04:00
fusee_cpp: begin mariko mtc work
This commit is contained in:
parent
598edc0a46
commit
c4fee796ea
5 changed files with 292 additions and 14 deletions
|
@ -18,12 +18,16 @@
|
|||
namespace ams::nxboot {
|
||||
|
||||
void DoMemoryTrainingErista(int index, void *mtc_tables_buffer);
|
||||
void DoMemoryTrainingMariko(int index, void *mtc_tables_buffer);
|
||||
void DoMemoryTrainingMariko(bool *out_did_training, int index, void *mtc_tables_buffer);
|
||||
|
||||
void RestoreMemoryClockRateMariko(void *mtc_tables_buffer);
|
||||
|
||||
namespace {
|
||||
|
||||
alignas(4) constinit u8 g_mtc_tables_buffer[0x26C0];
|
||||
|
||||
constinit bool g_did_training_mariko = false;
|
||||
|
||||
constexpr const u8 MemoryTrainingTableIndex_Invalid = std::numeric_limits<u8>::max();
|
||||
|
||||
constexpr const u8 MemoryTrainingTableIndices[] = {
|
||||
|
@ -74,7 +78,14 @@ namespace ams::nxboot {
|
|||
if (fuse::GetSocType() == fuse::SocType_Erista) {
|
||||
DoMemoryTrainingErista(index, g_mtc_tables_buffer);
|
||||
} else {
|
||||
DoMemoryTrainingMariko(index, g_mtc_tables_buffer);
|
||||
DoMemoryTrainingMariko(std::addressof(g_did_training_mariko), index, g_mtc_tables_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreMemoryClockRate() {
|
||||
/* NOTE: This resolves an off-by-one issue in PCV's detection of memory clock rate on Mariko. */
|
||||
if (fuse::GetSocType() == fuse::SocType_Mariko && g_did_training_mariko) {
|
||||
RestoreMemoryClockRateMariko(g_mtc_tables_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue