hocclk: add CPU LUT and add copyright
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
namespace board {
|
namespace board {
|
||||||
|
|
||||||
GpuVoltData voltData = {};
|
GpuVoltData voltData = {};
|
||||||
|
u32 cpuVoltTable[32] = {}; // 32LUT
|
||||||
u64 cldvfs;
|
u64 cldvfs;
|
||||||
CpuDfllData cachedTune;
|
CpuDfllData cachedTune;
|
||||||
|
|
||||||
@@ -373,14 +374,25 @@ namespace board {
|
|||||||
|
|
||||||
/* Assuming mariko. */
|
/* Assuming mariko. */
|
||||||
const u32 vmax = 800;
|
const u32 vmax = 800;
|
||||||
constexpr u32 VoltageTableOffset = 312;
|
constexpr u32 GpuVoltageTableOffset = 312;
|
||||||
if (!std::memcmp(&buffer[index + VoltageTableOffset], &vmax, sizeof(vmax))) {
|
if (!std::memcmp(&buffer[index + GpuVoltageTableOffset], &vmax, sizeof(vmax))) {
|
||||||
std::memcpy(voltData.voltTable, &buffer[index + VoltageTableOffset], sizeof(voltData.voltTable));
|
std::memcpy(voltData.voltTable, &buffer[index + GpuVoltageTableOffset], sizeof(voltData.voltTable));
|
||||||
voltData.voltTableAddress = base + memoryInfo.addr + VoltageTableOffset + index;
|
voltData.voltTableAddress = base + memoryInfo.addr + GpuVoltageTableOffset + index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr u32 CpuVoltageTableOffset = 0xB8;
|
||||||
|
std::memcpy(cpuVoltTable, &buffer[index + CpuVoltageTableOffset], sizeof(cpuVoltTable)); // TODO: verify the CPU table
|
||||||
|
|
||||||
svcCloseHandle(handle);
|
svcCloseHandle(handle);
|
||||||
handle = INVALID_HANDLE;
|
handle = INVALID_HANDLE;
|
||||||
|
|
||||||
|
for(int i = 0; i < (int)std::size(cpuVoltTable); ++i) {
|
||||||
|
fileUtils::LogLine("[dvfs] cpu volt %d: %u mV", i, cpuVoltTable[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < (int)std::size(voltData.voltTable); ++i) {
|
||||||
|
fileUtils::LogLine("[dvfs] gpu volt %d: %u mV", i, voltData.voltTable[i]);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ namespace board {
|
|||||||
u64 voltTableAddress;
|
u64 voltTableAddress;
|
||||||
u32 ramVmin;
|
u32 ramVmin;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* TODO: Find out what component this actually targets. */
|
|
||||||
struct UnkRegulator {
|
struct UnkRegulator {
|
||||||
u32 voltageMin;
|
u32 voltageMin;
|
||||||
u32 voltageStep;
|
u32 voltageStep;
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Souldbminer, Lightos_ and Horizon OC Contributors
|
||||||
|
*
|
||||||
|
* Copyright (c) CtCaer
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "bq24193.hpp"
|
#include "bq24193.hpp"
|
||||||
|
|
||||||
namespace bq24193 {
|
namespace bq24193 {
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Souldbminer, Lightos_ and Horizon OC Contributors
|
||||||
|
*
|
||||||
|
* Copyright (c) CtCaer
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "board.hpp"
|
#include "board.hpp"
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user