Files
Horizon-OC/Source/hoc-clk/sysmodule/src/board/board_volt.hpp
2026-04-23 18:50:51 -04:00

54 lines
1.5 KiB
C++

/*
* Copyright (c) Souldbminer, Lightos_ and Horizon OC Contributors
*
* 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/>.
*
*/
#pragma once
#include <switch.h>
#include <hocclk.h>
namespace board {
struct GpuVoltData {
u32 voltTable[6][32] = {};
u64 voltTableAddress;
u32 ramVmin;
};
struct UnkRegulator {
u32 voltageMin;
u32 voltageStep;
u32 voltageMax;
};
struct CpuDfllData {
u32 tune0Low;
u32 tune0High;
u32 tune1Low;
u32 tune1High;
// u32 tune_high_min_millivolts;
// u32 tune_high_margin_millivolts;
// u64 dvco_calibration_max;
};
void SetDfllTunings(u32 levelLow, u32 levelHigh, u32 tbreakPoint);
void CacheDfllData();
u32 CalculateTbreak(u32 table);
u32 GetVoltage(HocClkVoltage voltage);
void CacheGpuVoltTable();
void PcvHijackGpuVolts(u32 vmin);
u32 GetMinimumGpuVmin(u32 freqMhz, u32 bracket);
}