diff --git a/README.md b/README.md index bba0b0a4..8c3a6587 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Overclocking suite for Switch **(Mariko Only)** running on Atmosphere CFW. Suppo ## Features -- **CPU/GPU/RAM Overclock** up to **2397.0/1344.0/2131.2 MHz** +- **CPU/GPU/RAM Overclock** up to **2397.0/1497.6/2131.2 MHz** - **Fan Control Optimization** at high load - **Modded sys-clk and ReverseNX**(-Tools and -RT) - **No need to change clocks manually** after toggling modes in ReverseNX @@ -32,34 +32,33 @@ Overclocking suite for Switch **(Mariko Only)** running on Atmosphere CFW. Suppo - **Overclock** - - **Official X1+ CPU/GPU OC clock: 1963.5/1267.2 MHz**. - - Anything above that are not in the table of official module and are all wild guess – coefficients are not correctly calculated. ([issue #4](https://github.com/KazushiMe/Switch-OC-Suite/issues/4)) + - **Official X1+ CPU/GPU Max clock: 1963.5/1267.2 MHz**. + - Anything above that are not in the table of official module. ([issue #4](https://github.com/KazushiMe/Switch-OC-Suite/issues/4)) - **Recommended RAM clock: 1862.4 MHz** @ 600mV, (**1795.2 MHz for Hynix** ones @ 600mV). - - **RAM clock is set permanently** via patching ptm module, rather than sys-clk. - - Use Hekate to check out the brand of your RAM chips. + - Only 1331.2 MHz and Max MHz are available in sys-clk-OC settings. + - Use Hekate to check out the brand and of your RAM chips. - EM shielding & thermal paste for RAM chips and testing with emuNAND before long-term usage. - - Mariko variants have much lower power consumption compared to Erista, therefore **GPU clock capping is lifted for Mariko**. - - - For more info, see [README.md](https://github.com/KazushiMe/Switch-OC-Suite/tree/master/Source/sys-clk-OC) in sys-clk-OC. + - For more info on available clock rates, see [README.md](https://github.com/KazushiMe/Switch-OC-Suite/tree/master/Source/sys-clk-OC) in sys-clk-OC. - **Overvolt and Extreme Overclock** - CPU overvolting: 1220 mV, up from default 1120 mV. Frequencies ≥ 2193 MHz will enable overvolting. - - GPU overvolting: implemented but disabled, default 1050 mV. ([issue #4](https://github.com/KazushiMe/Switch-OC-Suite/issues/4)) - > Although Tegra X1+ GPU has much more potential than X1, and overvolting is quite promising, its power draw is not tested at higher voltage and its performance is hinderded by low RAM bandwidth on most occasions. + - GPU overvolting: 1170 mV, default 1050 mV. Frequencies ≥ 1420 Mhz trigger overvolting. ([issue #4](https://github.com/KazushiMe/Switch-OC-Suite/issues/4)) + - You cannot set ≥ 1344 MHz without official chargers. - - RAM overvolting: precompiled hekate bootloader is provided - - Edit `oc.ini` to change Vddq voltage value: + - RAM + - Overvolting: precompiled hekate bootloader is provided + - Edit `oc.ini` to change Vddq voltage value: ```ini [emc] volt=600000 ``` - - Overvolting beyond 650mV is not safe. - > Even though Tegra X1+ supports LPDDR4/LPDDR4X, LPDDR4X DRAM chips are not required to be backward-compatible with, or resistant to LPDDR4 1.1V Vddq voltage. - - For more info on DRAM overvolting and timings, see [issue #5](https://github.com/KazushiMe/Switch-OC-Suite/issues/5) + - Overvolting beyond 650mV is not safe and proved to be not much helpful. + - Timings: [EXPERIMENTAL] source codes, definitions and examples are provided. + - See [issue #5](https://github.com/KazushiMe/Switch-OC-Suite/issues/5) for more info on DRAM OC and timings - **Fan Control Optimization** at high load - Higher tolerable temperature and smoother fan curve. Set `holdable_tskin` to 56˚C. Previously it's set to 48˚C, so by default the fan would go crazy (80~100%) easily with a slight degree of OC. @@ -119,7 +118,7 @@ Overclocking suite for Switch **(Mariko Only)** running on Atmosphere CFW. Suppo 2. Copy all the files in `SdOut` to the root of SD card. `system_settings.ini` should be edited manually. -3. Grab `x.x.x_loader_xxxx.x.kip` for your Atmosphere version and desired RAM frequency, rename it to `loader.kip` and place it in `/atmosphere/kips/`. +3. Grab `x.x.x_loader_xxxx.x.kip` for your Atmosphere version and desired RAM frequency (according to DRAM manufacturer), rename it to `loader.kip` and place it in `/atmosphere/kips/`. 4. **Hekate-ipl bootloader:** diff --git a/SdOut/atmosphere/1.2.5_loader_1795.2.kip b/SdOut/atmosphere/1.2.5_loader_1795.2.kip deleted file mode 100644 index 27c69a23..00000000 Binary files a/SdOut/atmosphere/1.2.5_loader_1795.2.kip and /dev/null differ diff --git a/SdOut/atmosphere/1.2.5_loader_1795.2_hynix.kip b/SdOut/atmosphere/1.2.5_loader_1795.2_hynix.kip new file mode 100644 index 00000000..1926ec11 Binary files /dev/null and b/SdOut/atmosphere/1.2.5_loader_1795.2_hynix.kip differ diff --git a/SdOut/atmosphere/1.2.5_loader_1862.4.kip b/SdOut/atmosphere/1.2.5_loader_1862.4.kip deleted file mode 100644 index dbfe5e35..00000000 Binary files a/SdOut/atmosphere/1.2.5_loader_1862.4.kip and /dev/null differ diff --git a/SdOut/atmosphere/1.2.5_loader_1862.4_hynix.kip b/SdOut/atmosphere/1.2.5_loader_1862.4_hynix.kip new file mode 100644 index 00000000..a662950b Binary files /dev/null and b/SdOut/atmosphere/1.2.5_loader_1862.4_hynix.kip differ diff --git a/SdOut/atmosphere/1.2.5_loader_1996.8.kip b/SdOut/atmosphere/1.2.5_loader_1996.8.kip deleted file mode 100644 index 854e11c9..00000000 Binary files a/SdOut/atmosphere/1.2.5_loader_1996.8.kip and /dev/null differ diff --git a/SdOut/atmosphere/1.2.5_loader_1996.8_micron_samsung.kip b/SdOut/atmosphere/1.2.5_loader_1996.8_micron_samsung.kip new file mode 100644 index 00000000..f5ff384b Binary files /dev/null and b/SdOut/atmosphere/1.2.5_loader_1996.8_micron_samsung.kip differ diff --git a/SdOut/atmosphere/1.2.5_loader_2064.0.kip b/SdOut/atmosphere/1.2.5_loader_2064.0.kip deleted file mode 100644 index 9ec399b8..00000000 Binary files a/SdOut/atmosphere/1.2.5_loader_2064.0.kip and /dev/null differ diff --git a/SdOut/atmosphere/1.2.5_loader_2064.0_samsung.kip b/SdOut/atmosphere/1.2.5_loader_2064.0_samsung.kip new file mode 100644 index 00000000..17595939 Binary files /dev/null and b/SdOut/atmosphere/1.2.5_loader_2064.0_samsung.kip differ diff --git a/SdOut/atmosphere/contents/00FF0000636C6BFF/exefs.nsp b/SdOut/atmosphere/contents/00FF0000636C6BFF/exefs.nsp index 9f9af45b..c9a6ce54 100644 Binary files a/SdOut/atmosphere/contents/00FF0000636C6BFF/exefs.nsp and b/SdOut/atmosphere/contents/00FF0000636C6BFF/exefs.nsp differ diff --git a/SdOut/switch/.overlays/sys-clk-overlay.ovl b/SdOut/switch/.overlays/sys-clk-overlay.ovl index 94f8184f..9706dee0 100644 Binary files a/SdOut/switch/.overlays/sys-clk-overlay.ovl and b/SdOut/switch/.overlays/sys-clk-overlay.ovl differ diff --git a/SdOut/switch/sys-clk-manager.nro b/SdOut/switch/sys-clk-manager.nro index 932134f7..680dc456 100644 Binary files a/SdOut/switch/sys-clk-manager.nro and b/SdOut/switch/sys-clk-manager.nro differ diff --git a/Source/Atmosphere/stratosphere/loader/source/ldr_oc_patch.hpp b/Source/Atmosphere/stratosphere/loader/source/ldr_oc_patch.hpp index 41d1aa57..de676dbd 100644 --- a/Source/Atmosphere/stratosphere/loader/source/ldr_oc_patch.hpp +++ b/Source/Atmosphere/stratosphere/loader/source/ldr_oc_patch.hpp @@ -100,7 +100,7 @@ namespace pcv { 0xF1E94, 0xF1EE4, }; - constexpr u32 NewGpuVoltageLimit = 1050; // default max 1050mV + constexpr u32 NewGpuVoltageLimit = 1170; // default max 1050mV constexpr u32 GpuTablesFreeSpace[] = { 0xE3410, @@ -122,11 +122,11 @@ namespace pcv { // { 1228800, {}, { 1277303, -11675, -859, 0, 3722, 313 } }, // { 1267200, {}, { 1335531, -12567, -867, 0, 3681, 559 } }, { 1305600, {}, { 955000 } }, - { 1344000, {}, { 995000 } }, - // { 1382400, {}, { 1040000 } }, - // { 1420800, {}, { 1090000 } }, - // { 1459200, {}, { 1145000 } }, - // { 1497600, {}, { 1200000 } }, + { 1344000, {}, { 990000 } }, + { 1382400, {}, { 1030000 } }, + { 1420800, {}, { 1075000 } }, + { 1459200, {}, { 1120000 } }, + { 1497600, {}, { 1170000 } }, // { 1536000, {}, { 1250000 } }, }; static_assert(sizeof(NewGpuTables) <= sizeof(gpu_cvb_pll_table_t)*15); diff --git a/Source/Atmosphere/stratosphere/loader/source/ldr_patcher.cpp b/Source/Atmosphere/stratosphere/loader/source/ldr_patcher.cpp index c341698c..25412e3c 100644 --- a/Source/Atmosphere/stratosphere/loader/source/ldr_patcher.cpp +++ b/Source/Atmosphere/stratosphere/loader/source/ldr_patcher.cpp @@ -197,11 +197,11 @@ namespace ams::ldr { ADJUST_PROPORTIONAL(TARGET_TABLE, REF_TABLE, shadow_regs_ca_train.PARAM) \ ADJUST_PROPORTIONAL(TARGET_TABLE, REF_TABLE, shadow_regs_rdwr_train.PARAM) - /* Calculate DIVM and DIVN */ + /* Calculate DIVM and DIVN (clock DIVisors) */ /* Assume oscillator (PLLMB_IN) is 38.4 MHz */ /* PLLMB_OUT = PLLMB_IN / DIVM * DIVN */ - u32 divn = GetEmcClock() / 38400; u32 divm = 1; + u32 divn = GetEmcClock() / 38400; if (GetEmcClock() - divn * 38400 >= 38400 / 2) { divm = 2; divn = divn * 2 + 1; @@ -212,7 +212,7 @@ namespace ams::ldr { pcv::MarikoMtcTable* mtc_table_1600 = reinterpret_cast(mapped_nso + pcv::MtcTable_1600[j]); pcv::MarikoMtcTable* mtc_table_1331 = reinterpret_cast(mapped_nso + pcv::MtcTable_1600[j] - pcv::MtcTableOffset); - /* Normal and reasonable values */ + /* Patch parameters that seem like timings */ ADJUST_PROP_WITHIN_ALL_REG(mtc_table_1600, mtc_table_1331, emc_rc); ADJUST_PROP_WITHIN_ALL_REG(mtc_table_1600, mtc_table_1331, emc_rfc); ADJUST_PROP_WITHIN_ALL_REG(mtc_table_1600, mtc_table_1331, emc_rfcpb); @@ -280,6 +280,7 @@ namespace ams::ldr { ADJUST_PROPORTIONAL(mtc_table_1600, mtc_table_1331, min_mrs_wait); ADJUST_PROPORTIONAL(mtc_table_1600, mtc_table_1331, latency); + /* Patch clock divisors */ mtc_table_1600->pllmb_divm = divm; mtc_table_1600->pllmb_divn = divn; } @@ -288,16 +289,16 @@ namespace ams::ldr { } } - EmcClock = GetEmcClock() * 1000; + // u32 PtmEmcClock = GetEmcClock() * 1000; u32 CpuBoostClock = GetCpuBoostClock() * 1000; for (u32 i = 0; i < sizeof(PtmModuleId)/sizeof(ro::ModuleId); i++) { if (std::memcmp(std::addressof(PtmModuleId[i]), std::addressof(module_id), sizeof(module_id)) == 0) { - for (u32 j = 0; j < 16; j++) { - std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::OffsetInterval * j), &EmcClock, sizeof(EmcClock)); - std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::OffsetInterval * j + 0x4), &EmcClock, sizeof(EmcClock)); - } + // for (u32 j = 0; j < 16; j++) { + // std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::OffsetInterval * j), &PtmEmcClock, sizeof(PtmEmcClock)); + // std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::OffsetInterval * j + 0x4), &PtmEmcClock, sizeof(PtmEmcClock)); + // } for (u32 j = 0; j < 2; j++) { std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::CpuBoostOffset + ptm::OffsetInterval * j), &CpuBoostClock, sizeof(CpuBoostClock)); std::memcpy(reinterpret_cast(mapped_nso + ptm::EmcOffsetStart[i] + ptm::CpuBoostOffset + ptm::OffsetInterval * j + 0x4), &CpuBoostClock, sizeof(CpuBoostClock)); diff --git a/Source/sys-clk-OC/.gitignore b/Source/sys-clk-OC/.gitignore new file mode 100644 index 00000000..53c37a16 --- /dev/null +++ b/Source/sys-clk-OC/.gitignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/Source/sys-clk-OC/README.md b/Source/sys-clk-OC/README.md index 2d41a07e..08cb7974 100644 --- a/Source/sys-clk-OC/README.md +++ b/Source/sys-clk-OC/README.md @@ -2,10 +2,6 @@ Switch sysmodule allowing you to set cpu/gpu clocks according to the running application and docked state. -### Notes: - -- **No GPU capping on Mariko** (Hoag/Iowa/Aula) -- Ability to **set RAM clocks is removed**, please use sys-clk-OC with **[ptm patch](https://github.com/KazushiMe/Switch-OC-Suite/blob/master/Source/Patch/13-ptm.pchtxt)** or prebuilt loader.kip ## Clock table (MHz) @@ -33,6 +29,10 @@ Switch sysmodule allowing you to set cpu/gpu clocks according to the running app ### GPU clocks * 1??? → unknown max for Mariko +* 1497 +* 1459 +* 1420 +* 1382 * 1344 * 1305 * 1267 → official max for Mariko @@ -53,17 +53,19 @@ Switch sysmodule allowing you to set cpu/gpu clocks according to the running app * 153 * 76 → boost mode -### MEM clocks (only for reference) +### MEM clocks + +**Only 1331 and Max could be set in sys-clk-OC.** From Hekate Minerva module [sys_sdrammtc.c](https://github.com/CTCaer/hekate/blob/197ed8c319bd4132e4d7571ce037d4a27f806bba/modules/hekate_libsys_minerva/sys_sdrammtc.c#L67) -- 2131 → max for Erista & Mariko (with overvolting) +- 2131 → max for Erista (requires I/O bus overvolting); official max for Mariko (requires proper timings) - 2099 - 2064 - 1996 - 1932 - 1894 -- 1862 → stable max for Mariko (stable on most DRAM chips except Hynix ones) (without overvolting – capped at 600 mV) +- 1862 → official max for Erista; Mariko (stable on most DRAM chips except Hynix ones) (with timings for 1600MHz and no overvolting – capped at 600 mV) - 1795 - 1728 - 1600 → official docked & official boost mode @@ -72,6 +74,17 @@ From Hekate Minerva module [sys_sdrammtc.c](https://github.com/CTCaer/hekate/blo - 800 - 665 +## Capping + +To protect the battery from excessive strain, clocks requested from config may be capped before applying, depending on your current profile: + +| | Handheld | Charging (USB) | Charging (Official) | Docked | +|:-------:|:--------:|:--------------:|:-------------------:|:------:| +| **MEM** | - | - | - | - | +| **CPU** | - | - | - | - | +| **GPU** | 1344 | 1344 | - | - | + + ## Installation The following instructions assumes you have a Nintendo Switch running Atmosphère, updated to at least the latest stable version. @@ -118,14 +131,19 @@ Presets can be customized by adding them to the ini config file located at `/con [Application Title ID] docked_cpu= docked_gpu= +docked_mem= handheld_charging_cpu= handheld_charging_gpu= +handheld_charging_mem= handheld_charging_usb_cpu= handheld_charging_usb_gpu= +handheld_charging_usb_mem= handheld_charging_official_cpu= handheld_charging_official_gpu= +handheld_charging_official_mem= handheld_cpu= handheld_gpu= +handheld_mem= ``` * Replace `Application Title ID` with the title id of the game/application you're interested in customizing. @@ -147,6 +165,7 @@ Leads to a smoother framerate overall (ex: in the korok forest) [01007EF00011E000] docked_cpu=1224 handheld_charging_cpu=1224 +handheld_mem=1600 ``` ### Example 2: Picross diff --git a/Source/sys-clk-OC/common/src/clock_table.c b/Source/sys-clk-OC/common/src/clock_table.c index aa0051de..e3e02c5e 100644 --- a/Source/sys-clk-OC/common/src/clock_table.c +++ b/Source/sys-clk-OC/common/src/clock_table.c @@ -12,20 +12,20 @@ uint32_t sysclk_g_freq_table_mem_hz[] = { // From Hekate Minerva module - 665600000, - 800000000, - 1065600000, + // 665600000, + // 800000000, + // 1065600000, 1331200000, 1600000000, - 1728000000, - 1795200000, - 1862400000, - 1894400000, - 1932800000, - 1996800000, - 2064000000, - 2099200000, - 2131200000, + // 1728000000, + // 1795200000, + // 1862400000, + // 1894400000, + // 1932800000, + // 1996800000, + // 2064000000, + // 2099200000, + // 2131200000, 0, }; @@ -71,7 +71,10 @@ uint32_t sysclk_g_freq_table_gpu_hz[] = { 1267200000, 1305600000, 1344000000, - //1382400000, - //1420800000, + 1382400000, + 1420800000, + 1459200000, + 1497600000, + // 1536000000, 0, }; diff --git a/Source/sys-clk-OC/manager/src/advanced_settings_tab.cpp b/Source/sys-clk-OC/manager/src/advanced_settings_tab.cpp index 6d9725e2..9b11f643 100644 --- a/Source/sys-clk-OC/manager/src/advanced_settings_tab.cpp +++ b/Source/sys-clk-OC/manager/src/advanced_settings_tab.cpp @@ -77,7 +77,7 @@ AdvancedSettingsTab::AdvancedSettingsTab() }); // MEM - /*brls::SelectListItem *memFreqListItem = createFreqListItem(SysClkModule_MEM, context.overrideFreqs[SysClkModule_MEM] / 1000000); + brls::SelectListItem *memFreqListItem = createFreqListItem(SysClkModule_MEM, context.overrideFreqs[SysClkModule_MEM] / 1000000); memFreqListItem->getValueSelectedEvent()->subscribe([](int result) { Result rc = result == 0 ? @@ -90,7 +90,7 @@ AdvancedSettingsTab::AdvancedSettingsTab() errorResult(result == 0 ? "sysclkIpcRemoveOverride" : "sysclkIpcSetOverride", rc); // TODO: Reset selected value } - });*/ + }); this->addView(cpuFreqListItem); this->addView(gpuFreqListItem); diff --git a/Source/sys-clk-OC/manager/src/app_profile_frame.cpp b/Source/sys-clk-OC/manager/src/app_profile_frame.cpp index 0ea6af3e..4ad95451 100644 --- a/Source/sys-clk-OC/manager/src/app_profile_frame.cpp +++ b/Source/sys-clk-OC/manager/src/app_profile_frame.cpp @@ -116,7 +116,7 @@ void AppProfileFrame::addFreqs(brls::List* list, SysClkProfile profile) list->addView(gpuListItem); // MEM - /*brls::SelectListItem* memListItem = createFreqListItem(SysClkModule_MEM, this->profiles.mhzMap[profile][SysClkModule_MEM]); + brls::SelectListItem* memListItem = createFreqListItem(SysClkModule_MEM, this->profiles.mhzMap[profile][SysClkModule_MEM]); this->profiles.mhzMap[profile][SysClkModule_MEM] *= 1000000; @@ -126,7 +126,7 @@ void AppProfileFrame::addFreqs(brls::List* list, SysClkProfile profile) brls::Logger::debug("Caching freq for module %d and profile %d to %" PRIu32, SysClkModule_MEM, profile, this->profiles.mhzMap[profile][SysClkModule_MEM]); }); - list->addView(memListItem);*/ + list->addView(memListItem); } void AppProfileFrame::onProfileChanged() diff --git a/Source/sys-clk-OC/manager/src/cheat_sheet_tab.cpp b/Source/sys-clk-OC/manager/src/cheat_sheet_tab.cpp index 08a91bf5..0987082e 100644 --- a/Source/sys-clk-OC/manager/src/cheat_sheet_tab.cpp +++ b/Source/sys-clk-OC/manager/src/cheat_sheet_tab.cpp @@ -30,7 +30,7 @@ CheatSheetTab::CheatSheetTab() this->addView(new brls::Header("CPU Clocks")); brls::Table *cpuTable = new brls::Table(); - cpuTable->addRow(brls::TableRowType::BODY, "OC Suite Maximum", "2397.0 MHz"); + cpuTable->addRow(brls::TableRowType::BODY, "Tegra X1+ Official Max", "1963.5 MHz"); cpuTable->addRow(brls::TableRowType::BODY, "Official Boost", "1785.0 MHz"); cpuTable->addRow(brls::TableRowType::BODY, "Official Docked and Handheld", "1020.0 MHz"); @@ -40,7 +40,7 @@ CheatSheetTab::CheatSheetTab() this->addView(new brls::Header("GPU Clocks")); brls::Table *gpuTable = new brls::Table(); - gpuTable->addRow(brls::TableRowType::BODY, "OC Suite Maximum", "1344.0 MHz"); + gpuTable->addRow(brls::TableRowType::BODY, "Tegra X1+ Official Max", "1267.2 MHz"); gpuTable->addRow(brls::TableRowType::BODY, "Official Maximum", "921.6 MHz"); gpuTable->addRow(brls::TableRowType::BODY, "Official Docked", "768.0 MHz"); gpuTable->addRow(brls::TableRowType::BODY, "Official Handheld", "384.0/460.8 MHz"); @@ -63,7 +63,7 @@ CheatSheetTab::CheatSheetTab() return; } - memTable->addRow(brls::TableRowType::BODY, "OC Suite", formatFreq(context.freqs[SysClkModule_MEM])); + memTable->addRow(brls::TableRowType::BODY, "Tegra X1+ Official Max", "2131.2 MHz"); memTable->addRow(brls::TableRowType::BODY, "Official", "1331.2/1600.0 MHz"); this->addView(memTable); diff --git a/Source/sys-clk-OC/manager/src/utils.cpp b/Source/sys-clk-OC/manager/src/utils.cpp index fd27e929..0f3e66fa 100644 --- a/Source/sys-clk-OC/manager/src/utils.cpp +++ b/Source/sys-clk-OC/manager/src/utils.cpp @@ -110,7 +110,10 @@ brls::SelectListItem* createFreqListItem(SysClkModule module, uint32_t selectedF selected = i + 1; char clock[16]; - snprintf(clock, sizeof(clock), "%d MHz", freq / 1000000); + if (freq == 1600000000) + snprintf(clock, sizeof(clock), "Max MHz"); + else + snprintf(clock, sizeof(clock), "%d MHz", freq / 1000000); clocks.push_back(std::string(clock)); diff --git a/Source/sys-clk-OC/overlay/src/ui/format.h b/Source/sys-clk-OC/overlay/src/ui/format.h index efbd57bb..a0f65333 100644 --- a/Source/sys-clk-OC/overlay/src/ui/format.h +++ b/Source/sys-clk-OC/overlay/src/ui/format.h @@ -20,9 +20,13 @@ static inline std::string formatListFreqMhz(std::uint32_t mhz) { return FREQ_DEFAULT_TEXT; } + else if (mhz == 1600) + { + return "Max MHz"; + } char buf[10]; - return std::string(buf, snprintf(buf, sizeof(buf), "%u Mhz", mhz)); + return std::string(buf, snprintf(buf, sizeof(buf), "%u MHz", mhz)); } static inline std::string formatListFreqHz(std::uint32_t hz) { return formatListFreqMhz(hz / 1000000); } diff --git a/Source/sys-clk-OC/overlay/src/ui/gui/app_profile_gui.cpp b/Source/sys-clk-OC/overlay/src/ui/gui/app_profile_gui.cpp index c467e6e9..16a9b1f0 100644 --- a/Source/sys-clk-OC/overlay/src/ui/gui/app_profile_gui.cpp +++ b/Source/sys-clk-OC/overlay/src/ui/gui/app_profile_gui.cpp @@ -62,7 +62,7 @@ void AppProfileGui::addProfileUI(SysClkProfile profile) this->listElement->addItem(new tsl::elm::CategoryHeader(sysclkFormatProfile(profile, true))); this->addModuleListItem(profile, SysClkModule_CPU, &sysclk_g_freq_table_cpu_hz[0]); this->addModuleListItem(profile, SysClkModule_GPU, &sysclk_g_freq_table_gpu_hz[0]); - //this->addModuleListItem(profile, SysClkModule_MEM, &sysclk_g_freq_table_mem_hz[0]); + this->addModuleListItem(profile, SysClkModule_MEM, &sysclk_g_freq_table_mem_hz[0]); } void AppProfileGui::listUI() diff --git a/Source/sys-clk-OC/overlay/src/ui/gui/global_override_gui.cpp b/Source/sys-clk-OC/overlay/src/ui/gui/global_override_gui.cpp index b07fa2dd..a360d87c 100644 --- a/Source/sys-clk-OC/overlay/src/ui/gui/global_override_gui.cpp +++ b/Source/sys-clk-OC/overlay/src/ui/gui/global_override_gui.cpp @@ -62,7 +62,7 @@ void GlobalOverrideGui::listUI() { this->addModuleListItem(SysClkModule_CPU, &sysclk_g_freq_table_cpu_hz[0]); this->addModuleListItem(SysClkModule_GPU, &sysclk_g_freq_table_gpu_hz[0]); - //this->addModuleListItem(SysClkModule_MEM, &sysclk_g_freq_table_mem_hz[0]); + this->addModuleListItem(SysClkModule_MEM, &sysclk_g_freq_table_mem_hz[0]); } void GlobalOverrideGui::refresh() diff --git a/Source/sys-clk-OC/sysmodule/src/clock_manager.cpp b/Source/sys-clk-OC/sysmodule/src/clock_manager.cpp index ff90a435..e611b566 100644 --- a/Source/sys-clk-OC/sysmodule/src/clock_manager.cpp +++ b/Source/sys-clk-OC/sysmodule/src/clock_manager.cpp @@ -247,15 +247,23 @@ void ClockManager::Tick() if (hz) { hz = Clocks::GetNearestHz((SysClkModule)module, isEnabledReverseNX ? RealProfile : this->context->profile, hz); + if (module == SysClkModule_MEM && hz == 1600'000'000 && this->context->freqs[module] >= hz) + { + continue; + } if (hz != this->context->freqs[module] && this->context->enabled) { if (cpuBoost) { + // Skip setting CPU or GPU clocks in CpuBoostMode if CPU < 1963.5MHz or GPU > 76.8MHz if (module == SysClkModule_CPU && hz < MAX_CPU) { - hz = MAX_CPU; - FileUtils::LogLine("[mgr] CpuBoostMode detected, bump CPU to max"); + continue; + } + if (module == SysClkModule_GPU && hz > 76'800'000) + { + continue; } } FileUtils::LogLine("[mgr] %s clock set : %u.%u Mhz", Clocks::GetModuleName((SysClkModule)module, true), hz/1000000, hz/100000 - hz/1000000*10); @@ -265,19 +273,6 @@ void ClockManager::Tick() } } } - else if (FileUtils::IsBoostEnabled()) - { - // If user doesn't set any freq but with sys-clk enabled, then boost CPU in CpuBoostMode - if(cpuBoost && this->GetConfig()->Enabled()) - { - if(this->context->freqs[SysClkModule_CPU] != MAX_CPU) - { - FileUtils::LogLine("[mgr] CpuBoostMode detected, bump CPU to max"); - Clocks::SetHz(SysClkModule_CPU, MAX_CPU); - this->context->freqs[SysClkModule_CPU] = MAX_CPU; - } - } - } } } @@ -450,13 +445,6 @@ bool ClockManager::RefreshContext() for (unsigned int module = 0; module < SysClkModule_EnumMax; module++) { hz = Clocks::GetCurrentHz((SysClkModule)module); - - // Skip MEM freq check - if (module == SysClkModule_MEM) - { - this->context->freqs[module] = hz; - break; - } // Round to MHz uint32_t cur_mhz = hz/1000'000; diff --git a/Source/sys-clk-OC/sysmodule/src/clocks.cpp b/Source/sys-clk-OC/sysmodule/src/clocks.cpp index 7fcaef20..f5a98bea 100644 --- a/Source/sys-clk-OC/sysmodule/src/clocks.cpp +++ b/Source/sys-clk-OC/sysmodule/src/clocks.cpp @@ -179,8 +179,10 @@ void Clocks::ResetToStock(unsigned int module) { Clocks::SetHz(SysClkModule_GPU, apmConfiguration->gpu_hz); } - // We don't need to set MEM freqs any more - //Clocks::SetHz(SysClkModule_MEM, apmConfiguration->mem_hz); + if (module == SysClkModule_EnumMax || module == SysClkModule_MEM) + { + Clocks::SetHz(SysClkModule_MEM, apmConfiguration->mem_hz); + } } else { @@ -223,10 +225,6 @@ SysClkProfile Clocks::GetCurrentProfile() void Clocks::SetHz(SysClkModule module, std::uint32_t hz) { - // We don't need to set MEM freqs any more - if (module == SysClkModule_MEM) - return; - Result rc = 0; if(hosversionAtLeast(8,0,0)) @@ -292,11 +290,11 @@ std::uint32_t Clocks::GetMaxAllowedHz(SysClkModule module, SysClkProfile profile { if(profile < SysClkProfile_HandheldCharging) { - return isMariko ? 1536000000 : SYSCLK_GPU_HANDHELD_MAX_HZ; + return isMariko ? 1344000000 : SYSCLK_GPU_HANDHELD_MAX_HZ; } else if(profile <= SysClkProfile_HandheldChargingUSB) { - return isMariko ? 1536000000 : SYSCLK_GPU_UNOFFICIAL_CHARGER_MAX_HZ; + return isMariko ? 1344000000 : SYSCLK_GPU_UNOFFICIAL_CHARGER_MAX_HZ; } } @@ -305,7 +303,7 @@ std::uint32_t Clocks::GetMaxAllowedHz(SysClkModule module, SysClkProfile profile std::uint32_t Clocks::GetNearestHz(SysClkModule module, std::uint32_t inHz) { - // Hardcoded values to return, I don't know why it will bump to max when excessive OC + // Hardcoded values to return, or the frequency will ramp up to max as dvfs table is not correct if(module == SysClkModule_MEM) { switch(inHz) @@ -381,6 +379,10 @@ std::uint32_t Clocks::GetNearestHz(SysClkModule module, std::uint32_t inHz) return 1382400000; case 1420000000: return 1420800000; + case 1459000000: + return 1459200000; + case 1497000000: + return 1497600000; default: return inHz; }