hocclk bpmp: communication
This commit is contained in:
1 parent
b20d20edff
commit
1990b1b66c
14 files changed
+189
-4
No files matched your search
@@ -20,6 +20,7 @@
|
||||
#include <switch.h>
|
||||
|
||||
#include "../board/board.hpp"
|
||||
#include "../file/config.hpp"
|
||||
#include "../file/file_utils.hpp"
|
||||
#include "../mapping/mem_map.hpp"
|
||||
#include "bpmp.hpp"
|
||||
@@ -57,9 +58,12 @@ namespace bpmp {
|
||||
|
||||
constexpr u64 FwIramPhysBase = 0x40004000;
|
||||
constexpr u32 FwStagingSize = 0x8000;
|
||||
constexpr u64 WorkRamPhysBase = FwIramPhysBase + FwStagingSize; // matches bpmpfw's WorkRamStart
|
||||
|
||||
alignas(4096) u8 s_fwStageBuf[FwStagingSize];
|
||||
|
||||
HocClkBpmpSharedInfo s_sharedInfo = {};
|
||||
|
||||
inline volatile u32 &Mmio(u64 base_va, u32 offset) {
|
||||
return *reinterpret_cast<volatile u32 *>(base_va + offset);
|
||||
}
|
||||
@@ -213,4 +217,14 @@ namespace bpmp {
|
||||
s_pscPrepared = false;
|
||||
}
|
||||
|
||||
const HocClkBpmpSharedInfo *GetSharedInfo() {
|
||||
if (!IsPatchedExosphere()) {
|
||||
s_sharedInfo = {};
|
||||
return &s_sharedInfo;
|
||||
}
|
||||
|
||||
SmcCopyFromIram(&s_sharedInfo, WorkRamPhysBase, sizeof(s_sharedInfo));
|
||||
return &s_sharedInfo;
|
||||
}
|
||||
|
||||
} // namespace bpmp
|
||||
@@ -18,9 +18,13 @@
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
|
||||
#include <hocclk/bpmp.h>
|
||||
|
||||
namespace bpmp {
|
||||
Result StartBpmfwExecution();
|
||||
|
||||
void StartSleepMonitorThread();
|
||||
void StopSleepMonitorThread();
|
||||
|
||||
const HocClkBpmpSharedInfo *GetSharedInfo();
|
||||
}
|
||||
@@ -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"
|
||||
@@ -626,6 +627,8 @@ namespace clockManager {
|
||||
bool RefreshContext() {
|
||||
bool hasChanged = false;
|
||||
|
||||
gContext.bpmpInfo = *bpmp::GetSharedInfo();
|
||||
|
||||
std::uint32_t mode = 0;
|
||||
Result rc = apmExtGetCurrentPerformanceConfiguration(&mode);
|
||||
ASSERT_RESULT_OK(rc, "apmExtGetCurrentPerformanceConfiguration");
|
||||
|
||||
Reference in new issue
Block a user