rewrite: add Regulator type to ram oc dvfs
This commit is contained in:
@@ -75,7 +75,13 @@ namespace board {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CacheGpuVoltTable() {
|
void CacheGpuVoltTable() {
|
||||||
const u32 voltagePattern[] = { 600000, 12500, 1400000, };
|
|
||||||
|
|
||||||
|
UnkRegulator reg = {
|
||||||
|
.voltageMinUV = 600000,
|
||||||
|
.voltageStep = 12500,
|
||||||
|
.voltageMax = 1400000,
|
||||||
|
};
|
||||||
|
|
||||||
Handle handle = GetPcvHandle();
|
Handle handle = GetPcvHandle();
|
||||||
if (handle == INVALID_HANDLE) {
|
if (handle == INVALID_HANDLE) {
|
||||||
@@ -115,19 +121,19 @@ namespace board {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 *resultPattern = static_cast<u8 *>(memmem_impl(buffer, sizeof(buffer), voltagePattern, sizeof(voltagePattern)));
|
u8 *resultFindReg = static_cast<u8 *>(memmem_impl(buffer, sizeof(buffer), ®, sizeof(reg)));
|
||||||
u32 index = resultPattern - buffer;
|
u32 index = resultFindReg - buffer;
|
||||||
|
|
||||||
if (!resultPattern) {
|
if (!resultFindReg) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assuming mariko. */
|
/* Assuming mariko. */
|
||||||
const u32 vmax = 800;
|
const u32 vmax = 800;
|
||||||
constexpr u32 DvfsTableOffset = 312;
|
constexpr u32 VoltageTableOffset = 312;
|
||||||
if (!std::memcmp(&buffer[index + DvfsTableOffset], &vmax, sizeof(vmax))) {
|
if (!std::memcmp(&buffer[index + VoltageTableOffset], &vmax, sizeof(vmax))) {
|
||||||
std::memcpy(voltData.voltTable, &buffer[index + DvfsTableOffset], sizeof(dvfsTable));
|
std::memcpy(voltData.voltTable, &buffer[index + VoltageTableOffset], sizeof(voltData.voltTable));
|
||||||
voltData.voltTableAddress = base + memoryInfo.addr + DvfsTableOffset + index;
|
voltData.voltTableAddress = base + memoryInfo.addr + VoltageTableOffset + index;
|
||||||
}
|
}
|
||||||
|
|
||||||
svcCloseHandle(handle);
|
svcCloseHandle(handle);
|
||||||
|
|||||||
@@ -35,6 +35,13 @@ namespace board {
|
|||||||
u32 ramVmin;
|
u32 ramVmin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* TODO: Find out what component this actually targets. */
|
||||||
|
struct UnkRegulator {
|
||||||
|
u32 voltageMinUV;
|
||||||
|
u32 voltageStep;
|
||||||
|
u32 voltageMax;
|
||||||
|
}
|
||||||
|
|
||||||
void CacheGpuVoltTable();
|
void CacheGpuVoltTable();
|
||||||
void PcvHijackGpuVolts(u32 vmin);
|
void PcvHijackGpuVolts(u32 vmin);
|
||||||
u32 GetMinimumVmin(u32 freqMhz, u32 bracket);
|
u32 GetMinimumVmin(u32 freqMhz, u32 bracket);
|
||||||
|
|||||||
Reference in New Issue
Block a user