make sleep mode work
This commit is contained in:
1 parent
bd468f087d
commit
a3b8400477
7 files changed
+609
-13
No files matched your search
@@ -30,6 +30,7 @@
|
||||
#include <i2c.h>
|
||||
|
||||
#include "../board/board.hpp"
|
||||
#include "../bpmp/bpmp.hpp"
|
||||
#include "../display/aula.hpp"
|
||||
#include "../display/display_refresh_rate.hpp"
|
||||
#include "../file/config.hpp"
|
||||
@@ -40,6 +41,7 @@
|
||||
#include "../hos/process_management.hpp"
|
||||
#include "../i2c/i2cDrv.h"
|
||||
#include "../ipc/ipc_service.hpp"
|
||||
#include "../mapping/mem_map.hpp"
|
||||
#include "../soc/gm20b.hpp"
|
||||
#include "../util/lockable_mutex.h"
|
||||
#include "clock_manager.hpp"
|
||||
@@ -355,6 +357,22 @@ namespace clockManager {
|
||||
if (++tick > 10) {
|
||||
tick = 0;
|
||||
|
||||
// Restart BPMP after sleep.
|
||||
if (IsPatchedExosphere()) {
|
||||
constexpr u32 FlowCtlrPhysBase = 0x60007000;
|
||||
constexpr u32 FlowCtlrHaltCopEvents = 0x004;
|
||||
constexpr u32 HaltCopEventsModeShift = 29;
|
||||
constexpr u32 HaltCopEventsModeStop = 2;
|
||||
|
||||
u32 haltReg = SmcReadWriteRegister(FlowCtlrPhysBase + FlowCtlrHaltCopEvents, 0, 0);
|
||||
if ((haltReg >> HaltCopEventsModeShift) == HaltCopEventsModeStop) {
|
||||
Result rc = bpmp::StartBpmfwExecution();
|
||||
if (R_FAILED(rc)) {
|
||||
fileUtils::LogLine("[bpmp] restart after sleep failed: 0x%x", rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config::GetConfigValue(HocClkConfigValue_BatteryChargeCurrent)) {
|
||||
I2c_Bq24193_SetFastChargeCurrentLimit(config::GetConfigValue(HocClkConfigValue_BatteryChargeCurrent));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user