Merge upstream Horizon-OC main (749fd385)
Some checks failed
Build Horizon OC Zeus / build (push) Failing after 6s
Some checks failed
Build Horizon OC Zeus / build (push) Failing after 6s
Includes 2.3.1 changes: kip migration, erista GPU workaround, safety fixes, and Mariko GPU boot voltage patch. Resolve dist binary conflicts with upstream build artifacts.
This commit is contained in:
@@ -76,6 +76,7 @@ typedef enum {
|
||||
HocClkConfigValue_MarikoMiddleFreqs,
|
||||
|
||||
KipConfigValue_custRev,
|
||||
KipConfigValue_KipVersion,
|
||||
// KipConfigValue_mtcConf,
|
||||
KipConfigValue_hpMode,
|
||||
|
||||
@@ -138,6 +139,7 @@ typedef enum {
|
||||
|
||||
KipConfigValue_marikoGpuUV,
|
||||
KipConfigValue_marikoGpuVmin,
|
||||
KipConfigValue_marikoGpuBootVolt,
|
||||
KipConfigValue_marikoGpuVmax,
|
||||
|
||||
KipConfigValue_commonGpuVoltOffset,
|
||||
@@ -295,6 +297,8 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
||||
// KIP config values
|
||||
case KipConfigValue_custRev:
|
||||
return pretty ? "Custom Revision" : "kip_cust_rev";
|
||||
case KipConfigValue_KipVersion:
|
||||
return pretty ? "KIP Version" : "kip_version";
|
||||
// case KipConfigValue_mtcConf:
|
||||
// return pretty ? "MTC Config" : "kip_mtc_conf";
|
||||
case KipConfigValue_hpMode:
|
||||
@@ -413,6 +417,8 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
||||
return pretty ? "Mariko GPU Undervolt" : "mariko_gpu_uv";
|
||||
case KipConfigValue_marikoGpuVmin:
|
||||
return pretty ? "Mariko GPU Vmin" : "mariko_gpu_vmin";
|
||||
case KipConfigValue_marikoGpuBootVolt:
|
||||
return pretty ? "Mariko GPU Boot Voltage" : "mariko_gpu_boot_volt";
|
||||
case KipConfigValue_marikoGpuVmax:
|
||||
return pretty ? "Mariko GPU Vmax" : "mariko_gpu_vmax";
|
||||
|
||||
@@ -566,7 +572,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
||||
case HocClkConfigValue_GPUSchedulingMethod:
|
||||
case HocClkConfigValue_MarikoMiddleFreqs:
|
||||
return (input & 0x1) == input;
|
||||
|
||||
case KipConfigValue_KipVersion:
|
||||
case KipConfigValue_custRev:
|
||||
// case KipConfigValue_mtcConf:
|
||||
case KipConfigValue_hpMode:
|
||||
@@ -616,6 +622,7 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
||||
case KipConfigValue_eristaGpuVmin:
|
||||
case KipConfigValue_marikoGpuUV:
|
||||
case KipConfigValue_marikoGpuVmin:
|
||||
case KipConfigValue_marikoGpuBootVolt:
|
||||
case KipConfigValue_marikoGpuVmax:
|
||||
case KipConfigValue_commonGpuVoltOffset:
|
||||
case KipConfigValue_gpuSpeedo:
|
||||
@@ -690,6 +697,6 @@ static inline uint64_t hocclkValidConfigValue(HocClkConfigValue val, uint64_t in
|
||||
return ((input >= 800) && (input <= 1325));
|
||||
|
||||
default:
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ include ${TOPDIR}/lib/libultrahand/ultrahand.mk
|
||||
# version control constants
|
||||
#---------------------------------------------------------------------------------
|
||||
#TARGET_VERSION := $(shell git describe --dirty --always --tags)
|
||||
APP_VERSION := 2.3.1 # ensure to set KIP_VERSION and CUST_REV in sysmodule Makefile when updating this
|
||||
APP_VERSION := 2.4.0 # ensure to set KIP_VERSION and CUST_REV in sysmodule Makefile when updating this
|
||||
TARGET_VERSION := $(APP_VERSION)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,7 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
{
|
||||
case HocClkConfigValue_PollingIntervalMs:
|
||||
return {
|
||||
"The interval (in miliseconds) where clocks are applied, tempratures and voltages are polled and logs are written (if enabled).",
|
||||
"The interval (in milliseconds) where clocks are applied, temperatures and voltages are polled and logs are written (if enabled).",
|
||||
"Higher values may cause more delay between changing a setting and it taking effect, and lower values may increase sysmodule memory usage",
|
||||
"Default: 300ms"
|
||||
};
|
||||
@@ -35,6 +35,7 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
"Options:",
|
||||
"- MHz: Megahertz (e.g. 1600 MHz)",
|
||||
"- MT/s: MegaTransfers per second (e.g. 3200 MT/s)",
|
||||
"- MHz and MT/s: Display in both MHz and MT/s",
|
||||
"Default: MHz"
|
||||
};
|
||||
|
||||
@@ -109,8 +110,10 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
|
||||
case HocClkConfigValue_OverwriteRefreshRate:
|
||||
return {
|
||||
"Conrols the avaiability of display refresh rate features.",
|
||||
"When enabled, allows changing the display refresh rate and using display refresh rate related features."
|
||||
"Controls the availability of display refresh rate features.",
|
||||
"When enabled, allows changing the display refresh rate and using display refresh rate related features.",
|
||||
"This feature conflicts with FPSLocker's feature that does the same thing.",
|
||||
"Default: OFF"
|
||||
};
|
||||
|
||||
case HocClkConfigValue_MaxDisplayClockH:
|
||||
@@ -193,32 +196,6 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
" - Speedo 1487-1598: Bracket 0",
|
||||
" - Speedo 1598-1709: Bracket 1",
|
||||
" - Speedo 1709-1820: Bracket 2",
|
||||
"SOC Volt Table:",
|
||||
" - 1331/1600MHz tables are not modified",
|
||||
" - 1633-1866MHz:",
|
||||
" - Bracket 0: 700mV",
|
||||
" - Bracket 1: 675mV",
|
||||
" - Bracket 2: 650mV",
|
||||
" - 1900-2133MHz:",
|
||||
" - Bracket 0: 725mV",
|
||||
" - Bracket 1: 700mV",
|
||||
" - Bracket 2: 675mV",
|
||||
" - 2166-2400MHz:",
|
||||
" - Bracket 0: 750mV",
|
||||
" - Bracket 1: 725mV",
|
||||
" - Bracket 2: 700mV",
|
||||
" - 2433-2666MHz:",
|
||||
" - Bracket 0: 850mV",
|
||||
" - Bracket 1: 825mV",
|
||||
" - Bracket 2: 800mV",
|
||||
" - 2700-2933MHz:",
|
||||
" - Bracket 0: 950mV",
|
||||
" - Bracket 1: 925mV",
|
||||
" - Bracket 2: 900mV",
|
||||
" - 2966-3200MHz:",
|
||||
" - Bracket 0: 1050mV",
|
||||
" - Bracket 1: 1025mV",
|
||||
" - Bracket 2: 1000mV",
|
||||
"Default: 0"
|
||||
};
|
||||
|
||||
@@ -261,7 +238,7 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
" - 1600, 1866, 1996, 2133, 2400, 2666, 2933 and 3200 MHz are used",
|
||||
"The RAM max clock will always be available regardless of the step mode, but the intermediate frequencies will be limited by the selected step mode.",
|
||||
"This setting does not affect performance and the option you choose mostly is based on your personal taste",
|
||||
"33 MHz step mode is not possible due to certian limitations of Horizon OS",
|
||||
"33 MHz step mode is not possible due to certain limitations of Horizon OS",
|
||||
"Default: 66 MHz",
|
||||
};
|
||||
|
||||
@@ -356,13 +333,13 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
|
||||
case KipConfigValue_t6_tRTW_fine_tune:
|
||||
return {
|
||||
"Finetunes the raw calculation of t6",
|
||||
"Fine-tunes the raw calculation of t6",
|
||||
"Default: 0"
|
||||
};
|
||||
|
||||
case KipConfigValue_t7_tWTR_fine_tune:
|
||||
return {
|
||||
"Finetunes the raw calculation of t6",
|
||||
"Fine-tunes the raw calculation of t7",
|
||||
"Default: 0"
|
||||
};
|
||||
|
||||
@@ -379,11 +356,11 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
"Example:",
|
||||
"If 1333 is set to 2000 MHz, 1600 set to 2500 MHz, 1866 set to 2766 MHz and 2133 set to 2933 MHz:",
|
||||
"Frequencies below 2000 MHz use 1333, 2033-2500 MHz use 1600, 2533-2766 MHz use 1866 and 2800-2933 MHz use 2133. ",
|
||||
"Either of these can be ommited and it will work (say you set 1333 to -, then <2000 MHz will use 1600 latency)",
|
||||
"If all of these parameters are ommited the latency will automatically be calculated as follows:",
|
||||
"Either of these can be omitted and it will work (say you set 1333 to -, then <2000 MHz will use 1600 latency)",
|
||||
"If all of these parameters are omitted the latency will automatically be calculated as follows:",
|
||||
"1633-1866 MHz - 1866 WRL",
|
||||
"1900+ MHz - 2133 WRL",
|
||||
"These properties apply for both write and read latencies, and you can mix-and-match the brackets if nessesary",
|
||||
"These properties apply for both write and read latencies, and you can mix-and-match the brackets if necessary",
|
||||
"Default: -"
|
||||
};
|
||||
|
||||
@@ -499,7 +476,7 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
"Options:",
|
||||
" - HiOPT: L4T Custom HiOPT table",
|
||||
" - HiOPT - 15mV: L4T Custom HiOPT table with a 15mV offset",
|
||||
" - High UV: The highest undervolt table, reccomended",
|
||||
" - High UV: The highest undervolt table, recommended",
|
||||
"Default: HiOPT"
|
||||
};
|
||||
|
||||
@@ -538,14 +515,14 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
"Options:",
|
||||
" - HiOPT: L4T Custom HiOPT table",
|
||||
" - HiOPT - 15mV: L4T Custom HiOPT table with a 15mV offset",
|
||||
" - High UV: The highest undervolt table, reccomended",
|
||||
" - High UV: The highest undervolt table, recommended",
|
||||
"Default: HiOPT"
|
||||
};
|
||||
|
||||
case KipConfigValue_eristaGpuVmin:
|
||||
return {
|
||||
"Minimum GPU voltage",
|
||||
"Default: 810 mV (812mV as erista is stepped my 6.5mV instead of 5mV)"
|
||||
"Default: 810 mV (812mV as erista is stepped by 6.5mV instead of 5mV)"
|
||||
};
|
||||
|
||||
case KipConfigValue_commonGpuVoltOffset:
|
||||
@@ -563,7 +540,12 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
||||
"- Enabled: Enables GPU scheduling, 96.5% GPU max load",
|
||||
"Default: Do not override"
|
||||
};
|
||||
|
||||
case KipConfigValue_marikoGpuBootVolt:
|
||||
return {
|
||||
"The voltage supplied to the GPU during boot and when the temperature is below 20°C (in mV).",
|
||||
"Warning: Changing this value may cause instability.",
|
||||
"Default: 800mV"
|
||||
};
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -922,6 +922,14 @@ protected:
|
||||
);
|
||||
}
|
||||
if(!IsAula()) {
|
||||
tsl::elm::CustomDrawer* warningTextDV = new tsl::elm::CustomDrawer([](tsl::gfx::Renderer *renderer, s32 x, s32 y, s32 w, s32 h) {
|
||||
renderer->drawString("\uE150 Adjust the display voltage", false, x + 20, y + 30, 18, tsl::style::color::ColorText);
|
||||
renderer->drawString("with caution to avoid damage", false, x + 20, y + 50, 18, tsl::style::color::ColorText);
|
||||
renderer->drawString("to your display panel! ", false, x + 20, y + 70, 18, tsl::style::color::ColorText);
|
||||
renderer->drawString("Proceed at your own risk!", false, x + 20, y + 90, 18, tsl::style::color::ColorText);
|
||||
});
|
||||
warningTextDV->setBoundaries(0, 0, tsl::cfg::FramebufferWidth, 110);
|
||||
this->listElement->addItem(warningTextDV);
|
||||
addConfigButton(
|
||||
HocClkConfigValue_DisplayVoltage,
|
||||
"Display Voltage",
|
||||
@@ -1059,7 +1067,7 @@ protected:
|
||||
{1250000, "Unsafe Max"},
|
||||
};
|
||||
|
||||
ValueThresholds vdd2Thresholds(IsMariko() ? 1212500 : 1237500, 1250000);
|
||||
ValueThresholds vdd2Thresholds(IsMariko() ? 1212500 : 1237500, IsMariko() ? 1250000 : 1275000);
|
||||
addConfigButton(
|
||||
KipConfigValue_commonEmcMemVolt,
|
||||
"RAM VDD2 Voltage",
|
||||
@@ -1073,12 +1081,13 @@ protected:
|
||||
);
|
||||
|
||||
if(IsMariko()) {
|
||||
ValueThresholds vddqThresholds(675000, 725000);
|
||||
addConfigButton(
|
||||
KipConfigValue_marikoEmcVddqVolt,
|
||||
"RAM VDDQ Voltage",
|
||||
ValueRange(400000, 700000, 5000, "mV", 1000),
|
||||
ValueRange(400000, 750000, 5000, "mV", 1000),
|
||||
"RAM VDDQ Voltage",
|
||||
&thresholdsDisabled,
|
||||
&vddqThresholds,
|
||||
{},
|
||||
{},
|
||||
false,
|
||||
@@ -1293,10 +1302,12 @@ protected:
|
||||
|
||||
ValueThresholds thresholdsDisabled(0, 0);
|
||||
this->listElement->addItem(new tsl::elm::CategoryHeader("Advanced"));
|
||||
addConfigButton(KipConfigValue_timingEmcTbreak, "RAM-Timing tBreak", ValueRange(0, 1, 1, "", 1), "tBreak", &thresholdsDisabled, {}, timingTbreakFreqs, false, true);
|
||||
addConfigTrackbar(KipConfigValue_low_t6_tRTW, "Low t6 tRTW", ValueRange(0, 9, 1));
|
||||
addConfigTrackbar(KipConfigValue_low_t7_tWTR, "Low t7 tWTR", ValueRange(0, 9, 1));
|
||||
addConfigTrackbar(KipConfigValue_t2_tRP_cap, "1333WL t2 RP Cap", ValueRange(0, 8, 1));
|
||||
if(IsMariko()) {
|
||||
addConfigButton(KipConfigValue_timingEmcTbreak, "RAM-Timing tBreak", ValueRange(0, 1, 1, "", 1), "tBreak", &thresholdsDisabled, {}, timingTbreakFreqs, false, true);
|
||||
addConfigTrackbar(KipConfigValue_low_t6_tRTW, "Low t6 tRTW", ValueRange(0, 9, 1));
|
||||
addConfigTrackbar(KipConfigValue_low_t7_tWTR, "Low t7 tWTR", ValueRange(0, 9, 1));
|
||||
addConfigTrackbar(KipConfigValue_t2_tRP_cap, "1333WL t2 RP Cap", ValueRange(0, 8, 1));
|
||||
}
|
||||
addMappedConfigTrackbar(KipConfigValue_t6_tRTW_fine_tune, "t6 tRTW Fine Tune",
|
||||
{0xFFFFFFFEu, 0xFFFFFFFFu, 0u, 1u, 2u},
|
||||
{"-2", "-1", " 0", "+1", "+2"});
|
||||
@@ -1931,6 +1942,7 @@ protected:
|
||||
// return false;
|
||||
// });
|
||||
|
||||
addConfigButton(KipConfigValue_marikoGpuBootVolt, "GPU Boot Volt", ValueRange(700, 800, 5, "mV", 1), "GPU Boot Voltage", &thresholdsDisabled, {}, {}, false, true);
|
||||
addConfigButton(KipConfigValue_marikoGpuVmin, "GPU VMIN", ValueRange(0, 0, 0, "0", 1), "GPU VMIN", &thresholdsDisabled, {}, mGpuVoltsVmin, false, true);
|
||||
ValueThresholds MgpuVmaxThresholds(805, 850);
|
||||
addConfigButton(
|
||||
|
||||
@@ -28,9 +28,9 @@ INCLUDES := ../common/include src/hos src/soc src/i2c src/util src/pwr src/ipc
|
||||
EXEFS_SRC := exefs_src
|
||||
LIBNAMES := minIni
|
||||
# major minor patch
|
||||
TARGET_VERSION := 2.3.1
|
||||
KIP_VERSION := 231
|
||||
CUST_REV := 3
|
||||
TARGET_VERSION := 2.4.0
|
||||
KIP_VERSION := 240
|
||||
CUST_REV := 4
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "../tsensor/aotag.hpp"
|
||||
#include "../hos/integrations.hpp"
|
||||
#include "../file/file_utils.hpp"
|
||||
#include "../hos/rgltr.h"
|
||||
namespace board {
|
||||
|
||||
u64 clkVirtAddr, dsiVirtAddr, apbVirtAddr, fuseVirtAddr;
|
||||
@@ -137,6 +138,9 @@ namespace board {
|
||||
rc = pmdmntInitialize();
|
||||
ASSERT_RESULT_OK(rc, "pmdmntInitialize");
|
||||
|
||||
rc = rgltrInitialize();
|
||||
ASSERT_RESULT_OK(rc, "rgltrInitialize");
|
||||
|
||||
rc = QueryMemoryMapping(&clkVirtAddr, 0x60006000, 0x1000);
|
||||
ASSERT_RESULT_OK(rc, "QueryMemoryMapping (clk)");
|
||||
|
||||
@@ -201,7 +205,7 @@ namespace board {
|
||||
|
||||
apmExtExit();
|
||||
psmExit();
|
||||
|
||||
rgltrExit();
|
||||
if (HOSSVC_HAS_TC) {
|
||||
tcExit();
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "../soc/pllmb.hpp"
|
||||
#include "../file/config.hpp"
|
||||
#include "../soc/gm20b.hpp"
|
||||
#include "../file/config.hpp"
|
||||
namespace board {
|
||||
#define MIDDLE_FREQ_TABLE_START_POINT 1228800000
|
||||
static u32 currentInjectedHz = 0;
|
||||
@@ -75,6 +76,14 @@ namespace board {
|
||||
ASSERT_RESULT_OK(pcvSetClockRate(moduleID, hz), "pcvSetClockRate");
|
||||
}
|
||||
|
||||
void HandleCpuUv()
|
||||
{
|
||||
if (board::GetSocType() == HocClkSocType_Erista)
|
||||
board::SetDfllTunings(config::GetConfigValue(KipConfigValue_eristaCpuUV), 0, 1581000000); // Erista tbreak is always 1581MHz
|
||||
else
|
||||
board::SetDfllTunings(config::GetConfigValue(KipConfigValue_marikoCpuUVLow), config::GetConfigValue(KipConfigValue_marikoCpuUVHigh), board::CalculateTbreak(config::GetConfigValue(KipConfigValue_tableConf)));
|
||||
}
|
||||
|
||||
void SetHz(HocClkModule module, u32 hz) {
|
||||
Result rc = 0;
|
||||
bool usesGovenor = module > HocClkModule_MEM;
|
||||
@@ -116,7 +125,9 @@ namespace board {
|
||||
PcvSetHz(GetPcvModule(module), pcvHz);
|
||||
}
|
||||
}
|
||||
|
||||
if(config::GetConfigValue(HocClkConfigValue_LiveCpuUv) && module == HocClkModule_CPU) {
|
||||
HandleCpuUv();
|
||||
}
|
||||
if (useGm20b) {
|
||||
gm20b::setClock(hz / 1000);
|
||||
currentInjectedHz = hz;
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace board {
|
||||
u32 GetRealHz(HocClkModule module);
|
||||
void GetFreqList(HocClkModule module, u32 *outList, u32 maxCount, u32 *outCount);
|
||||
u32 GetHighestDockedDisplayRate();
|
||||
|
||||
void HandleCpuUv();
|
||||
|
||||
void ResetToStock();
|
||||
void ResetToStockDisplay();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "board_volt.hpp"
|
||||
#include "../file/file_utils.hpp"
|
||||
#include "../i2c/i2cDrv.h"
|
||||
#include "../hos/rgltr.h"
|
||||
namespace board {
|
||||
|
||||
GpuVoltData voltData = {};
|
||||
@@ -49,7 +50,8 @@ namespace board {
|
||||
u32 tune1_high;
|
||||
};
|
||||
|
||||
EristaCpuUvEntry eristaCpuUvTable[5] = {
|
||||
EristaCpuUvEntry eristaCpuUvTable[6] = {
|
||||
{0xFFEAD0FF, 0x0},
|
||||
{0xffff, 0x27007ff},
|
||||
{0xefff, 0x27407ff},
|
||||
{0xdfff, 0x27807ff},
|
||||
@@ -134,19 +136,16 @@ namespace board {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (GetHz(HocClkModule_CPU) < tbreakPoint || (!levelLow)) { // account for tbreak
|
||||
*tune0_ptr = cachedTune.tune0Low; // I think each erista has a different tune0/tune1?
|
||||
*tune1_ptr = cachedTune.tune1Low;
|
||||
return;
|
||||
} else {
|
||||
if (levelLow) {
|
||||
*tune0_ptr = eristaCpuUvTable[levelLow-1].tune0;
|
||||
*tune1_ptr = eristaCpuUvTable[levelLow-1].tune1;
|
||||
} else {
|
||||
*tune0_ptr = 0x0;
|
||||
*tune1_ptr = 0x0;
|
||||
}
|
||||
}
|
||||
// if (GetHz(HocClkModule_CPU) < tbreakPoint || (!levelLow)) { // account for tbreak
|
||||
// *tune0_ptr = cachedTune.tune0Low; // I think each erista has a different tune0/tune1?
|
||||
// *tune1_ptr = cachedTune.tune1Low;
|
||||
// return;
|
||||
// } else {
|
||||
// if (levelLow) {
|
||||
*tune0_ptr = eristaCpuUvTable[levelLow].tune0;
|
||||
*tune1_ptr = eristaCpuUvTable[levelLow].tune1;
|
||||
// } else {
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,10 +212,13 @@ namespace board {
|
||||
PcvPowerDomainId_Max77812_Dram = 0x3A000005, // vddq
|
||||
} PowerDomainId;
|
||||
*/
|
||||
/*
|
||||
Note: I think Nintendo's I2C driver (or my driver, but it looks correct to me)
|
||||
*/
|
||||
u32 GetVoltage(HocClkVoltage voltage) {
|
||||
u32 out = 0;
|
||||
BatteryChargeInfo info;
|
||||
|
||||
RgltrSession s;
|
||||
switch (voltage) {
|
||||
case HocClkVoltage_SOC:
|
||||
out = I2c_BuckConverter_GetUvOut(&I2c_SOC);
|
||||
@@ -228,14 +230,18 @@ namespace board {
|
||||
if(GetSocType() == HocClkSocType_Mariko) {
|
||||
out = I2c_BuckConverter_GetUvOut(&I2c_Mariko_CPU);
|
||||
} else {
|
||||
out = I2c_BuckConverter_GetUvOut(&I2c_Erista_CPU);
|
||||
rgltrOpenSession(&s, PcvPowerDomainId_Max77621_Cpu);
|
||||
rgltrGetVoltage(&s, &out);
|
||||
rgltrCloseSession(&s);
|
||||
}
|
||||
break;
|
||||
case HocClkVoltage_GPU:
|
||||
if(GetSocType() == HocClkSocType_Mariko) {
|
||||
out = I2c_BuckConverter_GetUvOut(&I2c_Mariko_GPU);
|
||||
} else {
|
||||
out = I2c_BuckConverter_GetUvOut(&I2c_Erista_GPU);
|
||||
rgltrOpenSession(&s, PcvPowerDomainId_Max77621_Gpu);
|
||||
rgltrGetVoltage(&s, &out);
|
||||
rgltrCloseSession(&s);
|
||||
}
|
||||
break;
|
||||
case HocClkVoltage_EMCVDDQ:
|
||||
@@ -453,5 +459,4 @@ namespace board {
|
||||
|
||||
return baseVolt;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
namespace kip {
|
||||
|
||||
bool kipAvailable = false;
|
||||
|
||||
void SetKipData()
|
||||
{
|
||||
// TODO: figure out if this REALLY causes issues (i doubt it)
|
||||
@@ -76,7 +75,7 @@ namespace kip {
|
||||
CUST_WRITE_FIELD_BATCH(&table, eristaEmcMaxClock2, config::GetConfigValue(KipConfigValue_eristaEmcMaxClock2));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoEmcMaxClock, config::GetConfigValue(KipConfigValue_marikoEmcMaxClock));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoEmcVddqVolt, config::GetConfigValue(KipConfigValue_marikoEmcVddqVolt));
|
||||
CUST_WRITE_FIELD_BATCH(&table, emcDvbShift, config::GetConfigValue(KipConfigValue_emcDvbShift) > 8 && config::GetConfigValue(KipConfigValue_emcDvbShift) <= 16 ? 8 : config::GetConfigValue(KipConfigValue_emcDvbShift)); // 2.2.0 -> 2.3.0 compat
|
||||
CUST_WRITE_FIELD_BATCH(&table, emcDvbShift, config::GetConfigValue(KipConfigValue_emcDvbShift));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoSocVmax, config::GetConfigValue(KipConfigValue_marikoSocVmax));
|
||||
|
||||
CUST_WRITE_FIELD_BATCH(&table, t1_tRCD, config::GetConfigValue(KipConfigValue_t1_tRCD));
|
||||
@@ -127,6 +126,7 @@ namespace kip {
|
||||
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoGpuUV, config::GetConfigValue(KipConfigValue_marikoGpuUV));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoGpuVmin, config::GetConfigValue(KipConfigValue_marikoGpuVmin));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoGpuBootVolt, config::GetConfigValue(KipConfigValue_marikoGpuBootVolt));
|
||||
CUST_WRITE_FIELD_BATCH(&table, marikoGpuVmax, config::GetConfigValue(KipConfigValue_marikoGpuVmax));
|
||||
|
||||
CUST_WRITE_FIELD_BATCH(&table, commonGpuVoltOffset, config::GetConfigValue(KipConfigValue_commonGpuVoltOffset));
|
||||
@@ -196,6 +196,7 @@ namespace kip {
|
||||
// }
|
||||
|
||||
if ((u64)crc32::checksum_file("sdmc:/atmosphere/kips/hoc.kip") != config::GetConfigValue(KipCrc32) && !config::GetConfigValue(HocClkConfigValue_IsFirstLoad)) {
|
||||
MigrateKipData(cust_get_cust_rev(&table), cust_get_kip_version(&table));
|
||||
SetKipData();
|
||||
notification::writeNotification("Horizon OC\nKIP wurde aktualisiert\nBitte Konsole neu starten");
|
||||
return;
|
||||
@@ -225,6 +226,7 @@ namespace kip {
|
||||
|
||||
clockManager::gContext.kipVersion = kipVersion;
|
||||
configValues.values[KipConfigValue_custRev] = cust_get_cust_rev(&table);
|
||||
configValues.values[KipConfigValue_KipVersion] = cust_get_kip_version(&table); // Run this after the check so we can do migration process
|
||||
configValues.values[KipConfigValue_hpMode] = cust_get_hp_mode(&table);
|
||||
|
||||
configValues.values[KipConfigValue_commonEmcMemVolt] = cust_get_common_emc_volt(&table);
|
||||
@@ -233,7 +235,7 @@ namespace kip {
|
||||
configValues.values[KipConfigValue_eristaEmcMaxClock2] = cust_get_erista_emc_max2(&table);
|
||||
configValues.values[KipConfigValue_marikoEmcMaxClock] = cust_get_mariko_emc_max(&table);
|
||||
configValues.values[KipConfigValue_marikoEmcVddqVolt] = cust_get_mariko_emc_vddq(&table);
|
||||
configValues.values[KipConfigValue_emcDvbShift] = cust_get_emc_dvb_shift(&table) > 8 && cust_get_emc_dvb_shift(&table) <= 16 ? 8 : cust_get_emc_dvb_shift(&table); // 2.2.0 -> 2.3.0 compat
|
||||
configValues.values[KipConfigValue_emcDvbShift] = cust_get_emc_dvb_shift(&table);
|
||||
configValues.values[KipConfigValue_marikoSocVmax] = cust_get_marikoSocVmax(&table);
|
||||
|
||||
configValues.values[KipConfigValue_t1_tRCD] = cust_get_tRCD(&table);
|
||||
@@ -283,6 +285,7 @@ namespace kip {
|
||||
configValues.values[KipConfigValue_eristaGpuVmin] = cust_get_erista_gpu_vmin(&table);
|
||||
configValues.values[KipConfigValue_marikoGpuUV] = cust_get_mariko_gpu_uv(&table);
|
||||
configValues.values[KipConfigValue_marikoGpuVmin] = cust_get_mariko_gpu_vmin(&table);
|
||||
configValues.values[KipConfigValue_marikoGpuBootVolt] = cust_get_mariko_gpu_boot_volt(&table);
|
||||
configValues.values[KipConfigValue_marikoGpuVmax] = cust_get_mariko_gpu_vmax(&table);
|
||||
configValues.values[KipConfigValue_commonGpuVoltOffset] = cust_get_common_gpu_offset(&table);
|
||||
configValues.values[KipConfigValue_gpuSpeedo] = board::GetFuseData()->gpuSpeedo; // cust_get_gpu_speedo(&table);
|
||||
@@ -313,5 +316,17 @@ namespace kip {
|
||||
notification::writeNotification("Horizon OC\nKonfigurationspuffer stimmt nicht überein");
|
||||
}
|
||||
}
|
||||
|
||||
void MigrateKipData(u32 custRev, u32 version) {
|
||||
HocClkConfigValueList configValues;
|
||||
config::GetConfigValues(&configValues);
|
||||
u32 previousVersion = configValues.values[KipConfigValue_KipVersion];
|
||||
if(previousVersion < 240 && version >= 240) {
|
||||
// <2.4.0 -> 2.4.0 migration: add marikoGpuBootVolt with default value of 800mV
|
||||
configValues.values[KipConfigValue_marikoGpuBootVolt] = 800;
|
||||
}
|
||||
config::SetConfigValues(&configValues, true);
|
||||
// This function cannot do anything at the moment. The capabilities will be expanded in the next release
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include <notification.h>
|
||||
#include <crc32.h>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
namespace kip {
|
||||
extern bool kipAvailable;
|
||||
|
||||
@@ -90,6 +88,7 @@ namespace kip {
|
||||
|
||||
u32 marikoGpuUV;
|
||||
u32 marikoGpuVmin;
|
||||
u32 marikoGpuBootVolt;
|
||||
u32 marikoGpuVmax;
|
||||
|
||||
u32 commonGpuVoltOffset;
|
||||
@@ -105,8 +104,6 @@ namespace kip {
|
||||
u32 reserved[60];
|
||||
} CustomizeTable;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#define CUST_MAGIC "CUST"
|
||||
#define CUST_MAGIC_LEN 4
|
||||
|
||||
@@ -264,6 +261,7 @@ namespace kip {
|
||||
static inline bool cust_set_erista_gpu_vmin(const char* p, u32 v) { CUST_WRITE_FIELD(p, eristaGpuVmin, v); }
|
||||
static inline bool cust_set_mariko_gpu_uv(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuUV, v); }
|
||||
static inline bool cust_set_mariko_gpu_vmin(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuVmin, v); }
|
||||
static inline bool cust_set_mariko_gpu_boot_volt(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuBootVolt, v); }
|
||||
static inline bool cust_set_mariko_gpu_vmax(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoGpuVmax, v); }
|
||||
static inline bool cust_set_common_gpu_offset(const char* p, u32 v) { CUST_WRITE_FIELD(p, commonGpuVoltOffset, v); }
|
||||
static inline bool cust_set_gpu_speedo(const char* p, u32 v) { CUST_WRITE_FIELD(p, gpuSpeedo, v); }
|
||||
@@ -354,6 +352,7 @@ namespace kip {
|
||||
static inline u32 cust_get_erista_gpu_vmin(const CustomizeTable* t) { return CUST_GET_FIELD(t, eristaGpuVmin); }
|
||||
static inline u32 cust_get_mariko_gpu_uv(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuUV); }
|
||||
static inline u32 cust_get_mariko_gpu_vmin(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuVmin); }
|
||||
static inline u32 cust_get_mariko_gpu_boot_volt(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuBootVolt); }
|
||||
static inline u32 cust_get_mariko_gpu_vmax(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoGpuVmax); }
|
||||
static inline u32 cust_get_common_gpu_offset(const CustomizeTable* t) { return CUST_GET_FIELD(t, commonGpuVoltOffset); }
|
||||
static inline u32 cust_get_gpu_speedo(const CustomizeTable* t) { return CUST_GET_FIELD(t, gpuSpeedo); }
|
||||
@@ -500,7 +499,7 @@ namespace kip {
|
||||
DECL_MARIKO_GPU_VOLT_GET(1459200, 21)
|
||||
DECL_MARIKO_GPU_VOLT_GET(1497600, 22)
|
||||
DECL_MARIKO_GPU_VOLT_GET(1536000, 23)
|
||||
|
||||
void MigrateKipData(u32 custRev, u32 version);
|
||||
void SetKipData();
|
||||
void GetKipData();
|
||||
}
|
||||
38
Source/hoc-clk/sysmodule/src/hos/rgltr.h
Normal file
38
Source/hoc-clk/sysmodule/src/hos/rgltr.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) ppkantorski (bord2death)
|
||||
*
|
||||
* 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 "pcv_types.h"
|
||||
|
||||
typedef struct {
|
||||
Service s;
|
||||
} RgltrSession;
|
||||
|
||||
Result rgltrInitialize(void);
|
||||
|
||||
void rgltrExit(void);
|
||||
|
||||
Service* rgltrGetServiceSession(void);
|
||||
|
||||
Result rgltrOpenSession(RgltrSession* session_out, PowerDomainId module_id);
|
||||
void rgltrCloseSession(RgltrSession* session);
|
||||
Result rgltrGetVoltage(RgltrSession* session, u32 *out_volt);
|
||||
Result rgltrGetPowerModuleNumLimit(u32 *out);
|
||||
Result rgltrGetVoltageEnabled(RgltrSession* session, u32 *out);
|
||||
Result rgltrRequestVoltage(RgltrSession* session, u32 microvolt);
|
||||
Result rgltrCancelVoltageRequest(RgltrSession* session);
|
||||
66
Source/hoc-clk/sysmodule/src/hos/rgltr_services.cpp
Normal file
66
Source/hoc-clk/sysmodule/src/hos/rgltr_services.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) ppkantorski (bord2death)
|
||||
*
|
||||
* 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 <switch.h>
|
||||
#include "rgltr.h"
|
||||
#include "rgltr_services.h" // for extern Service g_rgltrSrv, etc.
|
||||
|
||||
// Global service handle
|
||||
Service g_rgltrSrv;
|
||||
|
||||
Result rgltrInitialize(void) {
|
||||
if (hosversionBefore(8, 0, 0)) {
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
}
|
||||
return smGetService(&g_rgltrSrv, "rgltr");
|
||||
}
|
||||
|
||||
void rgltrExit(void) {
|
||||
serviceClose(&g_rgltrSrv);
|
||||
}
|
||||
|
||||
Result rgltrOpenSession(RgltrSession* session_out, PowerDomainId module_id) {
|
||||
const u32 in = (u32)module_id;
|
||||
return serviceDispatchIn(
|
||||
&g_rgltrSrv,
|
||||
0,
|
||||
in,
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &session_out->s
|
||||
);
|
||||
}
|
||||
|
||||
Result rgltrGetVoltage(RgltrSession* session, u32* out_volt) {
|
||||
u32 temp = 0;
|
||||
Result rc = serviceDispatchOut(&session->s, 4, temp);
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
*out_volt = temp;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result rgltrRequestVoltage(RgltrSession* session, u32 microvolt) {
|
||||
return serviceDispatchIn(&session->s, 5, microvolt);
|
||||
}
|
||||
|
||||
Result rgltrCancelVoltageRequest(RgltrSession* session) {
|
||||
return serviceDispatch(&session->s, 6);
|
||||
}
|
||||
|
||||
void rgltrCloseSession(RgltrSession* session) {
|
||||
serviceClose(&session->s);
|
||||
}
|
||||
32
Source/hoc-clk/sysmodule/src/hos/rgltr_services.h
Normal file
32
Source/hoc-clk/sysmodule/src/hos/rgltr_services.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) ppkantorski (bord2death)
|
||||
*
|
||||
* 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> // for Service, Result, hosversionBefore(), smGetService(), serviceClose(), etc.
|
||||
#include "rgltr.h" // for RgltrSession, PowerDomainId, etc.
|
||||
|
||||
extern Service g_rgltrSrv;
|
||||
|
||||
Result rgltrInitialize(void);
|
||||
void rgltrExit(void);
|
||||
|
||||
Result rgltrOpenSession(RgltrSession* session_out, PowerDomainId module_id);
|
||||
|
||||
Result rgltrGetVoltage(RgltrSession* session, u32* out_volt);
|
||||
|
||||
void rgltrCloseSession(RgltrSession* session);
|
||||
@@ -185,7 +185,23 @@ namespace clockManager {
|
||||
if (module == HocClkModule_GPU && board::GetSocType() == HocClkSocType_Mariko) {
|
||||
constexpr u32 kStep = 38400000;
|
||||
constexpr u32 kPcvStep = 76800000;
|
||||
constexpr u32 kMax = 1228800000;
|
||||
|
||||
u32 kMax = 0;
|
||||
for (u32 i = 0; i < count; i++) {
|
||||
for (u32 j = 0; j < count; j++) {
|
||||
if (freqs[j] == freqs[i] + kStep) {
|
||||
kMax = freqs[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (kMax == 0) {
|
||||
for (u32 i = 0; i < count; i++) {
|
||||
if (freqs[i] > kMax)
|
||||
kMax = freqs[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (u32 f = kPcvStep; f <= kMax && gFreqTable[module].count < HOCCLK_FREQ_LIST_MAX; f += kStep) {
|
||||
if (f % kPcvStep != 0) {
|
||||
@@ -221,6 +237,52 @@ namespace clockManager {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Workaround for PCV bug involving 38.4mhz step rate on erista
|
||||
if (module == HocClkModule_GPU && board::GetSocType() == HocClkSocType_Erista) {
|
||||
static const struct {
|
||||
u32 hz;
|
||||
HocClkConfigValue kval;
|
||||
} eristaGpuVoltMap[] = {
|
||||
{ 76800000, KipConfigValue_g_volt_e_76800 },
|
||||
{ 115200000, KipConfigValue_g_volt_e_115200 },
|
||||
{ 153600000, KipConfigValue_g_volt_e_153600 },
|
||||
{ 192000000, KipConfigValue_g_volt_e_192000 },
|
||||
{ 230400000, KipConfigValue_g_volt_e_230400 },
|
||||
{ 268800000, KipConfigValue_g_volt_e_268800 },
|
||||
{ 307200000, KipConfigValue_g_volt_e_307200 },
|
||||
{ 345600000, KipConfigValue_g_volt_e_345600 },
|
||||
{ 384000000, KipConfigValue_g_volt_e_384000 },
|
||||
{ 422400000, KipConfigValue_g_volt_e_422400 },
|
||||
{ 460800000, KipConfigValue_g_volt_e_460800 },
|
||||
{ 499200000, KipConfigValue_g_volt_e_499200 },
|
||||
{ 537600000, KipConfigValue_g_volt_e_537600 },
|
||||
{ 576000000, KipConfigValue_g_volt_e_576000 },
|
||||
{ 614400000, KipConfigValue_g_volt_e_614400 },
|
||||
{ 652800000, KipConfigValue_g_volt_e_652800 },
|
||||
{ 691200000, KipConfigValue_g_volt_e_691200 },
|
||||
{ 729600000, KipConfigValue_g_volt_e_729600 },
|
||||
{ 768000000, KipConfigValue_g_volt_e_768000 },
|
||||
{ 806400000, KipConfigValue_g_volt_e_806400 },
|
||||
{ 844800000, KipConfigValue_g_volt_e_844800 },
|
||||
{ 883200000, KipConfigValue_g_volt_e_883200 },
|
||||
{ 921600000, KipConfigValue_g_volt_e_921600 },
|
||||
{ 960000000, KipConfigValue_g_volt_e_960000 },
|
||||
{ 998400000, KipConfigValue_g_volt_e_998400 },
|
||||
{1036800000, KipConfigValue_g_volt_e_1036800 },
|
||||
{1075200000, KipConfigValue_g_volt_e_1075200 },
|
||||
};
|
||||
bool skip = false;
|
||||
for (auto& entry : eristaGpuVoltMap) {
|
||||
if (entry.hz == freqs[i]) {
|
||||
if (config::GetConfigValue(entry.kval) == 2000) {
|
||||
skip = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (skip) continue;
|
||||
}
|
||||
|
||||
*hz = freqs[i];
|
||||
fileUtils::LogLine("[mgr] %02u - %u - %u.%u MHz", gFreqTable[module].count, *hz, *hz / 1000000, *hz / 100000 - *hz / 1000000 * 10);
|
||||
|
||||
@@ -231,26 +293,27 @@ namespace clockManager {
|
||||
fileUtils::LogLine("[mgr] count = %u", gFreqTable[module].count);
|
||||
}
|
||||
|
||||
void HandleSafetyFeatures()
|
||||
bool HandleSafetyFeatures()
|
||||
{
|
||||
if (config::GetConfigValue(HocClkConfigValue_HandheldTDP) && (gContext.profile != HocClkProfile_Docked)) {
|
||||
if (board::GetConsoleType() == HocClkConsoleType_Hoag) {
|
||||
if (board::GetPowerMw(HocClkPowerSensor_Avg) < -(int)config::GetConfigValue(HocClkConfigValue_LiteTDPLimit)) {
|
||||
ResetToStockClocks();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (board::GetPowerMw(HocClkPowerSensor_Avg) < -(int)config::GetConfigValue(HocClkConfigValue_HandheldTDPLimit)) {
|
||||
ResetToStockClocks();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((tmp451TempSoc() / 1000) > (int)config::GetConfigValue(HocClkConfigValue_ThermalThrottleThreshold)) && config::GetConfigValue(HocClkConfigValue_ThermalThrottle)) {
|
||||
ResetToStockClocks();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void HandleMiscFeatures()
|
||||
{
|
||||
@@ -267,6 +330,9 @@ namespace clockManager {
|
||||
|
||||
if(board::GetConsoleType() == HocClkConsoleType_Aula)
|
||||
AulaDisplay::SetDisplayColorMode((AulaColorMode)config::GetConfigValue(HocClkConfigValue_AulaDisplayColorPreset));
|
||||
if(config::GetConfigValue(HocClkConfigValue_LiveCpuUv)) {
|
||||
board::HandleCpuUv();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,13 +365,6 @@ namespace clockManager {
|
||||
}
|
||||
}
|
||||
|
||||
void HandleCpuUv()
|
||||
{
|
||||
if (board::GetSocType() == HocClkSocType_Erista)
|
||||
board::SetDfllTunings(config::GetConfigValue(KipConfigValue_eristaCpuUV), 0, 1581000000); // Erista tbreak is always 1581MHz
|
||||
else
|
||||
board::SetDfllTunings(config::GetConfigValue(KipConfigValue_marikoCpuUVLow), config::GetConfigValue(KipConfigValue_marikoCpuUVHigh), board::CalculateTbreak(config::GetConfigValue(KipConfigValue_tableConf)));
|
||||
}
|
||||
|
||||
void DVFSReset()
|
||||
{
|
||||
@@ -452,10 +511,6 @@ namespace clockManager {
|
||||
gContext.stable.freqs[module] = nearestHz;
|
||||
}
|
||||
|
||||
if (module == HocClkModule_CPU && config::GetConfigValue(HocClkConfigValue_LiveCpuUv)) {
|
||||
HandleCpuUv();
|
||||
}
|
||||
|
||||
if (module == HocClkModule_MEM && board::GetSocType() == HocClkSocType_Mariko && targetHz < oldHz && config::GetConfigValue(HocClkConfigValue_DVFSMode) == DVFSMode_Hijack) {
|
||||
ApplyGpuDvfs(targetHz);
|
||||
}
|
||||
@@ -711,11 +766,11 @@ namespace clockManager {
|
||||
|
||||
bool isBoost = apmExtIsBoostMode(mode);
|
||||
|
||||
HandleSafetyFeatures();
|
||||
bool shouldSkipClockSet = HandleSafetyFeatures();
|
||||
HandleMiscFeatures();
|
||||
|
||||
// GPU clock should always be the same unless PCV has overwriten our change, so reset it
|
||||
if (RefreshContext() || config::Refresh() || board::GetRealHz(HocClkModule_GPU) != gContext.freqs[HocClkModule_GPU]) {
|
||||
if ((RefreshContext() || config::Refresh() || (board::GetRealHz(HocClkModule_GPU) != gContext.freqs[HocClkModule_GPU])) && !shouldSkipClockSet) {
|
||||
SetClocks(isBoost);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user