From 857dfa0da967914f30505f53950dfa6e18957bed Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sat, 14 Dec 2013 22:02:48 +0100 Subject: [PATCH] init.c: do cold reboot on exception Currently, if we get exception, FW will print exception info, send crash pattern to the host and reboot. We can reduce deadtime by doing cold reboot instead of simple reboot. The difference is, that usb interface will be reseted and usb subsystem will reinit driver. In this case we even do not need to update host driver. Signed-off-by: Oleksij Rempel --- target_firmware/magpie_fw_dev/target/init/init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target_firmware/magpie_fw_dev/target/init/init.c b/target_firmware/magpie_fw_dev/target/init/init.c index 8fc4640..3554656 100755 --- a/target_firmware/magpie_fw_dev/target/init/init.c +++ b/target_firmware/magpie_fw_dev/target/init/init.c @@ -166,9 +166,12 @@ void exception_reset(struct register_dump_s *dump) MAGPIE_REG_USB_RX1_SWAP_DATA = 0x1; MAGPIE_REG_USB_RX2_SWAP_DATA = 0x1; - A_PRINTF("Jump to BOOT\n"); - - // reboot..... + A_PRINTF("Cold reboot initiated."); +#if defined(PROJECT_MAGPIE) + HAL_WORD_REG_WRITE(WATCH_DOG_MAGIC_PATTERN_ADDR, 0); +#elif defined(PROJECT_K2) + HAL_WORD_REG_WRITE(MAGPIE_REG_RST_STATUS_ADDR, 0); +#endif /* #if defined(PROJECT_MAGPIE) */ A_USB_JUMP_BOOT(); } -- 2.31.1