From 90a759b98e928991201c8282fcfcde674f58a430 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 14 Jun 2020 13:05:51 +0300 Subject: [PATCH] Use reconfig workaround for power off and reboots --- bootloader/utils/util.c | 17 ++++------------- nyx/nyx_gui/utils/util.c | 2 -- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/bootloader/utils/util.c b/bootloader/utils/util.c index e7b66ee..b1a7eec 100644 --- a/bootloader/utils/util.c +++ b/bootloader/utils/util.c @@ -22,6 +22,7 @@ #include "../power/max77620.h" #include "../rtc/max77620-rtc.h" #include "../soc/bpmp.h" +#include "../soc/hw_init.h" #include "../soc/i2c.h" #include "../soc/pmc.h" #include "../soc/t210.h" @@ -135,24 +136,16 @@ void panic(u32 val) void reboot_normal() { - bpmp_mmu_disable(); - sd_end(); - display_end(); - - nyx_str->mtc_cfg.init_done = 0; + reconfig_hw_workaround(false, 0); panic(0x21); // Bypass fuse programming in package1. } void reboot_rcm() { - bpmp_mmu_disable(); - sd_end(); - display_end(); - - nyx_str->mtc_cfg.init_done = 0; + reconfig_hw_workaround(false, 0); PMC(APBDEV_PMC_SCRATCH0) = PMC_SCRATCH0_MODE_RCM; PMC(APBDEV_PMC_CNTRL) |= PMC_CNTRL_MAIN_RST; @@ -164,9 +157,7 @@ void reboot_rcm() void power_off() { sd_end(); - display_end(); - - nyx_str->mtc_cfg.init_done = 0; + reconfig_hw_workaround(false, 0); // Stop the alarm, in case we injected and powered off too fast. max77620_rtc_stop_alarm(); diff --git a/nyx/nyx_gui/utils/util.c b/nyx/nyx_gui/utils/util.c index 76af201..b1a7eec 100644 --- a/nyx/nyx_gui/utils/util.c +++ b/nyx/nyx_gui/utils/util.c @@ -139,8 +139,6 @@ void reboot_normal() sd_end(); reconfig_hw_workaround(false, 0); - nyx_str->mtc_cfg.init_done = 0; - panic(0x21); // Bypass fuse programming in package1. }