From c9405680f2a4d4086fce4bc15166b0220d3a38dc Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sat, 11 Feb 2023 23:56:16 +0200 Subject: [PATCH] nyx: update bpmp clock manage - Test max clock on T210B01 also - Add 3rd mode with lower clock. Manually applied only. - Test max clock for 10s instead of 5s --- nyx/nyx_gui/frontend/gui.c | 2 +- nyx/nyx_gui/nyx.c | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 1a389d9..10aba0c 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -2402,7 +2402,7 @@ static void _nyx_main_menu(lv_theme_t * th) } if (!n_cfg.bpmp_clock) - task_bpmp_clock = lv_task_create(first_time_bpmp_clock, 5000, LV_TASK_PRIO_LOWEST, NULL); + task_bpmp_clock = lv_task_create(first_time_bpmp_clock, 10000, LV_TASK_PRIO_LOWEST, NULL); } void nyx_load_and_run() diff --git a/nyx/nyx_gui/nyx.c b/nyx/nyx_gui/nyx.c index 7014014..0fe3ced 100644 --- a/nyx/nyx_gui/nyx.c +++ b/nyx/nyx_gui/nyx.c @@ -387,18 +387,33 @@ void nyx_init_load_res() // Load hekate/Nyx configuration. _load_saved_configuration(); - // Initialize nyx cfg to lower clock for T210. + // Initialize nyx cfg to lower clock on first boot. // In case of lower binned SoC, this can help with hangs. if (!n_cfg.bpmp_clock) { - n_cfg.bpmp_clock = h_cfg.t210b01 ? 1 : 2; // Set lower clock for T210. + // Set lower clock and save it. + n_cfg.bpmp_clock = 2; create_nyx_config_entry(false); - n_cfg.bpmp_clock = h_cfg.t210b01 ? 1 : 0; // Restore for T210 and keep for T210B01. + + // Start at max clock and test it. + n_cfg.bpmp_clock = 0; } - // Restore clock to max. - if (n_cfg.bpmp_clock < 2) + // Set selected clock. + switch (n_cfg.bpmp_clock) + { + case 0: + case 1: bpmp_clk_rate_set(BPMP_CLK_DEFAULT_BOOST); + break; + case 2: + bpmp_clk_rate_set(BPMP_CLK_LOWER_BOOST); + break; + case 3: + default: + bpmp_clk_rate_set(BPMP_CLK_LOWEST_BOOST); + break; + } // Load Nyx resources. FIL fp;