diff options
-rw-r--r-- | bootloader/imx233.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx233/system-imx233.c | 7 | ||||
-rw-r--r-- | firmware/target/arm/imx233/system-target.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/bootloader/imx233.c b/bootloader/imx233.c index d115389985..6dc503bb16 100644 --- a/bootloader/imx233.c +++ b/bootloader/imx233.c @@ -209,6 +209,8 @@ void main(uint32_t arg, uint32_t addr) kernel_entry = (void*) loadbuffer; printf("Executing"); + /* stop what was initialized to start from clean state */ + system_prepare_fw_start(); disable_interrupt(IRQ_FIQ_STATUS); commit_discard_idcache(); kernel_entry(); diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c index 5298f7cff9..d5ed7fc774 100644 --- a/firmware/target/arm/imx233/system-imx233.c +++ b/firmware/target/arm/imx233/system-imx233.c @@ -197,6 +197,13 @@ void system_init(void) #endif } +void system_prepare_fw_start(void) +{ + /* keep alive to get enough time, stop watchdog */ + imx233_keep_alive(); + imx233_rtc_enable_watchdog(false); +} + bool imx233_us_elapsed(uint32_t ref, unsigned us_delay) { uint32_t cur = HW_DIGCTL_MICROSECONDS; diff --git a/firmware/target/arm/imx233/system-target.h b/firmware/target/arm/imx233/system-target.h index 6272cf7a85..e77b5dc1b8 100644 --- a/firmware/target/arm/imx233/system-target.h +++ b/firmware/target/arm/imx233/system-target.h @@ -47,6 +47,7 @@ #define CPUFREQ_MAX IMX233_CPUFREQ_454_MHz #define CPUFREQ_SLEEP IMX233_CPUFREQ_64_MHz +void system_prepare_fw_start(void); void udelay(unsigned us); bool imx233_us_elapsed(uint32_t ref, unsigned us_delay); void imx233_reset_block(volatile uint32_t *block_reg); |