minerva: Make use of new minerva

- Training and switch is now faster
- Compatibility checks: New Minerva does not allow old binaries. New binaries do not allow old Minerva
- MTC table is now in a safe region
- Periodic training period increased to every 250ms
This commit is contained in:
CTCaer
2019-12-04 21:56:45 +02:00
parent 66c4f30bdf
commit 84328aa676
10 changed files with 63 additions and 22 deletions

View File

@@ -17,6 +17,7 @@
#include "util.h"
#include "../gfx/di.h"
#include "../mem/minerva.h"
#include "../power/max77620.h"
#include "../soc/bpmp.h"
#include "../soc/i2c.h"
@@ -25,6 +26,8 @@
#define USE_RTC_TIMER
extern volatile nyx_storage_t *nyx_str;
extern void sd_unmount(bool deinit);
u32 get_tmr_s()
@@ -99,6 +102,8 @@ void reboot_normal()
sd_unmount(true);
display_end();
nyx_str->mtc_cfg.init_done = 0;
panic(0x21); // Bypass fuse programming in package1.
}
@@ -109,6 +114,8 @@ void reboot_rcm()
sd_unmount(true);
display_end();
nyx_str->mtc_cfg.init_done = 0;
PMC(APBDEV_PMC_SCRATCH0) = 2; // Reboot into rcm.
PMC(APBDEV_PMC_CNTRL) |= PMC_CNTRL_MAIN_RST;
@@ -121,8 +128,11 @@ void power_off()
sd_unmount(true);
display_end();
// Stop the alarm, in case we injected and powered off too fast.
max77620_rtc_stop_alarm();
i2c_send_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_PWR_OFF);
while (true)
bpmp_halt();
}