fusee_cpp: implement bpmp overclock

This commit is contained in:
Michael Scire 2021-08-23 15:10:24 -07:00 committed by SciresM
parent 1a8f886a6e
commit 4480e7a8a5
7 changed files with 191 additions and 16 deletions

View file

@ -572,6 +572,16 @@ namespace ams::nxboot {
g_display_initialized = false;
}
void ShowDisplay() {
/* Enable backlight. */
constexpr auto DisplayBrightness = 100;
if (g_lcd_vendor == 0x2050) {
EnableBacklightForVendor2050ForAula(DisplayBrightness);
} else {
EnableBacklightForGeneric(DisplayBrightness);
}
}
void ShowFatalError(const ams::impl::FatalErrorContext *f_ctx, const Result save_result) {
/* If needed, initialize the display. */
if (!IsDisplayInitialized()) {
@ -601,13 +611,8 @@ namespace ams::nxboot {
/* Ensure the device will see consistent data. */
hw::FlushDataCache(g_frame_buffer, FrameBufferSize);
/* Enable backlight. */
constexpr auto DisplayBrightness = 100;
if (g_lcd_vendor == 0x2050) {
EnableBacklightForVendor2050ForAula(DisplayBrightness);
} else {
EnableBacklightForGeneric(DisplayBrightness);
}
/* Show the console. */
ShowDisplay();
}
void ShowFatalError(const char *fmt, ...) {
@ -635,13 +640,8 @@ namespace ams::nxboot {
/* Ensure the device will see consistent data. */
hw::FlushDataCache(g_frame_buffer, FrameBufferSize);
/* Enable backlight. */
constexpr auto DisplayBrightness = 100;
if (g_lcd_vendor == 0x2050) {
EnableBacklightForVendor2050ForAula(DisplayBrightness);
} else {
EnableBacklightForGeneric(DisplayBrightness);
}
/* Show the console. */
ShowDisplay();
WaitForReboot();
}

View file

@ -26,4 +26,6 @@ namespace ams::nxboot {
void InitializeDisplay();
void FinalizeDisplay();
void ShowDisplay();
}

View file

@ -63,6 +63,9 @@ namespace ams::nxboot {
/* Perform secure hardware initialization. */
SecureInitialize(true);
/* Overclock the bpmp. */
clkrst::SetBpmpClockRate(fuse::GetSocType() == fuse::SocType_Mariko ? clkrst::BpmpClockRate_589MHz : clkrst::BpmpClockRate_576MHz);
/* Initialize Sdram. */
InitializeSdram();
@ -88,7 +91,12 @@ namespace ams::nxboot {
/* Read our overlay file. */
ReadFuseeSecondary();
/* Initialize display (splash screen will be visible from this point onwards). */
InitializeDisplay();
ShowDisplay();
/* TODO */
WaitForReboot();
/* TODO */
AMS_INFINITE_LOOP();