From 0290892b2390d73ec58f05a981140cd2af8e54b7 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 8 Dec 2019 01:41:57 +0200 Subject: [PATCH] nyx hw reconfig: Add fan and 5V regulators deinit Additionally re-arrange minerva and mmu after these. --- nyx/nyx_gui/soc/hw_init.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nyx/nyx_gui/soc/hw_init.c b/nyx/nyx_gui/soc/hw_init.c index d2f38c6..5c943f2 100644 --- a/nyx/nyx_gui/soc/hw_init.c +++ b/nyx/nyx_gui/soc/hw_init.c @@ -25,19 +25,26 @@ #include "../mem/minerva.h" #include "../gfx/di.h" #include "../input/touch.h" +#include "../power/regulator_5v.h" #include "../storage/sdmmc.h" +#include "../thermal/fan.h" #include "../utils/util.h" extern sdmmc_t sd_sdmmc; void reconfig_hw_workaround(bool extra_reconfig, u32 magic) { - // Flush and disable MMU. - bpmp_mmu_disable(); + // Disable BPMP max clock. bpmp_clk_rate_set(BPMP_CLK_NORMAL); - minerva_change_freq(FREQ_204); + // Deinit touchscreen and 5V regulators. touch_power_off(); + set_fan_duty(0); + regulator_disable_5v(REGULATOR_5V_ALL); + + // Flush/disable MMU cache and set DRAM clock to 204MHz. + bpmp_mmu_disable(); + minerva_change_freq(FREQ_204); // Re-enable clocks to Audio Processing Engine as a workaround to hanging. CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= (1 << 10); // Enable AHUB clock.