all: add mariko gpu boot voltage patch
This commit is contained in:
@@ -114,8 +114,9 @@ volatile CustomizeTable C = {
|
|||||||
.eristaGpuVmin = 810,
|
.eristaGpuVmin = 810,
|
||||||
|
|
||||||
.marikoGpuUV = 0,
|
.marikoGpuUV = 0,
|
||||||
/* Vmin past 795mV won't work due boot voltage being 800mV. */
|
/* Vmin past 795mV won't work due boot voltage being 800mV (can be adjusted though). */
|
||||||
.marikoGpuVmin = 610,
|
.marikoGpuVmin = 610,
|
||||||
|
.marikoGpuBootVolt = 800, /* Used during boot and when temp is <20°C */
|
||||||
.marikoGpuVmax = 800,
|
.marikoGpuVmax = 800,
|
||||||
|
|
||||||
.commonGpuVoltOffset = 0,
|
.commonGpuVoltOffset = 0,
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ struct CustomizeTable {
|
|||||||
|
|
||||||
u32 marikoGpuUV;
|
u32 marikoGpuUV;
|
||||||
u32 marikoGpuVmin;
|
u32 marikoGpuVmin;
|
||||||
|
u32 marikoGpuBootVolt;
|
||||||
u32 marikoGpuVmax;
|
u32 marikoGpuVmax;
|
||||||
|
|
||||||
u32 commonGpuVoltOffset;
|
u32 commonGpuVoltOffset;
|
||||||
|
|||||||
@@ -50,15 +50,18 @@ namespace ams::ldr::hoc::pcv::mariko {
|
|||||||
R_THROW(ldr::ResultInvalidGpuDvfs());
|
R_THROW(ldr::ResultInvalidGpuDvfs());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!C.marikoGpuVmin) {
|
|
||||||
R_SKIP();
|
|
||||||
}
|
|
||||||
|
|
||||||
PATCH_OFFSET(ptr, C.marikoGpuVmin);
|
if(C.marikoGpuBootVolt) {
|
||||||
PATCH_OFFSET(ptr + 3, C.marikoGpuVmin);
|
PATCH_OFFSET(ptr - 3, C.marikoGpuBootVolt);
|
||||||
PATCH_OFFSET(ptr + 6, C.marikoGpuVmin);
|
}
|
||||||
PATCH_OFFSET(ptr + 9, C.marikoGpuVmin);
|
|
||||||
PATCH_OFFSET(ptr + 12, C.marikoGpuVmin);
|
if (C.marikoGpuVmin) {
|
||||||
|
PATCH_OFFSET(ptr, C.marikoGpuVmin);
|
||||||
|
PATCH_OFFSET(ptr + 3, C.marikoGpuVmin);
|
||||||
|
PATCH_OFFSET(ptr + 6, C.marikoGpuVmin);
|
||||||
|
PATCH_OFFSET(ptr + 9, C.marikoGpuVmin);
|
||||||
|
PATCH_OFFSET(ptr + 12, C.marikoGpuVmin);
|
||||||
|
}
|
||||||
|
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ typedef enum {
|
|||||||
|
|
||||||
KipConfigValue_marikoGpuUV,
|
KipConfigValue_marikoGpuUV,
|
||||||
KipConfigValue_marikoGpuVmin,
|
KipConfigValue_marikoGpuVmin,
|
||||||
|
KipConfigValue_marikoGpuBootVolt,
|
||||||
KipConfigValue_marikoGpuVmax,
|
KipConfigValue_marikoGpuVmax,
|
||||||
|
|
||||||
KipConfigValue_commonGpuVoltOffset,
|
KipConfigValue_commonGpuVoltOffset,
|
||||||
@@ -401,6 +402,8 @@ static inline const char* hocclkFormatConfigValue(HocClkConfigValue val, bool pr
|
|||||||
return pretty ? "Mariko GPU Undervolt" : "mariko_gpu_uv";
|
return pretty ? "Mariko GPU Undervolt" : "mariko_gpu_uv";
|
||||||
case KipConfigValue_marikoGpuVmin:
|
case KipConfigValue_marikoGpuVmin:
|
||||||
return pretty ? "Mariko GPU Vmin" : "mariko_gpu_vmin";
|
return pretty ? "Mariko GPU Vmin" : "mariko_gpu_vmin";
|
||||||
|
case KipConfigValue_marikoGpuBootVolt:
|
||||||
|
return pretty ? "Mariko GPU Boot Voltage" : "mariko_gpu_boot_volt";
|
||||||
case KipConfigValue_marikoGpuVmax:
|
case KipConfigValue_marikoGpuVmax:
|
||||||
return pretty ? "Mariko GPU Vmax" : "mariko_gpu_vmax";
|
return pretty ? "Mariko GPU Vmax" : "mariko_gpu_vmax";
|
||||||
|
|
||||||
|
|||||||
@@ -525,7 +525,12 @@ std::vector<std::string> ConfigInfoStrings(HocClkConfigValue val, bool isMariko,
|
|||||||
"- Enabled: Enables GPU scheduling, 96.5% GPU max load",
|
"- Enabled: Enables GPU scheduling, 96.5% GPU max load",
|
||||||
"Default: Do not override"
|
"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:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1903,6 +1903,7 @@ protected:
|
|||||||
// return false;
|
// return false;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
addConfigButton(KipConfigValue_marikoGpuBootVolt, "GPU Boot Volt", ValueRange(700, 850, 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);
|
addConfigButton(KipConfigValue_marikoGpuVmin, "GPU VMIN", ValueRange(0, 0, 0, "0", 1), "GPU VMIN", &thresholdsDisabled, {}, mGpuVoltsVmin, false, true);
|
||||||
ValueThresholds MgpuVmaxThresholds(805, 850);
|
ValueThresholds MgpuVmaxThresholds(805, 850);
|
||||||
addConfigButton(
|
addConfigButton(
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ namespace kip {
|
|||||||
|
|
||||||
CUST_WRITE_FIELD_BATCH(&table, marikoGpuUV, config::GetConfigValue(KipConfigValue_marikoGpuUV));
|
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, 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, marikoGpuVmax, config::GetConfigValue(KipConfigValue_marikoGpuVmax));
|
||||||
|
|
||||||
CUST_WRITE_FIELD_BATCH(&table, commonGpuVoltOffset, config::GetConfigValue(KipConfigValue_commonGpuVoltOffset));
|
CUST_WRITE_FIELD_BATCH(&table, commonGpuVoltOffset, config::GetConfigValue(KipConfigValue_commonGpuVoltOffset));
|
||||||
@@ -274,6 +275,7 @@ namespace kip {
|
|||||||
configValues.values[KipConfigValue_eristaGpuVmin] = cust_get_erista_gpu_vmin(&table);
|
configValues.values[KipConfigValue_eristaGpuVmin] = cust_get_erista_gpu_vmin(&table);
|
||||||
configValues.values[KipConfigValue_marikoGpuUV] = cust_get_mariko_gpu_uv(&table);
|
configValues.values[KipConfigValue_marikoGpuUV] = cust_get_mariko_gpu_uv(&table);
|
||||||
configValues.values[KipConfigValue_marikoGpuVmin] = cust_get_mariko_gpu_vmin(&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_marikoGpuVmax] = cust_get_mariko_gpu_vmax(&table);
|
||||||
configValues.values[KipConfigValue_commonGpuVoltOffset] = cust_get_common_gpu_offset(&table);
|
configValues.values[KipConfigValue_commonGpuVoltOffset] = cust_get_common_gpu_offset(&table);
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace kip {
|
|||||||
|
|
||||||
u32 marikoGpuUV;
|
u32 marikoGpuUV;
|
||||||
u32 marikoGpuVmin;
|
u32 marikoGpuVmin;
|
||||||
|
u32 marikoGpuBootVolt;
|
||||||
u32 marikoGpuVmax;
|
u32 marikoGpuVmax;
|
||||||
|
|
||||||
u32 commonGpuVoltOffset;
|
u32 commonGpuVoltOffset;
|
||||||
@@ -254,6 +255,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_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_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_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_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_common_gpu_offset(const char* p, u32 v) { CUST_WRITE_FIELD(p, commonGpuVoltOffset, v); }
|
||||||
static inline bool cust_set_marikoCpuMaxClock(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoCpuMaxClock, v); }
|
static inline bool cust_set_marikoCpuMaxClock(const char* p, u32 v) { CUST_WRITE_FIELD(p, marikoCpuMaxClock, v); }
|
||||||
@@ -338,6 +340,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_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_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_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_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_common_gpu_offset(const CustomizeTable* t) { return CUST_GET_FIELD(t, commonGpuVoltOffset); }
|
||||||
static inline u32 cust_get_marikoCpuMaxClock(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoCpuMaxClock); }
|
static inline u32 cust_get_marikoCpuMaxClock(const CustomizeTable* t) { return CUST_GET_FIELD(t, marikoCpuMaxClock); }
|
||||||
|
|||||||
BIN
dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp
vendored
BIN
dist/atmosphere/contents/00FF0000636C6BFF/exefs.nsp
vendored
Binary file not shown.
BIN
dist/atmosphere/kips/hoc.kip
vendored
BIN
dist/atmosphere/kips/hoc.kip
vendored
Binary file not shown.
BIN
dist/switch/.overlays/horizon-oc-overlay.ovl
vendored
BIN
dist/switch/.overlays/horizon-oc-overlay.ovl
vendored
Binary file not shown.
Reference in New Issue
Block a user